Processing method and device in router connection
By distinguishing the access types of terminal devices in the router and controlling the device online process, the problem of router resource waste is solved and more efficient resource management is achieved.
Patent Information
- Application Number
- CN202310638025.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-05-31
AI Technical Summary
In the process of connecting the terminal device to the router WIFI, there is a waste of router resources, especially when the router performs the device online process for the connected terminal device, resulting in resource occupation and waste.
By distinguishing in the router whether the terminal device is accessed through the first WIFI or the second WIFI, only the devices that meet the preset bridge conditions are processed for device online processing, and the online process of devices that do not meet the conditions is ignored, thereby reducing resource waste. The specific method includes establishing a WIFI connection between the router and the terminal device, judging the bridge type through ARP messages and bridge information, and deciding whether to execute the device online process.
It effectively reduces the waste of router resources, avoids the device online process for terminal devices that do not meet the preset conditions, and improves resource management efficiency.
Smart Images

Figure CN117715149B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a processing method and device in router connection. Background Art
[0002] With the popularization and development of the Internet, wireless fidelity (WIFI) technology has been widely used in daily life and office scenarios. WIFI technology is a wireless local area network technology based on the Institute of Electrical and Electronics Engineers (IEEE) 802.11 standard.
[0003] Normally, the terminal device can scan the QR code corresponding to the router through WeChat, connect to the router WIFI, and then connect to the Internet.
[0004] However, in the process of connecting the terminal device to the router WIFI, there is a waste of router resources. Summary of the invention
[0005] The embodiments of the present application provide a method and device for processing in a router connection, which are used to reduce the waste of resources in the router.
[0006] In the first aspect, the embodiment of the present application provides a processing method in a router connection, which is applied to a router, wherein the router includes a first network bridge, and the method includes: a first WIFI connection is established between the router and the terminal device based on a first WIFI SSID and a first WIFI password; after the first WIFI connection, the router sends a first message to the terminal device, wherein the first message includes a first IP address of the terminal device, and the first IP address and the first gateway address corresponding to the first network bridge are in the same network segment; the router receives a second message from the terminal device, wherein the second message includes: a first MAC address corresponding to the first IP address, and the second message is a message transmitted through the first network bridge and generated by the terminal device in response to the first message; when the router determines that the first network bridge does not meet the preset network bridge, the router does not perform device online processing on the terminal device indicated in the first MAC address. In this way, the router can prevent the device online process of the terminal device after the first WIFI connection through the preset network bridge, so as to reduce the waste of resources in the router.
[0007] Among them, the first bridge may be br2, and the preset bridge may be br0.
[0008] In a possible implementation, the router further includes: a second network bridge, and the method further includes: establishing a second WIFI connection between the router and the terminal device based on the second WIFI SSID and the second WIFI password; after the second WIFI connection, the router sends a third message to the terminal device, the third message includes the second IP address of the terminal device, and the second IP address and the second gateway address corresponding to the second network bridge are in the same network segment; the router receives a fourth message from the terminal device, the fourth message includes the second MAC address corresponding to the second IP address, the fourth message is transmitted through the second network bridge, and the fourth message is a message generated by the terminal device in response to the third message; when the router determines that the second network bridge meets the preset network bridge, the router performs device online processing on the terminal device indicated in the second MAC address. It can be understood that the router can distinguish whether the terminal device is accessed through the first WIFI or the second WIFI, and then perform the device online process on the terminal device accessed by the second WIFI.
[0009] The second network bridge may be br0.
[0010] In a possible implementation, the router includes an IPcheck process, and the router determines that the first bridge does not meet the preset bridge, including: the IPcheck process obtains the first bridge indicated in the socket socket of the second message, and determines that the first bridge does not meet the preset bridge.
[0011] In a possible implementation manner, the first message is an ARP message, and the second message is a response message corresponding to the ARP message.
[0012] In a possible implementation, before establishing a second WIFI connection between the router and the terminal device based on the second WIFI SSID and the second WIFI password, the method further includes: based on the first WIFI connection, the router receives a first request from the terminal device; the router sends a first message to the terminal device, the first message including: the second WIFI SSID, the second WIFI password, and the second gateway address corresponding to the second bridge. In this way, the router can establish a local area network connection with the terminal device through the first WIFI connection, and return the WIFI information used to connect to the Internet in the router, such as the second WIFI SSID and the second WIFI password, to the terminal device through the local area network connection, and then the router can establish a second WIFI connection with the terminal device, and enable the terminal device to connect to the network through the second WIFI.
[0013] In a possible implementation, after establishing the second WIFI connection, the method further includes: the router receives a first data packet from the terminal device, the first data packet is a data packet for accessing the network server through the router; the router sends a second data packet to the terminal device, the second data packet is a response data packet generated when the network server receives the first data packet. In this way, after the second WIFI connection is established, the terminal device can connect to the network server through the router to achieve the Internet access function.
[0014] In a possible implementation, the first WIFI connection is a LAN connection. In this way, the router can return the WIFI information that can access the Internet, such as the second WIFI SSID and the second WIFI password, to the terminal device through the LAN connection, thereby achieving the second WIFI connection with the terminal device.
[0015] In a second aspect, an embodiment of the present application provides a processing method in a router connection, which is applied to a terminal device, and the method includes: the terminal device establishes a first WIFI connection with the router based on a first WIFI SSID and a first WIFI password; after the first WIFI connection, the terminal device receives a first operation; in response to the first operation, the terminal device displays a first interface, the first interface is a web management interface of the router, and the first interface does not include the terminal device; the terminal device establishes a second WIFI connection with the router based on a second WIFI SSID and a second WIFI password; after the second WIFI connection, the terminal device receives a second operation; in response to the second operation, the terminal device displays the terminal device in the first interface.
[0016] It is understandable that after the router executes the device online process for the terminal device, the user can view the terminal device in the first interface. Therefore, not executing the device online process for the terminal device based on the first WIFI access can reduce the waste of router resources.
[0017] In a possible implementation, before the terminal device establishes a second WIFI connection with the router based on the second WIFI SSID and the second WIFI password, the method further includes: based on the first WIFI connection, the terminal device sends a first request to the router; the terminal device receives a first message from the router, the first message including: the second WIFI SSID, the second WIFI password, and the second gateway address corresponding to the second bridge. In this way, the terminal device can establish a local area network connection with the router through the first WIFI connection, and obtain WIFI information for connecting to the Internet from the router through the local area network connection, such as the second WIFI SSID and the second WIFI password, which are returned to the terminal device, and then the terminal device can establish a second WIFI connection with the router and connect to the network through the second WIFI.
[0018] In a possible implementation, the first WIFI connection is a LAN connection. In this way, the terminal device can obtain WIFI information that can access the Internet, such as the second WIFI SSID and the second WIFI password, from the router through the LAN connection, and then realize the second WIFI connection with the router.
[0019] In a possible implementation, after establishing the second WIFI connection, the method further includes: the terminal device sends a first data packet to the router based on the second WIFI connection, the first data packet is a data packet for accessing the network server through the router; the terminal device receives a second data packet from the router, the second data packet is a response data packet generated when the network server receives the first data packet. This allows the terminal device to access the Internet through the router after the first WIFI connection.
[0020] In a possible implementation, before the first WIFI connection, the method further includes: the terminal device receives a third operation of the user scanning a target QR code, the target QR code is a QR code corresponding to the router; in response to the third operation, the terminal device obtains the first WIFI SSID and the 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. In this way, the terminal device can first establish a local area network connection with the router by directly scanning the target QR code preset by the router, and then automatically obtain the WIFI connection information that can access the Internet through the local area network connection, and then establish a WIFI connection that can access the Internet through the router. The user only needs to scan the target QR code preset by the router, and the user does not need to actively enter information such as the WIFI password to achieve automatic connection of WIFI, which brings a better connection experience to the user.
[0021] In a third aspect, an embodiment of the present application provides a processing device in a router connection, wherein the communication unit of the router is used to establish a first WIFI connection with a terminal device based on a first WIFI SSID and a first WIFI password; after the first WIFI connection, the communication unit of the router is also used to send a first message to the terminal device, wherein the first message includes a first IP address of the terminal device, and the first IP address and the first gateway address corresponding to the first bridge are in the same network segment; the communication unit of the router is also used to receive a second message from the terminal device, wherein the second message includes: a first MAC address corresponding to the first IP address, and the second message is a message transmitted through the first bridge and generated by the terminal device in response to the first message; when the processing unit of the router determines that the first bridge does not meet the preset bridge, the processing unit of the router does not perform device online processing for the terminal device indicated in the first MAC address.
[0022] In a possible implementation, the router also includes: a second network bridge, and the communication unit of the router is also used to establish a second WIFI connection with the terminal device based on the second WIFI SSID and the second WIFI password; after the second WIFI connection, the communication unit of the router is also used to send a third message to the terminal device, the third message includes a second IP address of the terminal device, and the second IP address and the second gateway address corresponding to the second network bridge are in the same network segment; the communication unit of the router is also used to receive a fourth message from the terminal device, the fourth message includes a second MAC address corresponding to the second IP address, the fourth message is transmitted through the second network bridge, and the fourth message is a message generated by the terminal device in response to the third message; when the processing unit of the router determines that the second network bridge meets the preset network bridge, the processing unit of the router performs device online processing on the terminal device indicated in the second MAC address.
[0023] In a possible implementation, the processing unit of the router is configured to obtain the first bridge indicated in the socket of the second message, and determine that the first bridge does not meet the preset bridge.
[0024] In a possible implementation manner, the first message is an ARP message, and the second message is a response message corresponding to the ARP message.
[0025] In a possible implementation, based on the first WIFI connection, the communication unit of the router is also used to receive a first request from the terminal device; the communication unit of the router is also used to send a first message to the terminal device, and the first message includes: a second WIFI SSID, a second WIFI password, and a second gateway address corresponding to the second bridge.
[0026] In a possible implementation, the communication unit of the router is also used to receive a first data packet from a terminal device, where the first data packet is a data packet for accessing a network server through the router; the communication unit of the router is also used to send a second data packet to the terminal device, where the second data packet is a response data packet generated when the network server receives the first data packet.
[0027] In a possible implementation manner, the first WIFI connection is a local area network connection.
[0028] In a fourth aspect, an embodiment of the present application provides a processing device in a router connection, wherein a communication unit of a terminal device is used to establish a first WIFI connection with a router based on a first WIFI SSID and a first WIFI password; after the first WIFI connection, the processing unit of the terminal device is used to receive a first operation; in response to the first operation, the display unit of the terminal device is used to display a first interface, the first interface being a web management interface of the router, and the first interface does not include the terminal device; the communication unit of the terminal device is also used to establish a second WIFI connection with the router based on a second WIFI SSID and a second WIFI password; after the second WIFI connection, the processing unit of the terminal device is also used to receive a second operation; in response to the second operation, the display unit of the terminal device is also used to display the terminal device in the first interface.
[0029] In a possible implementation, based on the first WIFI connection, the communication unit of the terminal device is also used to send a first request to the router; the communication unit of the terminal device is also used to receive a first message from the router, and the first message includes: a second WIFI SSID, a second WIFI password, and a second gateway address corresponding to the second bridge.
[0030] In a possible implementation manner, the first WIFI connection is a local area network connection.
[0031] In one possible implementation, the communication unit of the terminal device is also used to send a first data packet to the router based on the second WIFI connection, where the first data packet is a data packet for accessing the network server through the router; the communication unit of the terminal device is also used to receive a second data packet from the router, where the second data packet is a response data packet generated when the network server receives the first data packet.
[0032] In a possible implementation, the processing unit of the terminal device is further used to receive a third operation of a user scanning a target QR code, where the target QR code is a QR code corresponding to a router; in response to the third operation, the processing unit of the terminal device is further used to obtain a first WIFI SSID and a first WIFI password based on the target QR code, where the first WIFI SSID and the first WIFI password are determined based on attribute parameters of the router.
[0033] In a fifth aspect, an embodiment of the present application provides a router, comprising: a processor and a memory, wherein the memory is used to store a computer program; the processor is used to call and execute the computer program so that the router executes the method in the first aspect and any possible implementation thereof.
[0034] In a sixth aspect, an embodiment of the present application provides a terminal device, comprising: a processor and a memory, wherein the memory is used to store a computer program; the processor is used to call and execute the computer program so that the terminal device executes the method in the second aspect and any possible implementation thereof.
[0035] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program. When the computer program runs on a computer, the computer executes the method in the first aspect and any possible implementation thereof, or executes the method in the second aspect and any possible implementation thereof.
[0036] In an eighth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method in the second aspect and any possible implementation thereof, or to execute the method in the first aspect and any possible implementation thereof.
[0037] In a ninth aspect, the present application provides a chip system, which includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by lines. The above chip system can be applied to a terminal device including a communication module and a memory. The interface circuit is used to receive a signal from the memory of the terminal device and send the received signal to the processor, where the signal includes a computer instruction stored in the memory. When the processor executes the computer instruction, the terminal device can execute the method in the second aspect and any possible implementation thereof, or execute the method in the first aspect and any possible implementation thereof.
[0038] It can be understood that the beneficial effects of the third aspect to the ninth aspect mentioned above can refer to the beneficial effects described in the first aspect to the second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present application;
[0040] Figure 2 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of the hardware structure of a router provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of a flow chart of a router connection method provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of an interface for viewing online devices provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of an interface for viewing an IP address provided in an embodiment of the present application;
[0045] Figure 7 A schematic diagram of another interface for viewing online devices provided in an embodiment of the present application;
[0046] Figure 8 A flowchart of a processing method in a router connection provided in an embodiment of the present application;
[0047] Fig. 9 A schematic diagram of a router connection device provided in an embodiment of the present application Figure 1 ;
[0048] Fig.10 A schematic diagram of a router connection device provided in an embodiment of the present application Figure 2 ;
[0049] Fig.11 A schematic diagram of the hardware structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] To facilitate understanding of the embodiments of the present application, some terms involved in the present application are first briefly explained.
[0051] 1. Network interface card
[0052] A network interface card, also known as a NIC, is a piece of computer hardware designed to allow computers to communicate on a computer network. It can also be understood as a computer hardware device that allows network connections.
[0053] The network card may also be called: a network interface controller, an Ethernet card, a local area network card, a network adapter or a network adapter card, etc. The embodiments of the present application do not limit this.
[0054] The main functions of the network card include data encapsulation and decapsulation, link management, data encoding and decoding, etc. The network card can be an intermediate medium between the computer or server and the data network. Specifically, as an interface of the TCP / IP layer, the network card can transmit signals at the physical layer and transmit data packets at the network layer.
[0055] It is understandable that each network card has a unique serial number called a hardware address (media access control address, MAC address).
[0056] According to the network connection method, network cards can include: wired network cards and wireless network cards. A wired network card requires a jumper (e.g., Ethernet jumper, fiber jumper, etc.) to connect a node to the network; a wireless network card has a small antenna and uses radio waves to communicate with an access point to access the wireless network. For example, a wired network card can correspond to an Ethernet interface (or eth interface for short); a wireless network card can correspond to a wireless local area network (WLAN) interface (or wl interface for short).
[0057] 2. Network bridge
[0058] A device that implements relaying and forwarding frames at the link layer. A bridge can also be understood as a device used to forward data at the data link layer. A bridge can also be called a bridge.
[0059] The network bridge can connect the interfaces corresponding to the network cards. For example, the network bridge can connect two Ethernet interfaces, or connect an Ethernet interface with a wireless interface, or connect two wireless interfaces, etc.
[0060] A bridge is a storage / forwarding device that connects two LANs and can forward packets purposefully based on MAC addresses. When a bridge 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 can divide a large LAN into multiple segments, or interconnect more than two LANs into a logical LAN, so that all users on the LAN can access the server.
[0061] 3. Public network and public IP address
[0062] The public network can be called the Internet, wide area network or extranet, etc.
[0063] A public IP address is an IP address used in the public network. A public IP address can be an independent identity that can be directly accessed by an IP on the Internet or can be directly accessed by other IPs. Through a public IP address, other terminal devices on the Internet can be directly found, or can also be found by other terminal devices.
[0064] 4. Private network and private IP address
[0065] A private network is a local network created by a router or switch. A private network can be called an intranet or a local area network.
[0066] A private IP address is an IP address used in a local area network. A private IP address can directly access other IP addresses in the public network, but cannot be directly accessed by other IP addresses in the public network.
[0067] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first value and the second value are only used to distinguish different values, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0068] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0069] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.
[0070] For example, Figure 1 A schematic diagram of a scenario provided in an embodiment of the present application. Figure 1 As shown, the scenario may include: a terminal device 101 and a router 102, and the terminal device 101 may be a mobile phone.
[0071] After the user purchases the router 102, the user may need to configure the router 102 according to different Internet access methods, and after the configuration is completed, the user can access the WIFI network by connecting to the router 102. Further, the terminal device 101 can turn on the setting function, search for WIFI signals when receiving the user's opening of the WIFI search, establish a connection with the router 102 when receiving the user triggering any WIFI and entering the password corresponding to any WIFI, and realize wireless Internet access.
[0072] In the above scenario, the user needs to manage the WIFI password entered when connecting to the router. It is difficult for the user to connect to the router if he does not know the WIFI password. Therefore, the embodiment of the present application provides a router connection method, so that the terminal device can quickly connect to the first WIFI of the router by scanning the applet code corresponding to the router to establish a local area network communication with the router, and then connect to the second WIFI of the router to access the Internet.
[0073] Normally, when a terminal device is connected to the first WIFI of a router, the router can execute the device online process for the terminal device connected to the first WIFI, such as determining that the terminal device is identified and storing the device information of the terminal device. In addition, when the terminal device is connected to the second WIFI of the router, the router can also execute the device online process for the terminal device connected to the second WIFI. After the router executes the device online process for the terminal devices connected to the first WIFI and the second WIFI, the user can view the terminal devices connected to the first WIFI of the router and the terminal devices connected to the second WIFI of the router through the web management page corresponding to the router. Among them, device online can be understood as the process in which the router confirms the identity of the terminal device and stores the device information of the terminal device. For example, when the router obtains the MAC address of the terminal device, it can allocate memory resources to the terminal device and store the device information.
[0074] It is understandable that the first WIFI connection is used to establish a local area network connection between the router and the terminal device and obtain the attribute information of the second WIFI. The first WIFI connection cannot enable the terminal device to connect to the Internet. Therefore, the router executes the device online process for the terminal device connected to the first WIFI, which wastes the router's resources.
[0075] In view of this, an embodiment of the present application provides a processing method in a router connection, and the router can use different bridges to distinguish whether the terminal device is accessed through a first WIFI or a second WIFI, so that the process of processing the device online in the router can not execute the device online process for the terminal device accessed by the first WIFI, so as to reduce the waste of router resources.
[0076] Before the router executes the device online process, it is determined whether the received data packet is a data packet reported through a preset bridge. For example, the router may process the data packet reported through a preset bridge, such as executing the device online process for the terminal device indicated by the data packet; or, the router may not perform the device online process for the terminal device indicated in the data packet reported through the preset bridge.
[0077] The above-mentioned terminal devices may be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. For example, the terminal devices may be mobile phones, smart TVs, wearable devices, tablet computers (Pad), computers with wireless transceiver functions, virtual reality (VR) terminal devices, augmented reality (AR) terminal 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, etc. The embodiments of the present application do not limit the specific technologies and specific device forms used by the terminal devices.
[0078] In order to better understand the embodiment of the present application, the structure of the terminal device of the embodiment of the present application is introduced below. Figure 2 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application.
[0079] like Figure 2 As shown, the terminal device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, an indicator 192, a camera 193, and a display screen 194, etc.
[0080] The sensor module 180 may include one or more of the following, for example: a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, or a bone conduction sensor.
[0081] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0082] The processor 110 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors. The processor 110 may also be provided with a memory for storing instructions and data.
[0083] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device, and can also be used to transfer data between the terminal device and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other devices, such as AR devices, etc.
[0084] The charging management module 140 is used to receive charging input from a charger, which may be a wireless charger or a wired charger. The power management module 141 is used to connect the charging management module 140 to the processor 110 .
[0085] The wireless communication function of the terminal device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160 and baseband processor.
[0086] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna.
[0087] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to terminal devices. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modem for demodulation.
[0088] The wireless communication module 160 can provide wireless communication solutions applied to terminal devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc.
[0089] The modem may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker, a receiver, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem may be an independent device. In other embodiments, the modem may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0090] The terminal device realizes the display function through the GPU, the display screen 194, and the 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 for graphics rendering.
[0091] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the terminal device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0092] The terminal device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0093] The camera 193 is used to capture static images or videos. In some embodiments, the terminal device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0094] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0095] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area.
[0096] The terminal device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0097] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Speaker 170A, also known as "speaker", is used to convert audio electrical signals into sound signals. The terminal device can listen to music or listen to hands-free calls through speaker 170A. Receiver 170B, also known as "earpiece", is used to convert audio electrical signals into sound signals. When the terminal device answers a call or voice message, the voice can be answered by placing receiver 170B close to the human ear. Headphone interface 170D is used to connect wired headphones. Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. In an embodiment of the present application, the terminal device may have a microphone 170C.
[0098] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The terminal device may receive the button input and generate a key signal input related to the user settings and function control of the terminal device. The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, message, missed call, notification, etc.
[0099] In addition, on top of the above components, the device also runs an operating system, such as an iOS operating system, an Android operating system, or a Windows operating system, etc. Applications can be installed and run on the operating system.
[0100] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture, etc., which will not be elaborated here.
[0101] For example, Figure 3 A schematic diagram of the hardware structure of a router provided in an embodiment of the present application. Figure 3 As shown, the router may include: a processor 210, a wireless communication module 220, a memory 230, a power module 240, a communication interface 250, a switch 260, and an antenna.
[0102] The processor 210 may include one or more processing units, for example, the processor 210 may include a CPU, a GPU, a DSP, an ISP, an AP, an NPU, a modem processor, a controller, a video codec, a baseband processor, etc. In some embodiments, different processing units may be independent devices or integrated into one or more processors. Among them, the CPU is the final execution unit for information processing and program running, and its main tasks include processing instructions, executing operations, controlling time, and processing data. The CPU may include a controller, an arithmetic unit, a cache memory, and a bus for connecting these components.
[0103] The wireless communication module 220 can provide wireless communication such as Wi-Fi, frequency modulation (FM), Bluetooth or NFC. The wireless communication module 220 can be one or more devices integrating at least one communication processing module. The wireless communication module 220 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 220 can also receive the signal to be sent from the processor 210, modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna.
[0104] The memory 230 can be used to store computer executable program codes, and the executable program codes include computer instructions. The processor 210 executes various functions and data processing by running the instructions stored in the memory 230. The memory 230 may include a program storage area and a data storage area. Among them, the program storage area may store at least one application required for a function (such as generating a key, sending a request, etc.). The data storage area may store target data, keys, etc. received from other devices. In addition, the memory 230 may include a high-speed random access memory, and may also include a non-volatile memory, etc.
[0105] The power module 240 can be used to receive power input, store electrical energy, and provide power to the processor 210, the wireless communication module 220, the memory 230, etc.
[0106] The communication interface 250 can be used to communicate with external devices such as electronic devices, mobile hard disks, and USB flash drives. The communication interface 250 can be any possible interface such as a network port or a universal serial bus (USB) interface.
[0107] The switch 260 is used to trigger the router to be turned on or off.
[0108] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0109] The present application embodiment provides a method for connecting to a router, so that a terminal device can scan the mini-program code of a router, pull up the mini-program page, and connect to the router WIFI based on user operations on the mini-program page. The applet in the application can be understood that the embodiment of the present application can make full use of The social attributes of the application and the convenient attributes of the mini program make it possible for terminal devices to Scan the mini program code associated with the router to automatically and quickly connect to the router WIFI.
[0110] For example, Figure 4 A schematic diagram of a flow chart of a router connection method provided in an embodiment of the present application. Figure 4 In a corresponding embodiment, the router connection method is applied to a router setting system, and the router setting system involves a terminal device and a router.
[0111] like Figure 4 As shown, the router connection method may include the following steps:
[0112] S401: The terminal device receives an operation in which a user scans a mini-program code.
[0113] The mini program code can be affixed to the body of the router or to the corresponding instruction manual or other location of the router, which is not limited in the embodiments of the present application.
[0114] The applet code may be generated by the applet uniform resource locator (URL) and attribute parameters of the router, etc. The attribute parameters of the router may include: a router serial number (SN) and other parameters used to uniquely indicate the router.
[0115] It is understandable that since the router SN is unique, the mini-program code is also unique, that is, one router can correspond to one mini-program code. The WIFI carried by the mini-program code can be non-hidden, that is, the user can search for the WIFI corresponding to the router through the terminal device. If the WIFI carried by the mini-program is hidden, the terminal device cannot successfully connect to the router WIFI.
[0116] S402. The terminal device obtains the mini-program URL and the router SN from the mini-program code.
[0117] For example, the terminal device can scan the mini-program code to obtain the mini-program URL and router SN, and save them in the terminal device.
[0118] S403: The terminal device uses the mini-program URL to pull the mini-program page from the server.
[0119] For example, the terminal device may send a request for obtaining a mini-program page to the server, and the request for obtaining the mini-program page may include the mini-program URL.
[0120] The server (or first server) described in S403 can be understood as Application public platform, used for terminal devices The application provides various mini-program pages. For example, a terminal device can send a request to the server to obtain a mini-program page, and the server can obtain the page information corresponding to the mini-program URL and return the page information corresponding to the mini-program to the terminal device, so that the terminal device can pull up the mini-program page from the server according to the mini-program URL parsed in the mini-program code.
[0121] S404: The server returns page information corresponding to the mini-program to the terminal device.
[0122] Among them, the page information corresponding to the mini program may include: page information corresponding to any interface in the mini program described in the embodiments of the present application, such as page information corresponding to the homepage of the mini program.
[0123] Exemplarily, after receiving the page information corresponding to the mini-program, the terminal device may render the page information and perform other operations, so that the terminal device can display different interface contents in the mini-program.
[0124] S405. The terminal device displays the homepage of the mini-program and calculates the first WIFI SSID and the first WIFI password using the SN.
[0125] The first WIFI may be the initial WIFI of the router or called a fixed WIFI. The first WIFI SSID and the first WIFI password are both obtained based on SN resolution, so the first WIFI SSID and the first WIFI password are also unique.
[0126] It is understandable that the first WIFI SSID and the first WIFI password are determined based on attribute parameters of the router, such as the router SN, and therefore the user is not allowed to modify the first WIFI SSID and the first WIFI password at will.
[0127] S406: The terminal device sends a request for connecting to the first WIFI of the router to the router.
[0128] The request for connecting to the first WIFI of the router may include: a first WIFI SSID and a first WIFI password.
[0129] S407: The router returns a message indicating that the first WIFI connection is successful to the terminal device.
[0130] The first WIFI SSID and the first WIFI password are fixed, so the terminal device can use the first WIFI to access the router, and the first WIFI SSID and the first WIFI can serve as a bridge to achieve a LAN connection between the terminal device and the router. In this scenario, the router has been set up in the firewall to ensure that the terminal device cannot access the Internet through the first WIFI connected to the router.
[0131] After S407, the terminal device may request the router to obtain the first IP address, and the router may allocate the first IP address to the terminal device connected to the first WIFI in the network segment corresponding to the first WIFI. Furthermore, the router may also obtain the first media access control address (MAC) of the terminal device based on the first IP address, and then execute the device online process for the terminal device connected to the first WIFI. The process of the router obtaining the first MAC address of the terminal device based on the first IP address can be found in Figure 8 The corresponding embodiments.
[0132] The network segment corresponding to the first WIFI can also be understood as the network segment corresponding to br2. For example, the network segment corresponding to the first WIFI can be 192.168.144.0 / 24.
[0133] The first IP address may be: 192.168.144.2, and the first IP address may also be understood as a private network IP address or an IP address used in a local area network.
[0134] It is understandable that the router can start the device online process when determining to obtain the first MAC address of the terminal device, allocate memory resources to the terminal device, and store the device information in the random access memory (RAM) and the read only memory (ROM) respectively.
[0135] The device information may include one or more of the following, for example: device name, the first IP address of the device, and the first MAC address of the device. Figure 5 The interface shown shows a device 501 connected to the first WIFI of the router.
[0136] When the router determines that the terminal device is online after connecting to the first WIFI, the terminal device can display the following information when receiving the user's operation of opening the device list: Figure 5 In the interface shown, the device list may include at least one terminal device connected to the router. Figure 5 This is a schematic diagram of an interface for viewing online devices provided in an embodiment of the present application. Figure 5 In the corresponding embodiments, a mobile phone as the terminal device is used as an example for illustration, and this example does not constitute a limitation on the embodiments of the present application.
[0137] like Figure 5 As shown, the interface may display a device list corresponding to the connected device, and the device list may include device 501. The interface may also include one or more of the following: the IP address (or first IP address) of device 501, the MAC address (or first MAC address) of device 501, the data transmission status of device 501, the online status of device 501, whether device 501 is allowed to access the Internet, the network speed limit of device 501, or the speed limit value corresponding to device 501. Among them, the IP address of device 501 may be 192.168.144.2, the MAC address of device 501 may be 3C:2E:F9:2C:25:73, and the online status of device 501 may be just online.
[0138] See also Figure 5 In a corresponding embodiment, the network segment corresponding to the first WIFI may be 192.168.144.0 / 24, so br2 in the router may allocate a first IP address 192.168.144.2 to the terminal device connected to the first WIFI of the router.
[0139] The network segment corresponding to the first WIFI may be inconsistent with the network segment corresponding to the second WIFI (or understood as the network segment corresponding to br0). Figure 6 The corresponding embodiment checks the information in the network segment corresponding to the second WIFI.
[0140] For example, Figure 6 A schematic diagram of an interface for viewing an IP address provided in an embodiment of the present application.
[0141] like Figure 6As shown, the network segment corresponding to the second WIFI can be 192.168.3.0 / 24, the gateway address of the router can be: 192.168.3.1, the range of IP addresses allowed to be allocated by br0 can be: 192.168.3.2-192.168.3.254, and the lease period can be one day.
[0142] S408: The terminal device sends a request for obtaining a symmetric key to the router.
[0143] The request for obtaining the symmetric key may include: a router SN and signature information, where the signature information is information obtained after the terminal device signs the router SN using a private key.
[0144] The private key of the RSA asymmetric encryption algorithm filled with 1024-bit public key cryptography standards (PKCS) #8 can be preset in the applet of the terminal device, and the public key of the RSA asymmetric encryption algorithm filled with 1024-bit PKCS #8 can be preset in the routing plug-in process of the router.
[0145] S409: The router returns the symmetric key to the terminal device.
[0146] Suitably, after the router receives the router SN and signature information in the request for obtaining the symmetric key, the router can use the public key to decrypt the signature information and compare the decrypted information with the router SN for consistency. After the signature verification is successful, the router can determine that the request for obtaining the symmetric key is a message sent by the applet in the terminal device, and then return the generated symmetric key to the terminal device. The symmetric key can be a 16-bit advanced encryption standard (AES) symmetric encryption key.
[0147] Based on the steps shown in S408-S409, the communication link between the subsequent terminal device and the router can be encrypted based on the symmetric key to ensure the security of data transmission. For example, the router can encrypt the routing information using the symmetric key and return the encrypted information to the terminal device through the step shown in S411. If appropriate, the terminal device can decrypt the message received in S1311.
[0148] S410: The terminal device sends a request for obtaining routing information to the router.
[0149] The request for obtaining routing information may be a UDP request, and the terminal device may send a UDP request to the router based on the first gateway address preset in the applet. The first gateway address may be the gateway address corresponding to br2 of the router.
[0150] The routing information (or first information) may be information obtained from a router. The routing information may include one or more of the following: a second WIFI SSID, a second WIFI password, a second gateway address, Internet access status, or information indicating whether the router wizard configuration is completed, etc. The second gateway address may be the gateway address corresponding to br0 of the router.
[0151] The online status may include: network connected, network disconnected, etc.
[0152] S411. The router returns routing information to the terminal device.
[0153] S412: The terminal device sends a request to the router for connecting to the second WIFI of the router.
[0154] The request for connecting to the second WIFI of the router may include: a second WIFI SSID and a second WIFI password.
[0155] S413: The router returns a message indicating that the second WIFI connection is successful to the terminal device.
[0156] After S413, the terminal device may request the router to obtain the second IP address, and the router may allocate the second IP address to the terminal device connected to the second WIFI in the network segment corresponding to the second WIFI. Furthermore, the router may also obtain the second MAC address of the terminal device based on the second IP address, and then execute the device online process for the terminal device connected to the second WIFI. The process of the router obtaining the second MAC address of the terminal device based on the second IP address can be found in Figure 8 The corresponding embodiments.
[0157] The network segment corresponding to the second WIFI may also be understood as the network segment corresponding to br0, such as the network segment corresponding to the second WIFI may be 192.168.3.0 / 24.
[0158] The second IP address may be: 192.168.3.2. The second IP address may also be understood as a public IP address, that is, an IP address used in the public network.
[0159] The network segment corresponding to the second WIFI is different from the network segment corresponding to the first WIFI, the second IP address is different from the first IP address, and the first MAC address is different from the second MAC address.
[0160] It is understandable that the router can start the device online process when the terminal device is connected to the second WIFI, allocate memory resources to the terminal device, and store device information in RAM and ROM respectively. The device information may include one or more of the following, for example: device name, device second IP address, device second MAC address and other device information. In this scenario, the terminal device can Figure 7 The interface shown in a in FIG. 7 shows a device 701 connected to the second WIFI of the router.
[0161] When the router determines that the terminal device is online after connecting to the second WIFI, the terminal device can display the following information when receiving the user's operation of opening the device list: Figure 7 The interface shown in a in FIG. Figure 7 A schematic diagram of another interface for viewing online devices provided in an embodiment of the present application.
[0162] like Figure 7 The interface shown in a in the figure may display a device list corresponding to the connected device, and the device list may include device 701. The interface may also include one or more of the following: the IP address (or second IP address) of device 701, the MAC address (or second MAC address) of device 701, the data transmission status of device 701, the online status of device 701, whether device 701 is allowed to access the Internet, the network speed limit of device 701, or the speed limit value corresponding to device 701. Among them, the IP address of device 701 may be 192.168.3.2, and the MAC address of device 701 may be 3C:2E:F9:2C:25:23.
[0163] Device 501 and device 701 may be the same terminal device. Figure 5 The device information of the device 501 displayed in the interface shown may be information generated when the terminal device is connected to the first WIFI of the router. Figure 7 The device information of device 701 is displayed in the interface shown in a, which may be information generated when the terminal device is connected to the second WIFI of the router.
[0164] In such Figure 7 In the interface shown in a of FIG. 1 , when the terminal device receives the user triggering the selection box 702 where the connected device is located and switches to the offline device, the terminal device can display the following Figure 7 The interface shown in b in the figure. Figure 7The interface shown in b in the figure can display a device list corresponding to the offline device, and the device list can include: device 501. The interface can also include: the connection status of the device 501 in the offline state when it is connected to the first WIFI, such as including one or more of the following connection status: the access time of the device 501 to the router first WIFI, the IP address of the device 501, the MAC address of the device 501, the data transmission status of the device 501, the online status of the device 501, whether the device 501 is allowed to access the Internet, the network speed limit of the device 501, or the speed limit value corresponding to the device 501, etc. For specific information on the connection status, please refer to Figure 5 The description in the corresponding embodiments will not be repeated here.
[0165] See also Figure 7 In a corresponding embodiment, the network segment corresponding to the second WIFI may be 192.168.3.0 / 24, so the router may allocate a second IP address 192.168.3.2 to the terminal device connected to the second WIFI of the router.
[0166] It is understandable that when the device 701 is connected to the second WIFI of the router, the device 501 connected to the first WIFI of the router goes offline and is displayed in the following manner: Figure 7 In the interface of the offline device shown in b.
[0167] Referring to the description of the first WIFI and the second WIFI, it can be understood that since the user usually modifies the first WIFI SSID and the first WIFI password to obtain the second WIFI SSID and the second WIFI password, when the terminal device is connected to the router, the terminal device cannot directly obtain the second WIFI SSID and the second WIFI password modified by the user. Therefore, the terminal device can effectively access the router through the fixed first WIFI SSID and the first WIFI password, and then further obtain the second WIFI SSID and the second WIFI password to connect to the router WIFI. Among them, the benefit of using the first WIFI SSID and the first WIFI password to realize the LAN communication between the terminal device and the router is that no matter how the second WIFI SSID and the second WIFI password change, the terminal device can use the first WIFI to realize the LAN communication and obtain the changed WIFI SSID and WIFI password.
[0168] After S413, when the terminal device sends a message to the router based on the second IP address and the second gateway, br0 can forward the message; further, the forward checkpoint in the data link layer firewall can forward the message reported by br0 and forward it to the network server. The network server can respond to the message and return the generated response message to the terminal device through the router, so that the terminal device can access the Internet through the second WIFI connection.
[0169] Exemplarily, based on the second WIFI connection, the terminal device sends a first data packet to the router, and the router can send the first data packet to the network server; adapted, the network server can respond to the received first data packet and generate a second data packet corresponding to the first data packet, and then the network data packet can return the second data packet to the terminal device through the router, so that the terminal device can access the Internet through the second WIFI connection. It can be understood that the first data packet is a data packet that accesses the network server through the router, and the second data packet is a response data packet generated when the network server receives the first data packet.
[0170] based on Figure 4 The description in the corresponding embodiment. The terminal device can first establish a local area network connection with the router by directly scanning the target QR code preset by the router, and then automatically obtain the WIFI connection information that can access the Internet through the local area network connection, and then establish a WIFI connection that can access the Internet through the router. The user only needs to scan the target QR code preset by the router, and does not need to actively enter the WIFI password and other information to achieve automatic WIFI connection, which brings a better connection experience to the user.
[0171] exist Figure 4 On the basis of the corresponding embodiment, since the device online process executed when the terminal device is connected to the first WIFI of the router wastes the resources of the router, in order to prevent the device online process of the first WIFI, the IP check process in the router can filter the message reported when the terminal device accesses the first WIFI of the router.
[0172] In an embodiment of the present application, the router can mount interfaces for accessing different WIFIs on different bridges and ignore messages uploaded by non-preset bridges to prevent the device online process of the terminal device connected to the first WIFI and save router resources.
[0173] For example, the router may pre-create a bridge br2 and set a gateway address of br2. The router may then mount the access interface wl1.5 used when the terminal device is connected to the first WIFI of the router under br2.
[0174] The interface information of wl1.5 can be:
[0175] wl1.5 Link encap: Ethernet HWadder 42:AC:73:F7:4C:6B
[0176] inet6 addr:fe80::40ac:73ff:fef7:4c6b / 64Scope:Link
[0177] UP BROADCAST RUNNING MULTICAST MTU: 1500Metric: 1
[0178] RX packets: 413035errors:0dropped:0overruns:0frame:0
[0179] TX packets: 11234errors:0dropped:0overruns:0carrier:0
[0180] collisions:0 txqueuelen:1
[0181] RX bytes: 129107010 (123.1MiB) TX bytes: 4026025 (3.8MiB)
[0182] Among them, Link encap: Ethernet can be understood as the encapsulation method of Ethernet, HWadder can be understood as the hardware address, inet6 addr can be understood as the inet6 address, Scope can be understood as the range, UP can be understood as the open state, BROADCAST can be understood as supporting broadcast, RUNNING can be understood as the network cable being connected, MULTICAST can be understood as supporting multicast, MTU can be understood as the maximum transmission unit, Metric can be understood as the number of hops, RX packets can be understood as receiving data packets, errors can be understood as errors, dropped can be understood as discarding, overruns can be understood as overload, frame can be understood as the number of frames, TX packets can be understood as sending data packets, carrier can be understood as carrier, txqueuelen can be understood as the length of the sending queue, collisions can be understood as the number of packet collisions, RXbytes can be understood as receiving bytes, and TX bytes can be understood as sending bytes.
[0183] The bridge information of br2 can be as follows:
[0184] br2 Link encap: Ethernet HWadder 42:AC:73:F4:4C:6B
[0185] inet addr: 192.168.144.1Bcast: 192.168.144.255Mask: 255.255.255.0
[0186] inet6 addr:fe80::e486:b7ff:fe5a:45e8 / 64Scope:Link
[0187] UP BROADCAST RUNNING MULTICAST MTU: 1500Metric: 1
[0188] RX packets: 1868errors:0dropped:0overruns:0frame:0
[0189] TX packets: 2105errors:0dropped:0overruns:0carrier:0
[0190] collisions:0 txqueuelen:1
[0191] RX bytes: 202849 (198.0KiB) TX bytes: 1170304 (1.1MiB)
[0192] Among them, inet addr can be understood as inet address, Bcast can be understood as broadcast address, and Mask can be understood as subnet mask.
[0193] Exemplarily, the interface used when the terminal device is connected to the second WIFI may be wl0 or wl1, and wl0 or wl1 is mounted on the bridge br0.
[0194] The bridge information of br0 can be as follows:
[0195] br0 Link encap: Ethernet HWadder 42:AC:73:F4:4C:57
[0196] inet addr: 192.168.3.1Bcast: 192.168.3.255Mask: 255.255.255.0
[0197] inet6 addr:fe80::40ac:73ff:fef7:4c57 / 64Scope:Link
[0198] UP BROADCAST RUNNING MULTICAST MTU: 1500Metric: 1
[0199] RX packets: 7646errors:0dropped:6overruns:0frame:0
[0200] TX packets: 10560errors:0dropped:0overruns:0carrier:0
[0201] collisions:0 txqueuelen:1
[0202] RX bytes: 1463561 (1.3MiB) TX bytes: 6382365 (1.1MiB)
[0203] Based on the description of the bridge information of br0 and br2 above, the correspondence between each interface and bridge in the router can be seen in Table 1.
[0204] Table 1 Schematic diagram of the correspondence between interfaces and bridges
[0205]
[0206] As shown in Table 1, eth0.3, eth0.4, wl0, and wl1 are interfaces mounted under the br0 bridge, and wl1.5 is an interface mounted under the br2 bridge.
[0207] The terminal devices using eth0.3, eth0.4, wl0 and wl1 can be devices connected to the second WIFI of the router. Therefore, br0 can report the messages transmitted in eth0.3, eth0.4, wl0 and wl1 to the application process IPcheak process, and the IPcheck process can execute the normal device online process for the device corresponding to the br0 interface.
[0208] The terminal device using wl1.5 can be the device connected to the first WIFI of the router. Therefore, the message transmitted in wl1.5 can be reported to the IPcheak process in br2. The IPcheck process cannot execute the device online process for the device corresponding to the br2 interface.
[0209] It is understandable that the process of the IPcheck process in the router determining whether to execute the device online process can be seen in Figure 8 The corresponding embodiments.
[0210] For example, Figure 8A flowchart of a processing method in a router connection provided in an embodiment of the present application.
[0211] like Figure 8 As shown, the processing method in the router connection may include the following steps:
[0212] S801. The terminal device sends a dynamic host configuration protocol (DHCP) discovery instruction to a router.
[0213] The DHCP discover command is used to obtain the IP address assigned when connecting to the WIFI of the router, such as obtaining the first IP address corresponding to the first WIFI or the second IP address corresponding to the second WIFI. The DHCP discover command may include device information such as device name and device manufacturer information.
[0214] Exemplarily, after S407 (or S413), the terminal device sends a DHCP discover instruction to the router. The DHCP discover instruction may be sent by the terminal device to the router in a broadcasting manner to search for a DHCP server, such as a router, in the network.
[0215] S802: The router returns a DHCP offer instruction to the terminal device.
[0216] The DHCP offer instruction may include: an IP address allocated by the router, such as a first IP address or a second IP address.
[0217] For example, when the terminal device is connected to the first WIFI of the router, the DHCPS application process in the router can determine that the bridge corresponding to the DHCP discover instruction transmitted from wl1.5 is br2 when receiving the DHCP discover instruction, and search for an unused first IP address from the address pool of br2, and then return the first IP address to the terminal device through the DHCP offer instruction.
[0218] When the terminal device is connected to the router's second WIFI, the DHCPS application process in the router can determine that the bridge corresponding to the DHCP discover instruction transmitted from wl0 is br0 when it receives the DHCP discover instruction, and search for an unused second IP address from the address pool of br0, and then return the second IP address to the terminal device through the DHCPoffer instruction.
[0219] S803: The terminal device sends a DHCP request instruction to the router.
[0220] The DHCP request instruction is used to instruct receiving an IP address, such as receiving a first IP address or receiving a second IP address.
[0221] Exemplarily, after receiving the DHCP offer instruction, the terminal device may send a DHCP request instruction in a broadcast manner to inform all DHCP servers such as routers which server provides the IP address to receive.
[0222] S804: The router sends an acknowledgement (ACK) instruction to the terminal device.
[0223] The ACK instruction can be used to notify the terminal device that it can use the IP address assigned by the router.
[0224] S805. The router sends an address resolution protocol (ARP) message to the terminal device.
[0225] The ARP message is used to obtain the MAC address corresponding to the IP address, for example, the ARP message is used to obtain the first MAC address corresponding to the first IP address, or the ARP message is used to obtain the second MAC address corresponding to the second IP address.
[0226] S806: The terminal device returns a response message corresponding to the ARP message to the router.
[0227] The response message corresponding to the ARP message may include: a MAC address corresponding to the IP address, for example, the response message corresponding to the ARP message includes: a first MAC address corresponding to the first IP address, or a second MAC address corresponding to the second IP address.
[0228] In a possible implementation, the steps shown in S805-S806 may be periodically performed between the terminal device and the router, so that the router can continuously determine the connection status of the terminal device.
[0229] S807: The router determines the target bridge indicated in the response message corresponding to the transmitted ARP message.
[0230] When the router receives a response message corresponding to an ARP message, the IPcheck process can determine from the recvfrom function interface of the socket which bridge the response message corresponding to the ARP message is reported from.
[0231] The IPcheck process is used to monitor ARP messages, parse the correspondence between IP addresses and MAC addresses in ARP messages, and perform device online and device offline processing on the device. For example, the IPcheck process can monitor ARP messages, that is, when an ARP message is monitored, the steps shown in S807-S808 are executed to determine whether to perform the device online process for the device.
[0232] S808: When it is determined that the target bridge is a preset bridge, the router executes a device online process; or, when it is determined that the target bridge is not a preset bridge, the router ignores a response message corresponding to the ARP message.
[0233] The preset network bridge may be a network bridge that allows the device to go online, for example, the preset network bridge may be br0.
[0234] In one implementation, in a scenario where the terminal device is connected to the first WIFI of the router, when the IP address is the first IP address, the response message corresponding to the ARP message includes the first MAC address, and the target bridge is br2, the IPcheck process in the router can determine that br2 is not the preset bridge, and then ignore the response message corresponding to the ARP message.
[0235] The router ignores the response message corresponding to the ARP message reported by the br2 interface, and then the router cannot determine the identity of the terminal device, making the terminal device unable to go online at this time. Figure 5 The interface shown shows a device 501 connected to the first WIFI of the router. It is understandable that after S407, the router can complete the judgment of whether the device is online through the steps shown in S801-S808, for example, not executing the device online process for the terminal device accessed through the first WIFI.
[0236] In another implementation, in a scenario where the terminal device is connected to the router's second WIFI, when the IP address is the second IP address, the response message corresponding to the ARP packet includes the second MAC address, and the target bridge is br0, the IPcheck process in the router can determine that br0 is the preset bridge and execute the device online process.
[0237] The router receives the response message corresponding to the ARP message reported by the br0 interface, and then the router can determine the identity of the terminal device based on the second MAC address, so that the terminal device can go online; further, after the device goes online, the router can allocate memory space to store device information such as the device name, second IP address, and second MAC address obtained by the IPcheck process. Since the terminal device is online at this time, the terminal device can Figure 7In the interface shown in a, the device 701 connected to the second WIFI of the router is viewed, and it cannot be Figure 7 In the interface shown in b, the device 501 in the offline state is viewed. It is understandable that after S413, the router can complete the judgment of whether the device is online through the steps shown in S801-S808, for example, executing the device online process for the terminal device accessed through the second WIFI.
[0238] Therefore, the router can recognize the terminal device when the terminal device is connected to the second WIFI, and ignore the terminal device when the router is connected to the first WIFI. This ignoring the situation where the terminal device is connected to the first WIFI also makes it easier for users to Figure 7 Manage devices connected to the router in the interface shown in a or b.
[0239] Based on this, the router can distinguish different bridges that transmit messages when connected to different WIFIs, and filter messages received at the bridge used after connecting to the first WIFI, so as to reduce the waste of router resources caused by the router executing device online for the terminal device connected to the first WIFI.
[0240] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0241] Combined with the above Figure 4-Figure 8 , the method provided in the embodiment of the present application is explained, and the device for executing the above method provided in the embodiment of the present application is described below.
[0242] For example, Fig. 9 A schematic diagram of a processing device in a router connection provided in an embodiment of the present application Figure 1 The processing device in the router connection may be the router in the embodiment of the present application, or may be a chip or chip system in the router.
[0243] like Fig. 9As shown, the processing device 900 in the router connection can be used in a communication device, circuit, hardware component or chip, and the processing device in the router connection includes: a processing unit 901 and a communication unit 902. The processing unit 901 is used to support the processing device 900 in the router connection to perform information processing steps; the communication unit is used to support the processing device 900 in the router connection to perform data sending and data receiving steps. The communication unit 902 can be an input or output interface, a pin or a circuit, etc.
[0244] In a possible embodiment, the processing device in the router connection may further include: a storage unit 903. The processing unit 901 and the storage unit 903 are connected via a line. The storage unit 903 may include one or more memories, and the memory may be a device used to store programs or data in one or more devices or circuits. The storage unit 903 may exist independently and be connected to the processing unit 901 of the processing device in the router connection via a communication line. The storage unit 903 may also be integrated with the processing unit 901.
[0245] The storage unit 903 may store computer-executable instructions of the method in the router so that the processing unit 901 executes the method in the above embodiment. The storage unit 903 may be a register, a cache, or a RAM, etc. The storage unit 903 may be integrated with the processing unit 901. The storage unit 903 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the storage unit 903 may be independent of the processing unit 901.
[0246] For example, Fig.10 A schematic diagram of a processing device in a router connection provided in an embodiment of the present application Figure 2 The processing device in the router connection may be the terminal device in the embodiment of the present application, or may be a chip or chip system in the terminal device.
[0247] like Fig.10 As shown, the processing device 1000 in the router connection can be used in a communication device, circuit, hardware component or chip, and the processing device in the router connection includes: a display unit 1001, a processing unit 1002 and a communication unit 1003. Among them, the display unit 1001 is used to support the display step performed by the processing device 1000 in the router connection; the processing unit 1002 is used to support the processing device 1000 in the router connection to perform information processing steps; the communication unit is used to support the processing device 1000 in the router connection to perform data transmission and data reception steps. Among them, the communication unit 1003 can be an input or output interface, pin or circuit, etc.
[0248] In a possible embodiment, the processing device in the router connection may further include: a storage unit 1004. The processing unit 1002 and the storage unit 1004 are connected via a line. The storage unit 1004 may include one or more memories, and the memory may be a device used to store programs or data in one or more devices or circuits. The storage unit 1004 may exist independently and be connected to the processing unit 1002 of the processing device in the router connection via a communication line. The storage unit 1004 may also be integrated with the processing unit 1002.
[0249] The storage unit 1004 can store computer-executable instructions of the method in the terminal device so that the processing unit 1002 executes the method in the above embodiment. The storage unit 1004 can be a register, a cache, or a RAM, etc. The storage unit 1004 can be integrated with the processing unit 1002. The storage unit 1004 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the storage unit 1004 can be independent of the processing unit 1002.
[0250] Fig.11 A schematic diagram of the hardware structure of a device provided in an embodiment of the present application is shown in FIG. Fig.11 As shown, the device may be a router or a terminal device, and the device may include a processor 1101, a communication line 1104, and at least one communication interface ( Fig.11 The communication interface 1103 is used as an example for explanation).
[0251] The processor 1101 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0252] Communications link 1104 may include circuitry to transmit information between the above-described components.
[0253] The communication interface 1103 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.
[0254] Possibly, the device may further include a memory 1102 .
[0255] The memory 1102 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a communication line 1104. The memory may also be integrated with the processor.
[0256] The memory 1102 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 1101. The processor 1101 is used to execute the computer-executable instructions stored in the memory 1102, thereby implementing the method provided by the embodiment of the present application.
[0257] Possibly, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, and the embodiments of the present application do not specifically limit this.
[0258] In a specific implementation, as an embodiment, the processor 1101 may include one or more CPUs, such as Fig.11 CPU0 and CPU1 in.
[0259] In a specific implementation, as an embodiment, the device may include multiple processors, such as Fig.11 1 and 1105. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0260] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium can include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (digital versatiledisc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.
[0261] The embodiments of the present application also provide a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.
[0262] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.
[0263] The above combinations should also be included in the scope of computer-readable media. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A processing method in a router connection, characterized in that: Applied to the router, the router includes a first bridge, and the method includes: A first WIFI connection is established between the router and the terminal device based on the first WIFI SSID and the first WIFI password; After the first WIFI is connected, the router sends a first message to the terminal device, wherein the first message includes a first IP address of the terminal device, and the first IP address and a first gateway address corresponding to the first bridge are in the same network segment; The router receives a second message from the terminal device, the second message including: a first MAC address corresponding to the first IP address, the second message is transmitted through the first bridge, and the second message is a message generated by the terminal device in response to the first message; When the router determines that the first network bridge does not meet the preset network bridge, the router does not perform device online processing on the terminal device indicated in the first MAC address.
2. The method according to claim 1, characterized in that: The router also includes: a second network bridge, and the method further includes: A second WIFI connection is established between the router and the terminal device based on a second WIFI SSID and a second WIFI password; After the second WIFI is connected, the router sends a third message to the terminal device, wherein the third message includes a second IP address of the terminal device, and the second IP address and a second gateway address corresponding to the second bridge are in the same network segment; The router receives a fourth message from the terminal device, the fourth message includes a second MAC address corresponding to the second IP address, the fourth message is transmitted through the second network bridge, and the fourth message is a message generated by the terminal device in response to the third message; When the router determines that the second network bridge satisfies the preset network bridge, the router performs device online processing on the terminal device indicated in the second MAC address.
3. The method according to claim 1 or 2, characterized in that: The router includes an IPcheck process, and the router determines that the first bridge does not meet the preset bridge, including: the IPcheck process obtains the first bridge indicated in the socket of the second message, and determines that the first bridge does not meet the preset bridge.
4. The method according to any one of claims 2 to 3, characterized in that: The first message is an ARP message, and the second message is a response message corresponding to the ARP message.
5. The method according to claim 2, characterized in that: Before establishing a second WIFI connection between the router and the terminal device based on the second WIFI SSID and the second WIFI password, the method further includes: Based on the first WIFI connection, the router receives a first request from the terminal device; The router sends a first message to the terminal device, wherein the first message includes: the second WIFI SSID, the second WIFI password, and the second gateway address.
6. The method according to claim 2 or 5, characterized in that: After establishing the second WIFI connection, the method further includes: The router receives a first data packet from the terminal device, where the first data packet is a data packet for accessing a network server through the router; The router sends a second data packet to the terminal device, where the second data packet is a response data packet generated when the network server receives the first data packet.
7. The method according to any one of claims 1 to 6, characterized in that: The first WIFI connection is a local area network connection.
8. A processing method in a router connection, characterized in that: Applied to a terminal device, the method comprises: The terminal device establishes a first WIFI connection with the router based on the first WIFI SSID and the first WIFI password; After the first WIFI is connected, the terminal device receives a first message sent by the router, wherein the router includes a first network bridge, the first message includes a first IP address of the terminal device, and the first IP address and a first gateway address corresponding to the first network bridge are in the same network segment; The terminal device sends a second message to the router, where the second message includes: a first MAC address corresponding to the first IP address, and the second message is transmitted through the first bridge, and the second message is a message generated by the terminal device in response to the first message; The terminal device receives a first operation, and the first network bridge does not meet the preset network bridge; In response to the first operation, the terminal device displays a first interface, where the first interface is a web management interface of the router, the first interface does not include the terminal device, and the terminal device is not online; The terminal device establishes a second WIFI connection with the router based on the second WIFI SSID and the second WIFI password; After the second WIFI is connected, the terminal device receives a second operation; In response to the second operation, the terminal device displays the terminal device in the first interface.
9. The method according to claim 8, characterized in that The method further comprises: After the second WIFI is connected, the terminal device receives a third message sent by the router, wherein the router also includes a second network bridge, and the third message includes a second IP address of the terminal device, and the second IP address and a second gateway address corresponding to the second network bridge are in the same network segment; The terminal device sends a fourth message to the router, wherein the fourth message includes the second MAC address corresponding to the second IP address, and the fourth message is transmitted through the second bridge and is a message generated by the terminal device in response to the third message; The terminal device receives the second operation, including: after the terminal device sends the fourth message to the router, the terminal device receives the second operation, the second bridge satisfies the preset bridge, and the terminal device goes online.
10. The method according to claim 8 or 9, characterized in that: Before the terminal device establishes a second WIFI connection with the router based on the second WIFI SSID and the second WIFI password, the method further includes: Based on the first WIFI connection, the terminal device sends a first request to the router; The terminal device receives a first message from the router, wherein the first message includes: the second WIFI SSID, the second WIFI password, and a second gateway address corresponding to the second bridge.
11. The method according to claim 8 or 9, characterized in that: The first WIFI connection is a local area network connection.
12. The method according to claim 8 or 9, characterized in that: After establishing the second WIFI connection, the method further includes: The terminal device sends a first data packet to the router based on the second WIFI connection, where the first data packet is a data packet for accessing a network server through the router; The terminal device receives a second data packet from the router, where the second data packet is a response data packet generated when the network server receives the first data packet.
13. The method according to claim 8 or 9, characterized in that: Before the first WIFI connection, the method further includes: The terminal device receives a third operation of a user scanning a target QR code, where the target QR code is a QR code corresponding to the router; In response to the third operation, the terminal device acquires the first WIFI SSID and the first WIFI password based on the target QR code, where the first WIFI SSID and the first WIFI password are determined based on attribute parameters of the router.
14. A router, characterized in that: include: processor and memory, wherein The memory is used to store computer programs; The processor is configured to call and execute the computer program so as to enable the router to perform the method according to any one of claims 1 to 7.
15. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 7, or the method according to any one of claims 8 to 13.
Citation Information
Patent Citations
Router configuration and maintenance method based on WeChat applet
CN111405595A
