A load balancing method and device for an Android system

By enabling the QoS configuration option in the Android system and cross-compiling the iproute2 source code, the speed-limiting command is issued to each functional interface according to the total bandwidth of the WIFI module, which solves the problem of bandwidth contention of multi-functional WIFI modules in the Android system and achieves network stability and reliability.

CN115529634BActive Publication Date: 2025-12-19GUANGZHOU LANGO ELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211136960.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-19
Publication Date
2025-12-19
Estimated Expiration
2042-09-19

AI Technical Summary

Technical Problem

In Android systems, when the same Wi-Fi module has multiple functions enabled simultaneously, there is a lack of necessary restrictions, which leads to random bandwidth contention between functions and affects network stability.

Method used

By enabling the QoS configuration option through the kernel of the Android system source code, cross-compiling the iproute2 source code and generating an executable file, receiving user function start commands, and issuing rate limiting commands to the network interfaces of each function according to the total bandwidth of the WIFI module, in order to achieve load balancing.

Benefits of technology

It achieves reasonable allocation of bandwidth for each function, solves the problem of random contention, and improves the stability and reliability of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115529634B_ABST
    Figure CN115529634B_ABST
Patent Text Reader

Abstract

The application provides a load balancing method and device for an Android system, and the method comprises the following steps: opening a QoS configuration option through a kernel of an Android system source code; receiving a plurality of function starting commands of a user after the Android system is started; wherein the function starting commands respectively correspond to a plurality of functions of a WIFI module one by one; respectively issuing a speed limiting command to a network interface corresponding to each function according to a total bandwidth of the WIFI module of the Android system in response to the function starting commands, so as to realize load balancing of the plurality of functions; wherein the speed limiting command comprises an upper limit of a bandwidth corresponding to each function. Compared with the prior art, after the Android system is started, the commands of the user are received, the speed limiting command is respectively issued to the network interface of each function, the speed limiting command comprises the upper limit of the bandwidth, so that the bandwidth between the loads corresponding to each function can be reasonably distributed, the problem of random contention is solved, and the stability and reliability of the network are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of mobile communication technology, and in particular to a load balancing method and device for an Android system. BACKGROUND

[0002] In the actual application of the Android system, the same WIFI module can be used to implement different functions at the same time. For example, the WLAN wireless connection function and the WIFI direct connection function can be started at the same time, or the WLAN wireless connection function and the HOTSPOT hotspot sharing function can be started at the same time. In the prior art, the same WIFI module lacks necessary restrictions on several functions, and therefore in a specific application scenario, the bandwidth between functions is randomly contended, which affects the network stability. SUMMARY

[0003] The present application provides a load balancing method and device for an Android system to solve the technical problem of how to improve the stability of the network.

[0004] To solve the above technical problem, the present application provides a load balancing method for an Android system, comprising: opening a QoS configuration option through the kernel of the Android system source code;

[0005] After the Android system is started, receiving a plurality of function start commands of a user; wherein the function start commands one by one correspond to a plurality of functions of a WIFI module;

[0006] In response to the function start commands, respectively issuing a speed limiting command to the network interface corresponding to each function according to the total bandwidth of the WIFI module of the Android system, so as to realize the load balancing of the plurality of functions; wherein the speed limiting command comprises an upper limit of the bandwidth corresponding to each function.

[0007] As a possible implementation manner, before the Android system is started, the method further comprises:

[0008] Cross-compiling the iproute2 source code to generate a corresponding executable file, and transplanting the executable file into the Android system.

[0009] As a possible implementation manner, the functions of the WIFI module include the WLAN wireless connection function, the WIFI direct connection function and the hotspot sharing function.

[0010] As a possible implementation manner, the total bandwidth of the WIFI module of the Android system is set according to the hardware performance parameters of the WIFI module.

[0011] As a possible implementation manner, the load balancing method further comprises:

[0012] Receive a function closing command of a user; in response to the function closing command, issue a speed limit canceling command to a network interface of a function corresponding to the function closing command, to close bandwidth limitation of the function corresponding to the function closing command.

[0013] Correspondingly, the embodiment of the application further provides a load balancing device for an Android system, comprising a configuration module, a receiving module and a speed limit module; wherein,

[0014] The configuration module is configured to open a QoS configuration option through a kernel of an Android system source code.

[0015] The receiving module is configured to receive a plurality of function starting commands of a user after the Android system is started; wherein the function starting commands one-to-one correspond to a plurality of functions of a WIFI module.

[0016] The speed limit module is configured to respond to the function starting commands, and issue a speed limit command to a network interface corresponding to each function according to a total bandwidth of the WIFI module of the Android system, to realize load balancing of the plurality of functions; wherein the speed limit command comprises an upper limit of a bandwidth corresponding to each function.

[0017] As a possible implementation manner, before the Android system is started, the load balancing device further comprises a transplantation module, which is configured to cross-compile an iproute2 source code, generate a corresponding executable file, and transplant the executable file into the Android system.

[0018] As a possible implementation manner, the functions of the WIFI module comprise a WLAN wireless connection function, a WIFI direct connection function and a hotspot sharing function.

[0019] As a possible implementation manner, the total bandwidth of the WIFI module of the Android system is set according to a hardware performance parameter of the WIFI module.

[0020] As a possible implementation manner, the load balancing device further comprises a speed limit canceling module, which is configured to receive a function closing command of a user; in response to the function closing command, issue a speed limit canceling command to a network interface of a function corresponding to the function closing command, to close bandwidth limitation of the function corresponding to the function closing command.

[0021] Compared with the prior art, the embodiment of the application has the following beneficial effects:

[0022] The embodiment of the present application provides a load balancing method and device for an Android system, and the method comprises the following steps: opening a QoS configuration option through a kernel of an Android system source code; receiving a plurality of function starting commands of a user after starting the Android system; wherein the function starting commands are respectively one-to-one corresponding to a plurality of functions of a WIFI module; respectively issuing a speed limiting command to a network interface corresponding to each function according to a total bandwidth of the WIFI module of the Android system in response to the function starting commands, so as to realize load balancing of the plurality of functions; wherein the speed limiting command comprises an upper limit of the bandwidth corresponding to each function. Compared with the prior art, after starting the Android system, the command of the user is received, the speed limiting command is respectively issued to the network interface of each function, and the speed limiting command comprises the upper limit of the bandwidth, so that the bandwidth between the loads corresponding to each function can be reasonably distributed, the problem of random contention is solved, and the stability and reliability of the network are effectively improved. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 Fig. 1 is a flowchart of an embodiment of the load balancing method for the Android system provided by the present application.

[0024] Figure 2 Fig. 2 is a structural schematic diagram of an embodiment of the load balancing device for the Android system provided by the present application. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0026] Embodiment one:

[0027] According to the related art, in a use scenario, the Android system can use the same WIFI module to realize a plurality of different functions at the same time. The functions include but are not limited to WLAN wireless connection function, WIFI direct connection function and hotspot sharing function and the like.

[0028] Due to certain user needs, it may be necessary to enable two or more functions simultaneously. For example, simultaneously enabling WLAN wireless connectivity and Wi-Fi Direct, or simultaneously enabling WLAN wireless connectivity and HOTSPOT sharing. However, the relevant technologies do not provide necessary restrictions on each function, which may lead to one function having excessive bandwidth, thus consuming the bandwidth of other functions. For instance, if the WLAN wireless connection function is 100 Mbit / s, but the total bandwidth is only 150 Mbit / s, then only 50 Mbit / s of bandwidth is available for the portable WLAN hotspot function, potentially resulting in low bandwidth for the portable WLAN hotspot function. Depending on actual usage requirements, random contention between functions may occur, thus affecting network stability and reliability.

[0029] Please refer to Figure 1 , Figure 1 This invention provides a load balancing method for an Android system to address one or more of the aforementioned technical problems, comprising steps S1 to S3, wherein...

[0030] Step S1: Enable the QoS configuration option through the kernel of the Android system source code.

[0031] In this embodiment, the Android system runs on a Linux kernel, which supports configurable and customizable features. This embodiment enables QoS configuration options through the Linux kernel.

[0032] QoS stands for Quality of Service. Network QoS, also known as network service quality, allocates bandwidth to various services / functions to provide quality assurance when bandwidth resources are limited. Through QoS configuration, you can define the priority of network transmission data, the allocation of network resources, and the control of network transmission characteristics.

[0033] Furthermore, before the Android system starts, the process also includes: cross-compiling the iproute2 source code to generate the corresponding executable file, and porting the executable file to the Android system.

[0034] Iproute2 source code is open source code and can be obtained from open source libraries. By cross-compiling this source code to obtain the corresponding executable file, the executable file can be ported to the Android system, thereby upgrading the executable program of the Android system.

[0035] Step S2: After the Android system starts up, it receives several function activation commands from the user; wherein each function activation command corresponds to a certain function of the WIFI module.

[0036] As an example of the embodiment, the several function start commands can include a first function start command, a second function start command and a third function start command. The functions of the WIFI module include WLAN wireless connection function, WIFI direct connection function and hotspot sharing function. At this time, the first function start command corresponds to the WLAN wireless connection function, the second function start command corresponds to the WIFI direct connection function, and the third function start command corresponds to the hotspot sharing function.

[0037] Step S3, in response to the function start command, according to the total bandwidth of the WIFI module of the Android system, respectively issuing a speed limit command to the network interface corresponding to each function to achieve load balancing of several functions; wherein the speed limit command includes the upper limit of the bandwidth corresponding to each function.

[0038] In the embodiment, preferably, the total bandwidth of the WIFI module of the Android system can be set according to the hardware performance parameters of the WIFI module.

[0039] In step S3, when the user needs to use a certain function, the Android system will receive a function start command corresponding to the certain function, and then, in response to the function start command and according to the total bandwidth of the WIFI module of the Android system, respectively issuing a speed limit command to the network interface corresponding to each function. For example, as an example of the embodiment, the command / system / bin / tc qdisc add dev WLAN0 root tbf rate 100Mbit latency 50ms burst 1000 can be used to achieve the above. The above command is a standard parameter input of the tc instruction. Among them, WLAN0 represents the network interface used by the wireless WLAN function, and 100M represents that the maximum bandwidth of the wireless WLAN function is 100M. Similarly, WLAN1 can be used to correspond to the network interface used by the hotspot function, and other commands can be used to correspond to the network interface of the WIFI direct connection function, and so on.

[0040] Further, by the same way of setting, on the premise that the total bandwidth is greater than or equal to 200Mbit / s, the WLAN wireless connection function is configured to limit the speed to 100Mbit / s, and the hotspot sharing function is configured to limit the speed to 100Mbit / s. When the user uses the WLAN wireless connection function, if the data volume of online reaches the set upper limit value, that is, 100Mbit / s, the function will not continue to occupy the bandwidth configured by the hotspot sharing function. At this time, both functions can guarantee to be allocated to 100Mbit / s of bandwidth, achieving the effect of load balancing.

[0041] As an example of the embodiment, the bandwidth upper limit of each function can be a preset value. As another example of the embodiment, the user can configure the corresponding speed limiting option of the setting page, so that the bandwidth of each function can be allocated.

[0042] Further, if the user does not want to limit the function (the reasons why the user does not want to limit the function include that the user wants to close the function or simply does not want to limit the bandwidth of the function to meet the maximum use requirement of the function), the function closing command of the user is received, and a speed limiting cancel command of the network interface of the function corresponding to the function closing command is issued in response to the function closing command, so as to close the bandwidth limitation of the function corresponding to the function closing command. For example, / system / bin / tc qdisc del dev WLAN0 root tbf, which is a parameter of the standard tc instruction, the WLAN0 parameter indicates the interface used by the WLAN wireless function, and after the configuration, the speed limitation of the WLAN wireless function takes effect. Correspondingly, the WIFI direct function and the hotspot sharing function can be respectively set in the same way.

[0043] In the embodiment, the reasonable allocation of the specific bandwidth can be considered according to the use scene of the device. For example, in general, the requirement of the bandwidth of the hotspot sharing (screen projection) function is higher than that of the ordinary online service, so when the hotspot is turned on, sufficient bandwidth is often guaranteed for the hotspot function, and when the hotspot function is turned off, the bandwidth limitation is turned off.

[0044] Correspondingly, referring to Figure 2 The embodiment of the application further provides a load balancing device for an Android system, which comprises a configuration module 101, a receiving module 102 and a speed limiting module 103.

[0045] The configuration module 101 is used for opening a QoS configuration option through the kernel of the source code of the Android system.

[0046] The receiving module 102 is used for receiving a plurality of function starting commands of the user after the Android system is started, wherein the function starting commands one by one correspond to a plurality of functions of the WIFI module.

[0047] The speed limiting module 103 is used for issuing a speed limiting command to the network interface corresponding to each function according to the total bandwidth of the WIFI module of the Android system in response to the function starting command, so as to realize the load balancing of the plurality of functions, wherein the speed limiting command comprises the bandwidth upper limit corresponding to each function.

[0048] As a preferred solution, the load balancing device further comprises a transplantation module for cross-compiling iproute2 source code, generating corresponding executable files, and transplanting the executable files into the Android system before the Android system is started.

[0049] As a preferred solution, the functions of the WIFI module include WLAN wireless connection function, WIFI direct connection function and hotspot sharing function.

[0050] As a preferred solution, the total bandwidth of the Android system WIFI module is set according to the hardware performance parameters of the WIFI module.

[0051] As a preferred solution, the load balancing device further comprises a speed limiting cancellation module for receiving a function closing command of a user, and issuing a speed limiting cancellation command to the network interface of the function corresponding to the function closing command to close the bandwidth limitation of the function corresponding to the function closing command in response to the function closing command.

[0052] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0053] The embodiments of the present application provide a load balancing method and device for an Android system, which comprises: opening a QoS configuration option through the kernel of Android system source code; receiving a plurality of function starting commands of a user after the Android system is started; wherein the function starting commands one-to-one correspond to a plurality of functions of a WIFI module respectively; and issuing a speed limiting command to the network interface corresponding to each function according to the total bandwidth of the WIFI module of the Android system in response to the function starting commands to realize load balancing of the plurality of functions; wherein the speed limiting command comprises an upper limit of the bandwidth corresponding to each function. Compared with the prior art, after the Android system is started, the speed limiting command is issued to the network interface of each function according to the command of the user, and the speed limiting command comprises an upper limit of the bandwidth, so that the bandwidth between the loads corresponding to each function can be reasonably allocated, the problem of random contention is solved, and the stability and reliability of the network are effectively improved.

[0054] The above-described specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application, and it should be understood that the above-described specific embodiments are only for the specific embodiments of the present application and are not used to limit the protection scope of the present application. It is particularly pointed out that any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A load balancing method for an Android system, characterized in that, The method comprises the following steps: opening a QoS configuration option through a kernel of an Android system source code; after the Android system is started, receiving a plurality of function starting commands of a user; wherein the function starting commands one by one correspond to a plurality of functions of a WIFI module respectively; the plurality of functions of the WIFI module comprise a WLAN wireless connection function, a WIFI direct connection function and a hot spot sharing function; in response to the function starting commands, respectively issuing a speed limiting command to a network interface corresponding to each function according to a total bandwidth of the WIFI module of the Android system, so as to realize load balancing of the plurality of functions; wherein the speed limiting command comprises an upper limit of a bandwidth corresponding to each function; the total bandwidth of the WIFI module of the Android system is set according to a hardware performance parameter of the WIFI module.

2. The load balancing method for Android system according to claim 1, wherein, Before the Android system is started, the method further comprises the following steps: cross-compiling an iproute2 source code, generating a corresponding executable file, and transplanting the executable file into the Android system.

3. The load balancing method for Android system according to any one of claims 1 to 2, characterized in that, The load balancing method further comprises the following steps: receiving a function closing command of a user; in response to the function closing command, issuing a speed limiting canceling command to a network interface of a function corresponding to the function closing command, so as to close bandwidth limitation of the function corresponding to the function closing command.

4. A load balancing device for the Android system, characterized in that, The load balancing device comprises a configuration module, a receiving module and a speed limiting module; wherein the configuration module is configured to open a QoS configuration option through a kernel of an Android system source code; the receiving module is configured to receive a plurality of function starting commands of a user after the Android system is started; wherein the function starting commands one by one correspond to a plurality of functions of a WIFI module respectively; the plurality of functions of the WIFI module comprise a WLAN wireless connection function, a WIFI direct connection function and a hot spot sharing function; the speed limiting module is configured to, in response to the function starting commands, respectively issue a speed limiting command to a network interface corresponding to each function according to a total bandwidth of the WIFI module of the Android system, so as to realize load balancing of the plurality of functions; wherein the speed limiting command comprises an upper limit of a bandwidth corresponding to each function; the total bandwidth of the WIFI module of the Android system is set according to a hardware performance parameter of the WIFI module.

5. The load balancing device for Android system of claim 4, wherein, Before the Android system is started, the load balancing device further comprises a transplanting module; the transplanting module is configured to cross-compile an iproute2 source code, generate a corresponding executable file, and transplant the executable file into the Android system.

6. The load balancing device for Android system according to any one of claims 4 to 5, wherein, The load balancing device further comprises a speed limiting canceling module; the speed limiting canceling module is configured to receive a function closing command of a user; in response to the function closing command, issue a speed limiting canceling command to a network interface of a function corresponding to the function closing command, so as to close bandwidth limitation of the function corresponding to the function closing command.

Citation Information

Patent Citations

  • Data communication device with individual application bandwidth reporting and control

    US9008673B1

  • Terminal network speed control method and apparatus, terminal, and storage medium

    WO2022017290A1