CN113543146A - Network coexistence control method and device based on Android system - Google Patents
Network coexistence control method and device based on Android system Download PDFInfo
- Publication number
- CN113543146A CN113543146A CN202110809340.9A CN202110809340A CN113543146A CN 113543146 A CN113543146 A CN 113543146A CN 202110809340 A CN202110809340 A CN 202110809340A CN 113543146 A CN113543146 A CN 113543146A
- Authority
- CN
- China
- Prior art keywords
- network
- priority
- disconnected
- default
- routing information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 19
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W16/00—Network planning, e.g. coverage or traffic planning tools; Network deployment, e.g. resource partitioning or cells structures
- H04W16/14—Spectrum sharing arrangements between different networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W40/00—Communication routing or communication path finding
- H04W40/02—Communication route or path selection, e.g. power-based or shortest path routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/50—Allocation or scheduling criteria for wireless resources
- H04W72/56—Allocation or scheduling criteria for wireless resources based on priority criteria
Abstract
The invention discloses a method and a device for controlling network coexistence based on an Android system, wherein the method comprises the following steps: configuring network priorities, wherein the network priorities comprise a first priority, a second priority and a third priority, the first two priorities support generation of a default gateway, and the third priority only supports an intranet access function; starting a network coexistence function, refreshing the network again by the system according to the priority sequence configured by the routing table, saving the configuration state in the local file system, and automatically finishing the adjustment of the network priority sequence again after starting the system next time; the device access and disconnection function is characterized in that more than two networks are accessed to the device, including one network is connected and one network is disconnected, and the system can automatically judge the priority of the connected or disconnected network and readjust the routing table.
Description
Technical Field
The invention belongs to the technical field of Android system application, and particularly relates to a network coexistence control method and device based on an Android system.
Background
With the high-speed development of science and technology, a large number of different types of communication networks emerge, the types are various and are characterized, but in an Android system, only one network port can be used at the same time under the default condition, and various networks cannot be developed in a coexistence manner. However, a large number of practical projects require two or more network ports to be connected simultaneously, two or more networks to coexist simultaneously, and coexistence of multiple networks is a trend.
Disclosure of Invention
In view of the above technical problems, the present invention is directed to providing a method and an apparatus for controlling network coexistence based on an Android system.
In order to solve the technical problems, the invention adopts the following technical scheme:
one aspect of the embodiments of the present invention provides a method for controlling network coexistence based on an Android system, including the following steps:
configuring network priorities, wherein the network priorities comprise a first priority, a second priority and a third priority, the first two priorities support generation of a default gateway, and the third priority only supports an intranet access function;
starting a network coexistence function, refreshing the network again by the system according to the priority sequence configured by the routing table, saving the configuration state in the local file system, and automatically finishing the adjustment of the network priority sequence again after starting the system next time;
the device access and disconnection function is characterized in that more than two networks are accessed to the device, including one network is connected and one network is disconnected, and the system can automatically judge the priority of the connected or disconnected network and readjust the routing table.
Preferably, connecting a network specifically is: firstly, judging whether the network is in a first priority or a second priority, if not, generating a default route, if the accessed network is in the first priority, judging whether the network of the second priority already exists in the system at the moment, if so, deleting the network default route of the second priority first, and finally generating all route information of the first priority; if the second priority does not exist, directly generating all routing information of the first priority; if the access is a second priority network, judging whether the system has the first priority network or not, if so, not allowing the second priority network to generate default routing information, and only allowing the local routing to be generated;
preferably, disconnecting a network specifically is: firstly, judging whether the network is the third priority, if so, clearing the routing information of the third priority network; if the first priority network is not the second priority network, if the first priority network is the first priority network, the first priority network is disconnected, whether the second priority network in the system exists at the moment needs to be judged, and if the second priority network exists, the default gateway of the second priority network is added after all the routing information of the first priority network is cleared.
Another aspect of the embodiments of the present invention provides a control device for network coexistence based on an Android system, including:
a priority unit of a configuration network comprises a first priority, a second priority and a third priority, the first two priorities support generation of a default gateway, and the third priority only supports an intranet access function;
starting the functional units with coexisting networks, refreshing the networks again by the system according to the priority sequence configured by the routing table, saving the configuration state in the local file system, and automatically finishing the adjustment of the network priority sequence again after starting the system next time;
the equipment is connected with and disconnected from the network unit, more than two networks are connected with the equipment, including one network is connected and one network is disconnected, and the system can automatically judge the priority of the connected or disconnected network and readjust the routing table.
Preferably, connecting a network specifically is: firstly, judging whether the network is in a first priority or a second priority, if not, generating a default route, if the accessed network is in the first priority, judging whether the network of the second priority already exists in the system at the moment, if so, deleting the network default route of the second priority first, and finally generating all route information of the first priority; if the second priority does not exist, directly generating all routing information of the first priority; if the access is a second priority network, judging whether the system has the first priority network or not, if so, not allowing the second priority network to generate default routing information, and only allowing the local routing to be generated;
preferably, disconnecting a network specifically is: firstly, judging whether the network is the third priority, if so, clearing the routing information of the third priority network; if the first priority network is not the second priority network, if the first priority network is the first priority network, the first priority network is disconnected, whether the second priority network in the system exists at the moment needs to be judged, and if the second priority network exists, the default gateway of the second priority network is added after all the routing information of the first priority network is cleared.
The invention has the following beneficial effects:
(1) by the technical scheme of the embodiment of the invention, the coexistence of the networks can ensure that one device is simultaneously connected with 2 to 3 networks;
(2) by the technical scheme of the embodiment of the invention, the interface of the network priority can be adjusted, and the network sequence of WIFI, Ethernet and 4G can be configured at will.
Drawings
Fig. 1 is a schematic structural diagram of a network coexistence control device based on an Android system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Method embodiment
The invention discloses a network coexistence control method based on an Android system, which comprises the following steps:
configuring network priorities, wherein the network priorities comprise a first priority, a second priority and a third priority, the first two priorities support generation of a default gateway, and the third priority only supports an intranet access function; the 3 priorities correspond to the 3 fixed scores, the higher the score is, the higher the priority is, the highest score is the first priority, the highest score is used as an external network access interface, and similarly, the lowest priority is the third priority, and only the access to the internal network is supported. In the AgentInfo of each network, the getScore () is returned to the corresponding score, so that the score of each network can be configured.
Accessing more than two networks on the equipment, including connecting one network and disconnecting one network;
and starting a network coexistence function, refreshing the network by the system according to the priority sequence configured by the routing table, storing the configuration state in the local file system, and automatically finishing the adjustment of the network priority sequence again after starting the system next time. In a specific application example, a function of network coexistence is started, the system readjusts a routing table of the system according to a configured priority order to generate a default gateway route of a first priority, only host routes are generated according to a second priority and a third priority, the routing table of each network is completed in a ConnectivityService update route method, and the corresponding routing table can be adjusted according to different network types in the method. And the configuration state is stored in a flash memory, the sequence is automatically read after the computer is started next time, and the adjustment of the network priority sequence is completed again.
In a specific application example, the embodiment of the present invention has the following basic conventions: (1) not allowing the third priority network to generate a default gateway (or default route); (2) when there are the first two priority networks present, there is and only one default gateway allowed.
In a specific application example, connecting a network specifically includes: firstly, judging whether the network is in a first priority or a second priority, if not, generating a default route, if the accessed network is in the first priority, judging whether the network of the second priority already exists in the system at the moment, if so, deleting the network default route of the second priority first, and finally generating all route information of the first priority; if the second priority does not exist, directly generating all routing information of the first priority; if the accessed network is the second priority network, whether the network with the first priority already exists in the system is judged, if so, the second priority network at the moment is not allowed to generate default routing information, and only the local routing is allowed to be generated. The specific operation can be as follows: and judging which network device the currently operated network routing table belongs to according to the netId in the updateRoutes, if the currently operated network routing table belongs to the first-priority network device, generating a default gateway, and if the currently operated network routing table does not belong to the first-priority network device, not generating the default gateway.
In a specific application example, disconnecting a network specifically includes: firstly, judging whether the network is the third priority, if so, clearing the routing information of the third priority network; if the first priority network is not the second priority network, if the first priority network is the first priority network, the first priority network is disconnected, whether the second priority network in the system exists at the moment needs to be judged, and if the second priority network exists, the default gateway of the second priority network is added after all the routing information of the first priority network is cleared. The specific operation can be as follows: when a network interface sends state change, the system calls a rematch network and requests method, when a first priority network is disconnected and a second priority network is accessed, the system needs a default gateway route at the moment, and a default gateway route is added to the second priority network in the rematch network and requests method.
The interface for adjusting the network priority is provided by the embodiment of the invention, and the network sequence of WIFI, Ethernet and 4G can be configured at will. After the opened interface is called, the changeNetworkpriority method is called, the network priority order is readjusted, and the system can refresh the network immediately to enable the three networks to meet the configuration. Meanwhile, the configuration can be saved in a local file system, and the network reconfiguration can be realized after the system is restarted.
Device embodiment
Corresponding to the method embodiment, referring to fig. 1, a schematic structural diagram of a control device for network coexistence based on an Android system in the embodiment of the present invention is shown, including:
a priority unit of a configuration network comprises a first priority, a second priority and a third priority, the first two priorities support generation of a default gateway, and the third priority only supports an intranet access function;
starting the functional units with coexisting networks, refreshing the networks again by the system according to the priority sequence configured by the routing table, saving the configuration state in the local file system, and automatically finishing the adjustment of the network priority sequence again after starting the system next time;
the equipment is connected with and disconnected from the network unit, more than two networks are connected with the equipment, including one network is connected and one network is disconnected, and the system can automatically judge the priority of the connected or disconnected network and readjust the routing table.
In a specific application example, connecting a network specifically includes: firstly, judging whether the network is in a first priority or a second priority, if not, generating a default route, if the accessed network is in the first priority, judging whether the network of the second priority already exists in the system at the moment, if so, deleting the network default route of the second priority first, and finally generating all route information of the first priority; if the second priority does not exist, directly generating all routing information of the first priority; if the access is a second priority network, judging whether the system has the first priority network or not, if so, not allowing the second priority network to generate default routing information, and only allowing the local routing to be generated;
in a specific application example, disconnecting a network specifically includes: firstly, judging whether the network is the third priority, if so, clearing the routing information of the third priority network; if the first priority network is not the second priority network, if the first priority network is the first priority network, the first priority network is disconnected, whether the second priority network in the system exists at the moment needs to be judged, and if the second priority network exists, the default gateway of the second priority network is added after all the routing information of the first priority network is cleared.
The technical details not described in the device embodiments are the same as those in the method embodiments and are not described herein again.
It is to be understood that the exemplary embodiments described herein are illustrative and not restrictive. Although one or more embodiments of the present invention have been described with reference to the accompanying drawings, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present invention as defined by the following claims.
Claims (6)
1. A network coexistence control method based on an Android system is characterized by comprising the following steps:
configuring network priorities, wherein the network priorities comprise a first priority, a second priority and a third priority, the first two priorities support generation of a default gateway, and the third priority only supports an intranet access function;
starting a network coexistence function, refreshing the network again by the system according to the priority sequence configured by the routing table, saving the configuration state in the local file system, and automatically finishing the adjustment of the network priority sequence again after starting the system next time;
the device access and disconnection function is characterized in that more than two networks are accessed to the device, including one network is connected and one network is disconnected, and the system can automatically judge the priority of the connected or disconnected network and readjust the routing table.
2. The Android system-based network coexistence control method according to claim 1, wherein connecting a network specifically includes: firstly, judging whether the network is in a first priority or a second priority, if not, generating a default route, if the accessed network is in the first priority, judging whether the network of the second priority already exists in the system at the moment, if so, deleting the network default route of the second priority first, and finally generating all route information of the first priority; if the second priority does not exist, directly generating all routing information of the first priority; if the accessed network is the second priority network, whether the network with the first priority already exists in the system is judged, if so, the second priority network at the moment is not allowed to generate default routing information, and only the local routing is allowed to be generated.
3. The Android system-based network coexistence control method according to claim 1, wherein disconnecting a network specifically includes: firstly, judging whether the network is the third priority, if so, clearing the routing information of the third priority network; if the first priority network is not the second priority network, if the first priority network is the first priority network, the first priority network is disconnected, whether the second priority network in the system exists at the moment needs to be judged, and if the second priority network exists, the default gateway of the second priority network is added after all the routing information of the first priority network is cleared.
4. A control device for network coexistence based on an Android system is characterized by comprising:
a priority unit of a configuration network comprises a first priority, a second priority and a third priority, the first two priorities support generation of a default gateway, and the third priority only supports an intranet access function;
starting the functional units with coexisting networks, refreshing the networks again by the system according to the priority sequence configured by the routing table, saving the configuration state in the local file system, and automatically finishing the adjustment of the network priority sequence again after starting the system next time;
the equipment is connected with and disconnected from the network unit, more than two networks are connected with the equipment, including one network is connected and one network is disconnected, and the system can automatically judge the priority of the connected or disconnected network and readjust the routing table.
5. The Android-system-based network coexistence control device according to claim 4, wherein connecting a network specifically is: firstly, judging whether the network is in a first priority or a second priority, if not, generating a default route, if the accessed network is in the first priority, judging whether the network of the second priority already exists in the system at the moment, if so, deleting the network default route of the second priority first, and finally generating all route information of the first priority; if the second priority does not exist, directly generating all routing information of the first priority; if the accessed network is the second priority network, whether the network with the first priority already exists in the system is judged, if so, the second priority network at the moment is not allowed to generate default routing information, and only the local routing is allowed to be generated.
6. The Android-system-based network coexistence control device according to claim 4, wherein disconnecting a network specifically includes: firstly, judging whether the network is the third priority, if so, clearing the routing information of the third priority network; if the first priority network is not the second priority network, if the first priority network is the first priority network, the first priority network is disconnected, whether the second priority network in the system exists at the moment needs to be judged, and if the second priority network exists, the default gateway of the second priority network is added after all the routing information of the first priority network is cleared.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110809340.9A CN113543146B (en) | 2021-07-16 | 2021-07-16 | Network coexistence control method and device based on Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110809340.9A CN113543146B (en) | 2021-07-16 | 2021-07-16 | Network coexistence control method and device based on Android system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113543146A true CN113543146A (en) | 2021-10-22 |
CN113543146B CN113543146B (en) | 2024-02-09 |
Family
ID=78128577
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110809340.9A Active CN113543146B (en) | 2021-07-16 | 2021-07-16 | Network coexistence control method and device based on Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113543146B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20120071370A (en) * | 2012-01-17 | 2012-07-02 | 한양대학교 산학협력단 | Mobile terminal and network selection method thereof |
CN103491653A (en) * | 2013-05-13 | 2014-01-01 | 上海盛本通讯科技有限公司 | WiFi and 3G coexisting method based on Android intelligent terminal |
CN105282026A (en) * | 2014-06-23 | 2016-01-27 | 国基电子(上海)有限公司 | Default gateway selecting system and method |
CN106953795A (en) * | 2016-01-07 | 2017-07-14 | 中兴通讯股份有限公司 | Configure the method and device of many network interface cards |
CN112333028A (en) * | 2020-11-20 | 2021-02-05 | 南京创维信息技术研究院有限公司 | Dynamic processing method, device, terminal and medium for multi-network coexistence |
-
2021
- 2021-07-16 CN CN202110809340.9A patent/CN113543146B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20120071370A (en) * | 2012-01-17 | 2012-07-02 | 한양대학교 산학협력단 | Mobile terminal and network selection method thereof |
CN103491653A (en) * | 2013-05-13 | 2014-01-01 | 上海盛本通讯科技有限公司 | WiFi and 3G coexisting method based on Android intelligent terminal |
CN105282026A (en) * | 2014-06-23 | 2016-01-27 | 国基电子(上海)有限公司 | Default gateway selecting system and method |
CN106953795A (en) * | 2016-01-07 | 2017-07-14 | 中兴通讯股份有限公司 | Configure the method and device of many network interface cards |
CN112333028A (en) * | 2020-11-20 | 2021-02-05 | 南京创维信息技术研究院有限公司 | Dynamic processing method, device, terminal and medium for multi-network coexistence |
Also Published As
Publication number | Publication date |
---|---|
CN113543146B (en) | 2024-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8402453B2 (en) | In-service software upgrade of control and line cards of network element | |
US20120072894A1 (en) | In-Service Software Upgrade on Cards of Virtual Partition of Network Element that Includes Directing Traffic Away from Cards of Virtual Partition | |
US6487591B1 (en) | Method for switching between active and standby units using IP swapping in a telecommunication network | |
CN103188173B (en) | A kind of switch device | |
CN101110776B (en) | Backup method, backup device and backup system for data business | |
CN103491653A (en) | WiFi and 3G coexisting method based on Android intelligent terminal | |
EP3866393A1 (en) | Data center traffic exchange method and apparatus, device and storage medium | |
WO2019100993A1 (en) | Sdn network in-band control channel establishment method and device | |
CN103002065A (en) | Method and device for sharing internet protocol (IP) address by host device and standby device | |
CN108696417A (en) | Business switch method in backup network and device | |
WO2016124105A1 (en) | Media access control address learning method, device and system | |
US20230132861A1 (en) | Switching method and apparatus, device, and storage medium | |
CN112165429B (en) | Link aggregation convergence method and device for distributed switching equipment | |
CN109391514A (en) | Deployed with devices method, server, storage medium and device based on high availability | |
JPH03273352A (en) | On-line information processor | |
CN113543146A (en) | Network coexistence control method and device based on Android system | |
CN113839862A (en) | Method, system, terminal and storage medium for synchronizing ARP information between MCLAG neighbors | |
CN110392416B (en) | Network selection method of android system | |
CN102291313A (en) | Method, device and equipment for finding virtual router redundancy protocol (VRRP) network topology | |
WO2017117955A1 (en) | Route synchronizing method, device and communication system | |
WO2016169102A1 (en) | Multi-channel data connection management method and system, and mobile terminal | |
CN111327543A (en) | Message forwarding method and device, storage medium and electronic device | |
CN113407382B (en) | Dynamic regulation and control method and system for service fault | |
CN113407480A (en) | Centralized management's frame switch | |
CN113301141A (en) | Deployment method and system of artificial intelligence support framework |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |