Network implementation method, device and equipment for dual-network service coexistence based on Android system
By judging network scores and preset priority networks in the Android system, the problem of coexistence of dual network services is solved, and the effect of multiple networks working normally and network interchange is achieved at the same time.
Patent Information
- Application Number
- CN202311848307.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-01
AI Technical Summary
In the existing Android system, only a single network with high scores can be used under dual-network and multi-network architectures, and the data packets of the other network will be discarded, resulting in only one network that can work normally at the same time, and the coexistence of dual-network services cannot be achieved.
By judging the connected network score and preset priority network, determine whether it is necessary to back up direct connection routing information. According to the network scoring intervention method, users can select networks as needed, realize the exchange of priority networks and non-priority networks at any time, ensuring the retention of non-priority network packet routing paths.
It realizes that multiple networks can work normally within the same time, ensuring the robustness of non-priority networks. Users can choose the network as needed and interchange through the network scoring mechanism.
Smart Images

Figure CN120239003A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and in particular, to a network implementation method, apparatus, and device for dual-network service coexistence based on the Android system. Background Art
[0002] Currently, in Android products based on Google source code, although a dual-network and multi-network architecture is provided, multiple networks cannot be used simultaneously. Only a single network with a high score can be used through network scoring. Even if another network is forcibly connected, data packets will be discarded by the routing policy of the existing network, resulting in only one network being able to work properly at the same time between the wired network and the wireless network. Summary of the Invention
[0003] The present invention aims to at least solve one of the technical problems existing in the prior art. For this purpose, the object of the present invention is to provide a network implementation method, apparatus, and device for dual-network service coexistence based on the Android system.
[0004] A network implementation method for dual-network service coexistence based on the Android system proposed by the present invention includes: when a first network is accessed, determining whether there is a second network that has been accessed; if it is determined that there is the accessed second network, determining the network score of the first network according to the network score of the second network and a preset preferred network, and determining whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network; if it is determined that there is no accessed second network, determining the network score of the first network according to the first network and the preset preferred network, and determining whether it is necessary to back up the direct connection routing information of the first network; determining the current preferred network according to the network score, and updating the backed-up direct connection routing information.
[0005] In addition, the network implementation method for dual-network service coexistence based on the Android system according to the embodiments of the present invention may further have the following additional technical features:
[0006] Further, determining the network score of the first network according to the network score of the second network and a preset preferred network includes: when the second network is the preset preferred network, using the difference between the network score of the second network and a first preset score as the network score of the first network; when the second network is not the preset preferred network, using the sum of the network score of the second network and a second preset score as the network score of the first network.
[0007] Further, determining whether to back up the direct route information of the first network according to the second network and the preset preferred network includes: when the second network is the preset preferred network, backing up the direct route information of the first network; when the second network is not the preset preferred network, not backing up the direct route information of the first network.
[0008] Further, before determining the network score of the first network according to the network score of the second network and the preset preferred network, it further includes: when the second network is the preset preferred network, adding the network score of the second network to the full score; when the second network is not the preset preferred network, taking the difference between the full score and the third preset score as the network score of the second network, and backing up the direct route information of the second network; wherein, the third preset score is not less than the second preset score.
[0009] Further, determining the network score of the first network according to the first network and the preset preferred network, and whether to back up the direct route information of the first network includes: when the first network is the preset preferred network, adding the network score of the first network to the full score, and not backing up the direct route information of the first network; when the first network is not the preset preferred network, taking the difference between the full score and the fourth preset score as the network score of the first network, and backing up the direct route information of the first network.
[0010] Further, determining the current preferred network according to the network score includes: taking the network corresponding to the highest network score as the current preferred network.
[0011] Further, the preset preferred network is set by the user through an application program or preset in the controller.
[0012] According to the network implementation method for dual-network service coexistence based on the Android system in an embodiment of the present invention, when the first network is accessed, it is determined whether there is a second network that has been accessed. If it is determined that there is a second network that has been accessed, the network score of the first network is determined according to the network score of the second network and the preset preferred network, and it is determined whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network. If it is determined that there is no second network that has been accessed, the network score of the first network is determined according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network. The current preferred network is determined according to the network score, and the backed-up direct connection routing information is updated, so that the preset preferred network set or preset by the user in the controller becomes the current preferred network by intervening in the network score of the first network. In this way, the user can select the network as needed, and the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time. At the same time, the routing path of non-preferred network data packets is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0013] To solve the above problems, the present invention also proposes a network implementation device for dual-network service coexistence based on the Android system, including: a judgment module, configured to determine whether there is a second network that has been accessed when the first network is accessed; a first determination module, configured to, when it is determined that there is a second network that has been accessed, determine the network score of the first network according to the network score of the second network and the preset preferred network, and determine whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network; a second determination module, configured to, when it is determined that there is no second network that has been accessed, determine the network score of the first network according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network; a third determination module, configured to determine the current preferred network according to the network score and update the backed-up direct connection routing information.
[0014] The network implementation device for dual-network service coexistence based on the Android system according to an embodiment of the present invention, when the first network is accessed, determines whether there is a second network that has been accessed. If it is determined that there is a second network that has been accessed, the network score of the first network is determined according to the network score of the second network and the preset preferred network, and whether to back up the direct connection routing information of the first network is determined according to the second network and the preset preferred network. If it is determined that there is no second network that has been accessed, the network score of the first network is determined according to the first network and the preset preferred network, and whether to back up the direct connection routing information of the first network. The current preferred network is determined according to the network score, and the backed-up direct connection routing information is updated, so as to make the preset preferred network set or preset by the user in the controller become the current preferred network by intervening in the network score of the first network. In this way, the user can select the network as needed, and the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time. At the same time, the routing path of non-preferred network data packets is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0015] In view of the above problems, the present invention also proposes an electronic device, including: the network implementation device for dual-network service coexistence based on the Android system as described in any of the above embodiments.
[0016] The electronic device according to an embodiment of the present invention, when the first network is accessed, determines whether there is a second network that has been accessed. If it is determined that there is a second network that has been accessed, the network score of the first network is determined according to the network score of the second network and the preset preferred network, and whether to back up the direct connection routing information of the first network is determined according to the second network and the preset preferred network. If it is determined that there is no second network that has been accessed, the network score of the first network is determined according to the first network and the preset preferred network, and whether to back up the direct connection routing information of the first network. The current preferred network is determined according to the network score, and the backed-up direct connection routing information is updated, so as to make the preset preferred network set or preset by the user in the controller become the current preferred network by intervening in the network score of the first network. In this way, the user can select the network as needed, and the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time. At the same time, the routing path of non-preferred network data packets is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0017] In view of the above problems, the present invention also provides a computer-readable storage medium, on which a network implementation program for coexistence of dual-network services based on the Android system is stored. When the network implementation program for coexistence of dual-network services based on the Android system is executed by a processor, it implements the network implementation method for coexistence of dual-network services based on the Android system as described in any one of the above embodiments.
[0018] For the computer-readable storage medium according to an embodiment of the present invention, when the network implementation program for coexistence of dual-network services based on the Android system stored thereon is executed by a processor, when a first network is accessed, it is determined whether there is a second network that has been accessed. If it is determined that there is a second network that has been accessed, then the network score of the first network is determined according to the network score of the second network and a preset preferred network, and it is determined whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network. If it is determined that there is no second network that has been accessed, then the network score of the first network is determined according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network. The current preferred network is determined according to the network score, and the backed-up direct connection routing information is updated, so as to make the preset preferred network set or preset by the user in the controller become the current preferred network by intervening in the network score of the first network. In this way, the user can select a network as needed, and the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time. At the same time, the routing path of non-preferred network data packets is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0019] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0021] Figure 1 is a flowchart of a network implementation method for coexistence of dual-network services based on the Android system according to an embodiment of the present invention;
[0022] Figure 2 is a schematic structural diagram of a network implementation device for coexistence of dual-network services based on the Android system according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] Embodiments of the present invention will be described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention will be described in detail below.
[0024] Reference will be made below Figure 1 - Figure 2 to describe a network implementation method, apparatus, and device for dual-network service coexistence based on the Android system according to an embodiment of the present invention.
[0025] Figure 1 is a flowchart of a network implementation method for dual-network service coexistence based on the Android system according to an embodiment of the present invention. As Figure 1 shown, a network implementation method for dual-network service coexistence based on the Android system includes the following steps:
[0026] Step S1: When the first network is accessed, determine whether there is a second network that has been accessed.
[0027] Specifically, the Android system provides a dual-network and multi-network architecture to allow devices equipped with the Android system to connect to multiple networks simultaneously. When a new network, denoted as the first network for example, is accessed, it is necessary to determine whether there is a network that has been accessed, denoted as the second network for example, to determine the preferred network. In a specific embodiment, it is possible to sense whether the first network is accessed through the standard interface registerNetworkFactory based on the Android system. After sensing that the first network is accessed, determine whether there is a second network that has been accessed to determine the preferred network according to the first network and the second network. Specifically, devices equipped with the Android system include, but are not limited to: smart phones, tablet computers, and smart TVs.
[0028] Step S2: If it is determined that there is a second network that has been accessed, then determine the network score of the first network according to the network score of the second network and the preset preferred network, and determine whether it is necessary to back up the direct routing information of the first network according to the second network and the preset preferred network. Specifically, the preset preferred network is set by the user through an application program or preset in the controller.
[0029] Specifically, if it is determined that there is a second network that has been connected, the network score of the first network is determined based on the network score of the second network and whether the preset preferred network is the second network, so as to make the preset preferred network set or preset by the user in the controller become the current preferred network by intervening in the network score of the first network. In this way, the user can select the network as needed, and the current preferred network and non-preferred network can be swapped through the network score mechanism at any time. According to the second network and whether the preset preferred network is the second network, it is determined whether to back up the direct connection routing information of the first network, so that the routing path of the non-preferred network data packet is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0030] It should be noted that the network score is a method for measuring and evaluating the network quality and performance. The initial scores of the first network and the second network in the embodiments of the present invention are preset constants, and the Android system assigns different scores to different networks and presets them in the controller. Specifically, for example, the network score of Ethernet is 70, and the network score of WiFi (Wireless Fidelity) is 50. When all networks are disconnected, its network score is 0.
[0031] Step S3: If it is determined that there is no second network that has been connected, the network score of the first network and whether it is necessary to back up the direct connection routing information of the first network are determined according to the first network and the preset preferred network.
[0032] Specifically, if it is determined that there is no second network that has been connected, only the network score of the first network is determined according to the first network and whether the preset preferred network is the first network, so as to make the preset preferred network set or preset by the user in the controller become the current preferred network by intervening in the network score of the first network. It is determined whether to back up the direct connection routing information of the first network according to the first network and the preset preferred network, so that when the first network is not the current preferred network, the routing path of its network data packet is retained to ensure the robustness of the first network and enable the first network to work properly.
[0033] Step S4: Determine the current preferred network according to the network score and update the backed-up direct connection routing information. Specifically, the network corresponding to the highest network score is used as the current preferred network.
[0034] Specifically, compare the network scores of the first network and the second network. The network with the highest network score is used as the current preferred network, and the direct connection route information of the backed-up non-preferred network is updated. It can be understood that when backing up the direct connection route information of the non-preferred network, it is equivalent to performing temporary cache management on the direct connection route information of the non-preferred network. After updating the backed-up direct connection route information of the non-preferred network, the network with the highest network score can be used as the current preferred network. That is, while the preset preferred network becomes the current preferred network, the routing path of the non-preferred network packets is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0035] In a specific embodiment, RouteInfo can be obtained through the standard interface based on the Android system for temporary cache management, and the update of the backed-up direct connection route information can be implemented by scheduling the Netd standard interface addLegacyRouteForNetId.
[0036] In an embodiment of the present invention, determining the network score of the first network according to the network score of the second network and the preset preferred network includes: when the second network is the preset preferred network, the difference between the network score of the second network and the first preset score is used as the network score of the first network; when the second network is not the preset preferred network, the sum of the network score of the second network and the second preset score is used as the network score of the first network.
[0037] Specifically, both the first preset score and the second preset score are constants with moderate values, preset in the controller, and used to intervene in the network score of the first network to make the preset preferred network become the current preferred network. Specifically, when the second network is the preset preferred network, to ensure that the network score of the first network is lower than that of the second network, the difference between the network score of the second network and the first preset score is used as the network score of the first network; when the second network is not the preset preferred network, it is considered that the first network is the preferred network. To ensure that the network score of the first network is higher than that of the second network, the sum of the network score of the second network and the second preset score is used as the network score of the first network. In this way, by intervening in the network score of the first network, the preset preferred network set or preset by the user in the controller becomes the current preferred network, enabling the user to select the network as needed and realizing the interchange of the current preferred network and the non-preferred network through the network score mechanism at any time.
[0038] In a specific embodiment, the first preset score is, for example, 10, the second preset score is, for example, 20, the first network is, for example, Ethernet, and its network score is, for example, 70. The second network is, for example, WiFi, and its network score is, for example, 50. When the second network WiFi is the preset preferred network, the difference of 40 between the network score 50 of the second network WiFi and the first preset score 10 is used as the network score of the first network to ensure that the network score of the first network Ethernet is lower than that of the second network WiFi. In this way, the second network WiFi is the current preferred network. When the second network WiFi is not the preset preferred network, the sum of 70 of the network score 50 of the second network WiFi and the second preset score 20 is used as the network score of the first network Ethernet to ensure that the network score of the first network Ethernet is higher than that of the second network WiFi. In this way, the first network WiFi is the current preferred network.
[0039] In an embodiment of the present invention, determining whether to back up the direct connection routing information of the first network according to the second network and the preset preferred network includes: when the second network is the preset preferred network, backing up the direct connection routing information of the first network; when the second network is not the preset preferred network, not backing up the direct connection routing information of the first network.
[0040] Specifically, when the second network is the preset preferred network, the first network is a non-preferred network. Therefore, it is not necessary to back up the direct connection routing information of the second network, and only the direct connection routing information of the first network needs to be backed up. After updating the backed-up direct connection routing information of the first network, the routing path of the first network data packet can be retained to ensure the robustness of the first network. When the second network is not the preset preferred network, at this time the first network is the preferred network. Therefore, the direct connection routing information of the first network is not backed up. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0041] In an embodiment of the present invention, before determining the network score of the first network according to the network score of the second network and the preset preferred network, it further includes: when the second network is the preset preferred network, adding the network score of the second network to the full score; when the second network is not the preset preferred network, using the difference between the full score and the third preset score as the network score of the second network, and backing up the direct connection routing information of the second network; where the third preset score is not less than the second preset score.
[0042] Specifically, the third preset score is a constant with a moderate value, preset in the controller, and is used to intervene in the network score of the first network so that the preset preferred network becomes the current preferred network. Specifically, when the second network is the preset preferred network, the network score of the second network is added to the full score to ensure that the network score of the second network is higher than that of the first network; when the second network is not the preset preferred network, the difference between the full score and the third preset score is used as the network score of the second network to ensure that the network score of the second network is lower than the full score, so that the network score of the first network is higher than that of the second network under intervention, and the direct connection routing information of the second network is backed up, so that the preset preferred network set or preset by the user in the controller becomes the current preferred network, enabling the user to select the network as needed, and realizing that the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time.
[0043] It can be understood that if it is determined that there is a second network that has been accessed and the second network is not the preset preferred network, then when determining the network score of the first network, the sum of the network score of the second network and the second preset score as the network score of the first network cannot exceed the full score of the network score. Thus, before determining the network score of the first network based on the network score of the second network and the preset preferred network, when the difference between the full score and the third preset score is used as the network score of the second network, the third preset score is not less than the second preset score.
[0044] In an embodiment of the present invention, determining the network score of the first network according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network includes: when the first network is the preset preferred network, the network score of the first network is added to the full score, and the direct connection routing information of the first network is not backed up; when the first network is not the preset preferred network, the difference between the full score and the fourth preset score is used as the network score of the first network, and the direct connection routing information of the first network is backed up.
[0045] Specifically, the fourth preset score is a constant with a moderate value, preset in the controller, and used to intervene in the network score of the first network so that the preset preferred network becomes the current preferred network. Specifically, when the first network is the preset preferred network, the network score of the first network is added to the full score to ensure that when the second network is connected, the network score of the first network is higher than that of the second network, maintaining the priority of the first network, and the direct connection routing information of the first network is not backed up; when the first network is not the preset preferred network, the difference between the full score and the fourth preset score is used as the network score of the first network, so that when the second network is connected, the score can be increased on the basis of the network score of the first network, making the network score of the second network higher than that of the first network and becoming the current preferred network. At the same time, the direct connection routing information of the first network is backed up so that after the backed-up direct connection routing information of the first network is updated, the routing path of the first network data packet can be retained to ensure the robustness of the first network.
[0046] According to the network implementation method for dual-network service coexistence based on the Android system in an embodiment of the present invention, when the first network is connected, it is determined whether there is a second network that has been connected. If it is determined that there is a second network that has been connected, the network score of the first network is determined according to the network score of the second network and the preset preferred network, and it is determined whether the direct connection routing information of the first network needs to be backed up according to the second network and the preset preferred network. If it is determined that there is no second network that has been connected, the network score of the first network is determined according to the first network and the preset preferred network, and whether the direct connection routing information of the first network needs to be backed up. The current preferred network is determined according to the network score, and the backed-up direct connection routing information is updated, so that the preset preferred network set or preset by the user in the controller becomes the current preferred network by intervening in the network score of the first network. In this way, the user can select the network as needed, and the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time. At the same time, the routing path of the non-preferred network data packet is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0047] A further embodiment of the present invention also discloses a network implementation device for dual-network service coexistence based on the Android system. Figure 2 is a schematic structural diagram of a network implementation device for dual-network service coexistence based on an embodiment of the present invention, as Figure 2As shown, the device 10 includes a judgment module 11, a first determination module 12, a second determination module 13, and a third determination module 14. Among them, the judgment module 11 is used to judge whether there is an already connected second network when the first network is accessed; the first determination module 12 is used to, when it is judged that there is an already connected second network, determine the network score of the first network according to the network score of the second network and a preset preferred network, and determine whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network; the second determination module 13 is used to, when it is judged that there is no already connected second network, determine the network score of the first network according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network; the third determination module 14 determines the current preferred network according to the network score and updates the backed-up direct connection routing information.
[0048] In an embodiment of the present invention, the first determination module 12 determines the network score of the first network according to the network score of the second network and a preset preferred network, including: when the second network is the preset preferred network, taking the difference between the network score of the second network and a first preset score as the network score of the first network; when the second network is not the preset preferred network, taking the sum of the network score of the second network and a second preset score as the network score of the first network.
[0049] In an embodiment of the present invention, the first determination module 12 determines whether it is necessary to back up the direct connection routing information of the first network according to the second network and a preset preferred network, including: when the second network is the preset preferred network, backing up the direct connection routing information of the first network; when the second network is not the preset preferred network, not backing up the direct connection routing information of the first network.
[0050] In an embodiment of the present invention, before the first determination module 12 determines the network score of the first network according to the network score of the second network and a preset preferred network, it is further used to: when the second network is the preset preferred network, adding the network score of the second network to the full score; when the second network is not the preset preferred network, taking the difference between the full score and a third preset score as the network score of the second network, and backing up the direct connection routing information of the second network; where the third preset score is not less than the second preset score.
[0051] In an embodiment of the present invention, the second determination module 13 determines the network score of the first network according to the first network and a preset preferred network, and whether it is necessary to back up the direct routing information of the first network, including: when the first network is the preset preferred network, adding the network score of the first network to the full score and not backing up the direct routing information of the first network; when the first network is not the preset preferred network, using the difference between the full score and the fourth preset score as the network score of the first network, and backing up the direct routing information of the first network.
[0052] In an embodiment of the present invention, the third determination module 14 determines the current preferred network according to the network score, including: using the network corresponding to the highest network score as the current preferred network.
[0053] In an embodiment of the present invention, the preset preferred network is set by the user through an application program or preset in the controller.
[0054] It should be noted that when the network implementation device 10 for coexisting dual-network services based on the Android system in the embodiment of the present invention configures the dual-network services of the Android system, its specific implementation manner is similar to the specific implementation manner of the network implementation method for coexisting dual-network services based on the Android system in the embodiment of the present invention. For details, please refer to the description in the method part. To reduce redundancy, it will not be elaborated here.
[0055] According to the network implementation device 10 for coexisting dual-network services based on the Android system in the embodiment of the present invention, when the first network is accessed, it is determined whether there is a second network that has been accessed. If it is determined that there is a second network that has been accessed, the network score of the first network is determined according to the network score of the second network and the preset preferred network, and it is determined whether it is necessary to back up the direct routing information of the first network according to the second network and the preset preferred network. If it is determined that there is no second network that has been accessed, the network score of the first network is determined according to the first network and the preset preferred network, and whether it is necessary to back up the direct routing information of the first network. The current preferred network is determined according to the network score, and the backed-up direct routing information is updated, so as to make the preset preferred network set or preset by the user in the controller become the current preferred network by intervening in the network score of the first network. In this way, the user can select the network as needed, and the current preferred network and non-preferred network can be swapped through the network score mechanism at any time. At the same time, the routing path of the non-preferred network data packet is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0056] A further embodiment of the present invention also discloses an electronic device, comprising: a network implementation device for coexistence of dual-network services based on the Android system as described in any of the above embodiments.
[0057] It should be noted that when the electronic device of the embodiment of the present invention configures the dual-network services of the Android system, the specific implementation manner is similar to that of the network implementation method for coexistence of dual-network services based on the Android system in the embodiment of the present invention. For details, please refer to the description in the method part. To reduce redundancy, it will not be elaborated here.
[0058] For the electronic device according to the embodiment of the present invention, when the first network is accessed, it is judged whether there is a second network that has been accessed. If it is judged that there is a second network that has been accessed, the network score of the first network is determined according to the network score of the second network and the preset preferred network, and it is determined whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network. If it is judged that there is no second network that has been accessed, the network score of the first network is determined according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network. The current preferred network is determined according to the network score, and the backed-up direct connection routing information is updated, so as to make the preset preferred network set or preset in the controller by the user become the current preferred network by intervening in the network score of the first network. In this way, the user can select the network as needed, and the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time. At the same time, the routing path of the non-preferred network data packet is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0059] A further embodiment of the present invention also discloses a computer-readable storage medium, on which a network implementation program for coexistence of dual-network services based on the Android system is stored. When the network implementation program for coexistence of dual-network services based on the Android system is executed by a processor, it implements the network implementation method for coexistence of dual-network services based on the Android system as described in any of the above embodiments.
[0060] A computer-readable storage medium according to an embodiment of the present invention, when a network implementation program for dual-network service coexistence based on the Android system stored thereon is executed by a processor, when a first network is accessed, it is determined whether there is a second network that has been accessed. If it is determined that there is a second network that has been accessed, the network score of the first network is determined according to the network score of the second network and a preset preferred network, and it is determined whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network. If it is determined that there is no second network that has been accessed, the network score of the first network is determined according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network. The current preferred network is determined according to the network score, and the backed-up direct connection routing information is updated, so as to make the preset preferred network set or preset by the user in the controller become the current preferred network by intervening in the network score of the first network. In this way, the user can select a network as needed, and the current preferred network and non-preferred network can be interchanged through the network score mechanism at any time. At the same time, the routing path of non-preferred network data packets is retained to ensure the robustness of the non-preferred network. In this way, the first network and the second network can both work properly at the same time by using different network cards.
[0061] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example.
[0062] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and purposes of the present invention, and the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A network implementation method for coexistence of dual-network services based on the Android system, characterized in that, Including: When the first network is accessed, determine whether there is a second network that has been accessed; If it is determined that there is a second network that has been accessed, then determine the network score of the first network according to the network score of the second network and a preset preferred network, and determine whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network; If it is determined that there is no second network that has been accessed, then determine the network score of the first network according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network; Determine the current preferred network according to the network score, and update the backed-up direct connection routing information.
2. The network implementation method for dual-network service coexistence based on the Android system according to claim 1, wherein Determining the network score of the first network according to the network score of the second network and a preset preferred network includes: When the second network is the preset preferred network, use the difference between the network score of the second network and a first preset score as the network score of the first network; When the second network is not the preset preferred network, use the sum of the network score of the second network and a second preset score as the network score of the first network.
3. The network implementation method for dual-network service coexistence based on the Android system according to claim 2, wherein, Determining whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network includes: When the second network is the preset preferred network, back up the direct connection routing information of the first network; When the second network is not the preset preferred network, do not back up the direct connection routing information of the first network.
4. The network implementation method for dual-network service coexistence based on the Android system according to claim 2, characterized in that Before determining the network score of the first network according to the network score of the second network and a preset preferred network, it further includes: When the second network is the preset preferred network, add the network score of the second network to the full score; When the second network is not the preset preferred network, use the difference between the full score and a third preset score as the network score of the second network, and back up the direct connection routing information of the second network; wherein, the third preset score is not less than the second preset score.
5. The network implementation method for coexistence of dual-network services based on the Android system according to claim 1, wherein Determining the network score of the first network according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network includes: When the first network is the preset preferred network, add the network score of the first network to the full score, and do not back up the direct connection routing information of the first network; When the first network is not the preset preferred network, use the difference between the full score and a fourth preset score as the network score of the first network, and back up the direct connection routing information of the first network.
6. The network implementation method for dual-network service coexistence based on the Android system according to claim 1, wherein, Determining the current preferred network according to the network score includes: Use the network corresponding to the highest network score as the current preferred network.
7. The network implementation method for dual-network service coexistence based on the Android system according to any one of claims 1-6, characterized in that The preset preferred network is set by the user through an application program or preset in the controller.
8. A network implementation device for dual-network service coexistence based on the Android system, characterized in that, Including: A judgment module, configured to judge whether there is a second network that has been accessed when the first network is accessed; A first determination module, configured to, when it is judged that there is the second network that has been accessed, determine the network score of the first network according to the network score of the second network and a preset preferred network, and determine whether it is necessary to back up the direct connection routing information of the first network according to the second network and the preset preferred network; A second determination module, configured to, when it is judged that there is no second network that has been accessed, determine the network score of the first network according to the first network and the preset preferred network, and whether it is necessary to back up the direct connection routing information of the first network; A third determination module, configured to determine the current preferred network according to the network score and update the backed-up direct connection routing information.
9. An electronic device, characterized in that, It includes: The network implementation device for dual-network service coexistence based on the Android system as described in claim 8.
10. A computer-readable storage medium, characterized in that, A network implementation program for dual-network service coexistence based on the Android system is stored on the computer-readable storage medium. When the network implementation program for dual-network service coexistence based on the Android system is executed by a processor, the network implementation method for dual-network service coexistence based on the Android system as described in any one of claims 1-7 is implemented.
Citation Information
Cited By
Multi-network implementation method and system based on Android intelligent set top box
CN121842463A