Application bandwidth control method and electronic equipment
Through the speed limit of the bandwidth of the back -end application in electronic equipment, the problem of the background application occupation of bandwidth caused by the bandwidth of the background application, and the smooth operation of the front desk application and the improvement of the user experience.
Patent Information
- Application Number
- CN202310932134.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-26
- Publication Date
- 2025-01-28
AI Technical Summary
In electronic devices, when background applications occupy a large amount of bandwidth resources, the front-end applications will cause lag, delay, etc., affecting the user experience.
By limiting the bandwidth of some background applications in electronic devices to ensure the normal operation of the front desk application. The specific method is to determine the back -end application that meets a certain condition when the interface of the front desk application is displayed, and adjust it to the target bandwidth to reduce the impact on the front desk application.
Under the premise of minimizing the impact on the background application, reducing the phenomenon of stuttering during the operation of the front desk, making the front desk application run more smoothly and improve the user experience.
Smart Images

Figure CN119383673A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a method for controlling application bandwidth and an electronic device. Background Art
[0002] With the rapid development of electronic devices, electronic devices can already meet the needs of running multiple applications at the same time. For example, after an electronic device is connected to a wireless network (wireless fidelity, WiFi), there may be a scenario where the electronic device runs multiple different applications at the same time. For example, while a foreground video application is playing a video, a background application can download a file.
[0003] The total amount of bandwidth resources that can be provided by the same electronic device is fixed. In scenarios where foreground applications and background applications are running at the same time, the resource allocation capabilities of each application are different. When background applications occupy a large amount of bandwidth resources, the bandwidth of the foreground application will be limited accordingly, causing the foreground application to freeze and have high latency, thus affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide an application bandwidth control method and an electronic device. In a scenario where a foreground application and a background application are running simultaneously in the electronic device, by limiting the bandwidth of some background applications, the phenomenon of jamming during the running of the foreground application is reduced while minimizing the impact on the background application, so that the foreground application runs more smoothly.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a method for controlling application bandwidth is provided, the method comprising:
[0007] During the process of displaying the interface of a first application on a display screen of an electronic device, after determining a third application that meets a first preset condition from at least one second application running in the background of the electronic device, the bandwidth of the third application is controlled to be adjusted to a first target bandwidth, the first preset condition being that the bandwidth index of the second application reaches the target index, the bandwidth index of the second application is used to measure whether to limit the bandwidth of the second application, the first target bandwidth is less than the current bandwidth of the third application, and the first target bandwidth is determined based on the total bandwidth of the electronic device.
[0008] Among them, the first application is a foreground application, and the second application is a background application.
[0009] Optionally, when foreground applications and background applications are running simultaneously in an electronic device, by limiting the bandwidth occupied by some background applications, the foreground application can run more smoothly, reducing the phenomenon of foreground application jamming, which is conducive to improving the user experience. In addition, in the embodiment of the present application, the electronic device controls the bandwidth of some background applications, reducing the impact on the background applications, and ensuring that other background applications whose bandwidth is not restricted can run normally.
[0010] Optionally, before the electronic device controls the bandwidth of the third application to be adjusted to the first target bandwidth, the above-mentioned application bandwidth control method may further include:
[0011] The electronic device determines a first target bandwidth corresponding to the bandwidth indicator of the third application according to the corresponding relationship between the bandwidth indicator and the target bandwidth.
[0012] It can be understood that different bandwidth indicators correspond to different target bandwidths. The electronic device can determine the first target bandwidth corresponding to the third application based on the bandwidth indicator of the third application, and limit the bandwidth of the third application running in the background. Under the premise of minimizing the impact on the background application, the normal operation of the first application running in the foreground is guaranteed.
[0013] Optionally, the bandwidth indicator may be a target score of the application; before determining a third application that meets the first preset condition from a plurality of second applications running in the background of the electronic device, the above-mentioned application bandwidth control method may further include:
[0014] The electronic device determines a target score for a first application and a target score for each of a plurality of second applications; when the target score for the first application is greater than a first threshold, the third application is an application in the plurality of second applications whose target score is less than the second threshold, and the second threshold is less than the first threshold; when the target score for the first application is less than the first threshold, the third application is an application in the plurality of second applications whose target score is less than the third threshold, and the third threshold is less than the second threshold.
[0015] That is, the electronic device measures whether to limit the bandwidth of the application by the target score of each running application. The size of the target score can also be used to represent the perceived strength of the application during operation by the user.
[0016] It can be understood that when the target scores of the first application running in the foreground are different, the electronic device limits the speed of different background applications to avoid lag in the first application running in the foreground while reducing the impact on the background applications.
[0017] Optionally, the electronic device determines the target score of the first application and the target score of each of the plurality of second applications, including:
[0018] The electronic device determines a target score of the first application according to at least one of an application type of the first application, whether an application acceleration request is sent, and whether the application is stuck;
[0019] For each of the plurality of second applications, the electronic device determines a target score for the second application according to at least one of whether the second application has input or output of a voice stream, a service throughput rate, and whether the second application is speed-limited.
[0020] It can be understood that the electronic device can determine the first score corresponding to the first application according to the application type of the first application. For example, the electronic device pre-stores first scores corresponding to different application types. For example, when the application type of the current application is a game application or a voice application, the corresponding first score is 30 points, when the application type of the current application is a video cache application, the corresponding first score is 20 points, and when the application type of the current application is other than a game application, a voice application, and a video cache application, the corresponding first score is 10 points.
[0021] The electronic device may also determine the second score corresponding to the first application according to whether an application acceleration request is sent during the operation of the first application. For example, when the electronic device determines that an application acceleration request is sent during the operation of the first application, the second score corresponding to the first application is determined to be 60 points; when the electronic device determines that no application acceleration request is sent during the operation of the first application, the second score corresponding to the first application is determined to be 0 points.
[0022] The electronic device may also determine the third score corresponding to the first application according to whether the first application is stuck during operation. For example, when the electronic device determines that the first application is stuck during operation, the third score corresponding to the first application is determined to be 15 points, and when the electronic device determines that the first application is not stuck during operation, the third score corresponding to the first application is determined to be 0 points.
[0023] Then, the electronic device can determine the target score of the first application based on the first score, the second score, and the third score of the first application. Similarly, the electronic device can determine the target score of the second application. Then, the electronic device can determine the third application to be speed-limited based on the target score of the first application and the target score of the second application. After the electronic device determines the corresponding first target bandwidth based on the target score of the third application, it adjusts the bandwidth of the third application to the first target bandwidth, thereby ensuring the normal operation of the foreground application while minimizing the impact on the background application.
[0024] Optionally, the above-mentioned application bandwidth control method may further include:
[0025] After the electronic device determines the total bandwidth of the electronic device according to the bandwidth parameter, the target bandwidths corresponding to the different target scores are determined according to the bandwidth coefficients and the total bandwidth corresponding to the different target scores.
[0026] The bandwidth parameter includes at least one of an air interface bandwidth, a peak bandwidth of a network layer, and a historical peak bandwidth of a currently connected wireless network.
[0027] In the embodiment of the present application, the smaller the target score, the smaller the corresponding bandwidth coefficient. That is, the smaller the target score, the smaller the target bandwidth corresponding to the target score. In other words, the smaller the target score of the third application, the less the user can perceive the running process of the third application, and the more severe the bandwidth speed limit on the third application, thereby reducing the impact on other background applications.
[0028] Optionally, the electronic device determines the total bandwidth of the electronic device according to the bandwidth parameter, including:
[0029] The electronic device determines the total bandwidth according to the minimum bandwidth of at least one of the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network included in the bandwidth parameter.
[0030] It can be understood that the electronic device determines the uplink bandwidth of the minimum bandwidth of at least one of the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network as the uplink bandwidth of the total bandwidth, and determines the downlink bandwidth of the minimum bandwidth of at least one of the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network as the downlink bandwidth of the total bandwidth.
[0031] Optionally, after the electronic device controls the bandwidth of the third application to be adjusted to the first target bandwidth, the method further includes:
[0032] In response to satisfying the second preset condition, the electronic device re-determines an application that satisfies the first preset condition from the applications running in the background of the electronic device, and adjusts the bandwidth of the application that satisfies the first preset condition, the adjusted bandwidth being less than the bandwidth before the adjustment, the second preset condition being a change in the application running in the foreground of the electronic device and / or a change in the application running in the background of the electronic device.
[0033] It can be understood that during the operation of an electronic device, the foreground application and / or background application in the electronic device may change. In this case, the electronic device can determine the application to be limited in real time or periodically to adjust the bandwidth of the re-determined application to be limited to ensure the normal operation of the foreground application.
[0034] Optionally, the third application includes multiple data streams during operation, and the electronic device controls the bandwidth of the third application to be adjusted to the first target bandwidth, including:
[0035] The electronic device controls the bandwidth of a target data stream in the third application to a first target bandwidth, where the target data stream is a predefined data stream among the multiple data streams.
[0036] It can be understood that when the electronic device limits the bandwidth of the third application, the electronic device can limit the bandwidth of part of the data flow in the third application, thereby reducing the impact on the running third application.
[0037] Optionally, the electronic device controls the bandwidth of the target data stream in the third application to the first target bandwidth, including:
[0038] After the electronic device obtains the socket corresponding to the target data stream, it configures the corresponding class class for the socket corresponding to the target data stream, where the class is used to indicate that the bandwidth of the socket is adjusted to the first target bandwidth; according to the class corresponding to the socket, the bandwidth of the socket is adjusted to the first target bandwidth.
[0039] It can be understood that the electronic device can limit the bandwidth of the socket corresponding to the target data stream to achieve speed limiting for a single socket of the same background application, so as to reduce the impact on the background application.
[0040] Optionally, the above-mentioned application bandwidth control method may further include:
[0041] When the target score of the first application is greater than the first threshold, the electronic device determines a fourth application whose target score is greater than a fourth threshold from at least one second application, and the fourth threshold is greater than the first threshold; the electronic device controls the bandwidth of the fourth application to be adjusted to the second target bandwidth, and the bandwidth of the second target application is greater than the current bandwidth of the fourth application.
[0042] It can be understood that when the target score of the background application is greater than the fourth threshold, the electronic device can accelerate the bandwidth of the fourth application.
[0043] In a second aspect, the present application provides an electronic device, comprising: a display screen; one or more processors; a memory; wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to execute the application bandwidth control method described in any one of the above-mentioned first aspects.
[0044] In a third aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the application bandwidth control method as described in any one of the first aspects.
[0045] In a fourth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the application bandwidth control method as described in any one of the first aspects.
[0046] It can be understood that the electronic device described in the second aspect, the computer storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is an example diagram of a mobile phone running a foreground application and a background application in the related art;
[0048] Figure 2 This is an example diagram of the bandwidth used by front-end shopping applications in the relevant technology;
[0049] Figure 3 This is an example diagram of a method for controlling bandwidth of a background application provided in the related art;
[0050] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0051] Figure 5 A software structure diagram of an electronic device provided in an embodiment of the present application;
[0052] Figure 6 An example of a mobile phone running a foreground application and a background application in an embodiment of the present application Figure 1 ;
[0053] Figure 7 An example of a mobile phone running a foreground application and a background application in an embodiment of the present application Figure 2 ;
[0054] Figure 8 An example of a mobile phone running a foreground application and a background application in an embodiment of the present application Figure 3 ;
[0055] Fig. 9 A flowchart of a method for controlling application bandwidth provided in an embodiment of the present application;
[0056] Fig.10 A schematic diagram of a method for determining a total bandwidth provided in an embodiment of the present application;
[0057] Fig.11 A schematic diagram of a process for determining a target score for an application provided in an embodiment of the present application;
[0058] Fig.12 A flowchart of another method for controlling application bandwidth provided in an embodiment of the present application;
[0059] Fig.13 An example of a mobile phone running a foreground application and a background application in an embodiment of the present application Figure 4 ;
[0060] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The technical solution in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. In the description of the embodiment of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0062] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0063] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0064] In the related art, when multiple applications are running simultaneously in an electronic device, background applications occupy more bandwidth resources when running, which may cause the foreground application to freeze. Among them, the foreground application refers to the application that is visible to the user and can interact with the user when running in the electronic device, and the background application refers to the application that is invisible to the user when running in the electronic device.
[0065] For example, Figure 1 As shown in the figure, the mobile phone is running news applications and application market at the same time. When the news application running in the foreground is playing a video, the application market running in the background is downloading applications at a rate of 3.5M / s. Figure 1 It can be seen that the downloading of applications from the application market running in the background occupies a large amount of bandwidth resources, which limits the bandwidth of the news applications running in the foreground, resulting in a freeze when the news applications running in the foreground play videos. Figure 1 As shown in , the news app running in the foreground cannot play the video normally.
[0066] For example, suppose that the foreground application and the background application running simultaneously in the mobile phone are chat application A and news application B, respectively. When the user uses chat application A to video chat with friends, the news application B running in the background is updating news in real time. In this scenario, since news application B occupies most of the bandwidth resources when updating news, chat application A may become stuck or blurry during operation.
[0067] Table 1 below shows the total bandwidth of the mobile phone when using WiFi, which is stored in the log information of the mobile phone, and the bandwidth occupied by the chat application A and the bandwidth occupied by the news application B when the mobile phone runs the foreground chat application A and the background news application B at the same time. As can be seen from Table 1, the downlink bandwidth of the bandwidth occupied by the news application B running in the background is greater than the downlink bandwidth of the bandwidth occupied by the chat application A running in the foreground. Since the background application news application B occupies a large amount of bandwidth resources during operation, it may cause a freeze in the operation of the chat application A.
[0068] Table 1
[0069] Downlink bandwidth / uplink bandwidth of total bandwidth News Application B Chat Application A (19281847,1215701) (17825155,252250) (1285400,885343) (6496021,1033967) (5198669,227004) (1282989,771978) (36643182,1528908) (35843707,817760) (795498,700044) (36198079,1556329) (35681206,811785) (492081,736391) (42694598,1612172) (42161463,875508) (515880,727135)
[0070] The above-mentioned uplink bandwidth refers to the bandwidth of electronic devices sending data to the base station. For example, the bandwidth of a mobile phone uploading pictures to the base station is the uplink bandwidth. The downlink bandwidth refers to the bandwidth of electronic devices receiving data sent by the base station. For example, the bandwidth of a mobile phone downloading files from the base station is the downlink bandwidth.
[0071] For another example, after the mobile phone is connected to WiFi, while the user is using the foreground game application to play games, the background system application of the mobile phone uploads a large number of logs. Since the background system application takes up a lot of bandwidth resources to upload logs, the foreground game application may freeze during operation. As can be seen from Table 2 below, the uplink bandwidth and downlink bandwidth of the bandwidth occupied by the system application running in the background (for example, the system application with the application identifier of 1000) are much larger than the uplink bandwidth and downlink bandwidth of the bandwidth occupied by the game application running in the foreground. Since the background system application takes up a lot of total bandwidth resources during operation, it may cause freezes during the operation of the game application.
[0072] Table 2
[0073] Downlink bandwidth / uplink bandwidth of total bandwidth System Application Game applications (523482,26708304) (477044,26653369) (46438,54800) (525149,26631785) (478933,26589387) (46216,42398) (520176,26599094) (473292,26562891) (46807,36086) (526783,26558603) (482097,26507443) (44686,51160) (525565,26647164) (480955,26578244) (44610,68920)
[0074] It should be explained that the uplink bandwidth and uplink bandwidth of the bandwidth occupied by the foreground application and the background application in Table 1 and Table 2 are only used as an exemplary description. In actual scenarios, the uplink bandwidth and uplink bandwidth of the bandwidth occupied by the foreground application and the background application actually running in the mobile phone shall prevail.
[0075] After the mobile phone is connected to WiFi, when multiple applications are running in the mobile phone, the background applications occupy bandwidth resources, resulting in many problems with the foreground applications. The following Table 3 shows the problems of some foreground applications recorded in the log information of the mobile phone.
[0076] Table 3
[0077]
[0078] For example, after the mobile phone is connected to WiFi, when the user uses the shopping application on the mobile phone, the uplink bandwidth and downlink bandwidth occupied by the shopping application running in the foreground are not ranked first. Figure 2 As shown in Table 4, the reasons affecting the bandwidth used by the foreground shopping applications include: network environment reasons, background log transmission, and repeated billing by users, etc. For example, when the shopping application is running in the foreground, the amount of data downloaded or updated by the application running in the background is too much, occupying a large amount of bandwidth resources, resulting in a jamming phenomenon during the operation of the shopping application. The amount of data downloaded or updated by the background application recorded in the log information of the mobile phone is shown in Table 4 below. It can be seen from Table 4 that the amount of data downloaded or updated by the application market running in the background is 1600, the amount of data downloaded or updated by the official mall running in the background is 453, the amount of data downloaded or updated by the download application running in the background is 189, and the amount of data downloaded or updated by the chat application running in the background is 118, etc. It can be seen that in the process of running the foreground application and the background application at the same time in the mobile phone, the amount of data downloaded or updated by the background application is too much, occupying the downlink bandwidth of the bandwidth, resulting in a jamming phenomenon in the foreground application running in the mobile phone.
[0079] Table 4
[0080] Background application name Amount of data downloaded or updated Application Market 1600 Official Store 453 Download apps 189 Chat Applications 118
[0081] In the related art, when a foreground application and a background application are running simultaneously in a mobile phone, when a foreground application freezes, the user usually manually ends the background process to release bandwidth resources or the mobile phone actively controls the threads of all background applications to enter a dormant state so that the foreground application can run smoothly.
[0082] For example, Figure 3This is an example diagram of a bandwidth control method for background applications provided in the related art. Figure 3 As shown, when a foreground application and multiple background applications (for example, background application 1, background application 2, ..., background application N) are running in a mobile phone, the application framework layer determines that the foreground application is stuck, and the application framework layer sends a control command to the kernel layer. The control command is used to control the threads of all background applications to enter a dormant state. After the kernel layer receives the control command, the kernel layer controls the threads corresponding to all background applications to be in a dormant state, thereby limiting the bandwidth of the background application to ensure the smooth operation of the foreground application.
[0083] However, when the foreground application freezes, the kernel layer controls the threads corresponding to all background applications to be in a dormant state, which will cause all background applications to fail to run normally, thus affecting the user experience.
[0084] To this end, an embodiment of the present application provides a method for controlling application bandwidth, the method comprising: in the process of displaying the interface of the first application on the display screen of the electronic device, after determining a third application that meets the first preset condition from multiple second applications running in the background, controlling the bandwidth of the third application to be adjusted to the first target bandwidth. Thus, in the process of running the foreground application, by limiting the bandwidth of some background applications, not only the impact on other background applications is reduced, but also the foreground application can be made to run more smoothly, reducing the phenomenon of foreground application jamming, which is conducive to improving the user experience.
[0085] Exemplarily, the application bandwidth control method provided in the embodiments of the present application can be applied to mobile phones, tablet computers, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, vehicle-mounted devices, smart cars, smart speakers and other electronic devices with display screens, and the embodiments of the present application do not impose any restrictions on this.
[0086] like Figure 4 As shown, Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0087] The electronic device 100 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 button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0088] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0089] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0090] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0091] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0092] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (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.
[0093] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0094] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0095] 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 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
[0096] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0097] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0098] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
[0099] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194.
[0100] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0101] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0102] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the 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 change display information.
[0103] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0104] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0105] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise and brightness of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0106] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0107] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0108] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0109] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0110] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0111] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0112] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0113] The pressure sensor 180A is used to sense pressure signals and convert the pressure signals into electrical signals.
[0114] The gyro sensor 180B may be used to determine the motion posture of the electronic device 100 .
[0115] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can detect the opening and closing of the flip leather case by using the magnetic sensor 180D.
[0116] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0117] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0118] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0119] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0120] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0121] The temperature sensor 180J is used to detect the temperature.
[0122] The touch sensor 180K is also called a “touch panel.” The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen.”
[0123] Bone conduction sensor 180M can obtain vibration signals.
[0124] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0125] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0126] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0127] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0128] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes a system with a layered architecture as an example to exemplify the software structure of the electronic device.
[0129] Figure 5A software structure diagram of an electronic device provided in an embodiment of the present application.
[0130] It is understandable that the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system may include an application layer (abbreviated as application layer), an application framework layer (abbreviated as framework layer), a local framework layer, and a kernel layer.
[0131] The above-mentioned application layer may include a series of application packages.
[0132] like Figure 5 As shown, the application package may include system applications. System applications refer to applications that are set in the electronic device before leaving the factory. For example, system applications may include programs such as camera, gallery, calendar, music, short message, memo, and weather.
[0133] The application package may also include third-party applications, which are applications that users install after downloading the installation package from an application store (or application market), such as game applications, short video applications, and reading applications (such as e-books).
[0134] The application framework layer provides an application programming interface (API) and a programming framework for the application programs in the application layer. The application framework layer includes some predefined functions.
[0135] like Figure 5 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a traffic statistics module, an intelligent perception module, and an intelligent decision-making module, etc.
[0136] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0137] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0138] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0139] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
[0140] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0141] The notification manager allows applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a reminder sound is emitted, the phone vibrates, the indicator light flashes, etc.
[0142] The traffic statistics module is used to determine the total bandwidth of the electronic device according to the bandwidth parameter, wherein the bandwidth parameter includes at least one of the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network.
[0143] The intelligent sensing module is used to detect whether the electronic device is connected to a wireless network.
[0144] The intelligent decision-making module is used to determine a third application that meets a first preset condition from at least one second application running in the background of the electronic device during the process of displaying the interface of the first application on the display screen of the electronic device, wherein the third application includes a partial application of at least one second application, the first preset condition is that the bandwidth indicator of the second application reaches the target indicator, and the bandwidth indicator of the second application is used to measure whether to limit the bandwidth of the second application.
[0145] The intelligent decision module is also used to determine the target score of the first application and the target scores of multiple second applications. When the target score of the first application is greater than the first threshold, the third application is determined to be an application in the multiple second applications whose target score is less than the second threshold. When the target score of the first application is less than the first threshold, the third application is determined to be an application in the multiple second applications whose target score is less than the third threshold. After determining the first target bandwidth corresponding to the target score of the third application based on the corresponding relationship between the target score and the target bandwidth, the intelligent decision module sends a command to the local framework layer.
[0146] The Network daemon (Netd for short) in the local framework layer is a daemon responsible for network management. Netd is used to receive commands sent by the intelligent decision-making module of the application framework layer and forward the received commands to the kernel layer.
[0147] The kernel layer is the layer between hardware and software. The kernel layer contains at least WiFi driver, policy execution module, display driver, camera driver, audio driver and sensor driver.
[0148] Among them, the WiFi driver is used to connect the electronic device to the WiFi network.
[0149] The policy execution module is used to receive a command sent by the intelligent decision-making module, such as adjusting the bandwidth of the third application to the first target bandwidth after receiving the first command.
[0150] The following takes a mobile phone as an example of an electronic device, and describes in detail the method for controlling the application bandwidth provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0151] In the embodiment of the present application, in response to the user's power-on operation, the mobile phone executes the power-on process. After the mobile phone is powered on, in response to the user's networking operation, the mobile phone connects to the wireless network. Alternatively, after the mobile phone detects the wireless network, it automatically connects to the wireless network.
[0152] In one possible scenario, after the mobile phone is connected to a wireless network, some applications in the mobile phone are automatically started and run in the background. For example, after the mobile phone is connected to a wireless network, the weather application is automatically started and the latest weather information is updated in real time in the background. For another example, the calendar application in the mobile phone is automatically started and the latest calendar information is updated in real time in the background. For another example, the time application in the mobile phone is also automatically started after the mobile phone is connected to a wireless network, and the time application updates the current time information in real time in the background.
[0153] For example, Figure 6 As shown in (a), after the mobile phone is connected to the wireless network, the calendar application and time application in the mobile phone are automatically started in the background, and the display area 602 of the mobile phone desktop 601 displays the calendar information and time information updated in real time.
[0154] During the running of the background application in the mobile phone, the mobile phone detects the user's trigger operation (such as a click operation or a touch operation, etc.) on the icon of application A on the desktop. In response to the trigger operation, the mobile phone starts application A, and the display interface of application A is displayed on the display screen. At this time, application A is running in the foreground of the mobile phone, that is, application A is the foreground application A. In actual scenarios, the display screen can display the display interface of the foreground application A in full screen, or it can display the display interface of the foreground application A in the form of a small window. In the embodiment of the present application, the form in which the foreground application A is displayed on the desktop is not limited. In addition, the mobile phone can also display the display interfaces of multiple foreground applications in different display areas at the same time in the form of split screen.
[0155] For example, Figure 6As shown, when the mobile phone detects that the user clicks the icon 603 of the camera application on the desktop 601, the camera application is started and the display is as shown. Figure 6 In the preview state, the viewfinder 605 displays the preview image in real time. In the photo mode, when the mobile phone detects that the user is Figure 6 After the trigger operation (eg, touch operation or click operation) of the shooting control shown in (b) of FIG. 1 is performed, the camera application enters the shooting mode in response to the trigger operation. During the operation of the camera application, the calendar application and the time application in the mobile phone are still running in the background.
[0156] For example, Figure 7 As shown in (a) of FIG. 1 , when the mobile phone detects that the user clicks the icon 702 of the video application on the desktop 701, the video application is started and the display is as follows: Figure 7 The playback interface 703 shown in (b) in FIG. 7 . When the video application is playing the video in the foreground, the time application and calendar application running in the mobile phone are updated in real time in the background.
[0157] Also exemplary, such as Figure 8 As shown, the display screen of the mobile phone is divided into a display area 801 and a display area 802, and different foreground applications are running in the two display areas. Figure 8 As shown, a chat interface of a chat application is displayed in display area 801 , and a playback interface of a video application is displayed in display area 802 .
[0158] It should be noted that when a foreground application and a background application are running in a mobile phone at the same time, the embodiments of the present application do not limit the number of foreground applications and background applications in operation. That is to say, the number of foreground applications running in the foreground of the mobile phone can be 1 or more, and the number of background applications running in the background can be 1 or more. For example, when the display interface corresponding to two foreground applications is displayed in split screen in a mobile phone, two background applications can also be running in the background; for example, when a video application is playing a video in the foreground of the mobile phone, a download application is downloading files in the background; for another example, when a video application is playing a video in the foreground of the mobile phone, a game application is updating its version and a gallery application is uploading pictures to the server in the background.
[0159] In addition, the background applications and foreground applications running simultaneously in the mobile phone can both be system applications, or both be third-party applications, or the background application can be a system application and the foreground application can be a third-party application, or the background application can be a third-party application and the foreground application can be a system application, or the background application can be both a system application and a third-party application, etc. The application types of the background applications and foreground applications are not limited in the embodiments of the present application. For example, the foreground application running in the mobile phone is a weather application, and the background application is a calendar application; for another example, the foreground application running in the mobile phone is a chat application, and the background application is a game application; for another example, the foreground application running in the mobile phone is a weather application, and the background application is a game application; for another example, the foreground application running in the mobile phone is a short video application, and the background application is a weather application and a dating application, etc.
[0160] In another possible case, after the mobile phone is connected to the wireless network, in response to the user's triggering operation, the mobile phone starts the foreground application B, and in response to the exit operation of the application B, the application B switches to the background. In other words, the background application running in the mobile phone can be an application that switches from the foreground to the background.
[0161] In an embodiment of the present application, when a foreground application and a background application are running simultaneously in a mobile phone, in order to avoid the running background application occupying too much bandwidth resources, causing the foreground application to freeze, the mobile phone can limit the bandwidth of some background applications to increase the bandwidth occupied by the foreground application, so that the foreground application runs more smoothly.
[0162] In an embodiment of the present application, during the process of displaying the interface of the first application (i.e., the foreground application) on the display screen of the mobile phone, after determining a third application that meets the first preset condition from at least one second application (i.e., the background application) running in the background of the mobile phone, the mobile phone determines the first target bandwidth corresponding to the bandwidth index of the third application based on the correspondence between the bandwidth index and the target bandwidth. Then, the mobile phone controls the bandwidth of the third application to be adjusted to the first target bandwidth. Among them, the first preset condition is that the bandwidth index of the second application reaches the target index, and the bandwidth index of the second application is used to measure whether to limit the bandwidth of the second application. The above-mentioned first target bandwidth is less than the current bandwidth of the third application.
[0163] In one possible case, the bandwidth indicator may be a target score of an application. The mobile phone may determine the target score of a first application in operation, and the target score of each second application among multiple second applications. When the mobile phone determines that the target score of the first application is greater than a first threshold, the third application may be an application among multiple second applications whose target score is less than a second threshold, and the second threshold is less than the first threshold; when the mobile phone determines that the target score of the first application is less than the first threshold, the third application may be an application among multiple second applications whose target score is less than a third threshold, and the third threshold is less than the second threshold.
[0164] Combine the following Figure 9-11 The control method of the above application bandwidth is explained from the dimensions of each module inside the mobile phone.
[0165] Fig. 9 A flow chart of a method for controlling application bandwidth provided in an embodiment of the present application is shown as follows: Fig. 9 As shown, the method comprises the following steps:
[0166] Step 901: The intelligent perception module of the application framework layer detects that the mobile phone is connected to a wireless network.
[0167] In the embodiment of the present application, the intelligent perception module of the application framework layer of the mobile phone can monitor the network status of the mobile phone, that is, the intelligent perception module of the application framework layer monitors whether the wireless network of the mobile phone is turned on. When the wireless network of the mobile phone is turned on, the mobile phone is connected to the wireless network, and the intelligent perception module of the application framework layer can monitor that the mobile phone is connected to the wireless network and the wireless network is in an available state.
[0168] Step 902: The intelligent decision module of the application framework layer determines the target score corresponding to each running application.
[0169] After the mobile phone is connected to the wireless network, the target scores corresponding to each running application can be determined. For example, in an embodiment of the present application, after detecting that the mobile phone is connected to the wireless network, the intelligent perception module of the application framework layer can notify the intelligent decision-making module of the application framework layer of the detection result. In response, the intelligent decision-making module can determine the target score of the foreground application and the target score of each background application in multiple background applications. Of course, when there is only one application running in the background, the intelligent decision-making module can determine the target score of the application running in the background.
[0170] For example, assuming that the foreground application running in the mobile phone is game application A, and the background applications running are application B and application C, the intelligent decision-making module can calculate the target scores corresponding to game application A, application B and application C respectively according to the preset scoring strategy.
[0171] The intelligent decision-making module of the application framework layer determines the target scores corresponding to the running foreground applications and background applications. Fig.11 As well as the detailed elaboration process of Table 6, it will not be elaborated here.
[0172] Step 903: The intelligent decision-making module of the application framework layer determines whether the target score of the foreground application is greater than a first threshold.
[0173] In an embodiment of the present application, after the intelligent decision module of the application framework layer determines the target scores corresponding to the foreground application and the background application running in the mobile phone, the intelligent decision module of the application framework layer compares the target score corresponding to the foreground application with the first threshold to determine whether the target score of the foreground application is greater than the first threshold. In the case where the intelligent decision module determines that the target score of the foreground application is greater than the first threshold, the following step 904 is executed. In the case where the intelligent decision module determines that the target score of the foreground application is less than the first threshold, the following step 905 is executed.
[0174] Step 904: The intelligent decision module of the application framework layer determines that the third application is an application whose target score is less than the second threshold.
[0175] The second threshold is less than the first threshold, and the second threshold is less than or equal to the basic score. The basic score may be a score assigned to each application in advance. For example, the first threshold is 80 points, and the second threshold is 60 points. The third application here refers to an application in the background application whose target score is less than the second threshold. The third application may be one or more, which is not limited here.
[0176] When the intelligent decision module of the application framework layer determines that the target score of the foreground application is greater than the first threshold, the intelligent decision module determines a third application whose target score is less than the second threshold from the background applications based on the target scores corresponding to each background application.
[0177] Step 905: The intelligent decision module of the application framework layer determines that the third application is an application whose target score is greater than a third threshold.
[0178] The third threshold may be a preset target score, for example, the third threshold may be 0.
[0179] In an embodiment of the present application, when the intelligent decision module of the application framework layer determines that the target score of the running foreground application is less than the first threshold, the intelligent decision module determines from the background applications that the application with a target score less than the third threshold is the third application.
[0180] Step 906: The intelligent decision module of the application framework layer determines a first target bandwidth corresponding to the target score of the third application.
[0181] In some embodiments of the present application, after the intelligent decision module determines a third application whose target score is less than a second threshold, the intelligent decision module may determine a first target bandwidth corresponding to the target score of the third application based on the correspondence between the target score and the target bandwidth.
[0182] It can be understood that different target scores correspond to different target bandwidths, or different target score intervals correspond to different target bandwidths.
[0183] Exemplarily, when the target score is greater than or equal to 0 and less than or equal to the first target score, the corresponding target bandwidth is bandwidth 1. When the target score is greater than the first target score and less than or equal to the second target score, the corresponding target bandwidth is bandwidth 2. When the target score is greater than the second target score and less than or equal to the third target score, the corresponding target bandwidth is bandwidth 3. When the target score is less than or equal to 0, the corresponding target bandwidth is bandwidth 4. When the target score is greater than the fourth target score and less than the fifth target score, the corresponding target bandwidth is bandwidth 5.
[0184] Among them, the above bandwidth 1 is smaller than bandwidth 2, bandwidth 2 is smaller than bandwidth 3, bandwidth 3 is smaller than bandwidth 4, and bandwidth 4 is smaller than bandwidth 5.
[0185] It should be explained that the target bandwidths corresponding to the above-mentioned different target score intervals are only used as an exemplary description. In actual scenarios, the target scores of applications can be divided into score intervals of different gears. The number of target score intervals and the target bandwidths corresponding to each target score interval are not limited in the embodiments of the present application. For example, the target scores can be divided into three gears, and target score intervals of different gears correspond to different target bandwidths. In addition, when the target bandwidth corresponding to the target score of the third application is less than the current bandwidth of the third application, the bandwidth of the third application is adjusted to the target bandwidth, thereby realizing bandwidth limiting for the third application.
[0186] It can be understood that the target score can be used to characterize the user's perception of the application running process. That is, the larger the target score, the stronger the user's perception of the application running process. For example, the target score of the foreground application is greater than the target score of the background application. For another example, the target score of the game application running in the foreground is greater than the target score of the dating application running in the foreground. For another example, the target score of the voice application running in the background is greater than the target score of the download application running in the background.
[0187] Exemplarily, as shown in Table 5 below, when the intelligent decision module determines that the target score of the third application is greater than or equal to 0 and less than or equal to S1, the intelligent decision module determines that the first target bandwidth corresponding to the third application is bandwidth 1. When the intelligent decision module determines that the target score of the third application is greater than S1 and less than or equal to S2, the intelligent decision module determines that the first target bandwidth corresponding to the third application is bandwidth 2. When the intelligent decision module determines that the target score of the third application is greater than S2 and less than or equal to S3, the intelligent decision module determines that the first target bandwidth corresponding to the third application is bandwidth 3. When the intelligent decision module determines that the target score of the third application is greater than S3 and less than or equal to S4, the intelligent decision module determines not to limit the bandwidth of the third application. When the intelligent decision module determines that the target score of the third application is less than or equal to 0, the intelligent decision module determines that the first target bandwidth corresponding to the third application is bandwidth 4. When the intelligent decision module determines that the target score of the third application is greater than S4 and less than S5, the intelligent decision module determines to accelerate the third application.
[0188] Among them, S1 is less than S2, S2 is less than S3, S3 is less than S4, and S4 is less than S5. For example, the target score S1 can be 20 points, S2 can be 40 points, S3 can be 60 points, S4 can be 100 points, and S5 can be 120 points. For another example, the target score S1 can be 10 points, S2 can be 30 points, S3 can be 50 points, S4 can be 80 points, and S5 can be 120 points. For another example, the target score S1 can be 30 points, S2 can be 50 points, S3 can be 70 points, S4 can be 90 points, and S5 can be 110 points, etc., and the values of the target scores S1 to S5 are not limited in the embodiment of the present application. In the embodiment of the present application, when the running foreground application is an application with a low user perception, for example, the foreground application is a calendar application, in order to avoid the foreground application from being stuck, the intelligent decision-making module can limit the speed of the background application whose target score is less than the third threshold.
[0189] Optionally, when the intelligent decision module determines that there is no application whose target score is greater than or equal to the first threshold, that is, the intelligent decision module determines that the target scores corresponding to the running foreground application and the background application are both less than the first threshold. As shown in Table 5 below, if the intelligent decision module determines that the target score of the third application is greater than 0, the intelligent decision module determines not to limit the bandwidth of the third application. If the intelligent decision module determines that the target score of the third application is less than or equal to 0, the intelligent decision module determines that the first target bandwidth corresponding to the third application is bandwidth 4.
[0190] When the intelligent decision module determines a fourth application whose target score is greater than the fourth threshold value from the background application, the intelligent decision module can determine the second target bandwidth corresponding to the fourth application. The second target bandwidth is greater than the current bandwidth of the fourth application. That is, the intelligent decision module can accelerate the fourth application to increase the bandwidth of the fourth application and improve the user experience.
[0191] As shown in Table 5 below, when the intelligent decision module determines that the target score of the application is greater than S4 and less than S5, the intelligent decision module determines to adjust the bandwidth of the application to bandwidth 5. For example, when the intelligent decision module determines that the target score of the application is greater than 100 and less than 120, the intelligent decision module determines to adjust the bandwidth of the application to bandwidth 5.
[0192] Table 5
[0193]
[0194] It should be explained that the target scores corresponding to the applications in Table 5 above and the bandwidth adjustment strategies corresponding to different target score intervals are only described as examples, and no specific limitation is made in the embodiments of the present application. The above bandwidth 1 is smaller than bandwidth 2, and bandwidth 2 is smaller than bandwidth 3. It can also be understood that the smaller the target score of the third application, the smaller the first target bandwidth corresponding to the third application. In the embodiments of the present application, the target bandwidth changes with the change of the total bandwidth of the mobile phone. Optionally, after the mobile phone determines the total bandwidth of the mobile phone according to the bandwidth parameters, the mobile phone can determine the target bandwidth corresponding to different target scores according to the bandwidth coefficients and total bandwidth corresponding to different target scores. Among them, the bandwidth parameters include at least one of the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network. In addition, the smaller the target score, the smaller the corresponding bandwidth coefficient.
[0195] In other embodiments of the present application, after the traffic statistics module in the mobile phone determines the total bandwidth of the mobile phone based on the bandwidth parameters, the intelligent decision-making module can determine the target bandwidth corresponding to different target scores based on the bandwidth coefficient and total bandwidth corresponding to different target scores.
[0196] For example, in Table 5 above, bandwidth 1 may be a% of the total bandwidth, bandwidth 2 may be b% of the total bandwidth, and bandwidth 3 may be c% of the total bandwidth, wherein a%, b% and c% are all bandwidth coefficients.
[0197] Combine the following Fig.10 The method for determining the total bandwidth is described in detail. Fig.10 A schematic diagram of a method for determining a total bandwidth provided in an embodiment of the present application is shown in FIG. Fig.10As shown, the traffic statistics module of the application framework layer can determine the total bandwidth of the mobile phone according to at least one of the bandwidth parameters including the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network. Here, the total bandwidth includes the uplink bandwidth and the downlink bandwidth.
[0198] Among them, the air interface bandwidth refers to the maximum bandwidth that can actually be supported between the firmware and the router. The air interface bandwidth is greater than the historical peak bandwidth. The air interface bandwidth includes uplink bandwidth and downlink bandwidth. The peak bandwidth of the network layer is estimated based on experience and pre-stored in the configuration file. For example, the uplink bandwidth of the pre-set peak bandwidth of the network layer can be 2Mbps, and the downlink bandwidth can be 5Mbps. The network layer is the third layer in the Open System Interconnect (OSI) reference model, between the transport layer and the data link layer. It further manages data communications in the network based on the data frame transmission function between two adjacent endpoints provided by the data link layer, and tries to transmit data from the source to the destination through several intermediate nodes, thereby providing the most basic end-to-end data transmission service to the transport layer.
[0199] The historical peak bandwidth of the currently connected wireless network may refer to the peak bandwidth of the wireless network to which the mobile phone is currently connected within a preset historical duration. The historical peak bandwidth of the currently connected wireless network may be obtained by querying historical record information. For example, the historical peak bandwidth of the currently connected wireless network may be the maximum bandwidth of the wireless network to which the mobile phone is currently connected within the past 10 days. The historical peak bandwidth of the currently connected wireless network also includes uplink bandwidth and downlink bandwidth.
[0200] In one possible case of an embodiment of the present application, the traffic statistics module can determine the total bandwidth of the mobile phone based on the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network. The traffic statistics module can determine the minimum bandwidth among the uplink bandwidths corresponding to the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network as the uplink bandwidth of the total bandwidth. Similarly, the traffic statistics module can determine the minimum bandwidth among the downlink bandwidths corresponding to the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network as the downlink bandwidth of the total bandwidth.
[0201] Exemplarily, it is assumed that the traffic statistics module determines that the uplink bandwidth and downlink bandwidth of the air interface bandwidth are tx_m and rx_m respectively, and the traffic statistics module determines that the uplink bandwidth of the air interface bandwidth is tx_qoe=tx_m*X%, and the downlink rx_qoe=rx_m*X%. The traffic statistics module determines that the uplink bandwidth and downlink bandwidth of the peak bandwidth of the network layer are tx_ip and rx_ip respectively; the traffic statistics module determines that the uplink bandwidth and downlink bandwidth of the historical peak bandwidth of the currently connected wireless network are tx_his and rx_his respectively. The traffic statistics module determines that the uplink bandwidth of the total bandwidth is tx_pre=min(tx_qoe, tx_ip, tx_his), and the downlink bandwidth is rx_pre=min(rx_qoe, rx_ip, rx_his).
[0202] In the embodiment of the present application, after the traffic statistics module determines the total bandwidth of the mobile phone, the intelligent decision module can determine the first target bandwidth of the third application based on the total bandwidth. The intelligent decision module can determine the uplink bandwidth and downlink bandwidth of the first target bandwidth of the third application based on the bandwidth coefficient and the uplink bandwidth and downlink bandwidth of the total bandwidth.
[0203] For example, the intelligent decision-making module can determine that the uplink bandwidth of the first target bandwidth of the third application is tx_lim=max(tx_pre*35%, AMbps), and the downlink bandwidth is rx_lim=max(rx_pre*35%, BMbps). Among them, the bandwidth coefficient is 35%. For example, the above A can be 4 or 5, etc., and B can be 8 or 10, etc. The values of A and B are not limited here. The values of A and B can be adjusted according to the smoothness of the foreground application.
[0204] For another example, the application framework layer can determine that the uplink bandwidth of the first target bandwidth of the third application with the largest target score among the third applications is tx_lim_top1=tx_lim*C, and the downlink bandwidth is rx_lim_top1=rx_lim*C. The value of the bandwidth coefficient C can be 4 / 7 or other values, and the value of C is not limited in the embodiment of the present application.
[0205] Step 907: the intelligent decision module of the application framework layer sends a first command to Netd; correspondingly, Netd receives the first command.
[0206] The first command is used to instruct to adjust the bandwidth of the third application to the first target bandwidth.
[0207] Step 908: Netd sends a first command to the policy execution module of the kernel layer; correspondingly, the policy execution module of the kernel layer receives the first command.
[0208] Step 909: The policy execution module of the kernel layer adjusts the bandwidth of the third application to the first target bandwidth according to the first command.
[0209] In the embodiment of the present application, after receiving the first command, the policy execution module of the kernel layer adjusts the bandwidth of the third application to the first target bandwidth according to the first target bandwidth indicated in the first command.
[0210] In an actual scenario, the policy execution module may adjust the uplink bandwidth of the third application to the uplink bandwidth of the first target bandwidth, and adjust the downlink bandwidth of the third application to the downlink bandwidth of the first target bandwidth.
[0211] Exemplarily, the intelligent decision module of the application framework layer determines that the third application includes the third application A and the third application B, and the target score corresponding to the third application A is greater than S1 and less than S2, and the target score corresponding to the third application B is greater than S2 and less than S3. The intelligent decision module determines that the first target bandwidth corresponding to the third application A is bandwidth 2, and the first target bandwidth corresponding to the third application B is bandwidth 3 according to the correspondence between the target score and the target bandwidth. The intelligent decision module of the application framework layer sends a first command to Netd, and after receiving the first command, Netd sends the first command to the policy execution module of the kernel layer. The policy execution module of the kernel layer adjusts the uplink bandwidth of the third application A to the uplink bandwidth of bandwidth 2, and adjusts the downlink bandwidth of the third application A to the downlink bandwidth of bandwidth 2 according to the received first command. The policy execution module of the kernel layer adjusts the uplink bandwidth of the third application B to the uplink bandwidth of bandwidth 3, and adjusts the downlink bandwidth of the third application B to the downlink bandwidth of bandwidth 3 according to the received first command.
[0212] Also illustratively, it can be seen from Table 5 above that the intelligent decision module of the application framework layer determines that the target score of the third application is less than 0, for example, the target score of the third application is -50 points, and the intelligent decision module determines that the target bandwidth corresponding to the third application is bandwidth 4. The intelligent decision module sends a first command to Netd, and after receiving the first command, Netd sends the first command to the policy execution module of the kernel layer. The policy execution module of the kernel layer adjusts both the uplink bandwidth and the downlink bandwidth of the third application to bandwidth 4 according to the received first command.
[0213] As can be seen from the above, in the embodiment of the present application, the policy execution module of the kernel layer limits the bandwidth of the running background application. By limiting the bandwidth of the background application, the foreground application runs more smoothly, and the jamming phenomenon during the running of the foreground application is reduced. In addition, the policy execution module of the kernel layer controls the bandwidth of the running background application to only limit the speed, and does not control the background application to be in a dormant state. In the process of ensuring that the foreground application runs more smoothly, it also reduces the impact on the running background application.
[0214] In some embodiments of the present application, after the policy execution module of the kernel layer adjusts the bandwidth of the third application to the first target bandwidth, the mobile phone can re-execute the above steps 901 to 909 at every preset time interval (for example, the preset time can be 3s, 5s, 8s, 10s or 15s, etc.).
[0215] In other embodiments of the present application, after the policy execution module of the kernel layer adjusts the bandwidth of the third application to the first target bandwidth, in response to the mobile phone satisfying the second preset condition, the mobile phone can re-determine the application that satisfies the first preset condition from the applications running in the background, and adjust the bandwidth of the application that satisfies the first preset condition, the adjusted bandwidth is less than the bandwidth before the adjustment, and the second preset condition is a change in the application running in the foreground of the mobile phone and / or a change in the application running in the background of the mobile phone.
[0216] It can be understood that after the policy execution module of the kernel layer adjusts the bandwidth of the third application, the foreground application or the background application running in the mobile phone may change. For example, in response to the user's operation, the mobile phone may start a new foreground application, or close a background application, or switch the foreground application to the background application, or switch the background application to the foreground application. In this case, the mobile phone can re-execute the above-mentioned solution of step 901 to step 909.
[0217] It can be explained that when a mobile phone is connected to a wireless network and both foreground applications and background applications are running in the mobile phone, the intelligent decision-making module of the application framework layer can detect in real time whether there is a freeze in the running process of the foreground application. When the intelligent decision-making module of the application framework layer determines that a freeze has occurred in the running foreground application, the intelligent decision-making module of the application framework layer sends a command to the policy execution module of the kernel layer to limit the bandwidth of the background application, so that the foreground application runs more smoothly without affecting the running of the background application, and reduces the freeze in the running process of the foreground application.
[0218] Combine the following Fig.11 Elaborate on the process of determining the target score of the application by the intelligent decision module of the application framework layer. Fig.11 A schematic diagram of a process for determining a target score of an application provided in an embodiment of the present application. Fig.11 As shown, the intelligent decision module of the application framework layer determines the target score of the application and may include the following steps:
[0219] Step 1101: The intelligent decision-making module obtains a basic score.
[0220] Step 1102: The intelligent decision-making module determines whether the application whose score is to be determined is a foreground application.
[0221] In one possible case, if the intelligent decision module determines that the application whose score is to be determined is a foreground application, the intelligent decision module determines the target score of the foreground application according to the process of steps 1103 to 1109 described below.
[0222] In another possible case, if the intelligent decision module determines that the application for which the score is to be determined is a background application, the intelligent decision module determines the target score of the foreground application according to the process of steps 1110 to 1116 described below.
[0223] Step 1103: The intelligent decision module determines the first score corresponding to the application type of the foreground application according to the correspondence between the application type and the first score.
[0224] In an embodiment of the present application, when the intelligent decision module determines that the application whose score is to be determined is a foreground application, the intelligent decision module determines the first score corresponding to the application type of the foreground application based on the pre-stored correspondence between the application type and the first score.
[0225] As a possible implementation method, mobile phone manufacturers can sort all applications in the mobile phone according to the frequency of use of all applications. Then, mobile phone manufacturers can assign higher scores to foreground applications with higher frequency of use and lower scores to foreground applications with lower frequency of use. For example, mobile phone manufacturers can assign the highest scores to games or voice applications that users use more frequently.
[0226] For example, the first scores corresponding to different application types of foreground applications are shown in Table 6 below, that is, the first scores corresponding to game applications and voice applications are s1 (for example, 30 points), the first scores corresponding to video cache applications are s1 (for example, 20 points), and the first scores corresponding to other types of applications are s1 (for example, 10 points). For example, if the intelligent decision module determines that the running foreground application is a voice application, the intelligent decision module can determine that the first score corresponding to the voice foreground application is s1.
[0227] Table 6
[0228]
[0229] It should be noted that the scoring items and scoring standards corresponding to the foreground application and the background application in the above Table 6 are only used as an exemplary description. When actually calculating the scores corresponding to the foreground application and the background application, the scoring items and scoring standards corresponding to the foreground application and the background application shall be based on the scoring items and scoring standards pre-configured in the configuration file.
[0230] Step 1104: The intelligent decision-making module determines a second score corresponding to the foreground application according to whether an acceleration request of the foreground application is received.
[0231] In an embodiment of the present application, if the intelligent decision-making module receives an acceleration request sent by the foreground application, the intelligent decision-making module determines that the second score corresponding to the foreground application is a preset value 1.
[0232] The above-mentioned preset value 1 is a pre-set fixed score, and the second scores corresponding to different types of foreground applications when accelerated are the same, which are all preset value 1. Exemplarily, it can be seen from the above-mentioned Table 6 that if the intelligent decision-making module determines that the foreground application calls the preset acceleration interface during operation, the second score corresponding to the foreground application is determined to be s4 (for example, 50 points or 60 points, etc.). If the intelligent decision-making module determines that the foreground application does not call the preset acceleration interface during operation, the second score corresponding to the foreground application is determined to be 0.
[0233] Step 1105: The intelligent decision-making module determines a third score corresponding to the foreground application according to whether the foreground application is stuck.
[0234] In some embodiments of the present application, the intelligent decision-making module can determine whether there is a lag phenomenon during the operation of the foreground application based on the quality of experience (QoE).
[0235] The above QoE refers to user experience or user perception, that is, the user's subjective feeling about the quality or performance of the device, network and system, application or service. The indicators used to measure QoE may include: video quality, freeze time, freeze frequency, clarity, and clarity switching.
[0236] In an embodiment of the present application, the intelligent decision-making module can determine whether the foreground application is stuck based on an indicator used to measure QoE during the operation of the foreground application to determine a third score corresponding to the foreground application.
[0237] In other embodiments of the present application, the intelligent decision-making module can determine whether lag occurs during the running of the foreground application based on whether at least one of the lag delay, round-trip time (RTT), physical layer transmission rate, received signal strength indication (RSSI), uplink retransmission rate, number of uplink transmission control protocol (TCP) packets, downlink retransmission rate, and number of downlink TCP packets meets corresponding conditions during the running of the foreground application.
[0238] RTT is the total time from when the sender starts sending data to when the sender receives confirmation from the receiver (the receiver sends confirmation immediately after receiving the data, excluding data transmission time). RTT is determined by three parts: link propagation time, end system processing time, and router cache queuing and processing time.
[0239] For example, if the intelligent decision module determines that the jam delay during the operation of the foreground application is greater than the duration threshold 1 (for example, the duration threshold 1 can be 200ms or 300ms, etc.), the intelligent decision module determines that jams occurred during the operation of the foreground application. For another example, if the intelligent decision module determines that the duration of the RTT during the operation of the foreground application is greater than the duration threshold 2 (for example, the duration threshold 2 can be 500ms or 600ms, etc.), the intelligent decision module determines that jams occurred during the operation of the foreground application.
[0240] It should be explained that the method in which the above-mentioned intelligent decision-making module determines whether a foreground application has been stuck during its operation is only described as an example, and any other achievable method for determining whether a foreground application has been stuck during its operation is also applicable to the embodiments of the present application and is not limited here.
[0241] In one possible case, if the intelligent decision module determines that the foreground application is stuck during operation, the intelligent decision module determines that the third score corresponding to the foreground application is a preset value of 2.
[0242] The above-mentioned preset value 2 is a pre-set fixed score, and when different types of foreground applications experience lag, the corresponding third scores are the same, which are all preset value 2.
[0243] In another possible case, if the intelligent decision-making module determines that the foreground application does not experience any lag during operation, the intelligent decision-making module determines that the third score corresponding to the foreground application is 0.
[0244] For example, from the above Table 6, when the intelligent decision module determines that the foreground application running in the mobile phone is a game application, if the intelligent decision module determines that the game application has a stuck phenomenon during operation, the intelligent decision module determines that the third score corresponding to the foreground game application is s5. If the intelligent decision module determines that the game application has no stuck phenomenon during operation, the intelligent decision module determines that the third score corresponding to the foreground game application is 0.
[0245] It should be noted that the process of determining the first score, the second score, and the third score of the foreground application by the intelligent decision module in the embodiment of the present application is not limited. For example, the intelligent decision module can simultaneously determine the first score, the second score, and the third score of the foreground application. For example, the intelligent decision module can also first determine the second score of the foreground application, and then determine the first score or the third score of the foreground application, and so on. That is, the execution process of the above steps 1103 to 1105 is not limited in the embodiment of the present application.
[0246] Step 1106: The intelligent decision-making module determines the total score of the foreground application according to the basic score, the first score, the second score, and the third score.
[0247] In an embodiment of the present application, after the intelligent decision-making module determines the basic score, first score, second score and third score of the foreground application, the intelligent decision-making module can calculate the sum of the basic score, first score, second score and third score to determine the total score of the foreground application.
[0248] Exemplarily, if the intelligent decision-making module determines that the foreground application is a game application, the first score corresponding to the foreground application is 30 points. If the intelligent decision-making module determines that the acceleration request sent by the foreground application has not been received, the intelligent decision-making module determines that the second score corresponding to the foreground application is 0. If the intelligent decision-making module determines that the foreground application has a stuck phenomenon during operation, the intelligent decision-making module determines that the third score corresponding to the foreground application is 15 points. Assuming that the intelligent decision-making module determines that the basic score corresponding to the foreground application is 60 points, the intelligent decision-making module determines that the total score of the foreground application is 60+30+0+15=105 points based on the basic score, first score, second score and third score corresponding to the foreground application.
[0249] As another example, if the intelligent decision module determines that the foreground application is a video caching application, the first score corresponding to the foreground application is 20 points. If the intelligent decision module determines that an acceleration request is received from the foreground application, the intelligent decision module determines that the second score corresponding to the foreground application is 50. If the intelligent decision module determines that the foreground application has a stuck phenomenon during operation, the intelligent decision module determines that the third score corresponding to the foreground application is 15 points. Assuming that the intelligent decision module determines that the basic score corresponding to the foreground application is 60 points, the intelligent decision module determines that the total score of the foreground application is 60+20+50+15=145 points based on the basic score, first score, second score and third score corresponding to the foreground application.
[0250] Step 1107: The intelligent decision-making module determines whether the total score of the foreground application is greater than the first score threshold.
[0251] Step 1108: The intelligent decision-making module determines the target score of the foreground application as the total score of the foreground application.
[0252] Step 1109: The intelligent decision-making module determines that the target score of the foreground application is a first score threshold.
[0253] In an embodiment of the present application, the target score in the correspondence between the target score interval and the target bandwidth has a maximum upper limit score, for example, the maximum upper limit score is a first score threshold. After the intelligent decision-making module determines the total score corresponding to the foreground application, the intelligent decision-making module determines whether the total score of the foreground application is greater than the first score threshold, so as to avoid the target score of the foreground application being greater than the first score threshold, resulting in the inability to determine the target bandwidth corresponding to the foreground application.
[0254] In one possible case, if the intelligent decision module determines that the total score of the foreground application is greater than or equal to the first score threshold, the intelligent decision module determines that the target score of the foreground application is the first score threshold.
[0255] In another possible case, if the intelligent decision module determines that the total score of the foreground application is less than the first score threshold, the intelligent decision module determines that the target score of the foreground application is the total score of the foreground application.
[0256] For example, assuming that the first score threshold is 120 points, if the intelligent decision module determines that the total score of the foreground application is 105 points, the intelligent decision module determines that the target score of the foreground application is 105 points. If the intelligent decision module determines that the total score of the foreground application is 145 points, the intelligent decision module determines that the target score of the foreground application is 120 points.
[0257] Step 1110: The intelligent decision module determines a fourth score corresponding to the background application according to whether the background application has input / output of a voice stream.
[0258] In an embodiment of the present application, after the intelligent decision module determines that the running application is a background application, the intelligent decision module can determine the fourth score corresponding to the background application based on whether the background application has voice stream input / output.
[0259] In one possible case, if the intelligent decision module determines that the background application has voice stream input / output, the fourth score corresponding to the background application is determined to be a preset value 3. The preset value 3 is a preset fixed score, and when different types of background applications have voice stream input or output during operation, the corresponding fourth scores are the same, which are all preset value 3.
[0260] Exemplarily, assuming that the intelligent decision module determines that the background application has voice stream input / output, the intelligent decision module determines that the fourth score corresponding to the background application is s6 (for example, 40 points or 50 points, etc.).
[0261] In another possible case, if the intelligent decision module determines that the background application has no voice stream input / output, then the fourth score corresponding to the background application is determined to be 0.
[0262] Step 1111: The intelligent decision-making module determines the fifth score corresponding to the background application according to the business throughput rate of the background application.
[0263] The service throughput rate refers to the amount of data successfully transmitted per unit time. The throughput rate is limited by the bandwidth. The larger the bandwidth, the higher the upper limit of the throughput rate may be.
[0264] In an embodiment of the present application, the mobile phone pre-stores the correspondence between the ranking of the business throughput rates of background applications and the fifth score. The intelligent decision-making module can determine the fifth score corresponding to the background application based on the ranking of the business throughput rates of each background application in the background business throughput rates.
[0265] In some embodiments, the intelligent decision-making module may assign different fifth scores to the background applications that are ranked in the top three in terms of business throughput rate. For example, if the intelligent decision-making module determines that the business throughput rate of the background application is the highest, the intelligent decision-making module determines that the fifth score of the background application is a preset value of 4 (for example, the preset value 4 can be -10 points). If the intelligent decision-making module determines that the ranking of the business throughput rate of the background application is second, the intelligent decision-making module determines that the fifth score of the background application is a preset value of 5 (for example, the preset value 5 can be -30 points). If the intelligent decision-making module determines that the ranking of the business throughput rate of the background application is third, the intelligent decision-making module determines that the fifth score of the background application is a preset value of 6 (for example, the preset value 6 can be -50 points).
[0266] The above-mentioned preset value 4, preset value 5 and preset value 6 can be fixed values or variable values, which are not limited here.
[0267] Exemplarily, as shown in Table 6 above, assuming that the intelligent decision module determines that the service throughput rate of a certain background application ranks the highest among the background service throughput rates, the fifth score of the background application is determined to be s7. Further exemplary, assuming that the intelligent decision module determines that the service throughput rate of a certain background application ranks the third among the background service throughput rates, the fifth score of the background application is determined to be s9.
[0268] Step 1112: The intelligent decision-making module determines the sixth score corresponding to the background application according to whether the application layer limits the speed of the background application.
[0269] In an embodiment of the present application, the intelligent decision-making module can also determine the sixth score corresponding to the background application based on whether the application layer limits the speed of the background application.
[0270] For example, assuming that the application layer has limited the speed of a background application due to the high power consumption of the electronic device, the intelligent decision-making module recognizes that the application layer has limited the speed of the background application, and the intelligent decision-making module can determine that the sixth score corresponding to the background application is a preset value of 7 (for example, the preset value 7 can be -60 points). The above preset value 7 is a pre-set fixed score, and when the application layer limits the speed of different types of background applications, the sixth scores corresponding to the limited background applications are the same, which are all preset values 8.
[0271] It should be noted that the process of determining the fourth score, the fifth score, and the sixth score of the background application by the intelligent decision module in the embodiment of the present application is not limited. For example, the intelligent decision module can simultaneously determine the fourth score, the fifth score, and the sixth score of the background application. For example, the intelligent decision module can also first determine the fifth score of the background application, and then determine the fourth score or the sixth score of the background application, and so on. That is, the execution process of the above steps 1110 to 1112 is not limited in the embodiment of the present application.
[0272] Step 1113, the intelligent decision-making module determines the total score of the background application according to the basic score, the fourth score, the fifth score and the sixth score.
[0273] In an embodiment of the present application, after the intelligent decision-making module determines the basic score, fourth score, fifth score and sixth score of the background application, the intelligent decision-making module can calculate the sum of the basic score, fourth score, fifth score and sixth score to determine the total score of the background application.
[0274] Exemplarily, assuming that the intelligent decision-making module determines that the background application is a music playback application, and the intelligent decision-making module determines that the background application has voice output, the fourth score corresponding to the background application is determined to be 40 points. If the intelligent decision-making module determines that the service throughput of the background application ranks second among all background service throughputs, the intelligent decision-making module determines that the fifth score corresponding to the background application is -30 points. If the intelligent decision-making module determines that the background application does not recognize the speed limit of the background application by the application layer during operation, the intelligent decision-making module determines that the sixth score corresponding to the background application is 0 points. Assuming that the intelligent decision-making module determines that the basic score corresponding to the background application is 60 points, the intelligent decision-making module determines that the total score of the background application is 60+40-30+0=70 points based on the basic score, fourth score, fifth score and sixth score corresponding to the background application.
[0275] As another example, if the intelligent decision-making module determines that the foreground application is a dating application, and the intelligent decision-making module determines that the background application has voice output, then the fourth score corresponding to the background application is determined to be 40 points. If the intelligent decision-making module determines that the business throughput of the background application ranks first among all background business throughputs, the intelligent decision-making module determines that the fifth score corresponding to the background application is -10 points. If the intelligent decision-making module determines that the background application does not recognize the speed limit of the background application by the application layer during operation, the intelligent decision-making module determines that the sixth score corresponding to the background application is 0 points. Assuming that the intelligent decision-making module determines that the basic score corresponding to the background application is 60 points, the intelligent decision-making module determines that the total score of the background application is 60+40-10+0=90 points based on the basic score, fourth score, fifth score and sixth score corresponding to the background application.
[0276] Step 1114: The intelligent decision-making module determines whether the total score of the background application is greater than the second score threshold.
[0277] Step 1115: The intelligent decision-making module determines that the target score of the background application is the total score of the background application.
[0278] Step 1116: The intelligent decision-making module determines that the target score of the background application is a second score threshold.
[0279] In an embodiment of the present application, after the intelligent decision-making module determines the total score corresponding to the background application, the intelligent decision-making module determines whether the total score of the background application is greater than the second score threshold to determine the target score of the background application.
[0280] In one possible case, if the intelligent decision-making module determines that the total score of the background application is greater than or equal to the second score threshold, the intelligent decision-making module determines that the target score of the background application is the second score threshold.
[0281] In another possible case, if the intelligent decision module determines that the total score of the background application is less than the second score threshold, the intelligent decision module determines the target score of the background application to be the total score of the foreground application.
[0282] For example, assuming that the second score threshold is 80 points, if the intelligent decision module determines that the total score of the background application is 70 points, the intelligent decision module determines that the target score of the foreground application is 70 points. If the intelligent decision module determines that the total score of the background application is 90 points, the intelligent decision module determines that the target score of the background application is 80 points.
[0283] It can be understood that during the running of the foreground application, in order to avoid the foreground application from being stuck, when the bandwidth of some background applications is limited, in order to distinguish the target score of the foreground application from the target score of the background application, in this application, the target score of the background application is limited to be less than the second score threshold.
[0284] It should be noted that when the intelligent decision module determines the target scores of the foreground application and the background application, the above step 1101 may not be performed. In other words, the intelligent decision module does not pre-assign a basic score to the application. In this case, when calculating the total score of the foreground application in step 1106 and the total score of the background application in step 1113, the basic score may be 0.
[0285] In an embodiment of the present application, after the intelligent decision-making module determines the target scores corresponding to the running foreground applications and background applications according to the process of the above steps 1101 to 1116, the intelligent decision-making module can determine the target bandwidth corresponding to the foreground application or the background application according to the target scores corresponding to the foreground application and the background application, so as to control the bandwidth of the foreground application or the background application, and avoid the phenomenon of lag during the operation of the foreground application while minimizing the impact on the background application, so as to improve the user experience.
[0286] In the above embodiment, after the intelligent decision-making module determines the background application to be speed-limited (i.e., the third application), the bandwidth of the third application is controlled to the first target bandwidth, that is, in the above embodiment, the bandwidth of the background application is speed-limited at the application granularity. The following embodiment can speed-limit the bandwidth of the target data stream in the background application to be speed-limited, and the data streams running in the application all correspond to sockets. When speed-limiting the bandwidth of the target data stream, the bandwidth of the socket corresponding to the target data stream can be speed-limited to achieve speed-limiting of the bandwidth of the socket corresponding to different data streams of the same background application, thereby adjusting the bandwidth of different sockets of the background application and reducing the impact on the background application.
[0287] In one possible scenario of an embodiment of the present application, when an application in a mobile phone is started, along with the start of the application process, the application creates sockets corresponding to different data streams. Among them, the socket is the programming interface between the application process and the kernel network protocol stack. After the intelligent decision-making module of the application framework layer determines the target score of each socket corresponding to each application, the intelligent decision-making module determines the socket to be limited according to the target score corresponding to each socket. After the intelligent decision-making module determines the target bandwidth corresponding to the socket to be limited according to the target score corresponding to the socket to be limited, the policy execution module of the kernel layer adjusts the bandwidth of the socket to be limited to the target bandwidth, thereby achieving the purpose of individually limiting the speed of different sockets. The following is combined with Fig.12 A detailed explanation of the above process is given. Fig.12 A flow chart of another method for controlling application bandwidth provided in an embodiment of the present application is shown as follows: Fig.12As shown, the method may include the following steps:
[0288] Step 1201, when the intelligent sensing module determines that the mobile phone is turned on or restarted, configuration information and a virtual interface are added.
[0289] The configuration information may include a qdisc class, and the virtual interface may be ifb0.
[0290] For example, when the intelligent sensing module determines that the mobile phone is turned on or restarted, the code of the newly added qdisc class in the intelligent sensing module is as follows:
[0291] int tc_add_qdisc(string ifname, int type, string qdisc_id, stringparent).
[0292] When adding a qdisc class using the above code, create the qdisc name, type, id, and path name.
[0293] The code for deleting the qdisc class in the intelligent sensing module is as follows:
[0294] int tc_del_qdisc(string ifname, int type, string qdisc_id, stringparent).
[0295] Under normal circumstances, after the router forwards the message to the mobile phone, the application can directly communicate with the base station based on the received message, resulting in the mobile phone being unable to limit the downstream bandwidth of the router. In an embodiment of the present application, after the mobile phone is turned on or restarted, the intelligent perception module can configure a virtual interface. When the router forwards the message to the mobile phone, the router can send the message to the virtual interface. When the mobile phone limits the speed of the virtual interface and the router sends the message to the virtual interface, the application cannot receive the message, thereby achieving the purpose of limiting the downstream bandwidth of the router, thereby achieving the purpose of limiting the downstream bandwidth of the application.
[0296] Step 1202: When application A starts, a socket is created.
[0297] In the embodiment of the present application, when application A is started, the process corresponding to application A is started immediately. A process can correspond to multiple sockets, but a socket can only belong to one process. In other words, an application can correspond to multiple sockets, and a socket can only belong to one application.
[0298] Optionally, when the application A includes multiple data streams during operation, different data streams correspond to different sockets. For example, the application A includes a voice stream and a video stream during operation, wherein the voice stream corresponds to one socket and the video stream corresponds to another socket.
[0299] Step 1203: Application A sends socket information to Netd; correspondingly, Netd receives the socket information sent by Application A.
[0300] The socket information includes user identification information (UID), process identification number (PID) and a five-tuple.
[0301] Among them, UID is the value assigned by the system when the mobile phone installs the application. It is used to identify different applications and is fixed. When the application is uninstalled and reinstalled, the system will reallocate a new UID.
[0302] PID is a value assigned by the system when a process is running. After the process terminates, the PID corresponding to the process will be recycled by the system.
[0303] The five-tuple includes: source IP address, source port, destination IP address, destination port and transport layer protocol. For example, 192.168.1.110000TCP 121.14.88.76 80 constitutes a five-tuple. Its meaning is that a terminal with an IP address of 192.168.1.1 connects to a terminal with an IP address of 121.14.88.76 and a port of 80 through port 10000 and TCP protocol.
[0304] Step 1204, Netd reports the socket information to the intelligent decision-making module; correspondingly, the intelligent decision-making module receives the socket information.
[0305] Step 1205, the intelligent decision module maintains the socket table.
[0306] In an embodiment of the present application, after the intelligent decision-making module receives the socket information sent by Netd, the socket information can be stored in a table.
[0307] It should be noted that Fig.12The example of application A startup is used for description. In actual scenarios, multiple applications may be started in the mobile phone, and each application creates a corresponding socket. After the intelligent decision module receives the socket information corresponding to multiple applications sent by Netd, the intelligent decision module stores the socket information corresponding to the multiple applications in a table. For example, the socket information corresponding to different applications is stored in Table 7 below.
[0308] Table 7
[0309] application Socket information Application A socket1 information Application A socket2 information Application B socket3 information Application B socket4 information Application B socket5 information
[0310] Step 1206: The intelligent sensing module determines that the mobile phone is connected to a wireless network.
[0311] In the embodiment of the present application, the implementation process of the intelligent sensing module determining whether the mobile phone is connected to the wireless network in step 1206 can refer to the implementation process in the above step 901, which will not be repeated here.
[0312] Step 1207: The intelligent decision-making module determines the target score corresponding to each socket of each running application.
[0313] In the embodiment of the present application, the intelligent decision module determines the target score corresponding to each socket of each application, which can be seen in the above Fig.11 The implementation process of determining the target score corresponding to each application will not be repeated here.
[0314] It should be explained that when the intelligent decision module determines the target scores corresponding to different sockets of the same application, it can also first determine whether the application is a foreground application or a background application. When the intelligent decision module determines that the application to which the socket belongs is a foreground application, the intelligent decision module can determine the target score of each socket based on the application type, whether an application acceleration request is received, whether a freeze is detected during operation, and the data flow corresponding to the socket.
[0315] When the intelligent decision module determines that the application to which the socket belongs is a background application, the intelligent decision module can determine the target score of each socket based on whether there is audio stream input or output during the application operation, the service throughput, the application layer identification speed limit, and the data flow corresponding to the socket.
[0316] It can be understood that the scores of the sockets corresponding to different data streams are not the same. For example, the score of the socket corresponding to the audio stream may be 20 points, the score of the socket corresponding to the video stream may be 10 points, the score of the socket corresponding to the information stream may be -10 points, etc. Therefore, the intelligent decision-making module determines that the target scores of the sockets corresponding to different data streams of the same background application are not the same. The intelligent decision-making module can determine the target bandwidth corresponding to the target score of the socket to be limited according to the corresponding relationship between the target score of the socket and the target bandwidth.
[0317] Step 1208: The intelligent decision module determines the socket to be speed-limited according to the target scores corresponding to the sockets of each application.
[0318] In a possible implementation manner of the embodiment of the present application, the intelligent decision module may determine the socket corresponding to the predefined data flow as the socket to be rate-limited.
[0319] In another possible implementation of the embodiment of the present application, after the intelligent decision-making module determines the target score corresponding to the socket of each application, it determines whether the target score of the socket of the foreground application is greater than the fifth threshold.
[0320] When the intelligent decision module determines that the target score of the foreground application's socket is greater than the fifth threshold, the intelligent decision module determines the sockets corresponding to the backend applications whose target scores are less than the sixth threshold as the sockets to be speed-limited, where the sixth threshold is less than the fifth threshold.
[0321] When the intelligent decision module determines that the target score of the foreground application's socket is less than the first threshold, the intelligent decision module determines that the sockets corresponding to the background applications whose target scores are less than the seventh threshold are the sockets to be speed-limited, where the seventh threshold is less than the sixth threshold.
[0322] Step 1209: The intelligent decision module determines the target bandwidth according to the target score of the socket to be speed-limited.
[0323] In an embodiment of the present application, after the intelligent decision module determines the socket to be speed limited, the intelligent decision module can determine the target bandwidth corresponding to the target score of the socket to be speed limited based on the pre-stored relationship between the target score of the socket and the target bandwidth.
[0324] The implementation process of the intelligent decision-making module determining the target bandwidth according to the target score of the socket to be speed-limited can refer to the implementation process of the intelligent decision-making module determining the first target bandwidth according to the target score of the third application, which will not be repeated here.
[0325] Step 1210, the intelligent decision module sends tc command 1 to Netd to create multiple classes.
[0326] In the embodiment of the present application, the intelligent decision module sends a tc command 1 to Netd to create multiple classes, and different classes correspond to different target bandwidths. In addition, each class has a unique class identifier.
[0327] For example, it can be seen from Table 5 above that the target bandwidth corresponding to class1 is bandwidth 1, the target bandwidth corresponding to class2 is bandwidth 2, the target bandwidth corresponding to class3 is bandwidth 3, and the target bandwidth corresponding to class4 is bandwidth 4.
[0328] Step 1211, the intelligent decision module identifies the class corresponding to the socket to be rate-limited.
[0329] In the embodiment of the present application, the intelligent decision-making module determines the class corresponding to the target score according to the target score of the socket to be speed limited, so as to identify the class corresponding to the socket to be speed limited.
[0330] For example, when the target score corresponding to the socket to be speed limited is greater than 0 and less than or equal to the target score 1, the target bandwidth corresponding to the socket to be speed limited is the target bandwidth corresponding to class 1. When the target score corresponding to the socket to be speed limited is greater than the target score 1 and less than or equal to the target score 2, the target bandwidth corresponding to the socket to be speed limited is the target bandwidth corresponding to class 2. When the target score corresponding to the socket to be speed limited is greater than the target score 2 and less than or equal to the target score 3, the target bandwidth corresponding to the socket to be speed limited is the target bandwidth corresponding to class 3. When the target score corresponding to the socket to be speed limited is greater than the target score 3 and less than or equal to the target score 4, the target bandwidth corresponding to the socket to be speed limited is the target bandwidth corresponding to class 4.
[0331] Assuming that the intelligent decision module determines that the target score of the socket to be limited is greater than the target score 1 and less than the target score 2, the intelligent decision module determines that the target bandwidth corresponding to the socket to be limited is the target bandwidth corresponding to class2.
[0332] Step 1212, the intelligent decision module sends a filter command to Netd; correspondingly, Netd receives the filter command.
[0333] The filter command is used to indicate the class corresponding to the socket to be rate-limited.
[0334] Step 1213, Netd binds the socket to be rate-limited to the corresponding class.
[0335] In the embodiment of the present application, after Netd receives the filter command, Netd binds the socket to be speed-limited with the corresponding class according to the filter command.
[0336] Step 1214, Netd sends a speed limit command to the policy execution module of the kernel layer; correspondingly, the policy execution module receives the speed limit command.
[0337] Step 1215: The policy execution module limits the bandwidth of the socket to be limited according to the speed limit command.
[0338] The speed limit command is used to instruct to adjust the bandwidth of the socket to be speed limited to the target bandwidth corresponding to the class bound to the socket to be speed limited.
[0339] In the embodiment of the present application, after receiving the speed limit command, the policy execution module adjusts the bandwidth of the socket to be speed limited to the target bandwidth corresponding to the class bound to the socket to be speed limited, thereby achieving the purpose of adjusting the bandwidth of different sockets.
[0340] Step 1216: The intelligent decision module updates the target bandwidth corresponding to different classes.
[0341] When the foreground application and / or the background application running in the mobile phone changes, the target bandwidth for the socket speed limit of the background application may be different. In this case, the intelligent decision module can update the target bandwidth corresponding to different classes.
[0342] Step 1217, the intelligent decision module sends tc command 2 to Netd to refresh the target bandwidth corresponding to different classes.
[0343] Step 1218, application A sends a command to Netd to delete the socket information.
[0344] In the embodiment of the present application, when application A exits, application A sends a command to Netd to delete the socket information.
[0345] Step 1219, Netd sends a command to delete the socket information to the intelligent decision module; correspondingly, the intelligent decision module receives the command to delete the socket information.
[0346] Step 1220: The intelligent decision-making module deletes the socket information according to the command to delete the socket information.
[0347] In an embodiment of the present application, the intelligent decision-making module deletes the pre-stored socket information corresponding to application A according to the received command to delete the socket information.
[0348] Step 1221, the intelligent decision module sends tc command 3 to Netd to delete the class corresponding to the socket.
[0349] Step 1222, the intelligent decision module sends tc command 4 to unbind the socket from the corresponding class.
[0350] Step 1223: The intelligent decision-making module determines that no socket to be speed-limited is identified.
[0351] Step 1224, the intelligent decision module sends tc command 5 to Netd to delete all classes; correspondingly, Netd receives tc command 5.
[0352] In an embodiment of the present application, the intelligent decision module can determine the socket to be limited in speed according to the target score of the socket of each running application at a preset time interval. When the intelligent decision module fails to identify the socket to be limited in speed according to the target score of the socket of each application, the intelligent decision module sends tc command 5 to Netd to delete all classes. After receiving tc command 5, Netd deletes all classes according to tc command 5.
[0353] Step 1225, the intelligent decision module sends tc command 6 to Netd; correspondingly, Netd receives tc command 6.
[0354] Step 1226 , Netd sends tc command 6 to the policy execution module; correspondingly, the policy execution module receives tc command 6 .
[0355] Step 1227, the policy execution module releases the binding between all sockets and corresponding classes according to tc command 6.
[0356] In summary, in an embodiment of the present application, after the intelligent decision-making module of the application framework layer determines the socket to be speed-limited from the sockets of different background applications, it determines the target bandwidth of the socket to be speed-limited according to the target score of the socket to be speed-limited. Then, the policy execution module of the kernel layer adjusts the bandwidth of the socket to be speed-limited to the target bandwidth, thereby achieving the purpose of individually limiting different sockets of different applications. Compared with the related art, when the foreground application running on the mobile phone freezes, the bandwidth of all background applications is limited, resulting in all background applications being unable to operate normally. In an embodiment of the present application, the policy execution module only limits the bandwidth of the socket to be speed-limited, which reduces the impact on background applications while ensuring the normal operation of the foreground application.
[0357] For example, Fig.13 As shown in the figure, the mobile phone is running news applications and application market at the same time. When the news application is playing a video, the application market running in the background is downloading applications at a bandwidth of 1.5M / s. Figure 1 The application market running in the background is downloading applications at a bandwidth of 3.5M / s. In the embodiment of the present application, the mobile phone adjusts the downlink bandwidth of the application market of the background application to 1.5M / s, and ensures the normal operation of the foreground application by limiting the downlink bandwidth of the background application.
[0358] like Fig.14 As shown, an embodiment of the present application discloses an electronic device, which may be the mobile phone mentioned above. The electronic device may specifically include: a touch screen 1401, wherein the touch screen 1401 includes a touch sensor 1406 and a display screen 1407; one or more processors 1402; a memory 1403; one or more application programs (not shown); and one or more computer programs 1404, and the above-mentioned components may be connected via one or more communication buses 1405. Among them, the above-mentioned one or more computer programs 1404 are stored in the above-mentioned memory 1403 and are configured to be executed by the one or more processors 1402, and the one or more computer programs 1404 include instructions, which may be used to execute the relevant steps in the above-mentioned embodiments.
[0359] It is understandable that, in order to realize the above functions, the above-mentioned electronic devices, etc. include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present invention.
[0360] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device etc. according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0361] In the case of dividing each functional module according to each function, a possible composition diagram of the electronic device involved in the above embodiment, the electronic device may include: a display unit, a transmission unit and a processing unit, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0362] The embodiment of the present application also provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the above-mentioned related method steps to implement the application bandwidth control method in the above-mentioned embodiment.
[0363] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the application bandwidth control method in the above-mentioned embodiment.
[0364] An embodiment of the present application further provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the application bandwidth control method in the above-mentioned embodiment.
[0365] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory, so that the device executes the application bandwidth control method executed by the electronic device in the above-mentioned method embodiments.
[0366] Among them, the electronic device, computer-readable storage medium, computer program product or device provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0367] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0368] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0369] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.
[0370] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for controlling application bandwidth, characterized in that: Applied to electronic equipment, the method comprises: In the process of displaying the interface of the first application on the display screen of the electronic device, determining a third application that meets a first preset condition from at least one second application running in the background of the electronic device, wherein the first preset condition is that the bandwidth index of the second application reaches a target index, and the bandwidth index of the second application is used to measure whether to limit the bandwidth of the second application; The electronic device controls the bandwidth of the third application to be adjusted to a first target bandwidth, where the first target bandwidth is smaller than a current bandwidth of the third application and the first target bandwidth is determined based on a total bandwidth of the electronic device.
2. The method according to claim 1, characterized in that: Before the electronic device controls the bandwidth of the third application to be adjusted to the first target bandwidth, the method further includes: The electronic device determines the first target bandwidth corresponding to the bandwidth indicator of the third application according to the corresponding relationship between the bandwidth indicator and the target bandwidth.
3. The method according to claim 1 or 2, characterized in that: The bandwidth indicator is the target score of the application; Before determining a third application satisfying a first preset condition from a plurality of second applications running in the background of the electronic device, the method further includes: Determining, by the electronic device, a target score for the first application and a target score for each of the plurality of second applications; In a case where the target score of the first application is greater than a first threshold, the third application is an application whose target score among the plurality of second applications is less than a second threshold, and the second threshold is less than the first threshold; When the target score of the first application is less than the first threshold, the third application is an application among the plurality of second applications having a target score less than a third threshold, and the third threshold is less than the second threshold.
4. The method according to claim 3, characterized in that: The electronic device determines a target score of the first application and a target score of each of the plurality of second applications, including: The electronic device determines a target score of the first application according to at least one of an application type of the first application, whether an application acceleration request is sent, and whether an application is stuck; For each second application among the multiple second applications, the electronic device determines the target score of the second application according to at least one of whether the second application has voice stream input or output, service throughput, and whether it is speed-limited.
5. The method according to claim 3 or 4, characterized in that: The method further comprises: The electronic device determines a total bandwidth of the electronic device according to a bandwidth parameter, where the bandwidth parameter includes at least one of an air interface bandwidth, a peak bandwidth of a network layer, and a historical peak bandwidth of a currently connected wireless network; The electronic device determines the target bandwidths corresponding to the different target scores respectively according to the bandwidth coefficients corresponding to the different target scores and the total bandwidth. The smaller the target score is, the smaller the corresponding bandwidth coefficient is.
6. The method according to claim 5, characterized in that The electronic device determines the total bandwidth of the electronic device according to the bandwidth parameter, including: The electronic device determines the total bandwidth according to a minimum bandwidth of at least one of the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected wireless network included in the bandwidth parameters.
7. The method according to any one of claims 1 to 6, characterized in that: After the electronic device controls the bandwidth of the third application to be adjusted to the first target bandwidth, the method further includes: In response to satisfying a second preset condition, the electronic device re-determines an application that satisfies the first preset condition from the applications running in the background of the electronic device, and adjusts the bandwidth of the application that satisfies the first preset condition, wherein the adjusted bandwidth is less than the bandwidth before the adjustment, and the second preset condition is a change in the application running in the foreground of the electronic device and / or a change in the application running in the background of the electronic device.
8. The method according to any one of claims 1 to 7, characterized in that: The third application includes a plurality of data streams during operation, and the electronic device controls the bandwidth of the third application to be adjusted to the first target bandwidth, including: The electronic device controls the bandwidth of the target data stream in the third application to the first target bandwidth, and the target data stream is a predefined data stream among the multiple data streams.
9. The method according to claim 8, characterized in that The electronic device controls the bandwidth of the target data stream in the third application to the first target bandwidth, including: The electronic device obtains the socket corresponding to the target data stream; The electronic device configures a corresponding class class for the socket corresponding to the target data stream, where the class is used to indicate that the bandwidth of the socket is adjusted to the first target bandwidth; The electronic device adjusts the bandwidth of the socket to the first target bandwidth according to the class corresponding to the socket.
10. The method according to any one of claims 3 to 9, characterized in that: The method further comprises: When the target score of the first application is greater than the first threshold, the electronic device determines, from the at least one second application, a fourth application whose target score is greater than a fourth threshold, where the fourth threshold is greater than the first threshold; The electronic device controls the bandwidth of the fourth application to be adjusted to a second target bandwidth, where the second target bandwidth is greater than a current bandwidth of the fourth application.
11. An electronic device, characterized in that: include: Display screen; one or more processors; Memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the method for controlling the application bandwidth as described in any one of claims 1-10.
12. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, characterized in that: When the instruction is executed on an electronic device, the electronic device executes the method for controlling application bandwidth as claimed in any one of claims 1 to 10.