Ethernet control method and device for network terminal
By simulating network cable unplugging and reconnection on the network terminal, and using the IPv6 link local address to manage the Ethernet network, it solves the problem that the network cable cannot be automatically turned on and off when physically connected, realizes automatic network status switching, and improves user experience and system compatibility.
Patent Information
- Application Number
- CN202410607686.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-05-16
AI Technical Summary
When the network cable of the network terminal is always physically connected, the Ethernet network cannot be automatically turned on and off, resulting in poor user experience. Especially when frequent switching between private and public networks is required, the network cable needs to be manually plugged and unplugged, and The Android system lacks ROOT permissions and necessary interfaces, and cannot control the network controller through software.
By implementing the Ethernet control method and equipment on the network terminal, the system side and the device side communicate through the IPv6 link local address, simulate the network cable plugging and reconnecting, and use the opening and closing of the address management module to realize the Ethernet network Automatically turn on and off to ensure that IP addresses can be quickly obtained or released when network status switches.
The Ethernet network can be turned on and off without physical plugging and unplugging, which improves the user experience and simplifies operations. It is suitable for a variety of systems, has high compatibility, and does not change the native network communication method of the network terminal.
Smart Images

Figure CN118200061B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network communications, and in particular to an Ethernet control method used on a network terminal. Background Art
[0002] In some application scenarios, there's a need to control network connectivity on and off as needed, while maintaining a physical connection to the network terminal. For example, in a TV scenario, users can watch online TV or connect a set-top box to live TV. Switching between the TV and the set-top box requires two remote controls, creating significant inconvenience. Furthermore, the set-top box itself is expensive and requires an additional power strip and HDIM cable. Multiple devices and multiple wiring significantly impact the aesthetics of the setup. Eliminating the set-top box requires installing IPTV software on the TV, which presents the challenge of switching between a private network (live TV) and a public network (online TV), essentially switching between a wired and wireless network. For a better user experience, the dedicated network cable should remain connected to the TV, eliminating the need for manual cable insertion and removal. Software-based on-demand connectivity allows for switching the Ethernet network from on to off and back again.
[0003] Since the system and device are in a pseudo-connected state when the network is disconnected, the system cannot obtain a valid address, and the device cannot receive the network start command, so there is no way to switch from Ethernet network off to network on.
[0004] Normally, shutting down a network involves disabling the network controller or unplugging the network cable. However, on systems like Android, without root access and without the necessary interfaces for software development, software-controlled network controllers are impossible. Manual plugging and unplugging requires manual intervention, which is inconvenient. Summary of the Invention
[0005] Purpose of the invention: In order to solve the problem in the prior art that the Ethernet network cannot be turned on and off when the network cable of the network terminal is always physically connected, the present invention provides an Ethernet control method and device for a network terminal.
[0006] Technical solution: An Ethernet control method for a network terminal, comprising the following steps:
[0007] Initialization of the system and device sides;
[0008] The system end obtains an IPv6 link-local address of a first Ethernet module of a network terminal, wherein the system end is a first application software installed on the network terminal, and a second Ethernet module of the device end is connected to the first Ethernet module of the network terminal via a network cable;
[0009] When the system receives a trigger signal for network activation, it issues a network activation command, which is an IPv6 data packet. The device receives the network activation command, simulates plugging and unplugging the network cable, and ensures that the address management module is in the enabled state during reconnection. The system initiates an address acquisition request, obtains the IP address assigned by the address management module, and the Ethernet network is enabled. The address management module is a DHCP server.
[0010] When the system receives a network shutdown trigger signal, it sends a network shutdown command to the device. After receiving the network shutdown command, the device simulates unplugging and reconnecting the network cable, and ensures that the address management module is in the closed state during reconnection. The system initiates an address acquisition request, but fails to obtain an IP address, and the Ethernet network is shut down.
[0011] Furthermore, after receiving the network start command, the device first enables the address management module and then simulates the network cable unplugging and reconnecting;
[0012] After receiving the network shutdown command, the device first disables the address management module and then simulates unplugging and reconnecting the network cable.
[0013] Furthermore, the method of simulating network cable plugging and reconnection includes any one or more of the following: resetting the device-side PHY; resetting the system-side PHY; turning off the device-side PHY and then turning on the device-side PHY; turning off the system-side PHY and then turning on the system-side PHY; resetting the second Ethernet module on the device-side; resetting the first Ethernet module on the system-side; turning off the second Ethernet module on the device-side and then turning on the second Ethernet module on the device-side; turning off the first Ethernet module on the system-side and then turning on the first Ethernet module on the system-side, wherein the first Ethernet module and the second Ethernet module are network modules with Ethernet communication capabilities; resetting the device side; resetting the system side; turning off the device side and then turning on the device side; turning off the system side and then turning on the system side; changing the IP acquisition method of the first Ethernet module on the system side.
[0014] Furthermore, the trigger signal for opening the network is to open the first application software on the system side; the trigger signal for closing the network is to close the first application software on the system side.
[0015] Furthermore, the network shutdown command is an IPv4 data packet or an IPv6 data packet.
[0016] An Ethernet control device for a network terminal includes a system end and a device end. The system end is a first application software installed on the network terminal and includes a network management module, a command transceiver module, and an address request module. The network management module is used to obtain an IPv6 link-local address and receive a network opening or closing trigger signal to manage network opening and closing. The command transceiver module is used to issue a network opening command or a network closing command, wherein the network opening command is an IPv6 data packet. The address request module is used to initiate an address acquisition request, and the address request module is a DHCP server.
[0017] The device end includes a second Ethernet module, a protocol processing module, a network switch control module, a status update module and an address management module; the second Ethernet module on the device end is connected to the first Ethernet module of the network terminal via a network cable; the protocol processing module is used to receive and parse a network start command or a network shutdown command; the network switch control module is used to enable the address management module when receiving a network start command, and disable the address management module when receiving a network shutdown command; the status update module is used to simulate the unplugging and reconnecting of the network cable; the address management module is used to receive an address acquisition request initiated by the system end, and allocate an IP address to the system end in the enabled state.
[0018] Furthermore, the status update module is used to simulate the plugging and reconnection of the network cable, including any one or more of the following methods: resetting the device-side PHY; resetting the system-side PHY; turning off the device-side PHY and then turning on the device-side PHY; turning off the system-side PHY and then turning on the system-side PHY; resetting the second Ethernet module on the device-side; resetting the first Ethernet module on the system-side; turning off the second Ethernet module on the device-side and then turning on the second Ethernet module on the device-side; turning off the first Ethernet module on the system-side and then turning on the first Ethernet module on the system-side, the first Ethernet module and the second Ethernet module are network modules with Ethernet communication capabilities; resetting the device side; resetting the system side; turning off the device side and then turning on the device side; turning off the system side and then turning on the system side; changing the IP acquisition method of the first Ethernet module on the system side.
[0019] Furthermore, the first Ethernet module is a computer network card, an embedded MCU or an external Ethernet controller, the second Ethernet module is a computer network card, an embedded MCU or an external Ethernet controller, and the computer network card is a computer built-in network card or a computer external network card.
[0020] Furthermore, the network terminal is one of a TV, a computer, a tablet, and a mobile phone.
[0021] Compared with the prior art, the Ethernet control method and device for a network terminal provided by the present invention have the following beneficial effects:
[0022] When the network cable of the network terminal is always physically connected and there is no plugging or unplugging, the network can be controlled on and off as needed, which will greatly improve the user experience of the product; even when the Ethernet network is closed, the network can still be turned on; by simulating the plugging and reconnection of the network cable, the system end can be triggered to quickly initiate an address acquisition request during the network status switching process, making the network status switching fast; it can be applied to a variety of systems and has high system compatibility; there is no need to change the native network communication method of other application software on the network terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a structural block diagram of an Ethernet control device used on a network terminal;
[0024] Figure 2 Open the flow chart for the network;
[0025] Figure 3 Close the flowchart for the network. DETAILED DESCRIPTION
[0026] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments.
[0027] An Ethernet control device used on a network terminal, such as Figure 1 As shown, it includes a system side and a device side. The system side is the first application software installed on the network terminal. The network terminal can be: TV, computer, tablet, mobile phone, multimedia device, etc. The system can be Android, Windows, etc. To facilitate understanding of the technical solution, the modules in the figure are connected by single arrows, but there are actually two directions of signal transmission.
[0028] The system side includes a network management module, a command transceiver module, and an address request module. The network management module is used to obtain an IPv6 link-local address and receive network startup or shutdown trigger signals to manage network startup and shutdown. The command transceiver module is used to issue network startup or shutdown commands, with the network startup commands being IPv6 data packets. The address request module is used to initiate address acquisition requests.
[0029] The device side includes a second Ethernet module, a protocol processing module, a network switch control module, a status update module, and an address management module. The second Ethernet module on the device side is connected to the first Ethernet module of the network terminal via a network cable. The protocol processing module is used to receive and parse network enable or disable commands. The network switch control module is used to enable the address management module upon receiving a network enable command and disable it upon receiving a network disable command. The status update module simulates plugging and unplugging the network cable to reconnect it. The address management module is used to receive address requests initiated by the system side and, when enabled, allocate an IP address to the system side. The address management module includes a DHCP server.
[0030] The status update module is used to simulate the plugging and reconnection of the network cable, and is implemented by any one or more of the following combinations: resetting the device-side PHY; resetting the system-side PHY; turning off the device-side PHY and then turning on the device-side PHY; turning off the system-side PHY and then turning on the system-side PHY; resetting the second Ethernet module on the device-side; resetting the first Ethernet module on the system-side; turning off the second Ethernet module on the device-side and then turning on the second Ethernet module on the device-side; turning off the first Ethernet module on the system-side and then turning on the first Ethernet module on the system-side; resetting the device side; resetting the system side; turning off the device side and then turning on the device side; turning off the system side and then turning on the system side; changing the IP acquisition method of the first Ethernet module, such as changing from static acquisition to dynamic acquisition, or changing from dynamic acquisition to static acquisition. The main purpose of simulating the plugging and reconnection of the network cable is to trigger the system side to quickly initiate an address acquisition request.
[0031] The first Ethernet module and the second Ethernet module are network modules with Ethernet communication capabilities.
[0032] The first Ethernet module is a computer's network card (network adapter), an embedded MCU, or an external Ethernet controller; the second Ethernet module is a computer's network card, an embedded MCU, or an external Ethernet controller; the computer's network card is a computer's built-in network card or a computer's external network card.
[0033] In practice, the network management module also needs to determine whether the Ethernet module's network port is connected to a network cable. The command transceiver module also needs to send commands such as status queries to the device. This command transceiver communicates with the device through the system's socket component. The protocol processing module needs to be able to parse and process IPv4 and IPv6 packets.
[0034] An Ethernet control method for a network terminal comprises the following steps:
[0035] Initialization of the system and device sides;
[0036] The system end obtains the IPv6 link-local address of the first Ethernet module of the network terminal;
[0037] like Figure 2 As shown, when the system side receives the network opening trigger signal, the system side issues a network opening command, which is an IPv6 data packet; the device side receives the network opening command, simulates the network cable plugging and reconnection, and ensures that the address management module is in the open state during reconnection; the system side initiates an address acquisition request, obtains the IP address assigned by the address management module, and the Ethernet network is opened;
[0038] like Figure 3 As shown in the figure, when the system side receives the trigger signal of network shutdown, the system side sends a network shutdown command to the device side; after receiving the network shutdown command, the device side simulates the network cable unplugging and reconnecting, and ensures that the address management module is in the closed state during reconnection; the system side initiates an address acquisition request, but fails to obtain an IP address, and the Ethernet network is shut down.
[0039] Because IPv4 addresses are assigned by DHCP and IPv6 link-local addresses are assigned by the system, before the Ethernet network is turned on, the system and the device are in a pseudo-connected state. The system cannot obtain an IPv4 address, but it can obtain an IPv6 link-local address. Therefore, it can use IPv6 packets to send network startup commands, allowing the device to receive the commands.
[0040] The network shutdown command is an IPv4 packet or an IPv6 packet. The IPv4 address is obtained when the Ethernet network is open, so during the network shutdown process, the network shutdown command can be sent using an IPv4 packet. Of course, since the IPv6 link-local address has been obtained, the network shutdown command can also be sent using an IPv6 packet.
[0041] To ensure that the address management module is in the required state when the analog network cable is unplugged and reconnected, this embodiment is implemented as follows:
[0042] After receiving the network enable command, the device first enables the address management module, then disables the secondary Ethernet module, and then enables it again. Alternatively, you can disable the secondary Ethernet module first, then enable the address management module, and finally enable it. As long as the address management module remains enabled after the simulated reconnection, the address management module will be able to assign an IP address to the system when the reconnection triggers the system to initiate an address request.
[0043] After receiving the network shutdown command, the device first disables the address management module, then shuts down the secondary Ethernet module, and then enables it. Alternatively, you can first disable the secondary Ethernet module, then disable the address management module, and finally enable it. As long as the address management module is disabled after the simulated reconnection, the system will be unable to obtain an IP address after initiating an address acquisition request after the reconnection triggers the system.
[0044] In addition to turning off and on the Ethernet module, you can also simulate network cable unplugging and reconnection by using any of the following methods, or even a combination of the following methods, depending on the actual situation: resetting the device-side PHY; resetting the system-side PHY; turning off the device-side PHY and then turning it on; turning off the system-side PHY and then turning it on; resetting the second Ethernet module on the device-side; resetting the first Ethernet module on the system-side; turning off the first Ethernet module on the system-side and then turning it on; resetting the device side; resetting the system side; turning off the device side and then turning it on; turning off the system side and then turning it on; changing the IP acquisition method of the first Ethernet module on the system side, such as changing from static acquisition to dynamic acquisition, or from dynamic acquisition to static acquisition.
[0045] The trigger signal for network activation is the launch of the first application software on the system side; the trigger signal for network shutdown is the shutdown of the first application software on the system side. That is, when a user is using a network terminal, if the first application software is launched, the Ethernet network is automatically enabled under the control of the Ethernet control device. If the first application software is closed, the Ethernet network is automatically disabled under the control of the Ethernet control device. The network can be enabled and disabled repeatedly. In addition, other trigger conditions can be set according to the usage scenario. During the entire Ethernet network state switching process, the network cable remains physically connected, allowing the Ethernet network to be enabled and disabled without physically plugging or unplugging the cable.
Claims
1. An Ethernet control method for a network terminal, characterized in that: The following steps are involved: Initialization of system and device ends; The system end obtains the IPv6 link local address of the first Ethernet module of the network terminal, the system end is the first application software installed on the network terminal, and the second Ethernet module of the device end is connected to the first Ethernet module of the network terminal through a network cable; When the system side receives a trigger signal for network opening, the system side issues a network opening command, wherein the network opening command is an IPv6 data packet; The device receives the network start command, simulates the network cable plugging and unplugging, and ensures that the address management module is in the open state during the reconnection; the system initiates an address acquisition request, obtains the IP address assigned by the address management module, and the Ethernet network is opened; When the system receives a trigger signal for network shutdown, the system sends a network shutdown command to the device. After receiving the network shutdown command, the device simulates plugging and unplugging the network cable to reconnect, and ensures that the address management module is in a closed state during reconnection. The system initiates an address request, but fails to obtain an IP address, and the Ethernet network is closed. The address management module is a DHCP server.
2. The Ethernet control method for a network terminal according to claim 1, characterized in that: After receiving the network start command, the device first enables the address management module and then simulates the network cable unplugging and reconnecting; After the device receives the network shutdown command, it first disables the address management module and then simulates unplugging and reconnecting the network cable.
3. The Ethernet control method for a network terminal according to claim 1 or 2, characterized in that: Methods for simulating network cable unplugging and reconnecting include any one or more of the following: resetting the device-side PHY; Reset the system-side PHY; turn off the device-side PHY and then turn on the device-side PHY; turn off the system-side PHY and then turn on the system-side PHY; Reset the second Ethernet module on the device side; Reset the first Ethernet module on the system side; Turn off the second Ethernet module on the device side and then turn on the second Ethernet module on the device side; Turn off the first Ethernet module on the system side and then turn on the first Ethernet module on the system side, wherein the first Ethernet module and the second Ethernet module are network modules with Ethernet communication capabilities; Reset the device side; reset the system side; turn off the device side and then turn it on; turn off the system side and then turn it on; change the IP acquisition method of the first Ethernet module on the system side.
4. The Ethernet control method for a network terminal according to claim 1 or 2, characterized in that: The trigger signal for opening the network is to open the first application software on the system side; the trigger signal for closing the network is to close the first application software on the system side.
5. The Ethernet control method for a network terminal according to claim 1 or 2, characterized in that: The network shutdown command is an IPv4 data packet or an IPv6 data packet.
6. An Ethernet control device for a network terminal, characterized in that: The system comprises a system end and a device end. The system end is a first application software installed on a network terminal. The system end comprises a network management module, a command transceiver module and an address request module. The network management module is used to obtain an IPv6 link local address and receive a trigger signal for network opening or closing to manage network opening and closing. The command transceiver module is used to issue a network opening command or a network closing command, and the network opening command is an IPv6 data packet. The address request module is used to initiate an address acquisition request, and the address request module is a DHCP server. The device end includes a second Ethernet module, a protocol processing module, a network switch control module, a status update module and an address management module; the second Ethernet module of the device end is connected to the first Ethernet module of the network terminal through a network cable; the protocol processing module is used to receive and parse a network start command or a network shutdown command; the network switch control module is used to enable the address management module when receiving a network start command, and disable the address management module when receiving a network shutdown command; the status update module is used to simulate the plugging and unplugging of the network cable; the address management module is used to receive an address acquisition request initiated by the system end, and allocate an IP address to the system end in the enabled state.
7. The Ethernet control device for a network terminal according to claim 6, characterized in that: The status update module is used to simulate the plugging and unplugging of the network cable and reconnection, including any one or more of the following methods: resetting the device-side PHY; Reset the system-side PHY; turn off the device-side PHY and then turn on the device-side PHY; Turn off the system-side PHY and then turn on the system-side PHY; Reset the second Ethernet module on the device side; Reset the first Ethernet module on the system side; Turn off the second Ethernet module on the device side and then turn on the second Ethernet module on the device side; Turn off the first Ethernet module on the system side and then turn on the first Ethernet module on the system side, wherein the first Ethernet module and the second Ethernet module are network modules with Ethernet communication capabilities; Reset the device side; reset the system side; turn off the device side and then turn it on; turn off the system side and then turn it on; change the IP acquisition method of the first Ethernet module on the system side.
8. The Ethernet control device for a network terminal according to claim 6 or 7, characterized in that: The first Ethernet module is a computer network card, an embedded MCU or an external Ethernet controller, the second Ethernet module is a computer network card, an embedded MCU or an external Ethernet controller, and the computer network card is a computer built-in network card or a computer external network card.
9. The Ethernet control device for a network terminal according to claim 6 or 7, characterized in that: The network terminal is one of a TV, a computer, a tablet, and a mobile phone.
