Disclosure of Invention
The invention mainly aims to provide a network bandwidth allocation method, a mobile terminal and a computer storage medium, and aims to solve the problems that network bandwidth of an application program in operation is unreasonable to allocate and user experience is poor in the conventional mobile terminal.
In order to achieve the above object, the present invention provides a network bandwidth allocation method, an application and a mobile terminal, wherein the method comprises:
acquiring the occupied bandwidth of the current foreground application program;
determining a base bandwidth of the current foreground application;
comparing the occupied bandwidth with the value of the basic bandwidth;
and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value.
In the foregoing solution, the determining the basic bandwidth of the current foreground application includes:
acquiring a bandwidth required by the normal operation of the current foreground application as a basic bandwidth according to the attribute of the current foreground application; or,
and searching in a cloud database to obtain the bandwidth required by the normal operation of the current foreground application as the basic bandwidth.
In the above scheme, the method further comprises:
and detecting whether the current foreground application program meets network conditions, and increasing the occupied bandwidth of the foreground application program when the network conditions are not met.
In the above scheme, the method further comprises:
acquiring the total bandwidth of the network;
when the occupied bandwidth of the current foreground application program is smaller than the total network bandwidth, taking the difference between the total network bandwidth and the occupied bandwidth of the current foreground application program as the network bandwidth allowance;
and allocating the network bandwidth allowance to other running application programs except the current foreground application program.
In the foregoing scheme, the acquiring the total bandwidth of the network includes:
monitoring network transmission bandwidth obtained by network transmission;
acquiring the maximum network transmission bandwidth corresponding to a set period according to the period;
and taking the larger value of the maximum network transmission bandwidths corresponding to two continuous periods as the total network bandwidth.
In the foregoing solution, after taking the larger value between the network transmission amounts corresponding to two consecutive periods as the total bandwidth of the network, the method further includes:
and judging whether the network transmission bandwidth is lower than the total network bandwidth within preset time, if so, taking the maximum value of the network transmission bandwidth within the preset time, and replacing the maximum value with the total network bandwidth.
In the foregoing solution, the allocating the network bandwidth margin to other running applications except the current foreground application includes:
and distributing the network bandwidth allowance to other running application programs except the current foreground application program according to a preset rule.
In the foregoing solution, the current foreground application includes at least one of the following: a game application, an audiovisual application, an instant messaging application.
In addition, in order to achieve the above object, the present invention provides a mobile terminal including a processor, and a memory connected to the processor through a communication bus; wherein,
the memory is used for storing a network bandwidth allocation program;
the processor is configured to execute a network bandwidth allocation program to implement the following steps:
acquiring the occupied bandwidth of the current foreground application program;
determining a base bandwidth of the current foreground application;
and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value.
In the foregoing solution, the processor is configured to execute the determining of the basic bandwidth of the current foreground application, so as to implement the following steps:
acquiring a bandwidth required by the normal operation of the current foreground application as a basic bandwidth according to the attribute of the current foreground application; or,
and taking the bandwidth required by the normal operation of the current foreground application program obtained by searching in the cloud database as the basic bandwidth.
In the foregoing solution, the processor is configured to execute a network bandwidth allocation program to implement the following steps:
and detecting whether the current foreground application program meets network conditions, and increasing the occupied bandwidth of the foreground application program when the network conditions are not met.
In the foregoing solution, the processor is configured to execute a network bandwidth allocation program to implement the following steps:
acquiring the total bandwidth of the network;
when the occupied bandwidth of the current foreground application program is smaller than the total network bandwidth, taking the difference between the total network bandwidth and the occupied bandwidth of the current foreground application program as the network bandwidth allowance;
and allocating the network bandwidth allowance to other running application programs except the current foreground application program.
In the foregoing solution, the processor is configured to execute a program for acquiring a total bandwidth of a network, so as to implement the following steps:
monitoring network transmission bandwidth obtained by network transmission;
acquiring the maximum network transmission bandwidth corresponding to a set period according to the period;
and taking the larger value of the maximum network transmission bandwidths corresponding to two continuous periods as the total network bandwidth.
In the foregoing solution, the processor is configured to execute the program after taking a larger value between two network transmissions corresponding to two consecutive periods as the total bandwidth of the network, so as to implement the following steps:
and judging whether the network transmission bandwidth is lower than the total network bandwidth within preset time, if so, taking the maximum value of the network transmission bandwidth within the preset time, and replacing the maximum value with the total network bandwidth.
In the foregoing solution, the processor is configured to execute the program that allocates the network bandwidth margin to other running applications except the current foreground application, so as to implement the following steps:
and distributing the network bandwidth allowance to other running application programs except the current foreground application program according to a preset rule.
In the foregoing solution, the current foreground application includes at least one of the following: a game application, an audiovisual application, an instant messaging application.
To achieve the above object, the present invention proposes a computer storage medium storing one or more programs, the one or more programs being executable by one or more processors to cause the one or more processors to perform the steps of:
acquiring the occupied bandwidth of the current foreground application program;
determining a base bandwidth of the current foreground application;
comparing the occupied bandwidth with the value of the basic bandwidth;
and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value.
Therefore, compared with the prior art, the network bandwidth allocation method, the mobile terminal and the computer storage medium provided by the embodiment of the invention acquire the occupied bandwidth of the current foreground application program; determining a base bandwidth of the current foreground application; comparing the occupied bandwidth with the value of the basic bandwidth; and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value. The occupied bandwidth of the current foreground application program can be preferentially adjusted, namely, when the bandwidth of the current foreground application program is not enough for normal operation, the occupied bandwidth of the current foreground application program is increased to enable the current foreground application program to normally operate, so that the network bandwidth can be reasonably allocated by using the allocation method of the application program network bandwidth, the mobile terminal and the computer storage medium provided by the embodiment of the invention, and the user experience is improved.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The various components of the mobile terminal 100 are described in detail below with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for mobile communications), GPRS (General Packet Radio Service), CDMA2000(code Division multiple access 2000), WCDMA (Wideband code Division multiple access), TD-SCDMA (Time Division-Synchronous code Division multiple access), FDD-LTE (Frequency Division duplex Long Term Evolution), TDD-LTE (Time Division duplex Long Term Evolution), and the like.
WiFi belongs to a short-distance wireless transmission technology, and the mobile terminal 100 can help a user send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides the user with wireless broadband internet access. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal 100, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (user equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial radio access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (mobility management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving GateWay) 2034, a PGW (PDN GateWay) 2035, and a PCRF (Policy and charging functions Entity) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
To solve the problems in the prior art, embodiments of the present invention provide a network bandwidth allocation method, a mobile terminal, and a computer storage medium, and the following describes in detail a technical solution of the present invention with reference to the accompanying drawings and specific embodiments.
An embodiment of the present invention provides a network bandwidth allocation method, which is applied to a mobile terminal, and fig. 3 is a schematic flow chart of an optional method for implementing network bandwidth allocation provided in an embodiment of the present invention, as shown in fig. 3, the network bandwidth allocation method includes the following steps:
step S310: and acquiring the occupied bandwidth of the current foreground application program.
Here, the current foreground application refers to an application program running on an operation interface of the mobile terminal 100, and the acquiring of the bandwidth occupied by the current foreground application program may be understood as acquiring the bandwidth currently occupied by the application program running on the operation interface through network bandwidth monitoring software or a network bandwidth monitoring plug-in carried by the mobile terminal 100 itself, or an external network bandwidth monitor, to obtain a value of the currently occupied bandwidth. However, since the bandwidth occupied by the application program may vary in real time according to the current network environment and the hardware state of the mobile terminal 100, the occupied bandwidth value may be regarded as an approximate bandwidth value. Here, the average of the bandwidths occupied by the current foreground application acquired within the set time is taken as the occupied bandwidth of the current foreground application.
In the embodiment of the present invention, taking the current foreground application as an example of a certain game application, when a user is operating a certain game application, that is, the operation interface of the mobile terminal 100 is running the game application, the average value of the bandwidth occupied by the game application in a set time is monitored by the network bandwidth monitoring software or plug-in of the terminal itself to the occupied bandwidth value of the game application.
Of course, in other embodiments, the current foreground application may also be other applications, such as an audiovisual application like a video-type application, a music application, and an instant messaging application like a chat application.
Step S320: determining a base bandwidth of the current foreground application.
Here, the basic bandwidth refers to a bandwidth value that enables one application to normally operate, for example, a bandwidth value that enables a video application to normally operate is obviously higher than a bandwidth value that enables a music application to normally operate, the video application can be divided into three levels, i.e., ultra-definition, high-definition, and standard definition, the bandwidth value that can normally operate in each level is also different, and the bandwidth value that can normally operate decreases from ultra-definition to standard definition in turn, so the basic bandwidth may also be different according to different applications and different current application contents under different applications. In step S320, it is determined that the basic bandwidth of the current foreground application can be obtained in the following two ways, first, the bandwidth required by the normal operation of the current foreground application can be obtained as the basic bandwidth according to the attribute of the current foreground application, where the attribute of the current foreground application generally indicates that a basic traffic parameter for operating the current foreground application is indicated after the current foreground application is online, and the basic bandwidth for the normal operation of the current foreground application is obtained according to the parameter. Secondly, the bandwidth required by the normal operation of the current foreground application can be found and obtained in the cloud database as the basic bandwidth, it can be understood that bandwidth data required by the normal operation of a plurality of terminals when the application is used is stored in the cloud database, and the average value of the bandwidth data can be regarded as the bandwidth required by the normal operation of the current foreground application found and obtained in the cloud database and used as the basic bandwidth. The basic bandwidth of the current foreground application program is obtained in the two modes, namely, the method is accurate and convenient.
Step S330: comparing the occupied bandwidth with the basic bandwidth.
Here, the value of the occupied bandwidth of the current foreground application acquired in step S310 is compared with the value of the basic bandwidth of the current foreground application determined in step S320. It is understood that this step is to determine whether the occupied bandwidth of the current foreground application reaches the basic bandwidth required by the normal operation of the application. Here, still taking the current foreground application as the game application as an example, assuming that the bandwidth required for normal operation of the game application is 100kb/s, and the bandwidth currently occupied by the game application when the foreground is operated is 150kb/s, the game application can normally operate in the foreground currently, and the network condition of normal operation is satisfied, that is, when the occupied bandwidth is greater than the basic bandwidth, the current foreground application can normally operate. On the contrary, if the currently occupied bandwidth of the game application when the game application is operated in the foreground is 50kb/s, the game application cannot normally operate in the foreground currently, and the network condition of normal operation cannot be met.
Step S340: and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value.
Specifically, for example, the occupied bandwidth of the game application currently running in the foreground is 50kb/s, and the basic bandwidth of the game application is 100kb/s, and then the occupied bandwidth of the current foreground application is adjusted to 100 kb/s.
In an optional embodiment, the method further comprises: and continuously detecting whether the current foreground application program meets the network condition, and increasing the occupied bandwidth of the foreground application program when the current foreground application program does not meet the network condition. Here, the network condition may be understood as a network resource in a normal running state of the current foreground application. The network bandwidth allocation of the current foreground application program is further adjusted by a fine adjustment method, so that the current foreground application program can run normally.
In another alternative embodiment, please refer to fig. 4, where fig. 4 is a schematic flowchart of another alternative method for allocating network bandwidth according to an embodiment of the present invention, as shown in the figure, the method for allocating network bandwidth further includes the following steps:
step S410, acquiring the total bandwidth of the network.
In this embodiment, the total bandwidth of the network should be not less than the sum of the transmission bandwidths of the network used by all the running applications in the mobile terminal 100. The mode of obtaining the total network bandwidth may be to obtain the maximum value of the network transmission bandwidth in a set period as a standard, or to obtain the total network bandwidth through a network speed measurement mode, or to manually specify the total available network bandwidth by a user, or to obtain the maximum value of the network transmission bandwidth through a pressure test mode, and to use the maximum value as the total network bandwidth.
Specifically, the acquiring the total bandwidth of the network includes: firstly, network transmission is monitored to obtain network transmission bandwidth. Here, the network transmission condition in the mobile terminal 100 is monitored to obtain the network transmission bandwidth of all running applications. And secondly, acquiring the maximum network transmission bandwidth corresponding to the period according to the set period. Here, the access of the application to the network is often unstable, and in order to ensure accuracy, the maximum network transmission bandwidth in a set period is obtained according to the period, considering that the access fluctuation of the application running in the mobile terminal 100 to the network is relatively large. The setting period is flexibly set according to needs in the actual application process. And thirdly, taking the larger value of the maximum network transmission bandwidths corresponding to two continuous periods as the total network bandwidth. The total network bandwidth varies with the access condition of the application program to the network, so that a larger value between the maximum network transmission bandwidths corresponding to the two continuous periods is taken as the total network bandwidth, which not only ensures the accuracy of the total network bandwidth, but also does not need to consume excessive system resources to deal with the variation of the network condition.
Specifically, after the larger value between two network transmissions corresponding to two consecutive periods is taken as the total bandwidth of the network, the method further includes: and judging whether the network transmission bandwidth is lower than the total network bandwidth within preset time, if so, taking the maximum value of the network transmission bandwidth within the preset time, and replacing the maximum value with the total network bandwidth. If not, the previous maximum value is still the total bandwidth of the network.
Here, the change of the network environment is unpredictable, and a situation of network congestion may occur during a process of accessing the network by an operating application program, and a situation that a user actively changes the network may also occur, so that, in order to avoid an influence of the external network environments on the calculated total network bandwidth, when it is determined that the monitored total network bandwidth is lower than the current total network bandwidth within a preset time, it indicates that the total network bandwidth is inaccurate, and the maximum value of the network transmission bandwidth within the preset time needs to be used as a new total network bandwidth.
After the larger value between the maximum network transmission bandwidths corresponding to the two connection periods is used as the total network bandwidth, in the face of the complexity of the network environment in the actual application process, the network environment is monitored within a preset time, and if the network transmission bandwidth is always lower than the total network bandwidth in the real-time monitoring process, the total network bandwidth at the moment is inaccurate, adjustment needs to be performed, and a powerful guarantee is provided for obtaining the accurate total network bandwidth.
Step 420, when the occupied point of the current foreground application is smaller than the total network bandwidth, taking the difference between the network bandwidth and the occupied bandwidth of the current foreground application as the network bandwidth margin.
Specifically, the bandwidth occupied by the current foreground game application is 100kb/s, the current total network bandwidth is 300kb/s, and the remaining 200kb/s is used as the network bandwidth margin.
And step 430, allocating the network bandwidth allowance to other running applications except the current foreground application.
Specifically, the remaining 200kb/s of network bandwidth is allocated to other applications running in the background of the mobile terminal 100. Here, the allocating the network bandwidth margin to the other running applications except for the current foreground application includes allocating the network bandwidth margin to the other running applications except for the current foreground application according to a preset rule. Specifically, the method may include, but is not limited to, the first way of averagely allocating the network bandwidth margin to other running applications except the current foreground application; second, referring to fig. 5, please refer to fig. 5, in which fig. 5 is a schematic diagram of an optional application scenario of network bandwidth allocation according to an embodiment of the present invention. As shown in fig. 5, classifying the applications of the terminal, for example, classifying the applications S and X into a download class, and classifying the applications C and D into a communication class, where the classification may be performed according to a default class of the functions of the applications themselves, and classifying each application in a manner manually selected or manually confirmed by a user, as shown in fig. 5, confirming whether to classify the application a into the download class, and if so, classifying the application a into the download class, and because the applications of different classes require different network bandwidths, setting a priority to the balance allocation of the network bandwidths according to the different classes, for example, the applications of the download class require a larger network bandwidth and can be set as a high priority; meanwhile, the network bandwidth margin is divided in a gradient mode. Here, the predetermined rule includes determining which type of application allocates how much network bandwidth margin according to the priority of the type of application and the gradient of the network bandwidth margin. For example, the current application running in the background includes an application X and an application C, and according to the category priority, the priority of the application X is higher than that of the application C, the network bandwidth margin is divided into two decreasing equal parts, for example, the percentage of the network bandwidth margin is 40%, the 40% network bandwidth is divided into 30% and 10%, the 30% network bandwidth is allocated to the application S, and the 10% network bandwidth margin is allocated to the application C. Of course, other allocation rules are also possible, for example, when there are multiple applications of the same class running simultaneously in the current application running in the background, the network bandwidth allocated to the applications of the class can be allocated to each running application again on average. The specific preset rule may be redefined by the user in the actual application, which is not specifically limited in this embodiment. By allocating the network margin, the reasonable allocation of the network bandwidth of the application program in the mobile terminal 100 is further realized, and the user experience is improved.
Compared with the prior art, the network bandwidth allocation method provided by the embodiment of the invention obtains the occupied bandwidth of the current foreground application program; determining a base bandwidth of the current foreground application; comparing the occupied bandwidth with the value of the basic bandwidth; and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value. The occupied bandwidth of the current foreground application program can be adjusted preferentially, namely, when the bandwidth of the current foreground application program is not enough for normal operation, the occupied bandwidth of the current foreground application program is increased to enable the current foreground application program to operate normally, so that the network bandwidth can be distributed reasonably by using the method for distributing the network bandwidth of the application program provided by the embodiment of the invention, and the user experience degree is improved.
Further, the present invention provides a mobile terminal, please continue to refer to fig. 1, the mobile terminal 100 includes a processor 110, and a memory 109 connected to the processor 110 via a communication bus (not shown); wherein,
the memory 109 is used for storing a network bandwidth allocation program;
the processor 110 is configured to execute a network bandwidth allocation program to implement the following steps:
acquiring the occupied bandwidth of the current foreground application program;
determining a base bandwidth of the current foreground application;
and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value.
Optionally, the processor 110 is configured to execute the determining of the basic bandwidth of the current foreground application, so as to implement the following steps:
acquiring a bandwidth required by the normal operation of the current foreground application as a basic bandwidth according to the attribute of the current foreground application; or,
and taking the bandwidth required by the normal operation of the current foreground application program obtained by searching in the cloud database as the basic bandwidth.
Optionally, the processor 110 is configured to execute a network bandwidth allocation program to implement the following steps:
and detecting whether the current foreground application program meets network conditions, and increasing the occupied bandwidth of the foreground application program when the network conditions are not met.
Optionally, the processor 110 is configured to execute a network bandwidth allocation program to implement the following steps:
acquiring the total bandwidth of the network;
when the occupied bandwidth of the current foreground application program is smaller than the total network bandwidth, taking the difference between the total network bandwidth and the occupied bandwidth of the current foreground application program as the network bandwidth allowance;
and allocating the network bandwidth allowance to other running application programs except the current foreground application program.
Optionally, the processor 110 is configured to execute the program for acquiring a total bandwidth of a network, so as to implement the following steps:
monitoring network transmission bandwidth obtained by network transmission;
acquiring the maximum network transmission bandwidth corresponding to a set period according to the period;
and taking the larger value of the maximum network transmission bandwidths corresponding to two continuous periods as the total network bandwidth.
Optionally, the processor 110 is configured to execute the program after taking the larger value between two network transmissions corresponding to two consecutive periods as the total bandwidth of the network, so as to implement the following steps:
and judging whether the network transmission bandwidth is lower than the total network bandwidth within preset time, if so, taking the maximum value of the network transmission bandwidth within the preset time, and replacing the maximum value with the total network bandwidth.
Optionally, the processor 110 is configured to execute the program that allocates the network bandwidth margin to other running applications except the current foreground application, so as to implement the following steps:
and distributing the network bandwidth allowance to other running application programs except the current foreground application program according to a preset rule.
Optionally, the current foreground application includes at least one of: a game application, an audiovisual application, an instant messaging application.
Compared with the prior art, the mobile terminal provided in the embodiment of the present invention executes the network bandwidth allocation program through the processor 110 to obtain the occupied bandwidth of the current foreground application program; determining a base bandwidth of the current foreground application; comparing the occupied bandwidth with the value of the basic bandwidth; and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value. The occupied bandwidth of the current foreground application program can be preferentially adjusted, namely the occupied bandwidth of the current foreground application program is increased to enable the current foreground application program to normally run when the bandwidth of the current foreground application program is not enough to normally run, so that the mobile terminal provided by the embodiment of the invention can reasonably allocate the network bandwidth and improve the user experience.
Further, the present invention also provides a computer storage medium storing one or more programs executable by one or more processors to perform the steps of:
acquiring the occupied bandwidth of the current foreground application program;
determining a base bandwidth of the current foreground application;
comparing the occupied bandwidth with the value of the basic bandwidth;
and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
acquiring a bandwidth required by the normal operation of the current foreground application as a basic bandwidth according to the attribute of the current foreground application; or,
and searching in a cloud database to obtain the bandwidth required by the normal operation of the current foreground application as the basic bandwidth.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
and detecting whether the current foreground application program meets network conditions, and increasing the occupied bandwidth of the foreground application program when the network conditions are not met.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
and detecting whether the current foreground application program meets network conditions, and increasing the occupied bandwidth of the foreground application program when the network conditions are not met.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
and detecting whether the current foreground application program meets network conditions, and increasing the occupied bandwidth of the foreground application program when the network conditions are not met.
Optionally, the one or more programs are further executed by the one or more processors after the larger value between the network transmission amounts corresponding to two consecutive periods is taken as the total bandwidth of the network, so as to implement the following steps:
and judging whether the network transmission bandwidth is lower than the total network bandwidth within preset time, if so, taking the maximum value of the network transmission bandwidth within the preset time, and replacing the maximum value with the total network bandwidth.
Optionally, the one or more programs are further executable by the one or more processors to perform the step of allocating network bandwidth headroom to other running applications other than the current foreground application:
and distributing the network bandwidth allowance to other running application programs except the current foreground application program according to a preset rule.
Optionally, the current foreground application includes at least one of:
a game application, an audiovisual application, an instant messaging application.
Compared with the prior art, the computer storage medium provided by the embodiment of the invention acquires the occupied bandwidth of the current foreground application program; determining a base bandwidth of the current foreground application; comparing the occupied bandwidth with the value of the basic bandwidth; and when the occupied bandwidth value is smaller than the basic bandwidth value, increasing the occupied bandwidth value of the current foreground application program until the occupied bandwidth value of the current foreground application program is equal to the basic bandwidth value. The occupied bandwidth of the current foreground application program can be preferentially adjusted, namely the occupied bandwidth of the current foreground application program is increased to enable the current foreground application program to normally run when the bandwidth of the current foreground application program is not enough to normally run, so that the network bandwidth can be reasonably distributed by utilizing the computer storage medium provided by the embodiment of the invention, and the user experience is improved.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a mobile terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device, a robot, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.