Internet access implementation method and device based on virtual WIFI

By loading the virtual WIFI driver on the Android system and combining the Ethernet interface with the serial port, it solves the problem of being unable to adapt to wifi chips/wifi modules that do not support conventional interfaces, achieves efficient wifi Internet access, and improves Android product compatibility and data transfer rates.

CN118632322APending Publication Date: 2024-09-10SHANDONG SENTER ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310242106.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing technology cannot properly identify and adapt wifi chips/wifi modules that do not support SDIO, PCIE, and USB interfaces on Android systems, resulting in the inability to realize high data rate wifi Internet access functions.

Method used

By loading the virtual WIFI driver, the virtual network device wlan0 is generated, and the Ethernet interface is combined with the serial port to send control instructions and data packets to realize hotspot scanning, connection and data transmission of the wifi module.

Benefits of technology

It achieves compatibility with different wifi chips/wifi modules, and the user operation and data transmission rate are no different from traditional SOC or plug-in solutions, improving the wifi compatibility of android products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0004124644840000011
    Figure HDA0004124644840000011
  • Figure HDA0004124644840000012
    Figure HDA0004124644840000012
  • Figure HDA0004124644840000021
    Figure HDA0004124644840000021
Patent Text Reader

Abstract

The invention discloses an Internet access implementation method and device based on virtual WIFI, and belongs to the field of communication. According to the invention, when the wifi chip / wifi module of the third party only provides a common serial port and an Ethernet interface or only provides an Ethernet interface and cannot provide a driving program adaptive to the android platform, the wifi chip / wifi module can be integrated on the android platform. The Android application can complete the sending and receiving of a data packet through the Ethernet network card lt, the Ethernet interface lt, the Ethernet interface gt and the wifi antenna on the wifi module in sequence, so that the wifi internet access function is realized. From the perspective of use of the user, the user can surf the internet through wireless wifi. The rate of operating the wifi and uploading / downloading the data by the user is not different from the rate of operating the wifi and uploading / downloading the data by the traditional SOC scheme or the plug-in scheme, so that the compatibility of the android product to different wifi chips / wifi modules is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a method and device for realizing Internet access based on virtual WIFI. Background Art

[0002] The existing WiFi solutions on the Android platform are mainly on-chip integration (SOC) solutions and plug-in solutions. The SOC solution means that the platform manufacturer (such as Qualcomm, MTK, Spreadtrum, etc.) directly integrates the WiFi chip on the motherboard, and the commonly used interfaces include SDIO, PCIE, etc. This solution will identify the WiFi as an SDIO / PCIE WiFi network card, and a wlan0 network device will be generated in the system. The application sends and receives data packets through wlan0 to achieve the function of Internet access. The plug-in solution means that the WiFi chip is not integrated on the motherboard, but is connected to the motherboard through an extended external circuit. The commonly used interfaces include USB. On the Android system, this plug-in solution will identify the WiFi as a USB WiFi network card, and a wlan0 network device will be generated in the system. The application sends and receives data packets through wlan0 to achieve the function of Internet access.

[0003] The common point of the above two solutions is that the wlan0 network device is real, can send and receive network data packets, and is associated with physical wifi hardware (wifi chip / wifi module), and the application can access the Internet through wlan0. In terms of technical implementation, it is required to implement a set of drivers on the Android system to identify the wifi chip / wifi module as a wlan0 network device. However, some wifi chips / wifi modules only provide an interface mode of ordinary serial port plus Ethernet interface (do not support SDIO, PCIE, USB and other interfaces, and cannot provide a driver to convert the serial port into wifi. In fact, even if the driver to convert the serial port into wifi is implemented, the data transmission rate is very slow, which cannot meet the needs of products with high data rate transmission). It is impossible to identify it as a wlan0 network device according to the existing wifi solution, and it cannot be adapted to the Android system. The wifi chip / wifi module cannot work properly on the Android system. Summary of the invention

[0004] In order to solve the defects of the prior art, the present invention provides a method and device for implementing Internet access based on virtual WIFI, which improves the compatibility of Android products with different WIFI chips / WIFI modules.

[0005] The present invention provides the following technical solutions:

[0006] A method for implementing Internet access based on virtual WIFI, wherein a Wifi module includes an Ethernet interface and a serial port, the Ethernet interface of the Wifi module is connected to an Ethernet network card of an Android system, and the Wifi module is connected to the Android system via a serial port, and the method includes:

[0007] Turn on wifi, power on the wifi module to start the wifi module, and prepare the serial port;

[0008] Load the virtual Wifi driver and generate the virtual network device wlan0;

[0009] Send a periodic hotspot scan request through wlan0, open and connect the serial port, convert the hotspot scan request into a corresponding wifi command, and send it to the wifi module through the serial port; so that the wifi module starts the wifi hotspot scan and returns the hotspot scan execution success information through the serial port;

[0010] After receiving the returned hotspot scan execution success information, send a hotspot scan result acquisition request, convert the hotspot scan result acquisition request into a corresponding wifi command, and send it to the wifi module through the serial port, so that the wifi module returns the hotspot scan result through the serial port;

[0011] The returned hotspot scanning results are received and analyzed, a hotspot list is generated, and displayed on a user interface so that the user can select a Wi-Fi hotspot to connect to from the user interface.

[0012] Furthermore, the method further comprises:

[0013] After the user selects the wifi hotspot to be connected and enters the password, the password and connection request are converted into corresponding wifi commands and sent to the wifi module through the serial port; so that the wifi module establishes a connection with the wifi hotspot to be connected, and returns the wifi hotspot connection success information through the serial port;

[0014] After receiving the returned successful connection information of the wifi hotspot, starting the Ethernet network card, and configuring a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface;

[0015] After successfully configuring a static IP address for the Ethernet network card, configuring the routing table of the Ethernet network card to have the highest priority or deleting the route of the virtual wlan0 network device so that the data packets to be transmitted are transmitted through the Ethernet interface and the Ethernet network card;

[0016] The Wi-Fi hotspot is connected successfully, and the information of the connected Wi-Fi hotspot is displayed on the user interface.

[0017] A device for realizing Internet access based on virtual WIFI, wherein the Wifi module includes an Ethernet interface and a serial port, the Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system, and the Wifi module is connected to the Android system through the serial port, and the device includes:

[0018] The first enabling module is used to enable the wifi, power on the wifi module to start the wifi module, and prepare the serial port;

[0019] The first loading module is used to load the virtual Wifi driver and generate a virtual network device wlan0;

[0020] The first hotspot scanning module is used to send a periodic hotspot scanning request through wlan0, open and connect the serial port, convert the hotspot scanning request into a corresponding wifi command, and send it to the wifi module through the serial port; so that the wifi module starts the wifi hotspot scanning, and returns the hotspot scanning execution success information through the serial port;

[0021] A first hotspot scanning result acquisition module is used to send a hotspot scanning result acquisition request after receiving the returned hotspot scanning execution success information, convert the hotspot scanning result acquisition request into a corresponding wifi command, and send it to the wifi module through the serial port, so that the wifi module returns the hotspot scanning result through the serial port;

[0022] The first hotspot list display module is used to receive and parse the returned hotspot scanning results, generate a hotspot list, and display it on the user interface so that the user can select the Wi-Fi hotspot to be connected from the user interface.

[0023] Furthermore, the device also includes:

[0024] The first hotspot connection module is used for converting the password and the connection request into corresponding WiFi instructions after the user selects the WiFi hotspot to be connected and enters the password, and sends the instructions to the WiFi module through the serial port, so that the WiFi module can establish a connection with the WiFi hotspot to be connected, and return the WiFi hotspot connection success information through the serial port;

[0025] A network card configuration module is used to start the Ethernet network card after receiving the returned successful connection information of the WiFi hotspot, and configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface;

[0026] A routing configuration module, configured to configure the routing table of the Ethernet network card to the highest priority or delete the route of the virtual wlan0 network device after successfully configuring a static IP address for the Ethernet network card, so that the data packet to be transmitted is transmitted through the Ethernet interface and the Ethernet network card;

[0027] The first connection result display module is used to display the information of the connected WiFi hotspot on the user interface when the WiFi hotspot is successfully connected.

[0028] A method for implementing Internet access based on virtual WIFI, wherein the WIFI module includes an Ethernet interface, and the Ethernet interface of the WIFI module is connected to an Ethernet network card of an Android system, and the method includes:

[0029] Turn on wifi and power on the wifi module to start the wifi module;

[0030] Load the virtual Wifi driver and generate the virtual network device wlan0;

[0031] Start the Ethernet network card, configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; configure the routing table of the Ethernet network card to have the highest priority or delete the route of the virtual wlan0 network device;

[0032] Send a periodic hotspot scan request through wlan0, convert the hotspot scan request into a corresponding wifi command, and send it to the wifi module through the Ethernet interface; so that the wifi module unpacks and checks the received wifi command, starts wifi hotspot scanning, and returns hotspot scan execution success information through the Ethernet interface;

[0033] After receiving the returned hotspot scan execution success information and performing unpacking inspection, sending a request to obtain hotspot scan results, converting the request to obtain hotspot scan results into a corresponding wifi command, and sending it to the wifi module through the Ethernet interface, so that the Wifi module performs unpacking inspection on the received wifi command and returns the hotspot scan result through the Ethernet interface;

[0034] The returned hotspot scanning results are received and unpacked for inspection and analysis, a hotspot list is generated, and displayed on a user interface so that the user can select a Wi-Fi hotspot to connect to from the user interface.

[0035] Furthermore, the method further comprises:

[0036] After the user selects the wifi hotspot to be connected and enters the password, the password and the connection request are converted into corresponding wifi instructions and sent to the wifi module through the Ethernet interface; so that the wifi module unpacks and checks the received wifi instructions, establishes a connection with the wifi hotspot to be connected, and returns the wifi hotspot connection success information through the Ethernet interface;

[0037] After receiving the returned successful connection information of the wifi hotspot and performing unpacking inspection, the information of the connected wifi hotspot is displayed on the user interface.

[0038] A device for realizing Internet access based on virtual WIFI, wherein the WIFI module includes an Ethernet interface, and the Ethernet interface of the WIFI module is connected to the Ethernet network card of the Android system, and the device includes:

[0039] The second start-up module is used to start the wifi module and power on the wifi module to start the wifi module;

[0040] The second loading module is used to load the virtual Wifi driver and generate a virtual network device wlan0;

[0041] A network card and routing configuration module, used to start the Ethernet network card, configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; configure the routing table of the Ethernet network card to have the highest priority or delete the route of the virtual wlan0 network device;

[0042] The second hotspot scanning module is used to send a periodic hotspot scanning request through wlan0, convert the hotspot scanning request into a corresponding wifi command, and send it to the wifi module through the Ethernet interface; so that the wifi module unpacks the received wifi command, starts the wifi hotspot scanning, and returns the hotspot scanning execution success information through the Ethernet interface;

[0043] A second hotspot scanning result acquisition module is used to send a hotspot scanning result acquisition request after receiving the returned hotspot scanning execution success information and performing unpacking inspection, convert the hotspot scanning result acquisition request into a corresponding wifi command, and send it to the wifi module through the Ethernet interface, so that the wifi module performs unpacking inspection on the received wifi command and returns the hotspot scanning result through the Ethernet interface;

[0044] The second hotspot list display module is used to receive the returned hotspot scanning results and perform unpacking inspection and analysis, generate a hotspot list, and display it on the user interface so that the user can select the wifi hotspot to connect to from the user interface.

[0045] Furthermore, the device also includes:

[0046] The second hotspot connection module is used for converting the password and the connection request into a corresponding WiFi command after the user selects the WiFi hotspot to be connected and enters the password, and sends it to the WiFi module through the Ethernet interface; so that the WiFi module unpacks and checks the received WiFi command, establishes a connection with the WiFi hotspot to be connected, and returns WiFi hotspot connection success information through the Ethernet interface;

[0047] The second connection result display module is used to display the information of the connected WiFi hotspot on the user interface after receiving the returned WiFi hotspot connection success information and performing unpacking inspection.

[0048] The present invention has the following beneficial effects:

[0049] The present invention realizes that when a third-party WiFi chip / WiFi module only provides an ordinary serial port plus an Ethernet interface or only provides an Ethernet interface and cannot provide a driver adapted to the Android platform, it can be integrated into the Android platform. Android applications can complete the sending and receiving of data packets through "Ethernet network card <---> Ethernet interface on WiFi module <---> WiFi antenna" in sequence to realize the WiFi Internet access function. From the user's point of view, it is to surf the Internet through wireless WiFi. The speed of user operation of WiFi and data upload / download is no different from that of traditional SOC solutions or plug-in solutions, which improves the compatibility of Android products with different WiFi chips / WiFi modules. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a flowchart of the method for implementing Internet access based on virtual WIFI in Example 1;

[0051] Figure 2 This is a schematic diagram of a virtual WIFI-based Internet access implementation device according to Example 2;

[0052] Figure 3 This is a flowchart of a method for implementing Internet access based on virtual WIFI according to Example 3;

[0053] Figure 4 This is a schematic diagram of a virtual WIFI-based Internet access implementation device of Example 4. DETAILED DESCRIPTION

[0054] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0055] Embodiment 1:

[0056] The embodiment of the present invention provides an Internet access implementation method based on virtual WIFI, which is applicable to a wifi chip / wifi module that only provides a common serial port plus an Ethernet interface. For this wifi module, on an android system, only one serial port and one Ethernet interface can be identified. Based on this feature, the present invention controls the basic functions of wifi by a serial port (i.e., the sending and receiving of related wifi control instructions are realized by a serial port), and transmits and receives data packets through an Ethernet interface to realize android application Internet access. Specifically, the Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system (to be precise, the Android core board, i.e., the Android framework), and the Wifi module is connected to the Android system through a serial port.

[0057] Based on the above connection relationship, such as Figure 1 As shown, an embodiment of the method for implementing Internet access based on virtual WIFI of the present invention includes:

[0058] S1: Turn on WiFi, power on the WiFi module to start the WiFi module and prepare the serial port.

[0059] Under normal boot conditions, the WiFi is turned off and the WiFi module is powered off to save power and improve battery life. When the user needs to turn on the WiFi, first turn on the WiFi on the Android system, power on the WiFi module, start the WiFi module, and prepare the serial port.

[0060] S2: Load the virtual Wifi driver and generate the virtual network device wlan0.

[0061] In the Android WiFi framework, the basic functions of WiFi (such as turning on, off, hotspot scanning, selecting hotspots and entering passwords, connecting, connection status, disconnecting, signal strength display, IP address display, etc.) and processes must rely on a wlan0 network device (which can be real or virtual). Therefore, in the implementation of this solution, a virtual WiFi driver will be loaded on the Android system. After successful loading, a virtual network device wlan0 will be generated in the Android system. This virtual network device wlan0 has no association with the real WiFi chip / WiFi module, and cannot send or receive data packets. It exists to ensure that the entire Android WiFi process runs normally (the Android WiFi framework only cares about whether there is a wlan0 network device, and does not care whether the wlan0 network device is associated with real hardware). Android applications can initiate software processes such as hotspot scanning requests, connection requests, disconnection requests, signal and connection status query requests through wlan0.

[0062] S3: Send periodic hotspot scanning requests through wlan0, open and connect the serial port, convert the hotspot scanning requests into corresponding wifi commands, and send them to the wifi module through the serial port; so that the wifi module starts wifi hotspot scanning and returns the hotspot scanning execution success information through the serial port.

[0063] When the virtual network device wlan0 is loaded successfully, the Android system is triggered by the Android application to send a periodic hotspot scan request through wlan0. Then the Android framework opens and connects the serial port, converts the hotspot scan request into the corresponding wifi command scan, and sends it to the wifi module through the serial port. After the wifi module receives the wifi command scan from the serial port, it starts the wifi hotspot scan and returns a message that the command is executed successfully through the serial port.

[0064] S4: After receiving the returned hotspot scan execution success information, send a request to obtain the hotspot scan result, convert the request to obtain the hotspot scan result into a corresponding wifi command, and send it to the wifi module through the serial port, so that the Wifi module returns the hotspot scan result through the serial port.

[0065] After receiving the hotspot scan success information, the Android framework sends a request to obtain the hotspot scan results, converts the request into the corresponding wifi command scan_results, and sends it to the wifi module through the serial port. The wifi module returns the scanned hotspot data (i.e., hotspot scan results) to the Android framework through the serial port.

[0066] S5: Receive and parse the returned hotspot scanning results, generate a hotspot list, and display it on the user interface so that the user can select the Wi-Fi hotspot to connect to from the user interface.

[0067] After receiving the returned hotspot scanning results, the Android framework parses the hotspot data, generates a hotspot list, and returns it to the Android application; the Android application displays the hotspot list on the user interface, including the hotspot list, signal and connection status, IP address, gateway, DNS and other information. The user can then select a wifi hotspot from the interface, enter the password, and request to establish a connection.

[0068] As an improvement, the method of this embodiment further includes:

[0069] S6: After the user selects the wifi hotspot to be connected and enters the password, the password and connection request are converted into corresponding wifi commands and sent to the wifi module through the serial port; so that the wifi module establishes a connection with the wifi hotspot to be connected, and returns the wifi hotspot connection success information through the serial port.

[0070] As an example, the Android framework converts the password and connection request entered by the user into the corresponding wifi commands add_network, set_network, select_network, enable_network, and status, and sends them to the wifi module through the serial port. The wifi module connects to the specified hotspot and returns the connection success information of the specified wifi hotspot to the Android framework through the serial port, including the hotspot name, IP address, gateway, DNS, subnet mask, signal strength, etc.

[0071] S7: After receiving the returned successful connection information of the wifi hotspot, start the Ethernet network card and configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface.

[0072] After the Android framework successfully connects to the WiFi hotspot, it starts the Ethernet network card and configures a static IP address for the Ethernet network card. The configured static IP address must be in the same address segment as the IP address of the Ethernet interface on the WiFi6 module, thereby opening up the network path between the Ethernet network card and the Ethernet interface on the WiFi chip / WiFi module to ensure normal communication between the two.

[0073] S8: After successfully configuring a static IP address for the Ethernet network card, configure the routing table of the Ethernet network card to have the highest priority or delete the route of the virtual wlan0 network device, so that the data packets to be transmitted are transmitted through the Ethernet interface and the Ethernet network card.

[0074] This step is used to ensure that the data packets are transmitted through the Ethernet interface and Ethernet network card, and are not sent to the virtual wlan0 device, because the virtual wlan0 device is not associated with any physical network hardware and cannot send or receive data packets.

[0075] S9: The wifi hotspot is successfully connected, and the information of the connected wifi hotspot is displayed on the user interface.

[0076] At this point, it is considered that the wifi hotspot is connected successfully, and the Android framework notifies the Android application of the successful connection to the wifi hotspot, and the Android application displays the information of the connected hotspot on the user interface.

[0077] Finally, through the above operations, when the third-party WiFi chip / WiFi module only provides an ordinary serial port plus an Ethernet interface and cannot provide a driver adapted to the Android platform, it can be integrated into the Android platform through the present invention. Android applications can complete the sending and receiving of data packets through "Ethernet network card <---> Ethernet interface on WiFi module <---> WiFi antenna" in sequence to realize the WiFi Internet access function. From the user's point of view, it is to surf the Internet through wireless WiFi. The speed of user operation of WiFi and data upload / download is no different from that of traditional SOC solutions or plug-in solutions, which improves the compatibility of Android products with different WiFi chips / WiFi modules.

[0078] Embodiment 2:

[0079] Corresponding to Example 1, the embodiment of the present invention also provides an Internet access device based on virtual WIFI. The Wifi module of this embodiment includes an Ethernet interface and a serial port. The Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system, and the Wifi module is connected to the Android system through the serial port. Figure 2 As shown, the device comprises:

[0080] The first enabling module 1 is used to enable WiFi, power on the WiFi module to start the WiFi module, and prepare the serial port.

[0081] The first loading module 2 is used to load the virtual Wifi driver and generate a virtual network device wlan0.

[0082] The first hotspot scanning module 3 is used to send periodic hotspot scanning requests through wlan0, open and connect the serial port, convert the hotspot scanning requests into corresponding wifi commands, and send them to the wifi module through the serial port; so that the wifi module starts wifi hotspot scanning and returns the hotspot scanning execution success information through the serial port.

[0083] The first hotspot scanning result acquisition module 4 is used to send a request for obtaining hotspot scanning results after receiving the returned hotspot scanning execution success information, convert the request for obtaining hotspot scanning results into a corresponding wifi command, and send it to the wifi module through the serial port, so that the Wifi module returns the hotspot scanning result through the serial port.

[0084] The first hotspot list display module 5 is used to receive and parse the returned hotspot scanning results, generate a hotspot list, and display it on the user interface so that the user can select the Wi-Fi hotspot to be connected from the user interface.

[0085] As an improvement, the device may further include:

[0086] The first hotspot connection module is used to convert the password and connection request into corresponding WiFi instructions after the user selects the WiFi hotspot to be connected and enters the password, and sends it to the WiFi module through the serial port; so that the WiFi module can establish a connection with the WiFi hotspot to be connected, and return the WiFi hotspot connection success information through the serial port.

[0087] The network card configuration module is used to start the Ethernet network card after receiving the returned WiFi hotspot connection success information, and configure the Ethernet network card with a static IP address in the same address segment as the IP address of the Ethernet interface.

[0088] The routing configuration module is used to configure the routing table of the Ethernet network card to the highest priority or delete the route of the virtual wlan0 network device after successfully configuring the static IP address for the Ethernet network card, so that the data packets to be transmitted are transmitted through the Ethernet interface and the Ethernet network card.

[0089] The first connection result display module is used to display the information of the connected WiFi hotspot on the user interface when the WiFi hotspot is successfully connected.

[0090] When the third-party wifi chip / wifi module only provides an ordinary serial port plus an Ethernet interface, and is unable to provide a driver adapted to the Android platform, it can be integrated into the Android platform through the present invention. The Android application can complete the sending and receiving of data packets through "Ethernet network card <---> Ethernet interface on the wifi module <---> wifi antenna" in sequence to realize the wifi Internet access function. From the user's point of view, it is to surf the Internet through wireless wifi. The user's operation of wifi and the speed of data upload / download are no different from the traditional SOC solution or plug-in solution, which improves the compatibility of android products with different wifi chips / wifi modules.

[0091] The device provided in this embodiment has a one-to-one correspondence between its implementation principle and the technical effects produced by the embodiment 1 of the aforementioned method. For the sake of brief description, for the parts not mentioned in the embodiment of the device, reference can be made to the corresponding contents in the embodiment 1 of the aforementioned method. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the modules and units described in the device can all refer to the corresponding processes in the embodiment 1 of the aforementioned method, and will not be repeated here.

[0092] Embodiment 3:

[0093] The embodiment of the present invention also provides another method for realizing Internet access based on virtual WIFI. The difference from the embodiment 1 is that the Wifi module of the embodiment 1 includes an Ethernet interface and a serial port, and the wifi control instructions and data packets are transmitted separately through the serial port and the Ethernet interface. However, the present embodiment enables the Wifi module to be integrated into the Android system when it only includes an Ethernet interface but not a serial port. The Ethernet interface of the Wifi module of the present embodiment is connected to the Ethernet network card of the Android system, and the control instructions and data packets are transmitted through the Ethernet interface.

[0094] Correspondingly, such as Figure 3 As shown, the method of this embodiment includes:

[0095] S11: Turn on Wi-Fi and power on the Wi-Fi module to start the Wi-Fi module.

[0096] S12: Load the virtual Wifi driver and generate a virtual network device wlan0.

[0097] S11 and S12 of this embodiment are similar to S1 and S2 of Embodiment 1, except that this embodiment does not have operations corresponding to the serial port, so the repeated parts are not repeated here.

[0098] S13: Start the Ethernet network card, configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; configure the routing table of the Ethernet network card to have the highest priority or delete the route of the virtual wlan0 network device.

[0099] Since the control instructions and data packets in this embodiment are transmitted through the Ethernet interface, when turning on WiFi, you first need to turn on the Ethernet network card and configure an IP address in the same IP address segment as the Ethernet interface on the WiFi chip / WiFi module to ensure that they can communicate normally.

[0100] S14: Send a periodic hotspot scan request through wlan0, convert the hotspot scan request into a corresponding wifi command, and send it to the wifi module through the Ethernet interface; so that the wifi module unpacks and checks the received wifi command, starts the wifi hotspot scan, and returns the hotspot scan execution success information through the Ethernet interface.

[0101] This step is similar to S3 of Example 1, except that the wifi module in this step needs to unpack and check the received data. Because in this embodiment, both the control instructions and the data packets are transmitted through the Ethernet interface, the wifi module needs to unpack and check the received data to determine whether it is a wifi control instruction or a transmitted data packet. If it is a control instruction, the behavior of the wifi chip / wifi module is controlled. If it is an Internet data packet, it is handed over to the corresponding protocol layer for processing.

[0102] S15: After receiving the returned hotspot scan execution success information and performing unpacking inspection, send a request to obtain the hotspot scan result, convert the request to obtain the hotspot scan result into a corresponding wifi command, and send it to the wifi module through the Ethernet interface, so that the Wifi module can unpack and inspect the received wifi command and return the hotspot scan result through the Ethernet interface.

[0103] Similarly, the Android framework also needs to unpack and check the received data to confirm whether the data packet is a wifi command processing result or an Internet data packet. If it is a processing result, it will be parsed and displayed on the Android application interface; if it is an Internet data packet, it will be handed over to the corresponding protocol layer for processing.

[0104] S16: Receive the returned hotspot scanning results, perform unpacking inspection and analysis, generate a hotspot list, and display it on the user interface so that the user can select the wifi hotspot to connect to from the user interface.

[0105] S17: After the user selects the Wi-Fi hotspot to be connected and enters the password, the password and the connection request are converted into corresponding Wi-Fi instructions and sent to the Wi-Fi module through the Ethernet interface; so that the Wi-Fi module unpacks and checks the received Wi-Fi instructions, establishes a connection with the Wi-Fi hotspot to be connected, and returns the Wi-Fi hotspot connection success information through the Ethernet interface.

[0106] S18: After receiving the returned successful Wi-Fi hotspot connection information and performing unpacking inspection, the information of the connected Wi-Fi hotspot is displayed on the user interface.

[0107] Through the method of this embodiment, if the wifi chip / wifi module only has an Ethernet interface, it can also be integrated into the android platform. This embodiment has similar beneficial effects as embodiment 1, and the similarities are not repeated here. Compared with embodiment 1, the difference of this embodiment is that the received data needs to be unpacked and checked on the android side and the wifi chip / wifi module side, so compared with embodiment 1, the data transmission rate will be affected to a certain extent.

[0108] Embodiment 4:

[0109] Corresponding to the above-mentioned embodiment 3, the present invention also provides a device for realizing Internet access based on virtual WIFI. The Wifi module of this embodiment includes an Ethernet interface, and the Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system. Figure 4 As shown, the device of this embodiment includes:

[0110] The second enabling module 11 is used to enable the wifi and power on the wifi module to start the wifi module.

[0111] The second loading module 12 is used to load the virtual Wifi driver and generate a virtual network device wlan0.

[0112] The network card and routing configuration module 13 is used to start the Ethernet network card, configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; configure the routing table of the Ethernet network card to have the highest priority or delete the route of the virtual wlan0 network device.

[0113] The second hotspot scanning module 14 is used to send periodic hotspot scanning requests through wlan0, convert the hotspot scanning requests into corresponding wifi commands, and send them to the wifi module through the Ethernet interface; so that the wifi module unpacks and checks the received wifi commands, starts wifi hotspot scanning, and returns hotspot scanning execution success information through the Ethernet interface.

[0114] The second hotspot scanning result acquisition module 15 is used to send a request for obtaining hotspot scanning results after receiving the returned hotspot scanning execution success information and performing unpacking inspection, convert the request for obtaining hotspot scanning results into corresponding wifi instructions, and send it to the wifi module through the Ethernet interface, so that the Wifi module can unpack and inspect the received wifi instructions and return the hotspot scanning results through the Ethernet interface.

[0115] The second hotspot list display module 16 is used to receive the returned hotspot scanning results and perform unpacking inspection and analysis, generate a hotspot list, and display it on the user interface so that the user can select the wifi hotspot to be connected from the user interface.

[0116] As an improvement, the device of this embodiment may further include:

[0117] The second hotspot connection module is used to convert the password and connection request into corresponding WiFi instructions after the user selects the WiFi hotspot to be connected and enters the password, and sends it to the WiFi module through the Ethernet interface; so that the WiFi module can unpack and check the received WiFi instructions, establish a connection with the WiFi hotspot to be connected, and return the WiFi hotspot connection success information through the Ethernet interface.

[0118] The second connection result display module is used to display the information of the connected WiFi hotspot on the user interface after receiving the returned WiFi hotspot connection success information and performing unpacking inspection.

[0119] The device provided in the above embodiment, its implementation principle and the technical effects produced correspond to the embodiment 3 of the above method one by one. For the sake of brief description, the parts not mentioned in the embodiment of the device can refer to the corresponding contents in the embodiment 3 of the above method. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the modules and units described in the device can refer to the corresponding processes in the embodiment 3 of the above method, and will not be repeated here.

[0120] The method described in the above embodiment provided by the present invention can implement the business logic through a computer program and record it on a storage medium, and the storage medium can be read and executed by a computer to achieve the effect of the solution described in the method embodiment of this specification. Therefore, the embodiment of the present invention also provides a computer-readable storage medium for implementing Internet access based on virtual WIFI, including a memory for storing processor-executable instructions, and when the instructions are executed by the processor, the steps of the Internet access implementation method based on virtual WIFI in the above embodiment are implemented.

[0121] The storage medium may include a physical device for storing information, which is usually a medium that digitizes the information and then stores it in an electrical, magnetic or optical manner. The storage medium may include: a device that stores information in an electrical energy manner, such as various memories, such as RAM, ROM, etc.; a device that stores information in a magnetic energy manner, such as a hard disk, a floppy disk, a magnetic tape, a magnetic core memory, a magnetic bubble memory, a USB flash drive; a device that stores information in an optical manner, such as a CD or a DVD. Of course, there are other readable storage media, such as quantum memory, graphene memory, etc.

[0122] The storage medium described above may also include other implementation methods according to the description of the method embodiment. The implementation principle and technical effects produced by this embodiment are the same as those of the aforementioned method embodiment. For details, please refer to the description of the relevant method embodiment, and no further description will be given here.

[0123] The embodiment of the present invention also provides a device for implementing Internet access based on virtual WIFI, which may be a separate computer, or may include an actual operating device using one or more of the methods or one or more of the embodiments of this specification. The device for implementing Internet access based on virtual WIFI may include at least one processor and a memory storing computer executable instructions, and when the processor executes the instructions, it implements any one or more of the steps of the Internet access implementation method based on virtual WIFI.

[0124] The device described above may also include other implementation methods according to the description of the method embodiment. The implementation principle and technical effects produced by this embodiment are the same as those of the aforementioned method embodiment. For details, please refer to the description of the relevant method embodiment, and no further description will be given here.

[0125] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for implementing Internet access based on virtual WIFI, characterized in that: The Wifi module includes an Ethernet interface and a serial port, the Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system, and the Wifi module is connected to the Android system through the serial port, and the method includes: Turn on wifi, power on the wifi module to start the wifi module, and prepare the serial port; Load the virtual Wifi driver and generate the virtual network device wlan0; Send a periodic hotspot scan request through wlan0, open and connect the serial port, convert the hotspot scan request into a corresponding wifi command, and send it to the wifi module through the serial port; so that the wifi module starts the wifi hotspot scan and returns the hotspot scan execution success information through the serial port; After receiving the returned hotspot scan execution success information, send a hotspot scan result acquisition request, convert the hotspot scan result acquisition request into a corresponding wifi command, and send it to the wifi module through the serial port, so that the wifi module returns the hotspot scan result through the serial port; The returned hotspot scanning results are received and analyzed, a hotspot list is generated, and displayed on a user interface so that the user can select a Wi-Fi hotspot to connect to from the user interface.

2. The method for realizing Internet access based on virtual WIFI according to claim 1, characterized in that: The method further comprises: After the user selects the wifi hotspot to be connected and enters the password, the password and connection request are converted into corresponding wifi commands and sent to the wifi module through the serial port; so that the wifi module establishes a connection with the wifi hotspot to be connected, and returns the wifi hotspot connection success information through the serial port; After receiving the returned successful connection information of the wifi hotspot, starting the Ethernet network card, and configuring a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; After successfully configuring a static IP address for the Ethernet network card, configuring the routing table of the Ethernet network card to have the highest priority or deleting the route of the virtual wlan0 network device so that the data packets to be transmitted are transmitted through the Ethernet interface and the Ethernet network card; The Wi-Fi hotspot is connected successfully, and the information of the connected Wi-Fi hotspot is displayed on the user interface.

3. A device for realizing Internet access based on virtual WIFI, characterized in that: The Wifi module includes an Ethernet interface and a serial port. The Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system, and the Wifi module is connected to the Android system through the serial port. The device includes: The first enabling module is used to enable the wifi, power on the wifi module to start the wifi module, and prepare the serial port; The first loading module is used to load the virtual Wifi driver and generate a virtual network device wlan0; The first hotspot scanning module is used to send a periodic hotspot scanning request through wlan0, open and connect the serial port, convert the hotspot scanning request into a corresponding wifi command, and send it to the wifi module through the serial port; so that the wifi module starts the wifi hotspot scanning, and returns the hotspot scanning execution success information through the serial port; A first hotspot scanning result acquisition module is used to send a hotspot scanning result acquisition request after receiving the returned hotspot scanning execution success information, convert the hotspot scanning result acquisition request into a corresponding wifi command, and send it to the wifi module through the serial port, so that the wifi module returns the hotspot scanning result through the serial port; The first hotspot list display module is used to receive and parse the returned hotspot scanning results, generate a hotspot list, and display it on the user interface so that the user can select the Wi-Fi hotspot to be connected from the user interface.

4. The device for realizing Internet access based on virtual WIFI according to claim 3, characterized in that: The device also includes: The first hotspot connection module is used for converting the password and the connection request into corresponding WiFi instructions after the user selects the WiFi hotspot to be connected and enters the password, and sends the instructions to the WiFi module through the serial port, so that the WiFi module can establish a connection with the WiFi hotspot to be connected, and return the WiFi hotspot connection success information through the serial port; A network card configuration module is used to start the Ethernet network card after receiving the returned successful connection information of the WiFi hotspot, and configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; A routing configuration module, configured to configure the routing table of the Ethernet network card to the highest priority or delete the route of the virtual wlan0 network device after successfully configuring a static IP address for the Ethernet network card, so that the data packet to be transmitted is transmitted through the Ethernet interface and the Ethernet network card; The first connection result display module is used to display the information of the connected WiFi hotspot on the user interface when the WiFi hotspot is successfully connected.

5. A method for implementing Internet access based on virtual WIFI, characterized in that: The Wifi module includes an Ethernet interface, and the Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system. The method includes: Turn on wifi and power on the wifi module to start the wifi module; Load the virtual Wifi driver and generate the virtual network device wlan0; Start the Ethernet network card, configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; configure the routing table of the Ethernet network card to have the highest priority or delete the route of the virtual wlan0 network device; Send a periodic hotspot scan request through wlan0, convert the hotspot scan request into a corresponding wifi command, and send it to the wifi module through the Ethernet interface; so that the wifi module unpacks and checks the received wifi command, starts wifi hotspot scanning, and returns hotspot scan execution success information through the Ethernet interface; After receiving the returned hotspot scan execution success information and performing unpacking inspection, sending a request to obtain hotspot scan results, converting the request to obtain hotspot scan results into a corresponding wifi command, and sending it to the wifi module through the Ethernet interface, so that the Wifi module performs unpacking inspection on the received wifi command and returns the hotspot scan result through the Ethernet interface; The returned hotspot scanning results are received and unpacked for inspection and analysis, a hotspot list is generated, and displayed on a user interface so that the user can select a Wi-Fi hotspot to connect to from the user interface.

6. The method for realizing Internet access based on virtual WIFI according to claim 5, characterized in that: The method further comprises: After the user selects the wifi hotspot to be connected and enters the password, the password and the connection request are converted into corresponding wifi instructions and sent to the wifi module through the Ethernet interface; so that the wifi module unpacks and checks the received wifi instructions, establishes a connection with the wifi hotspot to be connected, and returns the wifi hotspot connection success information through the Ethernet interface; After receiving the returned successful connection information of the wifi hotspot and performing unpacking inspection, the information of the connected wifi hotspot is displayed on the user interface.

7. A device for surfing the Internet based on virtual WIFI, characterized in that: The Wifi module includes an Ethernet interface, and the Ethernet interface of the Wifi module is connected to the Ethernet network card of the Android system. The device includes: The second start-up module is used to start the wifi module and power on the wifi module to start the wifi module; The second loading module is used to load the virtual Wifi driver and generate a virtual network device wlan0; A network card and routing configuration module, used to start the Ethernet network card, configure a static IP address for the Ethernet network card that is in the same address segment as the IP address of the Ethernet interface; configure the routing table of the Ethernet network card to have the highest priority or delete the route of the virtual wlan0 network device; The second hotspot scanning module is used to send a periodic hotspot scanning request through wlan0, convert the hotspot scanning request into a corresponding wifi command, and send it to the wifi module through the Ethernet interface; so that the wifi module unpacks the received wifi command, starts the wifi hotspot scanning, and returns the hotspot scanning execution success information through the Ethernet interface; A second hotspot scanning result acquisition module is used to send a hotspot scanning result acquisition request after receiving the returned hotspot scanning execution success information and performing unpacking inspection, convert the hotspot scanning result acquisition request into a corresponding wifi command, and send it to the wifi module through the Ethernet interface, so that the wifi module performs unpacking inspection on the received wifi command and returns the hotspot scanning result through the Ethernet interface; The second hotspot list display module is used to receive the returned hotspot scanning results and perform unpacking inspection and analysis, generate a hotspot list, and display it on the user interface so that the user can select the wifi hotspot to connect to from the user interface.

8. The device for realizing Internet access based on virtual WIFI according to claim 7, characterized in that: The device also includes: The second hotspot connection module is used for converting the password and the connection request into a corresponding WiFi command after the user selects the WiFi hotspot to be connected and enters the password, and sends it to the WiFi module through the Ethernet interface; so that the WiFi module unpacks and checks the received WiFi command, establishes a connection with the WiFi hotspot to be connected, and returns WiFi hotspot connection success information through the Ethernet interface; The second connection result display module is used to display the information of the connected WiFi hotspot on the user interface after receiving the returned WiFi hotspot connection success information and performing unpacking inspection.