Network connection method and related apparatus
By obtaining routing information through the bridge device in the router and using the scanning of the mini-program code to achieve automatic WIFI connection, the problem of terminal devices being unable to obtain the gateway address is solved, improving user experience and saving resources.
Patent Information
- Application Number
- CN202310639181.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-05-31
AI Technical Summary
In a home network, when a terminal device tries to connect to the internet by scanning the router's QR code, it may be unable to obtain the gateway address, resulting in an inability to connect to the internet.
Routing information is obtained through the bridge device in the router, and a WIFI connection is established using the bridge device with a fixed gateway address. Automatic connection is achieved by scanning the mini-program code, avoiding the need to manually enter the gateway address.
This feature enables terminal devices to automatically establish a Wi-Fi connection after the router's gateway address is modified, improving user experience and saving costs and resources.
Smart Images

Figure CN119071877B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to network connection methods and related devices. Background Technology
[0002] With the development of internet technology, internet access has become increasingly common in people's lives. Sometimes, multiple devices need to use the same account to access the internet simultaneously. For example, in a home network, there are multiple devices such as mobile phones, computers, and smart TVs. These devices are all connected to a router, which connects to the internet through a single account.
[0003] Mobile devices and other terminal devices can connect to the router by scanning the mini-program code on the router with WeChat, and then connect to the Internet.
[0004] However, in some scenarios, the mini-program cannot obtain the router's gateway address and therefore cannot connect to the Internet. Summary of the Invention
[0005] This application provides a network connection method and related apparatus, applicable to the field of terminal technology. After connecting to a first Wi-Fi network, routing information is obtained through a bridge device with a fixed gateway address. The routing information is then used to connect to a second Wi-Fi network, thereby connecting to the Internet. Terminal devices can establish a connection with the router by scanning a target QR code in a mini-program, achieving automatic Wi-Fi connection without requiring the user to actively enter Wi-Fi passwords or other information, thus providing a better connection experience.
[0006] In a first aspect, embodiments of this application provide a network connection method applied to a router. The method includes: the router establishing a first Wi-Fi connection with a terminal device based on a first Wi-Fi SSID and a first Wi-Fi password; after establishing the first Wi-Fi connection, the router receiving a first request, the first request being sent by the terminal device based on a first gateway address, the first gateway address being pre-obtained by the terminal device and corresponding to the address of a first bridge device in the router; in response to the first request, the router sending a first message to the terminal device, the first message including: a second Wi-Fi SSID, a second Wi-Fi password, and a second gateway address, the second gateway address being corresponding to the address of a second bridge device in the router; the router establishing a second Wi-Fi connection with the terminal device based on the second Wi-Fi SSID and the second Wi-Fi password; after the address of the second bridge device is changed from the second gateway address to a third gateway address, the method further includes: the router establishing a third Wi-Fi connection with the terminal device based on a third Wi-Fi SSID and a third Wi-Fi password; wherein, the third Wi-Fi SSID is the same as the first Wi-Fi SSID. The SSIDs are the same, and the third Wi-Fi password is the same as the first Wi-Fi password. After establishing the third Wi-Fi connection, the router receives a second request from the terminal device, which 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, which includes: the fourth Wi-Fi SSID, the fourth Wi-Fi password, and the third gateway address. Based on the fourth Wi-Fi SSID and the fourth Wi-Fi password, the router establishes a fourth Wi-Fi connection with the terminal device, wherein the fourth Wi-Fi SSID is the same as the second Wi-Fi SSID, and the fourth Wi-Fi password is the same as the second Wi-Fi password.
[0007] The first bridge device in the aforementioned router can be a bridge device used to establish an initial WIFI connection between the terminal device and the router. Through this first bridge device, the terminal device cannot actually access the Internet (it cannot transmit data with the network server).
[0008] The second bridge device in the aforementioned router can be a bridge device used to establish a Wi-Fi connection between the terminal device and the router, enabling internet access. Through this second bridge device, the terminal device can access the internet (and transmit data between the terminal device and the server).
[0009] In this embodiment, when the gateway address of the bridge device (second bridge device) used for internet access by the terminal device in the router is modified, and the terminal device needs to re-establish a WIFI connection with the router, it can directly establish an initial WIFI connection (third WIFI connection) with the router through the pre-obtained first gateway address. Then, based on the modified third gateway address of the second bridge device, it establishes a final WIFI connection (fourth WIFI connection) with the router. This application can automatically establish a WIFI connection between the terminal device and the router by scanning a code when the gateway address of the bridge device used for internet access by the terminal device in the router is modified. This allows the user to automatically establish a WIFI connection without manually entering the modified gateway address when re-establishing a WIFI connection between the terminal device and the router, thus improving the user experience.
[0010] Optionally, the router receives a third message, which indicates that the address of the second bridge device should be changed to the address of the third gateway; 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 router's gateway address is modified, the final WIFI information (fourth WIFI connection) can be obtained through the first gateway address, and the fourth WIFI can be connected.
[0012] Optionally, the first request is a UDP packet, and the destination address of the UDP packet is the first gateway address; the first message is a response packet, which is a packet generated by the first bridge device in response to the UDP packet.
[0013] In this way, terminal devices can obtain the final Wi-Fi information (related information about the second Wi-Fi and the fourth Wi-Fi) through a fixed path (the first gateway address). This saves costs compared to obtaining it from a server.
[0014] Optionally, the first gateway address is obtained from the first server based on the Uniform Resource Locator URL corresponding to the target QR code. The URL is obtained by scanning the target QR code, which is the QR code corresponding to the router.
[0015] In this way, the first gateway address can be obtained from the first server via the target QR code. Scanning the code enters the mini-program, providing the first gateway address quickly and easily.
[0016] Optionally, the first Wi-Fi SSID and the first Wi-Fi password are obtained by scanning the target QR code, and the first Wi-Fi SSID and the first Wi-Fi password are determined based on the router's attribute parameters.
[0017] In this way, you can obtain the first Wi-Fi SSID and password through the target QR code and connect to the first Wi-Fi. Scanning the code leads to the mini-program, which is convenient and quick.
[0018] Optionally, the target QR code can be a mini-program code.
[0019] In this way, users can take full advantage of the convenience of mini-programs, making it easy for ordinary users to connect to and configure routers with zero barriers.
[0020] Optionally, the first Wi-Fi connection is a local area network (LAN) connection, and the third Wi-Fi connection is a LAN connection.
[0021] Optionally, after establishing the second Wi-Fi connection, the method further includes: the router receiving a first data packet, which is sent by the terminal device based on the second Wi-Fi connection and the second gateway address, and the first data packet is a data packet that accesses the network server through the router; the router sending a second data packet to the terminal device, which is a response data packet generated by the network server when it receives the first data packet.
[0022] It can interact with the Internet through a second gateway address and a second Wi-Fi network to enable terminal devices to access the Internet.
[0023] Optionally, after establishing the second Wi-Fi connection, the method further includes: the router receiving a third request, which is sent by the terminal device based on the second Wi-Fi and the second gateway address; in response to the third request, the router sending a fourth message to the terminal device, which includes the router's Internet access method, including: Ethernet Point-to-Point Communication Protocol (PPPOE) or Dynamic Host Configuration Protocol (DHCP).
[0024] In this way, the router's internet access method can be obtained through the second Wi-Fi 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 router's attribute parameters include: the router's serial number (SN), the first Wi-Fi SSID, and the first Wi-Fi password, which are determined based on the SN.
[0026] The router's serial number (SN) is unique, and the first Wi-Fi SSID and first Wi-Fi password obtained by resolving the SN are also unique. Therefore, regardless of whether the user knows the Wi-Fi password, the terminal device can use the first Wi-Fi SSID and first Wi-Fi password to establish a local area network connection with the router.
[0027] Optionally, before receiving the first request, the method further includes: the router receiving a fourth request from the terminal device; in response to the fourth request, the router sending a fifth message to the terminal device, the fifth message including a symmetric key, and the first message being a message generated by the router 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. This allows the terminal device and the router to encrypt the communication link based on the symmetric key, ensuring the security of data transmission.
[0029] Optionally, the first Wi-Fi network can be 2.4GHz. This reduces the likelihood of some devices that do not support 5GHz Wi-Fi being unable to connect, increasing the router's usability.
[0030] Secondly, embodiments of this application propose a network connection method applied to a terminal device. The method includes: the terminal device receiving a first operation from a user scanning a target QR code, the target QR code being a QR code corresponding to a router; in response to the first operation, the terminal device obtaining a first Wi-Fi SSID and a first Wi-Fi password based on the target QR code, the first Wi-Fi SSID and the first Wi-Fi password being determined based on attribute parameters of the router; the terminal device establishing a first Wi-Fi connection with the router based on the first Wi-Fi SSID and the first Wi-Fi password; after establishing the first Wi-Fi connection, the terminal device sending a first request to the router based on a first gateway address, the first gateway address being pre-obtained by the terminal device and being the address corresponding to a first bridge device in the router; the terminal device receiving a first message from the router, the first message including: a second Wi-Fi SSID, a second Wi-Fi password, and a second gateway address, the first message being a message generated by the router in response to the first request, the second gateway address being the address corresponding to a second bridge device in the router; and the terminal device establishing a second Wi-Fi connection with the router based on the second Wi-Fi SSID and the second Wi-Fi 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 receiving a second operation from the user scanning a target QR code; in response to the second operation, the terminal device obtaining a third Wi-Fi SSID and a third Wi-Fi password based on the target QR code; the terminal device establishing a third Wi-Fi connection with the router based on the third Wi-Fi SSID and the third Wi-Fi password; wherein the third Wi-Fi SSID is the same as the first Wi-Fi SSID, and the third Wi-Fi password is the same as the first Wi-Fi password; after establishing the third Wi-Fi connection, the terminal device sending a second request to the router based on the first gateway address; the terminal device receiving a second message from the router, the second message including: a fourth Wi-Fi SSID, a fourth Wi-Fi password, and the third gateway address, the second message being a message generated by the router in response to the second request; the terminal device establishing a fourth Wi-Fi connection with the router based on the fourth Wi-Fi SSID and the fourth Wi-Fi password. Herein, the fourth Wi-Fi SSID is the same as the second Wi-Fi SSID, and the fourth Wi-Fi password is the same as the second Wi-Fi password.
[0032] The first bridge device in the aforementioned router can be a bridge device used to establish an initial WIFI connection between the terminal device and the router. Through this first bridge device, the terminal device cannot actually access the Internet (it cannot transmit data with the network server).
[0033] The second bridge device in the aforementioned router can be a bridge device used to establish a Wi-Fi connection between the terminal device and the router, enabling internet access. Through this second bridge device, the terminal device can access the internet (and transmit data between the terminal device and the server).
[0034] In this embodiment, when the gateway address of the bridge device (second bridge device) used for internet access by the terminal device in the router is modified, and the terminal device needs to re-establish a WIFI connection with the router, it can directly establish an initial WIFI connection (third WIFI connection) with the router through the pre-obtained first gateway address. Then, based on the modified third gateway address of the second bridge device, it establishes a final WIFI connection (fourth WIFI connection) with the router. This application can automatically establish a WIFI connection between the terminal device and the router by scanning a code when the gateway address of the bridge device used for internet access by the terminal device in the router is modified. This allows the user to automatically establish a WIFI connection without manually entering the modified gateway address when re-establishing a WIFI connection between the terminal device and the router, thus improving the user experience.
[0035] Optionally, after establishing the second Wi-Fi connection, the method further includes: the terminal device receiving a third operation from the user; in response to the third operation, the terminal device changing the address of the second bridge device from the second gateway address to the third gateway address.
[0036] After connecting to the router, the terminal device can modify the router's gateway address. After modifying the router's gateway address, it can obtain information about the second Wi-Fi network through the first gateway address and connect to it.
[0037] Optionally, the first request is a UDP packet, and the destination address of the UDP packet is the first gateway address; the first message is a response packet, which is a packet generated by the first bridge device in response to the UDP packet.
[0038] In this way, terminal devices can obtain relevant information about the second Wi-Fi network through a fixed path (the first gateway address). This saves costs compared to obtaining it from a 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; 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 via the target QR code. Scanning the code enters the mini-program, providing the first gateway address quickly and easily.
[0041] Optionally, the terminal device obtains a Uniform Resource Locator (URL) based on the target QR code. The method then further includes: the terminal device sending a fifth request to a first server, the fifth request including the URL; the terminal device receiving a sixth message from the first server and displaying a first prompt on a first interface, the sixth message including at least one interface information corresponding to the URL, the at least one interface information including interface information corresponding to the first interface, the sixth message being a message generated by the first server in response to the fifth request, and the first prompt prompting the terminal device to enter the QR code connection system.
[0042] In this way, the terminal device can launch the mini-program and display the first interface via the URL obtained from the target QR code, thus enriching the user experience of using the preset functions. The first interface corresponds to... Figure 2 The interface in the middle.
[0043] Optionally, the target QR code can be a mini-program code.
[0044] In this way, users can take full advantage of the convenience of mini-programs, making it easy for ordinary users to connect to and configure routers with zero barriers.
[0045] Optionally, the first Wi-Fi connection is a local area network (LAN) connection, and the third Wi-Fi connection is a LAN connection.
[0046] Optionally, after establishing the second Wi-Fi connection, the method further includes: the terminal device sending a first data packet to the router based on the second Wi-Fi 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 receiving a second data packet from the router, the second data packet being a response data packet generated by the network server when it receives the first data packet.
[0047] Terminal devices can interact with the Internet through a second gateway address and a second Wi-Fi network to access the Internet.
[0048] Optionally, after establishing the second Wi-Fi connection, the method further includes: the terminal device sending a third request to the router based on the second Wi-Fi and the second gateway address; the terminal device receiving a fourth message from the router, the fourth message being a message generated by the router in response to the third request, the fourth message including the router's internet access method, which may include: Ethernet Point-to-Point Communication Protocol PPPoE or Dynamic Host Configuration Protocol DHCP.
[0049] In this way, the terminal device can obtain the router's internet access method through the second Wi-Fi and the second gateway address, so as to display the configuration interface corresponding to the subsequent internet access method.
[0050] Optionally, the router's attribute parameters include: the router's serial number (SN), the first Wi-Fi SSID, and the first Wi-Fi password, which are determined based on the SN.
[0051] The router's serial number (SN) is unique, and the first Wi-Fi SSID and first Wi-Fi password obtained by resolving the SN are also unique. Therefore, regardless of whether the user knows the Wi-Fi password, the terminal device can use the first Wi-Fi SSID and first Wi-Fi password to establish a local area network connection with the router.
[0052] Optionally, before sending the first request, the method further includes: the terminal device sending a fourth request to the router; the terminal device receiving 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.
[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 terminal device and the router can encrypt the communication link based on the symmetric key to ensure the security of data transmission.
[0054] Thirdly, embodiments of this application provide a router. The router includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the router to perform the method as described in the first aspect.
[0055] Fourthly, embodiments of this application provide 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 can be a mobile phone, smart TV, wearable device, tablet computer, computer with wireless transceiver capabilities, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, etc.
[0056] The terminal device includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the terminal device to perform the method as described in the second aspect.
[0057] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method as described in the first or second aspect.
[0058] Sixthly, embodiments of this application provide a computer program product, which includes a computer program that, when run, causes a computer to perform the method as described in the first or second aspect.
[0059] In a seventh aspect, embodiments of this application provide a chip, the chip including a processor, the processor being configured to invoke a computer program in memory to perform the method as described in the first or second aspect.
[0060] It should be understood that the second to seventh aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0061] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0062] Figure 2 This application provides a schematic diagram of the interface of a terminal device according to an embodiment of the present application.
[0063] Figure 3 A flowchart illustrating a network connection method provided in an embodiment of this application;
[0064] Figure 4 This is a schematic diagram of the software architecture of a router in a possible design.
[0065] Figure 5 This is a schematic diagram of the interaction flow for a possible network connection failure in a design.
[0066] Figure 6 A schematic diagram of a network architecture provided for an embodiment of this application;
[0067] Figure 7 A flowchart illustrating a network connection method provided in an embodiment of this application can also be shown.
[0068] Figure 8 This application provides a schematic diagram of a network connection process in accordance with an embodiment of the present application.
[0069] Figure 9 A flowchart illustrating a network connection method provided in an embodiment of this application;
[0070] Figure 10 This application provides a schematic diagram of the interface of a terminal device according to an embodiment of the present application.
[0071] Figure 11A This application provides a schematic diagram of the interface of a terminal device according to an embodiment of the present application.
[0072] Figure 11B This application provides a schematic diagram of the interface of a terminal device according to an embodiment of the present application.
[0073] Figure 12 This application provides a schematic diagram of the interface of a terminal device according to an embodiment of the present application.
[0074] Figure 13 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0075] To facilitate understanding of the embodiments of this application, some terms involved in this application will be briefly explained first.
[0076] 1. Network interface card (NIC): A computer hardware device designed to allow computers to communicate on a computer network. It can also be understood as a computer hardware device that enables network connectivity.
[0077] A network interface card (NIC) can also be referred to as a network interface controller, Ethernet card, local area network card, network adapter, or network adapter card, etc. This application does not limit the scope of the application to these terms.
[0078] The main functions of a network interface card (NIC) include data encapsulation and decapsulation, link management, and data encoding and decoding. A NIC can serve as an intermediary between a computer or server and a data network. Specifically, as an interface at the TCP / IP layer, a NIC can transmit signals at the physical layer and data packets at the network layer.
[0079] Understandably, each network card has a unique serial number called a hardware address (media access control address, MAC address).
[0080] Based on network connection methods, network interface cards (NICs) can be categorized into wired NICs and wireless NICs. A wired NIC requires a patch cable (e.g., Ethernet patch cable, fiber optic patch cable, etc.) to connect a node to the network; a wireless NIC has a small antenna and uses radio waves to communicate with an access point, thereby accessing a wireless network. For example, a wired NIC may correspond to an Ethernet interface (eth interface); a wireless NIC may correspond to a wireless interface (wlan interface).
[0081] 2. Network bridge: A device that relays data at the data link layer, forwarding frames. A network bridge can also be understood as a device at the data link layer used for forwarding data. A network bridge can also be called a bridge connector.
[0082] A bridge device can connect the interfaces corresponding to network interface cards (NICs). For example, a bridge device can connect two Ethernet interfaces, connect one Ethernet interface to one wireless interface, or connect two wireless interfaces.
[0083] A bridge device is a store-and-forward device that connects two local area networks (LANs). It can forward data 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, a bridge device can be understood as dividing a large LAN into multiple segments, or interconnecting two or more LANs into a single logical LAN, allowing all users on the LAN to access the server.
[0084] 3. Point-to-Point Protocol over Ethernet (PPPoE) Internet Access: A dial-up Internet access method using the PPPoE protocol. Typically, after broadband service is activated, the ISP provides users with a broadband account and password. Users can enter these information into the terminal device configured on the router. After successful verification, the terminal device obtains an Internet Protocol (IP) address to access the Internet.
[0085] 4. Dynamic Host Configuration Protocol (DHCP) Internet Access: This method uses the DHCP protocol and relies on a dynamic IP address assigned by a DHCP server to access the Internet. Normally, terminal devices can automatically obtain an IP address when needed and access the Internet based on that address.
[0086] 5. Other terms
[0087] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0088] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0089] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer 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, and c can be single or multiple.
[0090] 6. Terminal equipment
[0091] The terminal device in this application embodiment can also be any form of electronic device. For example, electronic devices may include handheld devices with communication functions, vehicle-mounted devices, etc. For example, some electronic devices include: mobile phones, tablets, PDAs, laptops, 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, in-vehicle devices, wearable devices, terminal devices in 5G networks, or future evolution of public land mobile communication networks. Terminal devices in a network (PLMN), etc., are not limited to this in the embodiments of this application.
[0092] By way of example and not limitation, in this embodiment, the electronic device can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not merely hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are feature-rich, large in size, and can achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those that focus on a specific type of application function and require the use of other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0093] Furthermore, in this embodiment of the 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 of human-machine interconnection and object-to-object interconnection.
[0094] The electronic devices in the embodiments of this 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 this embodiment, the electronic device or various network devices include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and 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, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0096] For example, Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1As shown, the application scenarios include: terminal device 101 and router 102.
[0097] Terminal device 101 can scan the QR code on router 102 to launch the mini-program page, where it can connect to the router's Wireless Fidelity (WIFI) and configure the router based on user actions. The mini-program can be... Mini-programs within the application.
[0098] For example, Figure 2 This is a schematic diagram of the interface of a terminal device provided in an embodiment of this application.
[0099] Open on the terminal device When the application uses the scan function and the camera on the terminal device is pointed at the QR code on the router, the terminal device can display something like this. Figure 5 The interface shown in 'a' can include: a mini-program code.
[0100] After the terminal device scans the QR code on the router, it can launch the corresponding mini-program page and display something like this. Figure 2 The interface shown in b is the homepage of the mini-program. This interface is used to indicate that the user has opened the mini-program. This interface may include one or more of the following: text messages to indicate that the user is welcome to join the XX One Scan Connect system, controls for exiting the mini-program, or controls for forwarding the mini-program, etc.
[0101] The text message used to welcome users to join the One-Scan Connect system can be displayed as: Welcome to the XX One-Scan Connect system. One-Scan Connect (or preset function) can be understood as enabling users to connect their terminal devices to the router's WIFI when they scan the mini-program code using their terminal devices.
[0102] Terminal devices can Figure 2 After remaining on the interface shown in b for 2 seconds, it will automatically redirect to... Figure 2 The interface shown in 'c'. Figure 2 The interface shown in 'c' indicates that routing information is being synchronized. This interface may include one or more of the following: text information indicating that routing information is being synchronized, a progress bar indicating the synchronization status of routing information, or a diagram indicating that the terminal device and the router are synchronizing routing information.
[0103] After the terminal device obtains routing information from the router, the terminal device can then... Figure 2 The interface shown in 'c' switches to Figure 2 The interface shown by d in the figure. Figure 2The interface shown in d is used to indicate that the terminal device has obtained routing information. The interface may include one or more of the following: an identifier 201 indicating connection to the router's WIFI, text information indicating that the routing information has been synchronized, a text identifier indicating that the terminal device and the router have completed information synchronization, a text identifier indicating connection to the router's WIFI in the second step, or a diagram 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 connected to the router's first Wi-Fi network. A detailed description of this first Wi-Fi network can be found below. Figure 3 Corresponding implementation examples.
[0105] In possible implementations, the identifier 201 can also be displayed as follows: Figure 2 The interface shown in 'c' can be understood as the terminal device connecting to the router's first Wi-Fi during the routing information synchronization process.
[0106] Typically, the synchronization time for terminal devices to route information can be as long as 6 seconds, meaning the terminal device... Figure 2 The interface shown in 'c' switches to Figure 2 The duration of the interface shown by d in the figure can be 6 seconds, etc.
[0107] Furthermore, if the terminal device determines that the router has been configured based on the routing information, the terminal device can then... Figure 2 The interface shown as d in the image switches to... Figure 2 The interface shown in 'e' is... Figure 2 The interface shown as 'e' indicates that the terminal device is connecting to the router's Wi-Fi. The terminal device can display something like this after connecting to the router's Wi-Fi. Figure 2 The interface shown in f is used to indicate that the terminal device has been connected to the router's WIFI.
[0108] The following is combined Figure 3 right Figure 2 The interaction between the terminal device and the router during the network connection process is explained.
[0109] For example, Figure 3 This is a flowchart illustrating a network connection method provided in an embodiment of this application. Figure 3 As shown, network connection methods include:
[0110] S301. The terminal device receives the user's operation of scanning the applet code on the router body.
[0111] The router can have a QR code attached to its body. This QR code can be generated from the mini-program's uniform resource locator (URL) and the router's serial number (SN). Therefore, terminal devices can obtain the mini-program's URL and router SN by scanning the QR code.
[0112] It's understandable that a router's serial number (SN) is unique, and therefore, the mini-program code is also unique; that is, one router can correspond to one mini-program code. The Wi-Fi network carried by the mini-program code can be open, meaning users can search for the router's Wi-Fi network using their terminal devices. If the Wi-Fi network carried by the mini-program is hidden, the terminal device will not be able to successfully connect to the router's Wi-Fi.
[0113] S302. In response to the user scanning the mini-program code on the router, 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 retrieve the mini-program page from the first server.
[0115] The first server can be understood as... The application public platform is used to provide services for terminal devices. The application provides a mini-program page. For example, a terminal device can send a request to a first server to retrieve a mini-program page. This request may include the mini-program URL. The first server can then return a pre-stored mini-program page to the terminal device, allowing the terminal device to launch the mini-program page from the server based on the mini-program URL parsed from the mini-program code.
[0116] S304. The first server returns the page information corresponding to the mini-program to the terminal device.
[0117] The page information corresponding to the mini-program may include: page information corresponding to any interface of the mini-program described in this application embodiment, such as the page information corresponding to the homepage of the mini-program.
[0118] For example, after receiving the page information corresponding to the mini-program, the terminal device can perform rendering and other operations based on the page information, so that the terminal device can display different interface content in the mini-program.
[0119] S305, The terminal device displays the homepage of the mini-program and uses SN to calculate the first WIFI service set identifier (SSID) and the first WIFI password.
[0120] The homepage of the mini-program can be Figure 2 The interface shown in b is shown in the image.
[0121] The first Wi-Fi can be the router's initial Wi-Fi or a fixed Wi-Fi. The first Wi-Fi SSID and the first Wi-Fi password are obtained based on SN parsing, so the first Wi-Fi SSID and the first Wi-Fi password are also unique.
[0122] It is understandable that the first Wi-Fi SSID and the first Wi-Fi password are determined based on the router's attribute parameter SN, therefore, the first Wi-Fi SSID and the first Wi-Fi password cannot be modified by the user at will.
[0123] S306. The terminal device sends a request to the router to connect to the router's first Wi-Fi network.
[0124] The request to connect to the router's first Wi-Fi network may include: the first Wi-Fi SSID and the first Wi-Fi password.
[0125] S307. The router returns a message to the terminal device indicating that the first WIFI connection was successful.
[0126] It is understandable that since the first Wi-Fi SSID and the first Wi-Fi password are fixed, the terminal device can use the first Wi-Fi to access the router's local area network. The first Wi-Fi SSID and the first Wi-Fi can act 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 measures in the firewall to allow local area network communication between the terminal device and the router, but prevents it from connecting to the Internet.
[0128] S308. The terminal device sends a request to the router to obtain routing information.
[0129] Routing information can be information obtained from the router, and may include one or more of the following: the router's second Wi-Fi SSID, second Wi-Fi password, gateway address, internet access status, or information indicating whether the router wizard configuration is complete.
[0130] The second Wi-Fi network can be understood as the router's actual Wi-Fi network or a modifiable Wi-Fi network. Typically, users can change the second Wi-Fi SSID to an easily identifiable name. The second Wi-Fi SSID can be the same as or different from the first Wi-Fi SSID. This application does not specifically limit the second Wi-Fi SSID.
[0131] In some embodiments, the second Wi-Fi password can be set according to user habits. For example, consider a second Wi-Fi SSID that is the same as the first Wi-Fi SSID. Typically, the user can change the second Wi-Fi SSID to an easily identifiable name, in which case the second Wi-Fi SSID is different from the first Wi-Fi SSID; alternatively, the user can choose not to change the second Wi-Fi SSID, in which case the second Wi-Fi SSID is the same as the first Wi-Fi SSID.
[0132] The internet connection status can include states such as "network connected" and "network disconnected". This router configuration wizard can be understood as setting up the router's internet access method, enabling the router to connect directly to the internet after scanning the mini-program code.
[0133] It is understandable that if the terminal device has not configured the router, the routing information may not include the second WIFI SSID and the second WIFI password. The information used to indicate whether the router wizard configuration has been completed may indicate that the router wizard configuration has not been completed.
[0134] In some embodiments, the terminal device sends UDP packets to the router to obtain routing information.
[0135] S309. The router returns routing information to the terminal device.
[0136] Accordingly, after receiving the routing information returned by the router, the terminal device can display, as follows: Figure 2 The interface shown in c is shown in the diagram. Furthermore, the terminal device can connect to the router's Wi-Fi using the second Wi-Fi SSID and second Wi-Fi password from the routing information, for example, by performing the steps shown in S310.
[0137] In a possible implementation, when the terminal device determines that the user has performed wizard configuration based on the information in the routing information indicating whether the router wizard configuration has been completed, the terminal device can connect to the router's WIFI based on the second WIFI SSID and the second WIFI password, for example, by performing the steps shown in S310.
[0138] S310. The terminal device sends a request to the router to connect to the router's second Wi-Fi network. This request may include the second Wi-Fi SSID and the second Wi-Fi password.
[0139] Adaptively, the router returns a message to the terminal device indicating a successful connection to the second Wi-Fi network. Upon receiving this message, the terminal device can determine that it has successfully connected to the router's Wi-Fi network.
[0140] In this way, terminal devices can quickly connect to the router's Wi-Fi by scanning the QR code on the router, reducing a series of complicated operations such as searching for Wi-Fi and entering the Wi-Fi password.
[0141] Compared to storing the router's WIFI SSID and WIFI password in the cloud, the router connection method described in this application embodiment can obtain the first WIFI SSID and the first WIFI password using the SN in the mini-program code, without the need for cloud involvement, thus saving resource consumption.
[0142] However, the above Figure 3 The method shown uses a guessing approach 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. Other scenarios include users modifying the gateway address through settings, other abnormal situations causing the gateway address to be modified, or the gateway address not being 1 by default.
[0143] To make it easier to understand, the following will be combined with Figure 4 The network architecture described in the document explains the gateways and other components involved in the network connection process.
[0144] For example, Figure 4 This is a schematic diagram of the software architecture of a router in a possible design. For example... Figure 4 As shown, the software architecture of a 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 across multiple end systems, and applications in two end systems use application layer protocols to exchange information packets; these information packets located at the application layer are called messages.
[0146] Application layer protocols include: Hypertext Transfer Protocol (HTTP), Simple Mail Transfer Protocol (SMTP), File Transfer Protocol (FTP), Domain Name System (DNS), etc.
[0147] HTTP provides the request and delivery of web page documents; SMTP provides the transmission of email messages; FTP provides file transfer between two end systems; DNS translates end system names into 32-bit network addresses.
[0148] The transport layer transmits application layer messages between application endpoints. Transport layer packets are called segments. A transport layer protocol in a source host delivers a transport layer segment and destination address 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. These services include guaranteed delivery of application-layer messages to the destination and flow control (i.e., sender / receiver rate matching). TCP also breaks long messages into shorter ones and provides congestion control mechanisms, so that the source suppresses its transmission rate when the network is congested.
[0151] The UDP protocol provides a connectionless service to its applications. This is a service that does not provide unnecessary services, lacks reliability, flow control, and 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), routing protocols, etc.
[0154] IP Protocol: This protocol defines the various fields in a datagram and how end systems and routers interact with these fields. There is only one IP, and all Internet components with a network layer must run IP.
[0155] Routing protocol: Based on this route, datagrams are transmitted from source to destination. It can provide routers with 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 destination. To move packets from one node to the next 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 then passes it along the path to the next node. At that next node, the link layer passes the datagram up to the network layer. Link layer packets are called frames (FNMIes).
[0157] A router's link layer can consist of bridge devices, network interface cards (NICs), etc. Bridge devices forward frames, thereby enabling data communication and transmission.
[0158] A bridge device can correspond to one or more network interface cards (NICs). Terminal devices connected to the same bridge device's NICs are located on the same local area network (LAN). A bridge device can be understood as a gateway.
[0159] like Figure 4 As shown, the router has a bridge device br0. Bridge device br0 corresponds to: wired network card eth0, wireless network card wlan0, and wireless network card wlan1.
[0160] The Wi-Fi signal corresponding to the wireless network card wlan0 can be 2.4G Wi-Fi or 5G Wi-Fi, etc. The Wi-Fi signal corresponding to the wireless network card wlan1 can be 5G Wi-Fi or 2.4G Wi-Fi, etc. This application embodiment does not limit the specific frequency band of the Wi-Fi signal corresponding to the wireless network card.
[0161] It is understood that the frequency range of 2.4G Wi-Fi is 2.4GHz-2.4835GHz; and the frequency range of 5G Wi-Fi is 5.15GHz-5.825GHz. This application does not specifically limit the Wi-Fi frequency band corresponding to the wireless network card.
[0162] If the terminal device connected to the wireless network card wlan0 does not obtain the gateway address of the bridge device br0, the terminal device may not be able to obtain the router's routing information and thus connect to the Internet.
[0163] Physical Layer: This layer provides the physical connection to the link layer using transmission media (e.g., twisted-pair copper wire, single-mode fiber, etc.) and is responsible for handling data transmission (e.g., moving bits from one node to the next in a frame). This layer is the data transmission medium for network communication and is composed of cables and devices connecting different nodes.
[0164] The physical layer includes multiple downstream devices. These downstream devices can be terminal devices connected to the router.
[0165] The following is combined Figure 3 and Figure 4 The network connection process is explained.
[0166] Terminal devices can obtain the mini-program URL and router SN by scanning the mini-program code on the router body; they can then obtain and display the mini-program page through the URL, connect to the wireless network card (e.g., wlan0 or wlan1) in the router through the router SN, and thus connect the terminal device to the local area network where the router is located.
[0167] After connecting to the local area network (LAN) where the router is located, the terminal device sends a UDP packet to the router to request routing information. The UDP packet sent by the terminal device is transmitted through the connected wireless network card to the corresponding driver, and then through the corresponding bridge device (e.g., bridge device br0) to the network layer-transport layer-application layer. The router processes the received packet and forwards the response packet from the application layer-transport layer-network layer-driver-physical network card to the terminal device.
[0168] It should be noted that after a terminal device connects to the router's local area network by scanning the QR code on the router's casing, the terminal device and the router are on the same network segment and can communicate directly. When the terminal device connects to the internet through the router, it also needs to obtain the address (gateway address) of the bridge device in the router used for internet connection.
[0169] Typically, a router's default gateway address ends in 1. Terminal devices can try to guess the gateway address based on their network segment and the default 1 ending. In S308 above, the terminal device sends a message to the router to obtain routing information based on the guessed gateway address.
[0170] If the router's gateway address ends in 1, the terminal device can obtain routing information based on the guessed gateway address. If the router's gateway address does not end in 1, the terminal device cannot obtain routing information based on the guessed gateway address, and therefore cannot connect to the Internet.
[0171] For example, taking a router as a 3-network segment, when a terminal device connects 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 router's default gateway address is 192.168.3.1, the terminal device sends a UDP packet to 192.168.3.1. The packet can reach the router's br0 and receive a response packet.
[0173] If the router's default gateway address is 192.168.3.2, and the terminal device sends a UDP packet to 192.168.3.2, the packet cannot reach the router's br0 port, and the terminal device cannot receive a response packet from the router.
[0174] It should be noted that the router's gateway address can end with any integer between 1 and 254. In some embodiments, the router's default gateway address may not end with 1. In other embodiments, the router's gateway address may change, and the changed gateway address may not end with 1. For example, after a terminal device connects to the Internet through a router, it may receive an operation instructing it to change the router's corresponding gateway address, thus changing the router's gateway address, which may not end with 1.
[0175] For example, Figure 5 This is a schematic diagram illustrating the interaction flow for a possible network connection failure in a design. For example... Figure 5 As shown, the interaction flow includes:
[0176] S501, The terminal device receives the user's operation of scanning the applet code on the router body.
[0177] S502: In response to the user scanning the WeChat Mini Program code on the router, the terminal device displays the Mini Program's homepage and connects to the router's first Wi-Fi network based on the Mini Program code.
[0178] For details, please refer to S302-S307 above, which will not be explained in detail here.
[0179] The terminal device obtains the mini-program URL and router SN from the mini-program code. The terminal device uses the mini-program URL to retrieve the mini-program page from the first server. The first server returns the mini-program page to the terminal device. The terminal device displays the mini-program's homepage and uses the SN to calculate the first Wi-Fi SSID and password. The terminal device sends a request to the router to connect to the router's first Wi-Fi network. The router returns a message to the terminal device indicating a successful first Wi-Fi connection.
[0180] S503: The terminal device sends a request to the router to obtain routing information based on the guessed gateway address.
[0181] S504. The router returns routing information to the terminal device.
[0182] It is understandable that when a terminal device connects to the local area network where the router is located, the terminal device obtains an IP address.
[0183] Taking a terminal device with the IP address 192.168.3.2 as an example, the terminal device guesses the router's gateway address to be 192.168.3.1. The terminal device sends a request to obtain routing information based on 192.168.3.1. If the gateway address is correct, the router returns the routing information to the terminal device.
[0184] S505: The terminal device sends a request to the router to connect to the router's second Wi-Fi network.
[0185] Adaptively, the router returns a message to the terminal device indicating that the second Wi-Fi connection has been successfully established.
[0186] If the router's gateway address changes, the terminal device and the router shall execute the following steps S508-S510.
[0187] It is understood that the router's gateway address can be modified by the terminal device in this application embodiment, or by other terminal devices connected to the router. This application embodiment does not limit the method of modifying the router's gateway address. For example, the modification process includes: S506 and S507.
[0188] S506. The second server sends the modified gateway address to the router.
[0189] The second server can be a server used to set router-related parameters, including but not limited to: second gateway address, second WIFI SSID, etc.
[0190] It is understandable that the second server can send the modified gateway address to the router after receiving a message from the terminal device with the modified gateway address; the second server can also send the modified gateway address to the router after receiving a message from other terminal devices connected to the router with the modified gateway address.
[0191] In some embodiments, the second server may be a browser server, allowing users to access the router's management page via a browser on a terminal device and modify the second gateway address. 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 was 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, the terminal device displays the mini-program's homepage and connects to the router's primary Wi-Fi network.
[0195] For details, please refer to S302-S307 above, which will not be explained in detail here.
[0196] The terminal device obtains the mini-program URL and router SN from the mini-program code. The terminal device uses the mini-program URL to retrieve the mini-program page from the first server. The first server returns the mini-program page to the terminal device. The terminal device displays the mini-program's homepage and uses the SN to calculate the first Wi-Fi SSID and password. The terminal device sends a request to the router to connect to the router's first Wi-Fi network. The router returns a message to the terminal device indicating a successful first Wi-Fi connection.
[0197] S510: The terminal device sends a request to the router to obtain routing information.
[0198] For example, if a terminal device's IP address is 192.168.3.2 and the modified gateway address is 192.168.3.5, the terminal device might guess the router's gateway address is 192.168.3.1. The terminal device then sends a request to obtain routing information based on 192.168.3.1. If the gateway address is incorrect, the router will not receive the request from the terminal device, cannot return routing information, and will be unable to connect to the internet.
[0199] In view of this, embodiments of this application provide a network connection method and related apparatus. After connecting to a first Wi-Fi network, routing information is obtained through a bridge device with a fixed gateway address. The routing information is then used to connect to a second Wi-Fi network, thereby connecting to the Internet.
[0200] In this way, when the gateway address corresponding to the second Wi-Fi changes, the terminal device can obtain routing information through the first Wi-Fi, and then obtain the gateway address corresponding to the second Wi-Fi to achieve network connection.
[0201] Specifically, terminal devices can establish a local area network (LAN) connection with the router by directly scanning the target QR code pre-installed on the router. Then, through this LAN connection, they automatically obtain Wi-Fi connection information and establish a Wi-Fi connection via the router. This allows users to automatically connect to Wi-Fi simply by scanning the router's pre-installed QR code, without needing to manually enter a Wi-Fi password or other information, thus providing a better connection experience.
[0202] The terminal device first establishes a local area network connection with the router by parsing the first WIFI SSID and the first WIFI password from the target QR code, thus achieving an initial connection with the router. After the connection is established, it can obtain the WIFI connection information that allows internet access from the router through the local area network (first gateway address), such as the second WIFI SSID and the second WIFI password. Then, after connecting to the router using the WIFI connection information that allows internet access, the terminal device can connect to the network server through the router to access the internet.
[0203] The technical solution of this application and how it solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be implemented independently or in combination with each other. The same or similar concepts or processes may not be described again in some embodiments.
[0204] For ease of understanding, the software architecture of the router provided in the embodiments of this application will be described below. For example, Figure 6 This is a schematic diagram of a network architecture provided for an embodiment of this 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 be referenced as described above. Figure 4 The relevant explanations will not be repeated here.
[0206] like Figure 6 As shown, the router is equipped 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 in the mini-program page or in the mini-program code.
[0207] For example, the relevant information of the bridge device br0 in the router can be as follows:
[0208] Link encapsulation: Ethernet HWaddr: 42:AC:73:F7:4C:57
[0209] Intranet address (inet addr): 192.168.3.1 BCC (Bcast): 192.168.3.255 Subnet mask (Mask): 255.255.255.0
[0210] Intranet 6 address (inet6 addr): fe80::40ac:73ff:fef7:4c57 / 64 Scope: Link
[0211] Uplink Broadcast Running Normal MTU: 1500 Metric: 1
[0212] Received packets (RX packets): 49745 Errors: 0 Dropped: 12 Timeouts: 0 Frames: 0
[0213] Transmitted packets (TX packets): 34438 Errors: 0 Dropped: 0 Timeouts: 0 Carrier: 0
[0214] Collision: 0; Launch queue length: 1
[0215] Received bytes (RX bytes): 19450873 (18.5 KiB) Transmitted bytes (TX bytes): 13071361 (12.4 KiB)
[0216] The relevant information for the bridge device br2 is 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 is understandable that the intranet address (inet addr) is the same as the gateway address.
[0226] The Wi-Fi signal corresponding to the wireless network card wlan0 can be 2.4G Wi-Fi or 5G Wi-Fi, etc. The Wi-Fi signal corresponding to the wireless network card wlan1 can be 5G Wi-Fi or 2.4G Wi-Fi, etc. The Wi-Fi signal corresponding to the wireless network card wlan1.5 can be 2.4G Wi-Fi or 5G Wi-Fi, etc. This application embodiment does not specifically limit the Wi-Fi signal corresponding to the wireless network card.
[0227] In some embodiments, the Wi-Fi network corresponding to the wireless network card WLAN1.5 is 2.4GHz Wi-Fi. This means that more terminal devices support 2.4GHz Wi-Fi, reducing the likelihood of some terminal devices that do not support 5GHz Wi-Fi being unable to connect to the first Wi-Fi network, thus increasing the router's usability. It is understood that terminal devices supporting 5GHz Wi-Fi will usually also support 2.4GHz Wi-Fi; however, terminal devices supporting 2.4GHz Wi-Fi may not necessarily support 5GHz Wi-Fi.
[0228] In this embodiment, the terminal device connects to the router's first Wi-Fi network via a mini-program code and can obtain routing information through the gateway address corresponding to the pre-configured bridge device br2. It then connects to the second Wi-Fi network based on 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 still connect to the Internet.
[0229] The following is combined Figure 6 The network connection process is explained.
[0230] Terminal devices 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 (e.g., wlan1.5) corresponding to the bridge device br2 in the router.
[0231] After connecting to the first Wi-Fi network, the terminal device sends a UDP packet to the router based on the gateway address corresponding to the bridge device br2 to request routing information. The UDP packet sent by the terminal device is forwarded from the connected wireless network card to the driver layer, and then through the corresponding bridge device (e.g., bridge device br2) to the network layer-transport layer-application layer. The router processes the received packet and forwards the response packet from the application layer-transport layer-network layer-driver layer-physical network card back to the terminal device.
[0232] For example, Figure 7 A flowchart illustrating a network connection method provided in an embodiment of this application can also be shown. For example... Figure 7 As shown, the method includes:
[0233] S701, The terminal device receives the user's operation of scanning the applet code on the router body.
[0234] S702: In response to the user scanning the QR code on the router's internal interface, the terminal device displays the homepage of the mini-program and connects to the router's primary Wi-Fi network.
[0235] Specifically, the terminal device obtains the mini-program URL and router SN from the mini-program code. The terminal device uses the mini-program URL to retrieve the mini-program page from the first server. The first server returns the mini-program page to the terminal device. The terminal device displays the mini-program's homepage and uses the SN to calculate the first Wi-Fi SSID and password. The terminal device sends a request to the router to connect to the router's first Wi-Fi. The router returns a message to the terminal device indicating a successful first Wi-Fi connection. For detailed explanations, please refer to S302-S307 above; they will not be repeated here.
[0236] In some embodiments, the first Wi-Fi is 2.4G Wi-Fi. This reduces the number of terminal devices that cannot connect due to lack of 5G Wi-Fi support, increasing the router's usability.
[0237] For example, with Figure 6 Taking the router shown as an example, the first WIFI is the WIFI corresponding to the wireless network card wlan1.5.
[0238] Following S702, terminal devices can send requests to the router to obtain IP addresses based on the first gateway address. The bridge device corresponding to the first gateway address in the router, such as br2, can assign the first IP address to the terminal device. When the terminal device sends a packet to the router based on the first IP address and the gateway IP address corresponding to br2, br2 can forward the packet. Furthermore, the forwarding gateway in the firewall can intercept the packets reported by br2 to prevent the terminal device from connecting to the internet via the first Wi-Fi network. The first gateway address can be set by default in the terminal device.
[0239] S703. The terminal device sends a request to the router to obtain routing information based on the first gateway address.
[0240] The first gateway address can be pre-set in the mini-program code or in the mini-program page. This application embodiment does not limit the method of obtaining the first gateway address.
[0241] In some embodiments, the terminal device obtains the mini-program URL and router SN from the mini-program code. The terminal device uses the mini-program URL to obtain the first gateway address from the first server.
[0242] In other embodiments, the terminal device obtains the mini-program URL, router SN, and first gateway address from the mini-program code.
[0243] In some embodiments, the terminal device sends a UDP packet to the router, the destination address of which is a first gateway address. Alternatively, upon receiving the UDP packet, the router retrieves a second gateway address stored in the router. The router then sends a reply packet to the terminal device. The reply packet includes routing information carrying the second gateway address.
[0244] The second gateway address can be stored in a module with storage function in the router. This application embodiment does not limit the storage location of the second gateway address.
[0245] For example, with 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 a first gateway address of 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 retrieves the second gateway address stored in the router.
[0247] S704. The router returns routing information to the terminal device, which includes the second gateway address.
[0248] For example, with 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 to the router to connect to the router's second Wi-Fi network based on the second gateway address.
[0250] The second Wi-Fi is the Wi-Fi corresponding to wireless network card wlan0, or the Wi-Fi corresponding to wireless network card wlan1.
[0251] Taking the second gateway address as 192.168.3.1 as an example, the address corresponding to the request in S705 to connect to the second WIFI of the router is 192.168.3.1.
[0252] S706. The router returns a message to the terminal device indicating that the second WIFI connection has been successfully established.
[0253] For example, the terminal device connects to the Internet via a bridge device br0.
[0254] If the router's gateway address changes, the terminal device and the router shall execute the following S709-S714.
[0255] It is understood that the router's gateway address can be modified by the terminal device in this application embodiment, or by other terminal devices connected to the router. This application embodiment does not limit the method of modifying the router's gateway address. For example, the modification process includes: S707 and S708.
[0256] Following S706, terminal devices can send requests to the router to obtain IP addresses. Router br0 can then assign a second IP address to the terminal device. When a 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. Furthermore, the forwarding gateway in the firewall can forward the messages reported by br2 to the network server, enabling the terminal device to connect to the internet via the second Wi-Fi network.
[0257] For example, based on the second Wi-Fi connection, the terminal device sends a first data packet to the router, which can then forward the first data packet to the network server. Adaptively, the network server can respond to the received first data packet and generate a second data packet corresponding to the first data packet. The network data packet can then return the second data packet to the terminal device through the router, enabling the terminal device to connect to the internet via the second Wi-Fi. It can be understood that the first data packet is the data packet that accesses the network server through the router, and the second data packet is the response data packet generated by the network server when it receives the first data packet.
[0258] In one possible implementation, the terminal device can close the first Wi-Fi connection after establishing the second Wi-Fi connection. For example, the terminal device sends a request to the router to close the first Wi-Fi connection, and the router returns a message to the terminal device indicating that the first Wi-Fi connection has been 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 can come from the terminal device or other terminal devices connected to the router.
[0262] In some embodiments, the second server can be a browser server. Users access the router's management page through the browser, then navigate to the local area network (LAN) page via network settings within the LAN page, where they can modify the second gateway address. The second server then sends a message requesting modification of the second gateway address to the router to change the router's second gateway address.
[0263] S708: The router sends a message to the second server indicating that the modification was successful.
[0264] If the router's gateway address is modified, the interaction process when the terminal device reconnects to the router 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 WeChat Mini Program code on the router, the terminal device displays the Mini Program's homepage and connects to the local area network where the router is located.
[0267] S711. The terminal device sends a request to the router to obtain routing information based on the preset gateway address.
[0268] S712: The router returns routing information to the terminal device. 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 of S713 is 192.168.3.5.
[0270] S713, The terminal device sends a request to the router to connect to the router's second Wi-Fi network.
[0271] Taking the modified second gateway address as 192.168.3.5 as an example, the address corresponding to the request in S714 for connecting to the second WIFI of the router is 192.168.3.5.
[0272] S714. The router returns a message to the terminal device indicating that the second WIFI connection has been successfully established.
[0273] In this way, the terminal device can connect to the Internet even after the gateway address changes. Furthermore, compared to retrieving pre-stored routing information from a cloud server, the method provided in this application is low-cost and highly practical.
[0274] For example, Figure 8 This is a schematic diagram illustrating a network connection process provided in an embodiment of this application. Figure 8 As shown, the method includes:
[0275] S801: The terminal device establishes a local area network connection with the router's first Wi-Fi network based on the first Wi-Fi SSID and the first Wi-Fi password.
[0276] The acquisition of the first Wi-Fi SSID and the first Wi-Fi password can be referred to S301-S305 above. The first Wi-Fi SSID and the first Wi-Fi password can also be acquired by other means, which are not limited in this embodiment.
[0277] S802, The terminal device obtains the router's second gateway address based on the first gateway address.
[0278] In this embodiment, the router can intercept packets reported by the first bridge device corresponding to the first gateway address to prevent the terminal device from connecting to the internet via the first Wi-Fi. The router does not intercept packets reported by the second bridge device corresponding to the second gateway address, allowing the terminal device to connect to the internet via the second Wi-Fi.
[0279] In some embodiments, S802 includes: S8021-S8023.
[0280] S8021. After establishing a local area network connection with the router's first Wi-Fi network, the terminal device sends a UDP packet to the router. This UDP packet is used to obtain the second gateway address. The destination address of this UDP packet is the first gateway address.
[0281] S8022: After receiving a UDP packet, the first bridge device in the router obtains the second gateway address, the second WIFISSID, and the second WIFI password.
[0282] The first bridge device can obtain the second gateway address from a module with storage capabilities. Alternatively, the first bridge device stores the second gateway address.
[0283] S8023, the first bridge device sends a reply message to the terminal device, which includes the second gateway address, the second WIFI SSID, and the second WIFI password.
[0284] Terminal devices can obtain a second gateway address for internet access through the first bridge device. Thus, 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. Furthermore, if the gateway address is changed, the terminal device can obtain the second Wi-Fi SSID and password through the first gateway address, and then connect to the second Wi-Fi network.
[0285] S803. The terminal device establishes a connection with the router's second Wi-Fi network based on the second Wi-Fi SSID and password. Alternatively, after establishing a connection with the router's second Wi-Fi network, the terminal device can communicate with the internet via the second gateway address. For example, the terminal device can perform router configuration, internet access, and other operations via the second gateway address.
[0286] Understandably, after establishing a local area network connection with the router, a terminal device can obtain a new gateway address. The terminal device can then connect to the internet for network communication using this new gateway address. Therefore, even if the gateway address used for internet access is modified, or is not the default gateway address, the terminal device can still connect to the internet through the router. Furthermore, this method is less costly compared to storing the gateway address used for internet access on a cloud server.
[0287] For example, Figure 9 This is a flowchart illustrating a network connection method provided in an embodiment of this application. Figure 9 As shown, the method includes:
[0288] S901, The terminal device receives the user's operation of scanning the mini-program code on the router body.
[0289] The router can have a QR code attached to its body. This QR code can be generated from the mini-program's uniform resource locator (URL) and the router's serial number (SN). Therefore, terminal devices can obtain the mini-program's URL and router SN by scanning the QR code.
[0290] It's understandable that a router's serial number (SN) is unique, and therefore, the mini-program code is also unique; that is, one router can correspond to one mini-program code. The Wi-Fi network carried by the mini-program code can be open, meaning users can search for the router's Wi-Fi network using their terminal devices. If the Wi-Fi network carried by the mini-program is hidden, the terminal device will not be able to successfully connect to the router's Wi-Fi.
[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: Terminal devices use the mini-program URL to retrieve mini-program pages from the server.
[0293] The first server can be understood as... The application public platform is used to provide services for terminal devices. The application provides a mini-program page. For example, a terminal device can send a request to a first server to retrieve a mini-program page. This request may include the mini-program URL. The first server can then return a pre-stored mini-program page to the terminal device, allowing the terminal device to launch the mini-program page from the server based on the mini-program URL parsed from the mini-program code.
[0294] S904. The server returns the 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 is shown in the image.
[0297] The first Wi-Fi network can be the router's initial Wi-Fi network, also known as a fixed Wi-Fi network. The SSID and password of this first Wi-Fi network are set at the factory and cannot be modified by the user. Furthermore, the SSID and password of the first Wi-Fi network can be calculated from the router's serial number (SN).
[0298] The gateway address corresponding to the first Wi-Fi network is set by the router at the factory and cannot be modified by users.
[0299] S906. The terminal device sends a request to the router to connect to the router's first Wi-Fi network.
[0300] The request to connect to the router's first Wi-Fi network may include: the first Wi-Fi SSID and the first Wi-Fi password.
[0301] S907. The router returns a message to the terminal device indicating that the first WIFI connection was successful.
[0302] Understandably, since the first Wi-Fi SSID and password are fixed, the terminal device can use the first Wi-Fi to access the router's local area network. The first Wi-Fi SSID and password can act as a bridge to enable data exchange between the terminal device and the router. In this scenario, the router has already configured security settings in its firewall to allow local area network communication between the terminal device and the router, but prevents internet access.
[0303] S908: The terminal device sends a request to the router to obtain routing information based on the first gateway address.
[0304] Routing information can be information obtained from the router, and may include one or more of the following: the router's second WIFI SSID, second WIFI password, second gateway address, internet access status, or information indicating whether the router wizard configuration is complete.
[0305] The second Wi-Fi network can be understood as the router's actual Wi-Fi network or a modifiable Wi-Fi network. Users can typically change the second Wi-Fi SSID to an easily identifiable name. For details on the second Wi-Fi SSID, please refer to the corresponding explanation above; it will not be repeated here.
[0306] The internet connection status can include: network connected, network disconnected, etc.
[0307] S909: The router returns routing information to the terminal device. This routing information includes the address of the second gateway.
[0308] Accordingly, after receiving the routing information returned by the router, the terminal device can display, as follows: Figure 2 The interface shown in b is shown in the diagram. Furthermore, the terminal device can connect to the router's second Wi-Fi network using the second gateway address, second Wi-Fi SSID, and second Wi-Fi password from the routing information, for example, by performing the steps shown in S811.
[0309] S910: The terminal device sends a request to the router to connect to the router's second Wi-Fi network.
[0310] The request to connect to the router's second Wi-Fi network may include: the second Wi-Fi SSID and the second Wi-Fi password.
[0311] S911, The router returns a message to the terminal device indicating that the second WIFI connection has been successfully established.
[0312] Accordingly, when the terminal device receives a message indicating that the second WIFI connection has been successful, the second device can determine that it has successfully connected to the router's WIFI.
[0313] It is understandable that, since users usually change the first Wi-Fi SSID and password to obtain the second Wi-Fi SSID and password, when a terminal device connects to the router, the terminal device cannot directly obtain the user's modified second Wi-Fi SSID and password.
[0314] Therefore, a terminal device can effectively access the router using a fixed first Wi-Fi SSID and first Wi-Fi password, and then further obtain a second Wi-Fi SSID and second Wi-Fi password to connect to the router's Wi-Fi. The advantage of using the first Wi-Fi SSID and first Wi-Fi password for local area network communication between the terminal device and the router is that regardless of changes to the second Wi-Fi SSID and second Wi-Fi password, the terminal device can still achieve local area network communication with the router using the fixed first Wi-Fi. When there are multiple routers, the first Wi-Fi SSID and first Wi-Fi password obtained by the terminal device when connecting to each router are different, which also prevents incorrect connections.
[0315] Based on the above embodiments, the routing information also includes: information indicating whether the router wizard configuration is complete. This router wizard configuration can be understood as setting the router's internet access method, enabling the router to connect directly to the internet after scanning the mini-program code.
[0316] It is understandable that if the terminal device has not configured the router, the routing information may not include the second WIFI SSID and the second WIFI password. The information used to indicate whether the router wizard configuration has been completed may indicate that the router wizard configuration has not been completed.
[0317] After step 909 above, when the terminal device determines that the user has performed wizard configuration based on the information in the routing information indicating whether the router wizard configuration has been completed, the terminal device can connect to the router's second WIFI based on the second gateway address, the second WIFI SSID, and the second WIFI password, for example, by performing the steps shown in S910.
[0318] Alternatively, if 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 has been completed, the terminal device can display something like... Figure 10The interface shown detects the internet access method. This interface includes: text indicating that the terminal device and router have completed information synchronization; text indicating the second step of internet access configuration; and text indicating the third step of setup completion.
[0319] After completing the router configuration, the terminal device can connect to the Internet via DHCP or PPPoE, and then execute the steps shown in S911.
[0320] When the terminal device detects that the internet connection method is DHCP, the terminal device can... Figure 10 The interface shown has switched to Figure 11A The interface shown includes: an indicator for showing internet access status, a text box 1001 for setting the Wi-Fi name, a text box 1002 for setting the Wi-Fi 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 program, a control for agreeing to automatic upgrades of the mini-program, or a configuration completion control 1003, etc.
[0321] The control indicating internet access status may display the words "Network connected"; the control for agreeing to the privacy statement may display "I have read and agree to the End User License Agreement and understand the statement regarding the smart router and privacy", where the smart router is the router described in the embodiments of this application; the control for downloading the Smart Space APP may display the words "Download Now"; the control for agreeing to automatically upgrade the mini-program may display "Automatically upgrade the device's applications and services to provide a better user experience (3:00-5:00 AM)".
[0322] Text box 1001 can display the first Wi-Fi service set identifier (SSID) by default. Text box 1002 can omit the password and only display "Please enter the password" to prompt the user to enter the second Wi-Fi password. For example, text box 1001 could display "mingcheng1234". Alternatively, text box 1001 can also omit the first Wi-Fi SSID; in this scenario, text box 1001 can display "Please enter the Wi-Fi name" to prompt the user to enter the second Wi-Fi SSID. Figure 11A Not shown in the interface. The WIFI SSID is the name of the wireless signal transmitted by the router, also known as the WIFI name.
[0323] When the terminal device receives an operation from the user to enter a second Wi-Fi SSID in text box 1001, text box 1001 displays the second Wi-Fi SSID entered by the user; when the terminal device receives an operation from the user to enter a second Wi-Fi password in text box 1002, text box 1002 displays the second Wi-Fi password entered by the user. In some embodiments, the terminal device can use "*" to hide the second Wi-Fi password entered by the user.
[0324] When the terminal device receives a user's trigger operation for the configuration control 1003, the terminal device sends the corresponding configuration information to the router to complete the router configuration.
[0325] When the terminal device detects that the internet access method is PPPoE, the terminal device can... Figure 10 The interface shown has switched to Figure 11B The interface shown includes a text box 1004 for entering the broadband account number or a text box 1005 for entering the broadband password. Other content displayed on this interface can be... Figure 11A The interface shown is similar, so it will not be described in detail here.
[0326] The text box 1004 can display the words "Please enter your broadband account" to prompt the user to enter the broadband account provided by the operator when the user applied for PPPOE Internet access; the text box 1005 can display the words "Please enter your broadband password" to prompt the user to enter the broadband password provided by the operator when the user applied for PPPOE Internet access, and the broadband account and broadband password can only be used to access the Internet via PPPOE if they are entered correctly.
[0327] When the terminal device receives an operation from the user entering a broadband account in text box 1004, text box 1004 displays the entered broadband account; when the terminal device receives an operation from the user entering a broadband password in text box 1005, text box 1005 displays the entered broadband password; when the terminal device receives an operation from the user entering a second Wi-Fi SSID in text box 1006, text box 1006 displays the entered second Wi-Fi SSID; when the terminal device receives an operation from the user entering a second Wi-Fi password in text box 1007, text box 1007 displays the entered second Wi-Fi password. In some embodiments, the terminal device can use "*" to hide the user-entered second Wi-Fi password.
[0328] When the terminal device receives a user's trigger operation for the configuration control 1008, the terminal device sends the corresponding configuration information to the router to complete the router configuration.
[0329] In some embodiments, when the terminal device does not receive routing information from the router within a certain time threshold after sending a request to obtain routing information, the terminal device may display the following: Figure 12 The interface shown in section 'a'. Furthermore, when the terminal device detects a user's trigger operation on the re-detection control 1101, the terminal device can re-execute the steps shown in S802-S810 to re-detect the routing information and enter... Figure 12 The interface shown in b is shown in the image.
[0330] Based on the above embodiments, after the terminal device connects to the router's second Wi-Fi network, it can also configure the router. The configuration process includes: S912-S915.
[0331] S912, The terminal device sends a request to the router to obtain the Internet access method.
[0332] For example, if the terminal device determines that the user has not performed wizard configuration based on the routing information obtained by the terminal device based on S909, which indicates whether the router wizard configuration has been completed, the terminal device may display the following: Figure 11A The interface shown or Figure 11B The interface shown in S912 is executed, and a request to obtain Internet access method is sent to the router.
[0333] S913, the router returns the Internet access method detection results to the terminal device.
[0334] The results of the Internet access method detection include, but are not limited to: the second WIFI SSID, second WIFI password, second gateway address, Internet access status, or information indicating whether the router wizard configuration is complete.
[0335] In this embodiment, the internet access method can be DHCP, PPPoE, or other methods, which are not limited here. When the internet access method is PPPoE, the parameter information also includes the broadband account and broadband password.
[0336] S914. When the terminal device receives a user's trigger operation for completing the configuration control, the terminal device sends configuration information to the router.
[0337] This configuration information may include: Wi-Fi configuration information, or configuration information corresponding to the internet access method and Wi-Fi configuration information. The Wi-Fi configuration information may include: the second gateway address, the second Wi-Fi SSID, and the second Wi-Fi password. When the internet access method is PPPoE, the configuration information corresponding to this method may include: the broadband account and broadband password; alternatively, when the internet access method is DHCP, the configuration information may not include the corresponding DHCP internet access configuration information.
[0338] S915, the router returns the configuration result to the terminal device.
[0339] Furthermore, when the terminal device receives a message from the router indicating successful configuration, the terminal device can perform the steps shown in S811-S812 based on the configured second WIFI SSID and second WIFI password to connect to the router's second WIFI.
[0340] Based on this, the terminal device can not only connect with a single scan, but also configure the router within the same scan, simplifying the router configuration process for users and making it easy for ordinary users to configure the router with zero barriers.
[0341] Based on the above embodiments, once the terminal device successfully connects to the first Wi-Fi network, the terminal device and the router can establish an encrypted communication link. This increases the security of the interaction between the terminal device and the router.
[0342] For example, terminal devices and routers can be encrypted using symmetric keys.
[0343] Specifically, the terminal device sends a request to the router to obtain the symmetric key. The router then returns the symmetric key to the terminal device. Subsequent communication between the terminal device and the router can be encrypted using the symmetric key to ensure data transmission security.
[0344] In this embodiment of the application, the request for obtaining the symmetric key may include: router SN and signature information, wherein the signature information is information obtained by the terminal device using the private key to sign the router SN.
[0345] The terminal device's mini-program can pre-configure a 1024-bit public key cryptography standards (PKCS) #8 padded RSA asymmetric encryption algorithm private key, and the router's routing plugin process can pre-configure a 1024-bit PKCS #8 padded RSA asymmetric encryption algorithm public key.
[0346] Adaptively, after the router receives the router's serial number (SN) and signature information in the request to obtain the symmetric key, the router can use its public key to decrypt the signature information and compare the decrypted information with the router's SN. After successful signature verification, the router can determine that the request to obtain the symmetric key was sent by a mini-program in the terminal device, and then return the generated symmetric key to the terminal device.
[0347] In this embodiment of the application, the symmetric key can be encrypted using encryption methods such as data encryption algorithm (DEA), advanced encryption standard (AES), and RSA encryption algorithm.
[0348] In some embodiments, the symmetric key can be an AES symmetric encryption key. This results in high encryption and decryption efficiency and short processing time, further reducing the interaction time between the terminal device and the router and improving the user experience.
[0349] The methods of the embodiments of this application have been described above. The apparatus for performing the above methods, provided in the embodiments of this application, is described below. Those skilled in the art will understand that the methods and apparatus can be combined with and referenced by each other, and the related apparatus provided in the embodiments of this application can perform the steps in the above methods.
[0350] The network connection method provided in this application can be applied to electronic devices with communication functions. Electronic devices include terminal devices, and the specific device form of the terminal device can be referred to the above-described related information, which will not be repeated here.
[0351] For example, Figure 13 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Figure 13As shown, the terminal device includes: 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, a headphone jack 170D, a sensor module 180, buttons 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, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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 understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device. In other embodiments of this application, the terminal device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0353] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0354] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0355] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, 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. Interfaces 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 understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the terminal device. In other embodiments of this application, the terminal device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0358] The charging management module 140 receives 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 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the terminal device. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0359] The power management module 141 connects 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, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0360] The terminal device implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0361] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device may include one or N displays 194, where N is a positive integer greater than 1.
[0362] Terminal devices can achieve shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0363] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0364] Camera 193 is used to capture still images or videos. In some embodiments, the terminal device may include one or N cameras 193, where N is a positive integer greater than 1. The types of cameras 193 may differ; for example, cameras 193 may include cameras for acquiring color images or TOF cameras, etc. In this application embodiment, a camera can be understood as a camera. Cameras include: AO cameras, TOF cameras, etc., as described in this application embodiment.
[0365] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.
[0366] Internal memory 121 can be used to store executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area.
[0367] The terminal device can implement audio functions such as music playback and recording through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor.
[0368] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. The terminal device can receive button input and generate key signal inputs related to user settings and function control of the terminal device. Indicator 192 can be an indicator light, used to indicate charging status, power level changes, messages, missed calls, notifications, etc.
[0369] In addition to the aforementioned components, the device also runs an operating system, such as iOS, Android, or Windows. Applications can be installed and run on this operating system.
[0370] The software system of terminal devices can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc., which will not be elaborated here.
[0371] This application provides a terminal device, which includes a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the terminal device to perform the above-described method.
[0372] This 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, causing the router to perform the above-described method.
[0373] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0374] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium 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 accessible 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 disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0376] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.
[0377] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0378] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A network connection method, characterized in that, Applied to a router, the method includes: The router establishes a first Wi-Fi connection with the terminal device based on the first Wi-Fi SSID and the first Wi-Fi password; After establishing the first WIFI connection, the router receives a first request. The first request is sent by the terminal device based on the first gateway address. The first gateway address is obtained in advance by the terminal device and 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, wherein the second gateway address is the address corresponding to the second bridge device in the router. The router establishes a second Wi-Fi connection with the terminal device based on the second Wi-Fi SSID and the second Wi-Fi password; 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 router establishes a third Wi-Fi connection with the terminal device based on the third Wi-Fi SSID and the third Wi-Fi password; wherein the third Wi-Fi SSID is the same as the first Wi-Fi SSID, and the third Wi-Fi password is the same as the first Wi-Fi password; After establishing the third Wi-Fi connection, the router receives a second request from the terminal device, which 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, the second message including: a fourth WIFI SSID, a fourth WIFI password, and the third gateway address; The router establishes a fourth Wi-Fi connection with the terminal device based on the fourth Wi-Fi SSID and the fourth Wi-Fi password, wherein the fourth Wi-Fi SSID is the same as the second Wi-Fi SSID, and the fourth Wi-Fi password is the same as the second Wi-Fi password.
2. The method according to claim 1, characterized in that, The method further includes: The router receives a third message, which is used to indicate that the address of the second bridge device be modified to the address of the third gateway. 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 packet, and the destination address of the UDP packet is the first gateway address; the first message is a response packet, and the response packet is a packet generated by the first bridge device in response to the UDP packet.
4. The method according to any one of claims 1-3, characterized in that, The first gateway address is obtained from the first server based on the Uniform Resource Locator URL corresponding to the target QR code. The URL is obtained by scanning the target QR code, which is the QR code corresponding to the router.
5. The method according to any one of claims 1-4, characterized in that, The first WIFI SSID and the first WIFI password are obtained by the terminal device by scanning the target QR code. The first WIFI SSID and the first WIFI password are determined based on the router's attribute parameters.
6. The method according to claim 4 or 5, characterized in that, The target QR code is a mini-program code.
7. The method according to any one of claims 1-6, characterized in that, The first WIFI connection is a local area network (LAN) connection, and the third WIFI connection is a LAN connection.
8. The method according to any one of claims 1-7, characterized in that, After establishing the second Wi-Fi connection, the method further includes: The router receives a first data packet, which is sent by the terminal device based on the second WIFI connection and the second gateway address. The first data packet is a data packet that accesses the network server through the router. The router sends a second data packet to the terminal device, the second data packet being a response data packet generated by the network server when it receives the first data packet.
9. The method according to any one of claims 1-8, characterized in that, After establishing the second Wi-Fi connection, the method further includes: The router receives a third request, which is sent by the terminal device based on the second Wi-Fi 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, which may be either PPPoE (Point-to-Point Ethernet) or DHCP (Dynamic Host Configuration Protocol).
10. The method according to any one of claims 1-9, characterized in that, The router's attribute parameters include: the router's serial number (SN), the first Wi-Fi SSID, and the first Wi-Fi password, which are determined based on the SN.
11. The method according to any one of claims 1-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 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.
12. The method according to any one of claims 1-11, characterized in that, The first WIFI is a 2.4G WIFI.
13. A network connection method, characterized in that, Applied to a terminal device, the method includes: The terminal device receives a first operation from the user to scan a target QR code, where the target QR code is the QR code corresponding to the 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. 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 Wi-Fi connection with the router based on the first Wi-Fi SSID and the first Wi-Fi 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 obtained in advance by the terminal device and 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: a second WIFI SSID, a second WIFI password, and a second gateway address. The first message is a message generated by the router in response to the first request. The second gateway address is the address corresponding to the second bridge device in the router. The terminal device establishes a second Wi-Fi connection with the router based on the second Wi-Fi SSID and the second Wi-Fi password; The method further includes, after the address of the second bridge device is changed from the second gateway address to the third gateway address: The terminal device receives a second operation from the user scanning the target QR code; In response to the second operation, the terminal device obtains the third WIFI SSID and the third WIFI password based on the target QR code; The terminal device establishes a third Wi-Fi connection with the router based on the third Wi-Fi SSID and the third Wi-Fi password; wherein the third Wi-Fi SSID is the same as the first Wi-Fi SSID, and the third Wi-Fi password is the same as the first Wi-Fi password; After establishing the third Wi-Fi 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, the second message being a message generated by the router in response to the second request; The terminal device establishes a fourth Wi-Fi connection with the router based on the fourth Wi-Fi SSID and the fourth Wi-Fi password, wherein the fourth Wi-Fi SSID is the same as the second Wi-Fi SSID, and the fourth Wi-Fi password is the same as the second Wi-Fi password.
14. The method according to claim 13, characterized in that, After establishing the second Wi-Fi connection, the method further includes: The terminal device receives a third operation from 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.
15. The method according to claim 13 or 14, characterized in that, The first request is a UDP packet, and the destination address of the UDP packet is the first gateway address; The first message is a response message, which 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-15, characterized in that, 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; 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, the fifth request including the URL; The terminal device receives a sixth message from the first server and displays a first prompt message on a 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. The first prompt message is used to prompt the terminal device to enter the QR code connection system.
18. The method according to any one of claims 13-17, characterized in that, The target QR code is a mini-program code.
19. The method according to any one of claims 13-18, characterized in that, The first WIFI connection is a local area network (LAN) connection, and the third WIFI connection is a LAN connection.
20. The method according to any one of claims 13-19, characterized in that, After establishing the second Wi-Fi 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. The first data packet is a data packet that accesses 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 by the network server when it receives the first data packet.
21. The method according to any one of claims 13-20, characterized in that, After establishing the second Wi-Fi 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, which is a message generated by the router in response to the third request. The fourth message includes the router's Internet access method, which includes: Ethernet Point-to-Point Communication Protocol (PPPOE) or Dynamic Host Configuration Protocol (DHCP).
22. The method according to any one of claims 13-21, characterized in that, The router's attribute parameters include: the router's serial number (SN), the first Wi-Fi SSID, and the first Wi-Fi password, which are determined based on the SN.
23. The method according to any one of claims 13-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-executed instructions; The processor executes computer execution instructions stored in the memory, causing the router to perform the method as described in any one of claims 1-12.
25. A terminal device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the terminal device to perform the method as described in any one of claims 13-23.
26. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-12, or the method as described in any one of claims 13-23.
27. A computer program product, characterized in that, Includes a computer program that, when run, causes a computer to perform the method as described in any one of claims 1-11, or to implement the method as described in any one of claims 13-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