Network connection method and related device
The network connection method automates WIFI setup by using a bridge device with a fixed gateway address and QR code scanning, addressing the challenge of manual password entry and gateway address issues in router connections, ensuring efficient and cost-effective network access.
Patent Information
- Application Number
- CN202310639181.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-05-31
AI Technical Summary
Existing methods for connecting multiple terminal devices to a router using a single account often fail to establish Internet access due to issues with obtaining the gateway address, requiring manual entry of passwords and information, which complicates the connection process.
A network connection method that utilizes a bridge device with a fixed gateway address to establish initial and final WIFI connections automatically through scanning a QR code, allowing terminal devices to connect to a router without manual input of passwords or gateway addresses, even when the gateway address is modified.
Enables seamless and user-friendly network connections by automating the process of establishing WIFI connections, reducing the need for manual configuration and saving costs by avoiding server interactions.
Smart Images

Figure CN119071877A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a network connection method and related devices. Background Art
[0002] With the development of Internet technology, Internet access is becoming more and more popular in people's lives. Sometimes multiple terminal devices need to use one account to access the Internet at the same time. For example, in a home network, there are multiple terminal devices, such as mobile phones, computers, and network TVs. These terminal devices are all connected to a router, which is connected to the Internet through one account.
[0003] Mobile phones and other terminal devices can connect to the router by scanning the mini-program code on the router through WeChat, and then connect to the Internet.
[0004] However, in some scenarios, the applet cannot obtain the gateway address of the router and cannot connect to the Internet. Summary of the invention
[0005] The embodiment of the present application provides a network connection method and related devices, which are applied to the field of terminal technology. After connecting to the first WIFI, the routing information is obtained through a bridge device with a fixed gateway address. The second WIFI is connected through the routing information, and then connected to the Internet. The terminal device can establish a connection with the router by scanning the target QR code of the mini program code, and the automatic connection of WIFI can be realized without the user actively entering the WIFI password and other information, bringing a better connection experience to the user.
[0006] In the first aspect, an embodiment of the present application provides a network connection method, which is applied to a router. The method includes: the router establishes a first WIFI connection with a terminal device based on a first WIFI SSID and a first WIFI password; after the first WIFI connection is established, the router receives a first request, the first request is sent by the terminal device based on a first gateway address, the first gateway address is pre-acquired by the terminal device, and the first gateway address is the address corresponding to the first bridge device in the router; in response to the first request, the router sends a first message to the terminal device, the first message includes: a second WIFI SSID, a second WIFI password, and a second gateway address, the second gateway address is the address corresponding to the second bridge device in the router; the router establishes a second WIFI connection with the terminal device based on the second WIFI SSID and the second WIFI password; after the address of the second bridge device is changed from the second gateway address to the third gateway address, the method also includes: the router establishes a third WIFI connection with the terminal device based on a third WIFI SSID and a third WIFI password; wherein the third WIFI SSID is connected to the first WIFI The third WIFI password is the same as the first WIFI password; after the third WIFI connection is established, the router receives a second request from the terminal device, and the second request is sent by the terminal device based on the first gateway address; in response to the second request, the router sends a second message to the terminal device, and the second message includes: a fourth WIFI SSID, a fourth WIFI password, and a third gateway address; the router establishes a fourth WIFI connection with the terminal device based on the fourth WIFI SSID and the fourth WIFI password, wherein the fourth WIFI SSID is the same as the second WIFI SSID, and the fourth WIFI password is the same as the second WIFI password.
[0007] The first bridge device in the above router may be a bridge device used to establish an initial WIFI connection between the terminal device and the router. Through the first bridge device, the terminal device cannot actually access the Internet (cannot transmit data with the network server).
[0008] The second bridge device in the above router can be a bridge device for the terminal device to establish a WIFI connection with the router for surfing the Internet. Through the second bridge device, the terminal device can surf the Internet (the terminal device can transmit data with the server).
[0009] In an embodiment of the present application, when the gateway address of a bridge device (second bridge device) in a router used for a terminal device to access the Internet is modified and the terminal device needs to establish a WIFI connection with the router again, an initial WIFI connection (third WIFI connection) can be established with the router directly through the pre-acquired first gateway address, and then a final WIFI connection (fourth WIFI connection) is established with the router based on the third gateway address modified by the second bridge device. The present application can automatically establish a WIFI connection between the terminal device and the router through a user scanning operation when the gateway address of the bridge device in the router used for the terminal device to access the Internet is modified, so that the user does not need to manually enter the modified gateway address during the process of re-establishing WIFI between the terminal device and the router to achieve automatic establishment of WIFI, thereby improving the user experience.
[0010] Optionally, the router receives a third message, where the third message is used to indicate that the address of the second bridge device is changed to a third gateway address; after receiving the third message, the router changes the address of the second bridge device from the second gateway address to the third gateway address.
[0011] After the gateway address of the router is modified, the final WIFI information (the fourth WIFI connection) can be obtained through the first gateway address and connected to the fourth WIFI.
[0012] Optionally, the first request is a UDP message, and the destination address of the UDP message is the first gateway address; the first message is a response message, and the response message is a message generated by the first bridge device in response to the UDP message.
[0013] In this way, the terminal device can obtain the final WIFI information (related information of the second WIFI, related information of the fourth WIFI) etc. through a fixed path (the first gateway address). Compared with obtaining from the server, it saves costs.
[0014] Optionally, the first gateway address is obtained from the first server based on a uniform resource locator URL corresponding to the target QR code, where the URL is obtained by scanning the target QR code, and the target QR code is the QR code corresponding to the router.
[0015] In this way, the first gateway address can be obtained from the first server through the target QR code. Scan the code to enter the mini program and get the first gateway address, which is convenient and fast.
[0016] Optionally, the first WIFI SSID and the first WIFI password are obtained by scanning a target QR code, and the first WIFI SSID and the first WIFI password are determined based on attribute parameters of a router.
[0017] In this way, you can obtain the first WIFI SSID and the first WIFI password through the target QR code and connect to the first WIFI. Scan the code to enter the mini program, which is convenient and fast.
[0018] Optionally, the target QR code is a mini program code.
[0019] In this way, users can make full use of the convenient attributes of the mini program, making it convenient for ordinary users to connect and configure the router with zero threshold.
[0020] Optionally, the first WIFI connection is a local area network connection, and the third WIFI connection is a local area network connection.
[0021] Optionally, after establishing the second WIFI connection, the method also includes: the router receives a first data packet, the first data packet is sent by the terminal device based on the second WIFI connection and the second gateway address, and the first data packet is a data packet for accessing the network server through the router; the router sends a second data packet to the terminal device, and the second data packet is a response data packet generated when the network server receives the first data packet.
[0022] The second gateway address and the second WIFI can be used to interact with the Internet to enable the terminal device to access the Internet.
[0023] Optionally, after establishing the second WIFI connection, the method also includes: the router receives a third request, the third request is sent by the terminal device based on the second WIFI and the second gateway address; in response to the third request, the router sends a fourth message to the terminal device, the fourth message includes the router's Internet access method, the router's Internet access method includes: Ethernet point-to-point communication protocol PPPOE, or dynamic host configuration protocol DHCP.
[0024] In this way, the router Internet access method can be obtained through the second WIFI and the second gateway address, so that the terminal device can display the configuration interface corresponding to the subsequent Internet access method.
[0025] Optionally, the attribute parameters of the router include: a serial number SN of the router, and the first WIFI SSID and the first WIFI password are determined based on the SN.
[0026] The SN of the router is unique, and the first WIFI SSID and the first WIFI password parsed from the SN are also unique. Therefore, regardless of whether the user knows the WIFI password, the terminal device can use the first WIFI SSID and the first WIFI password to achieve a LAN connection with the router.
[0027] Optionally, before receiving the first request, the method also includes: the router receives a fourth request from the terminal device; in response to the fourth request, the router sends a fifth message to the terminal device, the fifth message includes a symmetric key, and the first message is a message generated by the router after encrypting the second WIFI SSID, the second WIFI password and the second gateway address using the symmetric key.
[0028] The symmetric key supported by the router can be obtained through the fourth request and the fifth message. In this way, the communication link between the terminal device and the router can be encrypted based on the symmetric key to ensure the security of data transmission.
[0029] Optionally, the first WIFI is 2.4G WIFI. In this way, the situation where some terminal devices that do not support 5G WIFI cannot connect can be reduced, and the practicality of the router is increased.
[0030] In the second aspect, the embodiment of the present application proposes a network connection method, which is applied to a terminal device. The method includes: the terminal device receives a first operation of a user scanning a target QR code, and the target QR code is a QR code corresponding to a router; in response to the first operation, the terminal device obtains a first WIFI SSID and a first WIFI password based on the target QR code, and the first WIFI SSID and the first WIFI password are determined based on the attribute parameters of the router; the terminal device establishes a first WIFI connection with the router based on the first WIFI SSID and the first WIFI password; after establishing the first WIFI connection, the terminal device sends a first request to the router based on the first gateway address, the first gateway address is pre-acquired by the terminal device, and the first gateway address is the address corresponding to the first bridge device in the router; the terminal device receives a first message from the router, the first message includes: the second WIFI SSID, the second WIFI password and the second gateway address, the first message is a message generated by the router in response to the first request, and the second gateway address is the address corresponding to the second bridge device in the router; the terminal device establishes a second WIFI connection with the router based on the second WIFI SSID and the second WIFI password.
[0031] After the address of the second bridge device is changed from the second gateway address to the third gateway address, the method further includes: the terminal device receives a second operation of the user scanning the target QR code; in response to the second operation, the terminal device obtains a third WIFI SSID and a third WIFI password based on the target QR code; the terminal device establishes a third WIFI connection with the router based on the third WIFI SSID and the third WIFI password; wherein the third WIFI SSID is the same as the first WIFI SSID, and the third WIFI password is the same as the first WIFI password; after establishing the third WIFI connection, the terminal device sends a second request to the router based on the first gateway address; the terminal device receives a second message from the router, the second message includes: a fourth WIFI SSID, a fourth WIFI password and a third gateway address, and the second message is a message generated by the router in response to the second request; the terminal device establishes a fourth WIFI connection with the router based on the fourth WIFI SSID and the fourth WIFI password. wherein the fourth WIFI SSID is the same as the second WIFI SSID, and the fourth WIFI password is the same as the second WIFI password.
[0032] The first bridge device in the above router may be a bridge device used to establish an initial WIFI connection between the terminal device and the router. Through the first bridge device, the terminal device cannot actually access the Internet (cannot transmit data with the network server).
[0033] The second bridge device in the above router can be a bridge device for the terminal device to establish a WIFI connection with the router for surfing the Internet. Through the second bridge device, the terminal device can surf the Internet (the terminal device can transmit data with the server).
[0034] In an embodiment of the present application, when the gateway address of a bridge device (second bridge device) in a router used for a terminal device to access the Internet is modified and the terminal device needs to establish a WIFI connection with the router again, an initial WIFI connection (third WIFI connection) can be established with the router directly through the pre-acquired first gateway address, and then a final WIFI connection (fourth WIFI connection) is established with the router based on the third gateway address modified by the second bridge device. The present application can automatically establish a WIFI connection between the terminal device and the router through a user scanning operation when the gateway address of the bridge device in the router used for the terminal device to access the Internet is modified, so that the user does not need to manually enter the modified gateway address during the process of re-establishing WIFI between the terminal device and the router to achieve automatic establishment of WIFI, thereby improving the user experience.
[0035] Optionally, after establishing the second WIFI connection, the method further includes: the terminal device receives a third operation of the user; in response to the third operation, the terminal device modifies the address of the second bridge device from the second gateway address to the third gateway address.
[0036] After the terminal device is connected to the router, the gateway address of the router can be modified. After the gateway address of the router is modified, the information of the second WIFI can be obtained through the first gateway address and connected to the second WIFI.
[0037] Optionally, the first request is a UDP message, and the destination address of the UDP message is the first gateway address; the first message is a response message, and the response message is a message generated by the first bridge device in response to the UDP message.
[0038] In this way, the terminal device can obtain the relevant information of the second WIFI through a fixed path (the first gateway address), which saves costs compared to obtaining from the server.
[0039] Optionally, the method further includes: in response to the first operation, the terminal device obtains a uniform resource locator URL based on the target QR code; and the terminal device obtains a first gateway address from the first server based on the URL.
[0040] In this way, the first gateway address can be obtained from the first server through the target QR code. Scan the code to enter the mini program and get the first gateway address, which is convenient and fast.
[0041] Optionally, the terminal device obtains a uniform resource locator URL based on the target QR code, and then the method further includes: the terminal device sends a fifth request to the first server, the fifth request includes the URL; the terminal device receives a sixth message from the first server, and displays a first prompt message in the first interface, the sixth message includes at least one interface information corresponding to the URL, and the at least one interface information includes interface information corresponding to the first interface, the sixth message is a message generated by the first server in response to the fifth request, and the first prompt message is used to prompt the terminal device to enter the code scanning connection system.
[0042] In this way, the terminal device can pull up the mini program and display the first interface through the URL obtained from the target QR code to enrich the user's experience of using the preset function. The first interface corresponds to Figure 2 The interface in .
[0043] Optionally, the target QR code is a mini program code.
[0044] In this way, users can make full use of the convenient attributes of the mini program, making it convenient for ordinary users to connect and configure the router with zero threshold.
[0045] Optionally, the first WIFI connection is a local area network connection, and the third WIFI connection is a local area network connection.
[0046] Optionally, after establishing the second WIFI connection, the method also includes: the terminal device sends a first data packet to the router based on the second WIFI connection and the second gateway address, the first data packet being a data packet for accessing the network server through the router; the terminal device receives a second data packet from the router, the second data packet being a response data packet generated when the network server receives the first data packet.
[0047] The terminal device can interact with the Internet through the second gateway address and the second WIFI to access the Internet.
[0048] Optionally, after establishing the second WIFI connection, the method also includes: the terminal device sends a third request to the router based on the second WIFI and the second gateway address; the terminal device receives a fourth message from the router, the fourth message is a message generated by the router in response to the third request, the fourth message includes the router's Internet access method, and the router's Internet access method includes: Ethernet point-to-point communication protocol PPPOE, or dynamic host configuration protocol DHCP.
[0049] In this way, the terminal device can obtain the router Internet access method through the second WIFI and the second gateway address, so as to realize the display of the configuration interface corresponding to the subsequent Internet access method.
[0050] Optionally, the attribute parameters of the router include: a serial number SN of the router, and the first WIFI SSID and the first WIFI password are determined based on the SN.
[0051] The SN of the router is unique, and the first WIFI SSID and the first WIFI password parsed from the SN are also unique. Therefore, regardless of whether the user knows the WIFI password, the terminal device can use the first WIFI SSID and the first WIFI password to achieve a LAN connection with the router.
[0052] Optionally, before sending the first request, the method also includes: the terminal device sends a fourth request to the router; the terminal device receives a fifth message from the router, the fifth message includes a symmetric key, the fifth message is a message generated by the router in response to the fourth request, and the first message is a message generated by the router after encrypting the second WIFI SSID, the second WIFI password and the second gateway address using the symmetric key.
[0053] The terminal device can obtain the symmetric key supported by the router through the fourth request and the fifth message. In this way, the communication link between the terminal device and the router can be encrypted based on the symmetric key to ensure the security of data transmission.
[0054] In a third aspect, an embodiment of the present application provides a router, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the router executes the method of the first aspect.
[0055] In a fourth aspect, an embodiment of the present application provides a terminal device, which may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
[0056] The terminal device comprises: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method as in the second aspect.
[0057] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect or the second aspect is implemented.
[0058] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the method of the first aspect or the second aspect.
[0059] In a seventh aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method described in the first aspect or the second aspect.
[0060] It should be understood that the second to seventh aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0062] Figure 2 A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0063] Figure 3 A flowchart of a network connection method provided in an embodiment of the present application;
[0064] Figure 4 A schematic diagram of the software architecture of a router in a possible design;
[0065] Figure 5 A schematic diagram of an interaction flow for a network connection failure in a possible design;
[0066] Figure 6 A schematic diagram of a network architecture provided for an embodiment of the present application;
[0067] Figure 7 A process diagram of a network connection method provided in an embodiment of the present application can also be provided;
[0068] Figure 8 A schematic diagram of a network connection process provided in an embodiment of the present application;
[0069] Fig. 9 A flowchart of a network connection method provided in an embodiment of the present application;
[0070] Fig.10 A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0071] Fig.11A A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0072] Fig. 11B A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0073] Fig.12 A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0074] Fig.13 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0075] To facilitate understanding of the embodiments of the present application, some terms involved in the present application are first briefly explained.
[0076] 1. Network interface card (NIC): A piece of computer hardware designed to allow computers to communicate on a computer network. It can also be understood as a computer hardware device that allows network connections.
[0077] The network card may also be called: a network interface controller, an Ethernet card, a local area network card, a network adapter or a network adapter card, etc. The embodiments of the present application do not limit this.
[0078] The main functions of the network card include data encapsulation and decapsulation, link management, data encoding and decoding, etc. The network card can be an intermediate medium between the computer or server and the data network. Specifically, as an interface of the TCP / IP layer, the network card can transmit signals at the physical layer and transmit data packets at the network layer.
[0079] It is understandable that each network card has a unique serial number called a hardware address (media access control address, MAC address).
[0080] According to the network connection method, network cards can include: wired network cards and wireless network cards. A wired network card requires a jumper (e.g., Ethernet jumper, fiber jumper, etc.) to connect a node to the network; a wireless network card has a small antenna and uses radio waves to communicate with an access point to access the wireless network. For example, a wired network card can correspond to an Ethernet interface (eth interface); a wireless network card can correspond to a wireless interface (wlan interface).
[0081] 2. Network bridge: A device that implements relay and forwards frames at the link layer. A network bridge can also be understood as a device used to forward data at the data link layer. A network bridge can also be called a bridge.
[0082] The bridge device can connect the interfaces corresponding to the network cards. For example, the bridge device can connect two Ethernet interfaces, or connect one Ethernet interface with one wireless interface, or connect two wireless interfaces.
[0083] A bridge device is a storage / forwarding device that connects two LANs and can forward packets purposefully based on MAC addresses. When a bridge device receives a frame, it can determine the network interface to forward the frame based on the destination MAC address in the frame. Alternatively, it can be understood that a bridge device can divide a large LAN into multiple segments, or interconnect more than two LANs into a logical LAN, so that all users on the LAN can access the server.
[0084] 3. Point to point protocol over ethernet (PPPOE) Internet access: A dial-up Internet access method using the PPPOE protocol. Usually, after the broadband is activated, the operator can provide the user who uses PPPOE Internet access with a broadband account and broadband password. The user can enter the broadband account and broadband password in the terminal device configured with the router. After the broadband account and broadband password are successfully verified, the terminal device can obtain the Internet Protocol (IP) address to access the Internet.
[0085] 4. Dynamic Host Configuration Protocol (DHCP) Internet access: A method of using the DHCP protocol and accessing the Internet based on a dynamic IP address assigned by a DHCP server. Normally, a terminal device can automatically obtain an IP address when it needs to access the Internet, and access the Internet based on the obtained IP address.
[0086] 5. Other terms
[0087] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0088] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0089] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0090] 6. Terminal equipment
[0091] The terminal device of the embodiment of the present application may also be any form of electronic device. For example, the electronic device may include a handheld device with communication function, a vehicle-mounted device, etc. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (public land mobile The embodiments of the present application do not limit this.
[0092] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0093] In addition, in the embodiments of the present application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0094] The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0095] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0096] For example, Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1As shown, the application scenario includes: a terminal device 101 and a router 102 .
[0097] The terminal device 101 can scan the mini-program code on the router 102 to open the mini-program page, and connect to the wireless fidelity (WIFI) of the router and configure the router based on the user operation on the mini-program page. Mini-programs within applications.
[0098] For example, Figure 2 A schematic diagram of an interface of a terminal device provided in an embodiment of the present application.
[0099] Open on terminal device When you use the Scan function of the application and point the camera in the terminal device at the mini program code on the router body, the terminal device can display the following Figure 5 The interface shown in a in , which may include: mini program code.
[0100] After the terminal device scans the mini program code on the router body, the terminal device can pull up the mini program page corresponding to the mini program code and display the following information: Figure 2 The interface shown in b in the figure. The interface may be the homepage of the mini program, and the interface is used to indicate that the user has opened the mini program. The interface may include one or more of the following: a text message for indicating that the user is welcome to join the XX-scan connection system, a control for exiting the mini program, or a control for forwarding the mini program, etc.
[0101] The text message for indicating that the user is welcome to join the one-scan-to-connect system can be displayed as: Welcome to join the XX one-scan-to-connect system. One-scan-to-connect (or the preset function) can be understood as when the user uses the terminal device to scan the mini program code, the terminal device can be connected to the router WIFI.
[0102] The terminal device can be Figure 2 After staying in the interface shown in b for 2 seconds, it will automatically jump to Figure 2 The interface shown in c in Figure 1 is as follows. Figure 2 The interface shown in c in FIG. 1 is used to indicate that the routing information is being synchronized. The interface may include one or more of the following: text information indicating that the routing information is being synchronized, a progress bar indicating the synchronization status of the routing information, or a graphic icon indicating that the terminal device and the router are synchronizing the routing information.
[0103] After the terminal device obtains the routing information from the router, the terminal device can Figure 2 The interface shown in c in the figure switches to Figure 2 The interface shown in d in the figure. Figure 2The interface shown in d in the figure is used to indicate that the terminal device has obtained the routing information. The interface may include one or more of the following: an identifier 201 for indicating that the device is connected to the router WIFI, text information for indicating that the routing information has been synchronized, a text identifier for indicating that the terminal device and the router have completed information synchronization, a text identifier for indicating that the router WIFI is connected in the second step, or a graphic representation for indicating that the terminal device and the router have completed routing information synchronization.
[0104] The identifier 201 is used to indicate that the terminal device has been connected to the first WIFI of the router. The specific description of the first WIFI can be found in the following Figure 3 The corresponding embodiments.
[0105] In a possible implementation, the logo 201 may also be displayed in Figure 2 The interface shown in c can be understood as the terminal device being connected to the first WIFI of the router during the process of synchronizing the routing information.
[0106] Typically, the time for a terminal device to synchronize routing information can be 6 seconds or so, that is, the terminal device is Figure 2 The interface shown in c in the figure switches to Figure 2 The duration of the interface shown in d may be 6 seconds, etc.
[0107] Further, when the terminal device determines that the router has been configured based on the routing information, the terminal device can Figure 2 The interface shown in d in the figure switches to Figure 2 In the interface shown in e, the Figure 2 The interface shown in e in the figure is used to indicate that the terminal device is connecting to the router WIFI. The terminal device can display the following after connecting to the router WIFI: Figure 2 The interface shown in f in the figure is used to indicate that the terminal device has been connected to the router WIFI.
[0108] Combine the following Figure 3 right Figure 2 The interaction between the terminal device and the router during the network connection process shown is explained.
[0109] For example, Figure 3 A schematic diagram of a network connection method provided in an embodiment of the present application. Figure 3 As shown, the network connection methods include:
[0110] S301, the terminal device receives the operation of the user scanning the mini-program code on the router body.
[0111] The body of the router may be affixed with a mini-program code, which may be generated by the mini-program uniform resource locator (URL) and the router serial number (SN), so the terminal device may obtain the mini-program URL and the router SN by scanning the mini-program code.
[0112] It is understandable that the router SN is unique, so the mini-program code is also unique, that is, one router can correspond to one mini-program code. The WIFI carried by the mini-program code can be non-hidden, that is, the user can search for the WIFI corresponding to the router through the terminal device. If the WIFI carried by the mini-program is hidden, the terminal device cannot successfully connect to the router WIFI.
[0113] S302: In response to the user scanning the mini-program code on the router body, the terminal device obtains the mini-program URL and the router SN from the mini-program code.
[0114] S303: The terminal device uses the mini-program URL to pull the mini-program page from the first server.
[0115] The first server can be understood as Application public platform, used for terminal devices The application provides a mini-program page. For example, the terminal device may send a request to the first server for obtaining the mini-program page, which may include the mini-program URL, and the first server may return the pre-stored mini-program page to the terminal device, so that the terminal device can pull up the mini-program page from the server according to the mini-program URL parsed in the mini-program code.
[0116] S304: The first server returns page information corresponding to the mini-program to the terminal device.
[0117] Among them, the page information corresponding to the mini program may include: page information corresponding to any interface in the mini program described in the embodiments of the present application, such as page information corresponding to the homepage of the mini program.
[0118] Exemplarily, after receiving the page information corresponding to the mini-program, the terminal device may perform rendering and other operations according to the page information, so that the terminal device can display different interface contents in the mini-program.
[0119] S305. The terminal device displays the homepage of the mini-program and uses the SN to calculate a first WIFI service set identifier (SSID) and a first WIFI password.
[0120] The homepage of the mini program can be Figure 2 The interface shown in b.
[0121] The first WIFI may be the initial WIFI of the router or called a fixed WIFI. The first WIFI SSID and the first WIFI password are both obtained based on SN resolution, so the first WIFI SSID and the first WIFI password are also unique.
[0122] It is understandable that the first WIFI SSID and the first WIFI password are determined based on the attribute parameter SN of the router, so the user is not allowed to modify the first WIFI SSID and the first WIFI password at will.
[0123] S306: The terminal device sends a request for connecting to the first WIFI of the router to the router.
[0124] The request for connecting to the first WIFI of the router may include: a first WIFI SSID and a first WIFI password.
[0125] S307: The router returns a message indicating that the first WIFI connection is successful to the terminal device.
[0126] It can be understood that, since the first WIFI SSID and the first WIFI password are fixed, the terminal device can use the first WIFI to access the local area network of the router, and the first WIFI SSID and the first WIFI can serve as a bridge to realize data interaction between the terminal device and the router.
[0127] In this scenario, the router has been configured with security settings in the firewall so that the terminal device can communicate with the router over the LAN but cannot connect to the Internet.
[0128] S308: The terminal device sends a request for obtaining routing information to the router.
[0129] The routing information may be information obtained from the router, and the routing information may include one or more of the following: the second WIFI SSID, the second WIFI password, the gateway address, the Internet access status, or information indicating whether the router wizard configuration is completed in the router.
[0130] The second WIFI can be understood as the real WIFI of the router or the modifiable WIFI. Usually, the user can modify the second WIFI SSID to a name that is easy to identify. The second WIFI SSID can be the same as or different from the first WIFI SSID. The embodiment of the present application does not specifically limit the second WIFI SSID.
[0131] In some embodiments, the second WIFI password can be set according to user habits. For example, the second WIFI SSID is the same as the first WIFI SSID. Usually, the user can modify the second WIFI SSID to a name that is easy to identify, and the second WIFI SSID is different from the first WIFI SSID; or, the user may not modify the second WIFI SSID, and the second WIFI SSID is the same as the first WIFI SSID.
[0132] The Internet access status may include: network connected, network disconnected, etc. The router wizard configuration may be understood as setting the Internet access mode of the router, so that the router can directly connect to the router to access the Internet after scanning the mini program code.
[0133] It is understandable that, when the terminal device has not configured the router, the routing information may not include: the second WIFI SSID and the second WIFI password, and the information for indicating whether the router wizard configuration is completed may be an incomplete router wizard configuration.
[0134] In some embodiments, the terminal device sends a UDP message to the router to obtain routing information.
[0135] S309: The router returns routing information to the terminal device.
[0136] Suitably, after the terminal device receives the routing information returned by the router, the terminal device can display the following information: Figure 2 Further, the terminal device can use the second WIFI SSID and the second WIFI password in the routing information to connect to the router WIFI, for example, by executing the step shown in S310.
[0137] In a possible implementation, when the terminal device determines that the user has performed the wizard configuration based on the information in the routing information indicating whether the router wizard configuration is completed, the terminal device can connect to the router WIFI based on the second WIFI SSID and the second WIFI password, for example, executing the steps shown in S310.
[0138] S310: The terminal device sends a request for connecting to a second WIFI of the router to the router. The request for connecting to the second WIFI of the router may include: a second WIFI SSID and a second WIFI password.
[0139] Adaptively, the router returns a message to the terminal device indicating that the second WIFI connection is successful. When the terminal device receives the message indicating that the second WIFI connection is successful, the terminal device can determine that it has been successfully connected to the router WIFI.
[0140] In this way, the terminal device can quickly connect to the router WIFI by scanning the small program code on the router body, reducing a series of complex operations such as searching WIFI and entering WIFI passwords.
[0141] Compared to storing the router's WIFI SSID and WIFI password in the cloud, the router connection method described in the embodiment of the present application can use the SN in the mini-program code to obtain the first WIFI SSID and the first WIFI password, without the need for cloud participation, thus saving resource consumption.
[0142] However, the above Figure 3 The method shown uses guessing to obtain the gateway address. In some scenarios, the guessed gateway address may be incorrect, causing the terminal device to be unable to communicate with the router and thus unable to connect to the Internet. In some scenarios, the user can modify the gateway address through the settings page, or other abnormal situations may cause the gateway address to be modified, or the gateway address is not 1 by default.
[0143] For ease of understanding, the following Figure 4 The network architecture in describes the gateways involved in the network connection process.
[0144] For example, Figure 4 Figure 1 is a schematic diagram of the software architecture of a router in a possible design. Figure 4 As shown, the software architecture of the router includes: application layer, transport layer, network layer, link layer and physical layer.
[0145] The application layer is where network applications and their application layer protocols reside. Application layer protocols are distributed on multiple end systems, and applications in two end systems use application layer protocols to exchange information packets. This information packet at the application layer is called a message.
[0146] Application layer protocols include: Hyper text transfer protocol (HTTP), simple mail transfer protocol (SMTP), file transfer protocol (FTP), domain name system (DNS), etc.
[0147] HTTP provides the request and transmission of web documents; SMTP provides the transmission of email messages; FTP provides file transfer between two end systems; DNS converts end system names into 32-bit network addresses.
[0148] The transport layer transmits application layer messages between application endpoints. The packets at the transport layer are called segments. The transport layer protocol in a source host delivers the transport layer segments and destination addresses to the network layer.
[0149] Transport layer protocols include: transmission control protocol (TCP), user datagram protocol (UDP), etc.
[0150] The TCP protocol provides connection-oriented services to its applications. This service includes guaranteed delivery of application layer messages to the destination and flow control (i.e. sender / receiver rate matching). TCP also divides long messages into short messages and provides congestion control mechanisms so that when the network is congested, the source suppresses its transmission rate.
[0151] The UDP protocol provides a connectionless service to its applications. This is a service that does not provide unnecessary services, no reliability, no flow control, and no congestion control.
[0152] Network layer: responsible for sending data from one host to another. Network layer data packets are called datagrams.
[0153] Network layer protocols include: Internet protocol (IP protocol), routing protocol, etc.
[0154] IP protocol: This protocol defines the fields in a datagram and how end systems and routers act on these fields. There is only one IP, and all Internet components with a network layer must run IP.
[0155] Routing protocols: The routes by which datagrams are transmitted from source to destination can provide routers with the mutually shared routing information needed to establish the best path through the mesh network.
[0156] Link layer: The network layer routes datagrams through a series of routers between the source and the destination. In order to move packets from one node to the next node on the path, the network layer must rely on the services of the link layer. Specifically, at each node, the network layer passes the datagram down to the link layer, which passes the datagram to the next node along the path. At this next node, the link layer passes the datagram up to the network layer. Link layer packets are called frames.
[0157] The link layer of a router can be composed of bridge devices, network cards, etc. Frame forwarding is achieved through bridge devices, thereby realizing data communication transmission.
[0158] A bridge device can correspond to one or more network cards. The terminal devices connected to the network cards corresponding to the same bridge device are in the same local area network. A bridge device can be understood as a gateway.
[0159] like Figure 4 As shown in the figure, the router is equipped with a bridge device br0. The bridge device br0 corresponds to: wired network card eth0, wireless network card wlan0 and wireless network card wlan1.
[0160] The WIFI corresponding to the wireless network card wlan0 can be 2.4G WIFI, or 5G WIFI, etc. The WIFI corresponding to the wireless network card wlan1 can be 5G WIFI, or 2.4G WIFI, etc. The embodiment of the present application does not limit the specific frequency band of the WIFI signal corresponding to the wireless network card.
[0161] It is understandable that the frequency range of 2.4G WIFI is 2.4GHz-2.4835GHz, and the frequency range of 5G WIFI is 5.15GHz-5.825GHz. The embodiment of the present application does not specifically limit the WIFI frequency band corresponding to the wireless network card.
[0162] If the terminal device connected to the wireless network card wlan0 fails to obtain the gateway address of the bridge device br0, the terminal device may not be able to obtain the routing information of the router and connect to the Internet.
[0163] Physical layer: It uses transmission media (e.g., twisted-pair copper wire, single-mode optical fiber, etc.) to provide physical connections for the link layer and is responsible for handling data transmission (e.g., moving individual bits in a frame from one node to the next). This layer is the data transmission medium for network communications and is composed of cables and devices connecting different nodes.
[0164] The physical layer includes: multiple downstream devices. The downstream devices can be terminal devices connected to the router.
[0165] Combine the following Figure 3 and Figure 4 Describes the network connection process.
[0166] The terminal device can obtain the mini-program URL and router SN by scanning the mini-program code on the router body; obtain and display the mini-program page through the URL, connect to the wireless network card in the router (for example, wlan0 or wlan1) through the router SN, and then connect the terminal device to the local area network where the router is located.
[0167] After connecting to the LAN where the router is located, the terminal device sends a UDP message to the router to request routing information. The UDP message sent by the terminal device is sent to the corresponding driver through the connected wireless network card, and then sent to the network layer-transport layer-application layer through the corresponding bridge device (for example, bridge device br0). The router processes the received message and forwards the response message from the application layer-transport layer-network layer-driver-physical network card to the terminal device.
[0168] It should be noted that after the terminal device accesses the router's LAN by scanning the small program code on the router body, the terminal device and the router are in the same network segment and can communicate directly. When the terminal device connects to the Internet through the router, the terminal device also needs to obtain the address (gateway address) of the bridge device in the router used to connect to the Internet.
[0169] Usually, the default gateway address of the router usually ends with 1, and the terminal device can try to guess the gateway address based on the network segment where the terminal device is located and the default ending 1. In the above S308, the terminal device sends a message for obtaining routing information to the router according to the guessed gateway address.
[0170] If the gateway address of the router ends with 1, the terminal device can obtain routing information based on the guessed gateway address. If the gateway address of the router does not end with 1, the terminal device cannot obtain routing information based on the guessed gateway address and thus cannot connect to the Internet.
[0171] Exemplarily, taking the router as segment 3 as an example, when the terminal device is connected to the local area network where the router is located, the IP address obtained by the terminal device is 192.168.3.3.
[0172] If the default gateway address of the router is 192.168.3.1, the terminal device sends a UDP message to 192.168.3.1, the message can reach br0 of the router and get a response message.
[0173] If the default gateway address of the router is 192.168.3.2, the terminal device sends a UDP message to 192.168.3.2, but the message cannot reach br0 of the router, and the terminal device cannot get the response message from the router.
[0174] It should be noted that the gateway address of the router may end with any integer between 1 and 254. In some embodiments, the default gateway address of the router may not end with 1. In other embodiments, the gateway address of the router may be changed, and the changed gateway address may not end with 1. Exemplarily, after the terminal device is connected to the Internet through the router, it may receive an operation for instructing to change the gateway address corresponding to the router, and then the gateway address of the router is changed and may not end with 1.
[0175] For example, Figure 5 Figure 1 is a schematic diagram of the interaction process of a possible design with network connection failure. Figure 5 As shown, the interaction process includes:
[0176] S501, the terminal device receives the operation of the user scanning the mini-program code on the router body.
[0177] S502: In response to the user scanning the mini-program code on the router body, the terminal device displays the homepage of the mini-program and connects to the first WIFI of the router according to the mini-program code.
[0178] For details, please refer to the above S302-S307, which will not be described in detail here.
[0179] The terminal device obtains the applet URL and the router SN from the applet code. The terminal device uses the applet URL to pull the applet page from the first server. The first server returns the applet page to the terminal device. The terminal device displays the homepage of the applet and calculates the first WIFI SSID and the first WIFI password using the SN. The terminal device sends a request to the router for connecting to the first WIFI of the router. The router returns a message to the terminal device indicating that the first WIFI connection is successful.
[0180] S503: The terminal device sends a request for obtaining routing information to the router according to the guessed gateway address.
[0181] S504: The router returns routing information to the terminal device.
[0182] It is understandable that when a terminal device is connected to the local area network where the router is located, the terminal device obtains an IP address.
[0183] For example, if the IP address of the terminal device is 192.168.3.2, the terminal device guesses that the gateway address of the router is 192.168.3.1. The terminal device sends a request for obtaining routing information based on 192.168.3.1. When the gateway address is correct, the router returns the routing information to the terminal device.
[0184] S505: The terminal device sends a request for connecting to the second WIFI of the router to the router.
[0185] Adaptively, the router returns a message to the terminal device indicating that the second WIFI connection is successful.
[0186] If the gateway address of the router changes, the terminal device and the router execute the following S508-S510.
[0187] It is understandable that the gateway address of the router can be modified by the terminal device in the embodiment of the present application, or by other terminal devices connected to the router, and the embodiment of the present application does not limit the way of modifying the gateway address of the router. Exemplarily, the modification process includes: S506 and S507.
[0188] S506: The second server sends the modified gateway address to the router.
[0189] The second server may be a server for setting router-related parameters, and the router-related parameters include but are not limited to: a second gateway address, a second WIFI SSID, and the like.
[0190] It is understandable that the second server can send the modified gateway address to the router after receiving the message of the modified gateway address from the terminal device; the second server can send the modified gateway address to the router after receiving the message of the modified gateway address from other terminal devices connected to the router.
[0191] In some embodiments, the second server may be a browser server, and the second gateway address may be modified by entering the router management page through the browser on the terminal device. The second server sends a message requesting modification of the second gateway address to the router.
[0192] S507: The router sends a message to the server indicating that the modification is successful.
[0193] S508: The terminal device receives the user's operation of scanning the mini-program code on the router body.
[0194] S509. In response to the user scanning the mini-program code on the router body, the terminal device displays the homepage of the mini-program and connects to the first WIFI of the router.
[0195] For details, please refer to the above S302-S307, which will not be described in detail here.
[0196] The terminal device obtains the applet URL and the router SN from the applet code. The terminal device uses the applet URL to pull the applet page from the first server. The first server returns the applet page to the terminal device. The terminal device displays the homepage of the applet and calculates the first WIFI SSID and the first WIFI password using the SN. The terminal device sends a request to the router for connecting to the first WIFI of the router. The router returns a message to the terminal device indicating that the first WIFI connection is successful.
[0197] S510: The terminal device sends a request for obtaining routing information to the router.
[0198] For example, if the IP address of the terminal device is 192.168.3.2 and the modified gateway address is 192.168.3.5, the terminal device guesses that the gateway address of the router is 192.168.3.1. The terminal device sends a request for obtaining routing information based on 192.168.3.1. When the gateway address is incorrect, the router does not receive the request for obtaining routing information sent by the terminal device, cannot return routing information, and cannot connect to the Internet.
[0199] In view of this, the embodiment of the present application provides a network connection method and related devices. After connecting to the first WIFI, the routing information is obtained through a bridge device with a fixed gateway address. The second WIFI is connected through the routing information, and then connected to the Internet.
[0200] In this way, when the gateway address corresponding to the second WIFI changes, the terminal device can obtain routing information through the first WIFI, and then obtain the gateway address corresponding to the second WIFI to achieve network connection.
[0201] Specifically, the terminal device can first establish a local area network connection with the router by directly scanning the target QR code preset in the router, and then automatically obtain the WIFI connection information that can access the Internet through the local area network connection, and then establish a WIFI connection that can access the Internet through the router. Users only need to scan the target QR code preset in the router, and do not need to actively enter information such as the WIFI password to achieve automatic WIFI connection, which brings a better connection experience to users.
[0202] The terminal device first establishes a local area network connection with the router through the first WIFI SSID and the first WIFI password parsed from the target QR code, thereby initially establishing a connection with the router. After the connection is established, the terminal device can obtain WIFI connection information that can access the Internet from the router through the local area network (first gateway address), such as the second WIFI SSID and the second WIFI password. After connecting to the router using the WIFI connection information that can access the Internet, the terminal device can connect to the network server through the router to access the Internet.
[0203] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0204] For ease of understanding, the software architecture of the router provided in the embodiment of the present application is described below. Figure 6 A schematic diagram of a network architecture provided in an embodiment of the present application. Figure 6 As shown, the network architecture includes: application layer, transport layer, network layer, link layer and physical layer.
[0205] The application layer, transport layer, network layer, link layer and physical layer can refer to the above Figure 4 The relevant instructions will not be repeated here.
[0206] like Figure 6 As shown, the router is set with bridge devices br0 and br2. Bridge device br0 corresponds to: wired network card eth0, wireless network card wlan0 and wireless network card wlan1. Bridge device br2 corresponds to wireless network card wlan1.5. The gateway address corresponding to bridge device br2 cannot be changed and is preset on the mini-program page or in the mini-program code.
[0207] Exemplarily, the relevant information of the bridge device br0 in the router may be as follows:
[0208] Link encap: Ethernet HWaddr: 42:AC:73:F7:4C:57
[0209] Intnet addr: 192.168.3.1 Bcast: 192.168.3.255 Mask: 255.255.255.0
[0210] Inet6 addr: fe80::40ac:73ff:fef7:4c57 / 64 Scope: Link
[0211] UP BROADCAST RUNNING NULTICAST MTU: 1500 Metric: 1
[0212] RX packets: 49745 errors: 0 dropped: 12 overruns: 0 frame: 0
[0213] TX packets: 34438 errors: 0 dropped: 0 overruns: 0 carrier: 0
[0214] Conflict: 0 Transmit queue length (txqueuelen): 1
[0215] Receive bytes (RX bytes): 19450873 (18.5KiB) Transmit bytes (TX bytes): 13071361 (12.4KiB)
[0216] The relevant information of the bridge device br2 can be shown as follows:
[0217] Link encap: Ethernet HWaddr: 42:AC:73:F7:4C:6B
[0218] inet addr:192.168.188.1Bcast:192.168.188.255Mask:255.255.255.0
[0219] inet6 addr:fe80::3cf1:dff:fae8:bd99 / 64scope:Link
[0220] UP BROADCAST RUNNING NULTICAST MTU:1500Metric:1
[0221] RX packets:1400errors:0dropped:0overruns:0frame:0
[0222] TX packets:258errors:1dropped:1overruns:1carrier:0
[0223] collision: 0 txqueuelen: 1
[0224] RX bytes: 155375 (151.7KiB) TX bytes: 81632 (79.7KiB)
[0225] It can be understood that the intranet address (inet addr) is the gateway address.
[0226] The WIFI corresponding to the wireless network card wlan0 can be 2.4GWIFI, or 5GWIFI, etc. The WIFI corresponding to the wireless network card wlan1 can be 5GWIFI, or 2.4GWIFI, etc. The WIFI corresponding to the wireless network card wlan1.5 can be 2.4GWIFI, or 5GWIFI, etc. The embodiment of the application does not specifically limit the WIFI signal corresponding to the wireless network card.
[0227] In some embodiments, the WIFI corresponding to the wireless network card wlan1.5 is 2.4G WIFI. In this way, there are more terminal devices that support 2.4G WIFI, which can reduce the situation where some terminal devices that do not support 5G WIFI cannot connect to the first WIFI, and increase the practicality of the router. It is understandable that terminal devices that support 5G WIFI usually support 2.4G WIFI; while terminal devices that support 2.4G WIFI may not necessarily support 5G WIFI.
[0228] In the embodiment of the present application, the terminal device is connected to the first WIFI of the router through the applet code, and the routing information can be obtained through the gateway address corresponding to the preset bridge device br2. Connect to the second WIFI according to the routing information. When the gateway address of the bridge device br0 changes, the terminal devices connected to the multiple network cards corresponding to the bridge device can also connect to the Internet.
[0229] Combine the following Figure 6 Describes the network connection process.
[0230] The terminal device can obtain the mini-program URL and router SN by scanning the mini-program code on the router body; obtain and display the mini-program page through the URL, connect to the first WIFI through the router SN, and then connect to the wireless network card corresponding to the bridge device br2 in the router (for example, wlan1.5).
[0231] After connecting to the first WIFI, the terminal device sends a UDP message to the router according to the gateway address corresponding to the bridge device br2 to request routing information. The UDP message sent by the terminal device will be sent to the driver layer by the connected wireless network card, and then sent to the network layer-transport layer-application layer through the corresponding bridge device (for example, bridge device br2). The router processes the received message and forwards the response message from the application layer-transport layer-network layer-driver layer-physical network card to the terminal device.
[0232] For example, Figure 7 A process diagram of a network connection method provided in an embodiment of the present application can also be shown. Figure 7 As shown, the method includes:
[0233] S701. The terminal device receives an operation in which a user scans a small program code on a router body.
[0234] S702: In response to the user scanning the mini-program code on the router body, the terminal device displays the homepage of the mini-program and connects to the first WIFI of the router.
[0235] Specifically, the terminal device obtains the applet URL and the router SN from the applet code. The terminal device uses the applet URL to pull the applet page from the first server. The first server returns the applet page to the terminal device. The terminal device displays the homepage of the applet and uses the SN to calculate the first WIFI SSID and the first WIFI password. The terminal device sends a request to the router for connecting to the first WIFI of the router. The router returns a message to the terminal device indicating that the first WIFI connection is successful. For detailed descriptions, please refer to S302-S307 above, which will not be repeated here.
[0236] In some embodiments, the first WIFI is 2.4G WIFI. In this way, the situation where some terminal devices that do not support 5G WIFI cannot connect can be reduced, thereby increasing the practicality of the router.
[0237] For example, Figure 6 Taking the router shown as an example, the first WIFI is the WIFI corresponding to the wireless network card wlan1.5.
[0238] After S702, the terminal device can send a request for obtaining an IP address to the router based on the first gateway address, and the bridge device corresponding to the first gateway address in the router, such as br2, can allocate the first IP address to the terminal device. In the case where the terminal device sends a message to the router based on the first IP address and the gateway IP address corresponding to br2, br2 can forward the message; further, the forward checkpoint in the firewall can intercept the message reported by br2 to prevent the terminal device from connecting to the Internet through the first WIFI. Among them, the first gateway address can be set by default in the terminal device.
[0239] S703: The terminal device sends a request for obtaining routing information to the router according to the first gateway address.
[0240] The first gateway address can be preset in the mini program code or in the mini program page. The embodiment of the present application does not limit the method for obtaining the first gateway address.
[0241] In some embodiments, the terminal device obtains the applet URL and the router SN from the applet code. The terminal device obtains the first gateway address from the first server using the applet URL.
[0242] In other embodiments, the terminal device obtains the mini-program URL, the router SN and the first gateway address from the mini-program code.
[0243] In some embodiments, the terminal device sends a UDP message to the router, and the destination address of the UDP message is the first gateway address. Adaptively, after receiving the UDP message, the router obtains the second gateway address stored in the router. The router sends a reply message to the terminal device. The reply message includes routing information carrying the second gateway address.
[0244] The second gateway address may be stored in a module with a storage function in the router. The embodiment of the present application does not limit the storage location of the second gateway address.
[0245] For example, Figure 6 Taking the router shown as an example, the first gateway address is the gateway address corresponding to the bridge device br2.
[0246] Taking the first gateway address as 192.168.188.1 as an example, the address corresponding to the request for obtaining routing information is 192.168.188.1. After receiving the request for obtaining routing information, the bridge device br2 obtains the second gateway address stored in the router.
[0247] S704. The router returns routing information to the terminal device, where the routing information includes: a second gateway address.
[0248] For example, Figure 6 Taking the router shown as an example, the second gateway address is the gateway address corresponding to the bridge device br0.
[0249] S705: The terminal device sends a request for connecting to the second WIFI of the router to the router according to the second gateway address.
[0250] The second WIFI is the WIFI corresponding to the wireless network card wlan0, or the WIFI corresponding to the wireless network card wlan1.
[0251] Taking the second gateway address as 192.168.3.1 as an example, the address corresponding to the request for connecting to the second WIFI of the router in S705 is 192.168.3.1.
[0252] S706: The router returns a message to the terminal device indicating that the second WIFI connection is successful.
[0253] Exemplarily, the terminal device is connected to the Internet via the bridge device br0.
[0254] If the gateway address of the router changes, the terminal device and the router execute the following S709-S714.
[0255] It is understandable that the gateway address of the router can be modified by the terminal device in the embodiment of the present application, or by other terminal devices connected to the router, and the embodiment of the present application does not limit the way of modifying the gateway address of the router. Exemplarily, the modification process includes: S707 and S708.
[0256] After S706, the terminal device can send a request to the router for obtaining an IP address, and br0 in the router can allocate a second IP address to the terminal device. When the terminal device sends a message to the router based on the second IP address and the gateway IP address corresponding to br0, br0 can forward the message; further, the forward checkpoint in the firewall can forward the message reported by br2 and forward it to the network server, so that the terminal device can connect to the Internet through the second WIFI.
[0257] Exemplarily, based on the second WIFI connection, the terminal device sends a first data packet to the router, and the router can send the first data packet to the network server; adapted, the network server can respond to the received first data packet and generate a second data packet corresponding to the first data packet, and then the network data packet can return the second data packet to the terminal device through the router, so that the terminal device can access the Internet through the second WIFI connection. It can be understood that the first data packet is a data packet that accesses the network server through the router, and the second data packet is a response data packet generated when the network server receives the first data packet.
[0258] In a possible implementation, the terminal device may close the first WIFI connection after establishing the second WIFI connection. For example, the terminal device sends a request to close the first WIFI connection to the router, and the router returns a message to the terminal device indicating that the first WIFI connection is successfully closed.
[0259] S707: The second server sends the modified second gateway address to the router.
[0260] Adaptively, the router stores the modified second gateway address.
[0261] The modified second gateway address may come from a terminal device or other terminal devices connected to the router.
[0262] In some embodiments, the second server may be a server of a browser, and the router management page may be accessed through the browser, and the local area network page may be accessed through the network setting selection item in the router management page, and the second gateway address may be modified in the local area network page. The second server sends a message requesting modification of the second gateway address to the router to modify the second gateway address of the router.
[0263] S708: The router sends a message to the second server indicating that the modification is successful.
[0264] If the gateway address of the router is modified, when the terminal device connects to the router again, the interaction process is as shown in S709-S712 below.
[0265] S709: The terminal device receives the user's operation of scanning the mini-program code on the router body.
[0266] S710. In response to the user scanning the mini-program code on the router body, the terminal device displays the homepage of the mini-program and connects to the local area network where the router is located.
[0267] S711. The terminal device sends a request for obtaining routing information to the router according to the preset gateway address.
[0268] S712: The router returns routing information to the terminal device, wherein the routing information includes the modified second gateway address.
[0269] Taking the modified second gateway address as 192.168.3.5 as an example, the gateway address in the routing information in S713 is 192.168.3.5.
[0270] S713: The terminal device sends a request to the router for connecting to the second WIFI of the router.
[0271] Taking the modified second gateway address as 192.168.3.5 as an example, the address corresponding to the request for connecting to the second WIFI of the router in S714 is 192.168.3.5.
[0272] S714: The router returns a message to the terminal device indicating that the second WIFI connection is successful.
[0273] In this way, when the gateway address is changed, the terminal device can be connected to the Internet. In addition, compared with obtaining pre-stored routing information from a cloud server, the method provided by the embodiment of the present application is low in cost and high in practicality.
[0274] For example, Figure 8 A schematic diagram of a network connection process provided by an embodiment of the present application. Figure 8 As shown, the method includes:
[0275] S801. The terminal device establishes a local area network connection with the first WIFI of the router based on the first WIFI SSID and the first WIFI password.
[0276] The acquisition of the first WIFI SSID and the first WIFI password may refer to the above S301-S305. The first WIFI SSID and the first WIFI password may also be acquired in other ways, which are not limited in the embodiment of the present application.
[0277] S802. The terminal device obtains the second gateway address of the router based on the first gateway address.
[0278] In the embodiment of the present application, the router can intercept the message reported by the first bridge device corresponding to the first gateway address to prevent the terminal device from connecting to the Internet through the first WIFI. The router does not intercept the message reported by the second bridge device corresponding to the second gateway address, and the terminal device connects to the Internet through the second WIFI.
[0279] In some embodiments, S802 includes: S8021-S8023.
[0280] S8021. After the terminal device establishes a local area network connection with the first WIFI of the router, the terminal device sends a UDP message to the router, where the UDP message is used to obtain the second gateway address. The target address of the UDP message is the first gateway address.
[0281] S8022. After receiving the UDP message, the first bridge device in the router obtains the second gateway address, the second WIFI SSID and the second WIFI password.
[0282] The first network bridge device may obtain the second gateway address from a module with a storage function. Alternatively, the first network bridge device stores the second gateway address.
[0283] S8023. The first network bridge device sends a reply message to the terminal device, where the reply message includes the second gateway address, the second WIFI SSID, and the second WIFI password.
[0284] The terminal device can obtain the second gateway address for Internet access through the first bridge device. In this way, if the second gateway address is changed, the terminal device can obtain the changed second gateway address and connect to the Internet through the router. In addition, if the gateway address is changed, the terminal device can obtain the second WIFI SSID and the second WIFI password through the first gateway address, and then connect to the second WIFI.
[0285] S803, the terminal device establishes a connection with the second WIFI of the router based on the second WIFI SSID and the second WIFI password. Adaptively, after the terminal device establishes a connection with the second WIFI of the router, it can communicate with the Internet through the second gateway address. Exemplarily, the terminal device can perform operations such as configuring the router and surfing the Internet through the second gateway address.
[0286] It is understandable that after the terminal device establishes a LAN connection with the router, it can obtain a new gateway address. The terminal device can connect to the Internet through the new gateway address for network communication. In this way, after the gateway address used for Internet access is modified or is not the default gateway address, the terminal device can connect to the Internet through the router. In addition, compared with the method of storing the gateway address for Internet access in the cloud server, the cost is lower.
[0287] For example, Fig. 9 A schematic diagram of a network connection method provided in an embodiment of the present application. Fig. 9 As shown, the method includes:
[0288] S901. The terminal device receives an operation in which a user scans a small program code on a router body.
[0289] The body of the router may be affixed with a mini-program code, which may be generated by the mini-program uniform resource locator (URL) and the router serial number (SN), so the terminal device may obtain the mini-program URL and the router SN by scanning the mini-program code.
[0290] It is understandable that the router SN is unique, so the mini-program code is also unique, that is, one router can correspond to one mini-program code. The WIFI carried by the mini-program code can be non-hidden, that is, the user can search for the WIFI corresponding to the router through the terminal device. If the WIFI carried by the mini-program is hidden, the terminal device cannot successfully connect to the router WIFI.
[0291] S902. In response to the user scanning the mini-program code on the router body, the terminal device obtains the mini-program URL and the router SN from the mini-program code.
[0292] S903: The terminal device uses the mini-program URL to pull the mini-program page from the server.
[0293] The first server can be understood as Application public platform, used for terminal devices The application provides a mini-program page. For example, the terminal device may send a request to the first server for obtaining the mini-program page, which may include the mini-program URL, and the first server may return the pre-stored mini-program page to the terminal device, so that the terminal device can pull up the mini-program page from the server according to the mini-program URL parsed in the mini-program code.
[0294] S904: The server returns page information corresponding to the mini-program to the terminal device.
[0295] S905. The terminal device displays the homepage of the mini program and uses the SN to calculate the first WIFI SSID and the first WIFI password.
[0296] The homepage of the mini program can be Figure 2 The interface shown in b.
[0297] The first WIFI may be the initial WIFI of the router or a fixed WIFI. The first WIFI SSID and the first WIFI password are set by the router when it leaves the factory and are not allowed to be modified by the user at will. In addition, the first WIFI SSID and the first WIFI password may be calculated by the router SN.
[0298] The gateway address corresponding to the first WIFI is set by the router when it leaves the factory and users are not allowed to modify it at will.
[0299] S906: The terminal device sends a request for connecting to the first WIFI of the router to the router.
[0300] The request for connecting to the first WIFI of the router may include: a first WIFI SSID and a first WIFI password.
[0301] S907: The router returns a message indicating that the first WIFI connection is successful to the terminal device.
[0302] It is understandable that, since the first WIFI SSID and the first WIFI password are fixed, the terminal device can use the first WIFI to access the LAN of the router, and the first WIFI SSID and the first WIFI can serve as a bridge to achieve data interaction between the terminal device and the router. In this scenario, the router has been set up with security in the firewall so that the terminal device and the router can communicate in the LAN, but cannot connect to the Internet.
[0303] S908: The terminal device sends a request for obtaining routing information to the router according to the first gateway address.
[0304] The routing information may be information obtained from the router, and the routing information may include one or more of the following: the second WIFI SSID, the second WIFI password, the second gateway address, the Internet access status, or information indicating whether the router wizard configuration is completed in the router.
[0305] The second WIFI can be understood as the real WIFI of the router or the modifiable WIFI. Usually, the user can modify the second WIFI SSID to a name that is easy to identify. The second WIFI SSID can refer to the above corresponding description, which will not be repeated here.
[0306] The online status may include: network connected, network disconnected, etc.
[0307] S909: The router returns routing information to the terminal device, wherein the routing information includes the second gateway address.
[0308] Suitably, after the terminal device receives the routing information returned by the router, the terminal device can display the following information: Figure 2 Further, the terminal device can use the second gateway address, the second WIFI SSID and the second WIFI password in the routing information to connect to the second WIFI of the router, for example, by executing the step shown in S811.
[0309] S910: The terminal device sends a request for connecting to a second WIFI of the router to the router.
[0310] The request for connecting to the second WIFI of the router may include: a second WIFI SSID and a second WIFI password.
[0311] S911. The router returns a message indicating that the second WIFI connection is successful to the terminal device.
[0312] Suitably, when the terminal device receives a message indicating that the second WIFI connection is successful, the second device may determine that it has been successfully connected to the router WIFI.
[0313] It is understandable that, since users usually modify the first WIFI SSID and the first WIFI password to obtain the second WIFI SSID and the second WIFI password, when the terminal device is connected to the router, the terminal device cannot directly obtain the second WIFI SSID and the second WIFI password modified by the user.
[0314] Therefore, the terminal device can effectively access the router through the fixed first WIFI SSID and the first WIFI password, and then further obtain the second WIFI SSID and the second WIFI password to connect to the router WIFI. Among them, the advantage of using the first WIFI SSID and the first WIFI password to realize the LAN communication between the terminal device and the router is that no matter how the second WIFI SSID and the second WIFI password change, the terminal device can use the fixed first WIFI to realize the LAN communication between the router. When there are multiple routers, the first WIFI SSID and the first WIFI password obtained by the terminal device when connecting to each router are different, which can also prevent wrong connection.
[0315] Based on the above embodiment, the routing information also includes: information indicating whether the router wizard configuration is completed. The router wizard configuration can be understood as setting the Internet access method of the router, so that the router can directly connect to the router to access the Internet after scanning the mini program code.
[0316] It is understandable that, when the terminal device has not configured the router, the routing information may not include: the second WIFI SSID and the second WIFI password, and the information for indicating whether the router wizard configuration is completed may be an incomplete router wizard configuration.
[0317] After the above 909, when the terminal device determines that the user has performed the wizard configuration based on the information in the routing information used to indicate whether the router wizard configuration is completed, the terminal device can connect to the second WIFI of the router based on the second gateway address, the second WIFI SSID and the second WIFI password, for example, executing the steps shown in S910.
[0318] Alternatively, when the terminal device determines that the user has not performed wizard configuration based on the information in the routing information indicating whether the router wizard configuration is completed, the terminal device may display the following information: Fig.10The interface shown detects the Internet access mode. The interface includes: a text mark for indicating that the terminal device and the router have completed information synchronization, a text mark for indicating that the Internet access configuration is performed in the second step, and a text mark for indicating that the settings are completed in the third step.
[0319] The terminal device can access the Internet through DHCP or PPPOE, and after completing the configuration of the router, execute the steps shown in S911.
[0320] When the terminal device detects that the Internet access method is DHCP, the terminal device can Fig.10 The interface shown switches to Fig.11A The interface includes: an indicator for indicating the Internet access status, a text box 1001 for setting the WIFI name, a text box 1002 for setting the WIFI password, a control for downloading the Smart Space APP, a control for agreeing to the privacy statement, a control for agreeing to join the user experience improvement plan, a control for agreeing to automatically upgrade the mini-program, or a complete configuration control 1003, etc.
[0321] The words "Network connected" may be displayed around the logo indicating the Internet access status; the words "I have read and agreed to the End User License Agreement and are aware of the statement about the smart router and privacy" may be displayed around the control for agreeing to the privacy statement. The smart router is the router described in the embodiment of the present application; the words "Go to download" may be displayed around the control for downloading the Smart Space APP; the words "Automatically upgrade the device's applications and services to provide a better user experience (3:00-5:00 am)" may be displayed around the control for agreeing to automatically upgrade the mini-program.
[0322] The first WIFI service set identifier (SSID) may be displayed in text box 1001 by default, and the password may not be displayed in text box 1002, and only the words "Please enter password" may be displayed to prompt the user to enter the second WIFI password. For example, mingcheng1234 may be displayed in text box 1001. Alternatively, the first WIFI SSID may not be displayed in text box 1001. In this scenario, the words "Please enter WIFI name" may be displayed in text box 1001 to prompt the user to enter the second WIFI SSID. Fig.11A The WIFI SSID is not shown in the interface shown. The WIFI SSID is the name of the wireless signal sent by the router, which can also be called the WIFI name.
[0323] When the terminal device receives the operation of the user inputting the second WIFI SSID in the text box 1001, the text box 1001 displays the second WIFI SSID input by the user; when the terminal device receives the operation of the user inputting the second WIFI password in the text box 1002, the text box 1002 displays the second WIFI password input by the user. In some embodiments, the terminal device can use "*" to hide the second WIFI password input by the user.
[0324] When the terminal device receives the user's trigger operation for completing the configuration control 1003, the terminal device sends corresponding configuration information to the router to complete the configuration of the router.
[0325] When the terminal device detects that the Internet access method is PPPOE, the terminal device can Fig.10 The interface shown switches to Fig. 11B The interface includes: a text box 1004 for indicating input of a broadband account, or a text box 1005 for indicating input of a broadband password. Other contents displayed in the interface can be Fig.11A The interface shown is similar and will not be described again here.
[0326] The words “Please enter the broadband account number” may be displayed in the text box 1004 to prompt the user to enter the broadband account number provided by the operator when the user applies for PPPOE Internet access; the words “Please enter the broadband password” may be displayed in the text box 1005 to prompt the user to enter the broadband password provided by the operator when the user applies for PPPOE Internet access, and PPPOE Internet access can only be achieved when the broadband account number and broadband password are entered correctly.
[0327] When the terminal device receives the operation of the user inputting a broadband account in text box 1004, text box 1004 displays the broadband account input by the user; when the terminal device receives the operation of the user inputting a broadband password in text box 1005, text box 1005 displays the broadband password input by the user; when the terminal device receives the operation of the user inputting a second WIFI SSID in text box 1006, text box 1006 displays the second WIFI SSID input by the user; when the terminal device receives the operation of the user inputting a second WIFI password in text box 1007, text box 1007 displays the second WIFI password input by the user. In some embodiments, the terminal device can use "*" to hide the second WIFI password input by the user.
[0328] When the terminal device receives the user's trigger operation for completing the configuration control 1008, the terminal device sends corresponding configuration information to the router to complete the configuration of the router.
[0329] In some embodiments, when the terminal device does not receive the routing information returned by the router within a time threshold of sending a request for obtaining routing information, the terminal device may display the following information: Fig.12 Further, when the terminal device detects the user's triggering operation for re-detecting the control 1101, the terminal device can re-execute the steps shown in S802-S810 to re-detect the routing information and enter Fig.12 The interface shown in b.
[0330] On the basis of the above embodiment, after the terminal device is connected to the second WIFI of the router, it can also configure the router. The configuration process includes: S912-S915.
[0331] S912: The terminal device sends a request to the router for obtaining an Internet access method.
[0332] Exemplarily, when the terminal device determines that the user has not performed wizard configuration based on the information indicating whether the router wizard configuration is completed in the routing information obtained in S909, the terminal device may display the following information: Fig.11A The interface shown or Fig. 11B The interface shown in S912 is displayed, and the step shown in S912 is executed to send a request for obtaining an Internet access method to the router.
[0333] S913. The router returns the Internet access method detection result to the terminal device.
[0334] The Internet access detection result includes, but is not limited to: the second WIFI SSID, the second WIFI password, the second gateway address, the Internet access status, or the information indicating whether the router wizard configuration is completed in the router.
[0335] In the embodiment of the present application, the Internet access method can be DHCP Internet access, PPPOE Internet access, or other Internet access methods, which are not limited here. When the Internet access method is PPPOE Internet access, the parameter information also includes a broadband account and a broadband password.
[0336] S914: When the terminal device receives a trigger operation from the user to complete the configuration of the control, the terminal device sends configuration information to the router.
[0337] The configuration information may include: WIFI configuration information, or configuration information corresponding to the Internet access method and WIFI configuration information. Among them, the WIFI configuration information may include: the second gateway address, the second WIFI SSID and the second WIFI password. When the Internet access method is PPPOE, the configuration information corresponding to the Internet access method may include: broadband account and broadband password, or when the Internet access method is DHCP, the configuration information may not include the configuration information corresponding to DHCP Internet access.
[0338] S915. The router returns the configuration result to the terminal device.
[0339] Further, when the terminal device receives a message returned by the router indicating successful configuration, the terminal device can execute steps S811-S812 based on the set second WIFI SSID and the second WIFI password to connect to the second WIFI of the router.
[0340] Based on this, the terminal device can not only realize one-scan connection, but also configure the router in one-scan connection, so as to simplify the method of user configuration of the router and facilitate ordinary users to configure the router with zero threshold.
[0341] On the basis of the above embodiment, when the terminal device is successfully connected to the first WIFI, the terminal device and the router can establish an encrypted communication link, thus increasing the security of the interaction between the terminal device and the router.
[0342] Exemplarily, the terminal device and the router may be encrypted using a symmetric key.
[0343] Specifically, the terminal device sends a request to the router for obtaining the symmetric key. The router adaptively returns the symmetric key to the terminal device. Subsequently, the communication link between the terminal device and the router can be encrypted based on the symmetric key to ensure the security of data transmission.
[0344] In the embodiment of the present application, the request for obtaining the symmetric key may include: a router SN and signature information, where the signature information is information obtained after the terminal device signs the router SN using a private key.
[0345] The private key of the RSA asymmetric encryption algorithm filled with 1024-bit public key cryptography standards (PKCS) #8 can be preset in the applet of the terminal device, and the public key of the RSA asymmetric encryption algorithm filled with 1024-bit PKCS #8 can be preset in the routing plug-in process of the router.
[0346] Adaptively, after the router receives the router SN and signature information in the request for obtaining the symmetric key, the router can use the public key to decrypt the signature information and compare the decrypted information with the router SN for consistency. After the signature verification is successful, the router can determine that the request for obtaining the symmetric key is a message sent by the applet in the terminal device, and then return the generated symmetric key to the terminal device.
[0347] In the embodiment of the present application, the symmetric key can be encrypted using encryption methods such as data encryption algorithm (DEA), advanced encryption standard (AES) AES, and RSA encryption algorithm.
[0348] In some embodiments, the symmetric key may be an AES symmetric encryption key. In this way, the encryption and decryption efficiency is high and the time consumption is short, which can further shorten the interaction time between the terminal device and the router and improve the user experience.
[0349] The method of the embodiment of the present application has been described above, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above method.
[0350] The network connection method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0351] For example, Fig.13 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Fig.13As shown, the terminal device includes: the terminal device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0352] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0353] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0354] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0355] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0356] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0357] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal device. In other embodiments of the present application, the terminal device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0358] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of a terminal device. While the charging management module 140 is charging the battery 142, it can also power the electronic device through the power management module 141.
[0359] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0360] The terminal device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0361] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0362] The terminal device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0363] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0364] The camera 193 is used to capture static images or videos. In some embodiments, the terminal device may include 1 or N cameras 193, where N is a positive integer greater than 1. The types of the multiple cameras 193 may be different. For example, the camera 193 may include a camera for acquiring color images or a TOF camera, etc. In the embodiment of the present application, the camera may be understood as a camera. The camera includes: an AO camera, a TOF camera, etc. in the embodiment of the present application.
[0365] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0366] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area.
[0367] The terminal device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0368] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The terminal device may receive the button input and generate a key signal input related to the user settings and function control of the terminal device. The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, message, missed call, notification, etc.
[0369] In addition, on top of the above components, the device also runs an operating system, such as an iOS operating system, an Android operating system, or a Windows operating system, etc. Applications can be installed and run on the operating system.
[0370] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture, etc., which will not be elaborated here.
[0371] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.
[0372] An embodiment of the present application provides a router, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the router executes the above method.
[0373] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0374] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0375] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0376] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0377] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0378] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the protection scope of the present invention.
Claims
1. A network connection method, characterized in that: Applied to a router, the method comprises: The router establishes a first WIFI connection with the terminal device based on the first WIFI SSID and the first WIFI password; After establishing the first WIFI connection, the router receives a first request, where the first request is sent by the terminal device based on a first gateway address, where the first gateway address is pre-acquired by the terminal device, and the first gateway address is an address corresponding to a first bridge device in the router; In response to the first request, the router sends a first message to the terminal device, where the first message includes: a second WIFI SSID, a second WIFI password, and a second gateway address, where the second gateway address is an address corresponding to a second bridge device in the router; The router establishes a second WIFI connection with the terminal device based on the second WIFI SSID and the second WIFI password; After the address of the second network bridge device is changed from the second gateway address to the third gateway address, the method further includes: The router establishes a third WIFI connection with the terminal device based on a third WIFI SSID and a third WIFI password; wherein the third WIFI SSID is the same as the first WIFI SSID, and the third WIFI password is the same as the first WIFI password; After establishing the third WIFI connection, the router receives a second request from the terminal device, where the second request is sent by the terminal device based on the first gateway address; In response to the second request, the router sends a second message to the terminal device, where the second message includes: a fourth WIFI SSID, a fourth WIFI password, and the third gateway address; The router establishes a fourth WIFI connection with the terminal device based on the fourth WIFI SSID and the fourth WIFI password, wherein the fourth WIFI SSID is the same as the second WIFI SSID, and the fourth WIFI password is the same as the second WIFI password.
2. The method according to claim 1, characterized in that The method further comprises: The router receives a third message, where the third message is used to instruct to modify the address of the second bridge device to the third gateway address; After receiving the third message, the router modifies the address of the second bridge device from the second gateway address to the third gateway address.
3. The method according to claim 1 or 2, characterized in that: The first request is a UDP message, and the destination address of the UDP message is the first gateway address; the first message is a response message, and the response message is a message generated by the first bridge device in response to the UDP message.
4. The method according to any one of claims 1 to 3, characterized in that: The first gateway address is obtained from the first server based on a uniform resource locator URL corresponding to a target QR code, wherein the URL is obtained by scanning the target QR code, and the target QR code is a QR code corresponding to the router.
5. The method according to any one of claims 1 to 4, characterized in that: The first WIFI SSID and the first WIFI password are obtained by the terminal device by scanning a target QR code, and the first WIFI SSID and the first WIFI password are determined based on attribute parameters of a router.
6. The method according to claim 4 or 5, characterized in that: The target QR code is the mini program code.
7. The method according to any one of claims 1 to 6, characterized in that: The first WIFI connection is a local area network connection, and the third WIFI connection is a local area network connection.
8. The method according to any one of claims 1 to 7, characterized in that: After establishing the second WIFI connection, the method further includes: The router receives a first data packet, where the first data packet is sent by the terminal device based on the second WIFI connection and the second gateway address, and the first data packet is a data packet for accessing a network server through the router; The router sends a second data packet to the terminal device, where the second data packet is a response data packet generated when the network server receives the first data packet.
9. The method according to any one of claims 1 to 8, characterized in that: After establishing the second WIFI connection, the method further includes: The router receives a third request, where the third request is sent by the terminal device based on the second WIFI and the second gateway address; In response to the third request, the router sends a fourth message to the terminal device, wherein the fourth message includes an Internet access method of the router, and the Internet access method of the router includes: Ethernet point-to-point communication protocol PPPOE, or dynamic host configuration protocol DHCP.
10. The method according to any one of claims 1 to 9, characterized in that: The attribute parameters of the router include: a serial number SN of the router, and the first WIFI SSID and the first WIFI password are determined based on the SN.
11. The method according to any one of claims 1 to 10, characterized in that: Before receiving the first request, the method further includes: The router receives a fourth request from the terminal device; In response to the fourth request, the router sends a fifth message to the terminal device, the fifth message including a symmetric key, and the first message is a message generated by the router after encrypting the second WIFI SSID, the second WIFI password and the second gateway address using the symmetric key.
12. The method according to any one of claims 1 to 11, characterized in that: The first WIFI is 2.4G WIFI.
13. A network connection method, characterized in that: Applied to a terminal device, the method comprises: The terminal device receives a first operation of a user scanning a target QR code, where the target QR code is a QR code corresponding to the router; In response to the first operation, the terminal device acquires a first WIFI SSID and a first WIFI password based on the target QR code, where the first WIFI SSID and the first WIFI password are determined based on attribute parameters of the router; The terminal device establishes a first WIFI connection with the router based on the first WIFI SSID and the first WIFI password; After establishing the first WIFI connection, the terminal device sends a first request to the router based on a first gateway address, where the first gateway address is pre-acquired by the terminal device and the first gateway address is an address corresponding to a first bridge device in the router; The terminal device receives a first message from the router, the first message including: the second WIFI SSID, the second WIFI password and the second gateway address, the first message is a message generated by the router in response to the first request, and the second gateway address is an address corresponding to the second bridge device in the router; The terminal device establishes a second WIFI connection with the router based on the second WIFI SSID and the second WIFI password; Wherein, after the address of the second network bridge device is changed from the second gateway address to the third gateway address, the method further includes: The terminal device receives a second operation of a user scanning the target QR code; In response to the second operation, the terminal device acquires a third WIFI SSID and a third WIFI password based on the target QR code; The terminal device establishes a third WIFI connection with the router based on the third WIFI SSID and the third WIFI password; wherein the third WIFI SSID is the same as the first WIFI SSID, and the third WIFI password is the same as the first WIFI password; After establishing the third WIFI connection, the terminal device sends a second request to the router based on the first gateway address; The terminal device receives a second message from the router, the second message including: a fourth WIFI SSID, a fourth WIFI password and the third gateway address, and the second message is a message generated by the router in response to the second request; The terminal device establishes a fourth WIFI connection with the router based on the fourth WIFI SSID and the fourth WIFI password, wherein the fourth WIFI SSID is the same as the second WIFI SSID, and the fourth WIFI password is the same as the second WIFI password.
14. The method according to claim 13, characterized in that After establishing the second WIFI connection, the method further includes: The terminal device receives a third operation of the user; In response to the third operation, the terminal device changes the address of the second bridge device from the second gateway address to the third gateway address.
15. The method according to claim 13 or 14, characterized in that The first request is a UDP message, and the destination address of the UDP message is the first gateway address; The first message is a response message, and the response message is a message generated by the first bridge device in response to the UDP message.
16. The method according to any one of claims 13 to 15, characterized in that: The method further comprises: In response to the first operation, the terminal device acquires a uniform resource locator URL based on the target QR code; The terminal device obtains the first gateway address from the first server based on the URL.
17. The method according to claim 16, characterized in that The terminal device obtains a uniform resource locator URL based on the target QR code, and then the method further includes: The terminal device sends a fifth request to the first server, wherein the fifth request includes the URL; The terminal device receives a sixth message from the first server and displays a first prompt message in a first interface, the sixth message includes at least one interface information corresponding to the URL, the at least one interface information includes interface information corresponding to the first interface, the sixth message is a message generated by the first server in response to the fifth request, and the first prompt message is used to prompt the terminal device to enter a code scanning connection system.
18. The method according to any one of claims 13 to 17, characterized in that: The target QR code is a mini program code.
19. The method according to any one of claims 13 to 18, characterized in that: The first WIFI connection is a local area network connection, and the third WIFI connection is a local area network connection.
20. The method according to any one of claims 13 to 19, characterized in that: After establishing the second WIFI connection, the method further includes: The terminal device sends a first data packet to the router based on the second WIFI connection and the second gateway address, where the first data packet is a data packet for accessing a network server through the router; The terminal device receives a second data packet from the router, where the second data packet is a response data packet generated when the network server receives the first data packet.
21. The method according to any one of claims 13 to 20, characterized in that: After establishing the second WIFI connection, the method further includes: The terminal device sends a third request to the router based on the second WIFI and the second gateway address; The terminal device receives a fourth message from the router, the fourth message is a message generated by the router in response to the third request, the fourth message includes the Internet access method of the router, and the Internet access method of the router includes: Ethernet point-to-point communication protocol PPPOE, or dynamic host configuration protocol DHCP.
22. The method according to any one of claims 13 to 21, characterized in that: The attribute parameters of the router include: a serial number SN of the router, and the first WIFI SSID and the first WIFI password are determined based on the SN.
23. The method according to any one of claims 13 to 22, characterized in that: Before sending the first request, the method further includes: The terminal device sends a fourth request to the router; The terminal device receives a fifth message from the router, the fifth message including a symmetric key, the fifth message being a message generated by the router in response to the fourth request, and the first message being a message generated by the router after encrypting the second WIFI SSID, the second WIFI password, and the second gateway address using the symmetric key.
24. A router, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the router performs the method according to any one of claims 1 to 12.
25. A terminal device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the terminal device performs the method according to any one of claims 13 to 23.
26. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented, or the method according to any one of claims 13 to 23 is implemented.
27. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 11, or implement the method according to any one of claims 13 to 23.
Citation Information
Patent Citations
Router configuration method based on scanning of two-dimensional code
CN105227346A
Methods and apparatus for network address change for mobile devices
US20070047585A1
WiFi ZAPPER SMART PHONE APPLICATION
US20130331083A1
Routing Proxy For Adaptive Streaming
US20150207846A1
