IP Library Granted Patent US 12706804
Granted Patent B2
US 12706804 · App. 18/898,756 · Granted Aug 11, 2026

Application state network card driving method and apparatus

Inventor: Shuai Liu (Nanjing, CN)
Assignee: NANJING QINHENG MICROELECTRONICS CO., LTD.
H04L41/0809H04L12/4641H04L41/0816H04L41/0895H04L41/40
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12706804
App. No.
18/898,756
Granted
Aug 11, 2026
Kind
B2
Abstract

Disclosed are an application state network card driving method and apparatus. The method comprises the steps of: initializing a system, establishing a channel communicating with a physical network card hardware device, creating a virtual network card device in the system, and opening the physical network card hardware device channel and a virtual network card device node channel; downstream transmitting data received by a system network interface through the virtual network card device, and uploading data uploaded by the physical network card hardware device to the system network interface; and stopping node communication of the virtual network card device, and deleting the virtual network card device. According to the invention, a network card driver can be installed on a host system without needing a root permission, thus having a good compatibility and a wide application range.

Claims (28)

1 . An application state network card driving method, comprising the following steps of:

initializing a system;

establishing a physical network card hardware device channel;

creating a virtual network card device, which comprises: opening a VPN service, calling a public interface in an internal class of the VPN service to preset parameters of the virtual network card device, calling a function in the internal class of the VPN service to create the virtual network card device, and saving a virtual network card device node;

opening the physical network card hardware device channel and a virtual network card device node channel;

carrying out data communication between the system and a physical network card hardware device, which comprises: reading, by the virtual network card device, protocol layer packet data in the virtual network card device node, and transmitting the data to the physical network card hardware device through a network protocol interface module and a device interface module in sequence; and receiving, by the device interface module, the data sent by the physical network card hardware device, transmitting the data to the network protocol interface module, then transmitting the data to the virtual network card device through the network protocol interface module, and writing, by the virtual network card device, the data into the virtual network card device node; and

deleting the virtual network card device, which comprises: closing the physical network card hardware device channel and the virtual network card device node channel, calling a node closing function in system functions to close the virtual network card device node, and calling a service closing function in the system functions to close the VPN service; wherein

the process of initializing the system comprises: opening hardware device plugging and unplugging detection, when the physical network card hardware device is detected to be plugged, identifying the physical network card hardware device, and when the identification is successful, carrying out subsequent operations; and when the physical network card hardware device is detected to be unplugged, identifying the physical network card hardware device, and when the identification is successful, carrying out subsequent operations.

2 . The application state network card driving method according to claim 1 , wherein, in a communication process, the protocol layer packet data is in transparent transmission among the virtual network card device, the network protocol interface module, the device interface module and the physical network card hardware device.

3 . The application state network card driving method according to claim 1 , wherein a communication process further comprises at least one of the following situations:

after the virtual network card device reads the protocol layer packet data in the virtual network card device node, the protocol layer packet data is downstream transmitted through the network protocol interface module, the protocol layer packet data is packaged first, and then the packaged data is transmitted to the physical network card hardware device through the device interface module; and

when the data transmitted by the physical network card hardware device is non-protocol layer packet data, the non-protocol layer packet data is uploaded through the device interface module, the non-protocol layer packet data is parsed into the protocol layer packet data first, and then the protocol layer packet data is transmitted to the virtual network card device through the network protocol interface module.

4 . The application state network card driving method according to claim 1 , further comprising: in a communication process, according to a physical device interface type of the physical network card hardware device, selecting a corresponding data transmission mode for communication.

5 . The application state network card driving method according to claim 1 , wherein, when the method is applied to an Android system, in the process of creating the virtual network card device, VPNService.Builder which is the public function of the internal class of the VPN service is called to preset the parameters of the virtual network card device, and VPNService.Builder.Establish( ) which is the function of the internal class of the VPN service is called to create the virtual network card device.

6 . The application state network card driving method according to claim 1 , wherein, in the process of deleting the virtual network card device, the node closing function adopts ParcelFileDescriptor interface close( ) in the system functions, and the service closing function adopts stopService( ) in the system functions.

7 . An application state network card driving apparatus, comprising:

a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to:

control a creation module to work, control a deletion module to work, control a interface module to work, control a interface module to work, establish a physical network card hardware device channel, and open the physical network card hardware device channel and a virtual network card device node channel;

open a VPN service, calling a public interface in an internal class of the VPN service to preset parameters of a virtual network card device, call a function in the internal class of the VPN service to create the virtual network card device, and save a virtual network card device node;

stop node communication of the virtual network card device, call a node closing function in system functions to close the virtual network card device node, and call a service closing function in the system functions to close the VPN service;

downstream transmit protocol layer packet data written by a system network into the virtual network card device node, and upload the protocol layer packet data transmitted by the network protocol interface to the system network;

downstream transmit the protocol layer packet data transmitted by the virtual network card device, and upload the data transmitted by the device interface to the virtual network card device; and

downstream transmit the data transmitted by the network protocol interface to the physical network card hardware device, and upload the data sent by the physical network card hardware device.

8 . The application state network card driving apparatus according to claim 7 , wherein the instructions, when executed by the at least one processor, further cause the at least one processor to perform at least one of the following steps of:

packaging the protocol layer packet data downstream transmitted through the network protocol interface, and outputting non-protocol layer packet data; and

parsing the non-protocol layer packet data uploaded through the device interface, and obtaining the protocol layer packet data.

9 . The application state network card driving apparatus according to claim 7 , wherein the instructions, when executed by the at least one processor, further cause the at least one processor to, according to a physical device interface type of the physical network card hardware device, select a corresponding data transmission mode for communication.

10 . The application state network card driving apparatus according to claim 7 , wherein instructions, when executed by the at least one processor, are further configured to cause the at least one processor to detect the plugging and unplugging of the physical network card hardware device and identify the physical network card hardware device.