Wireless connection methods, electronic devices, wireless routers and storage media
By recording the mapping relationship between the random MAC address on the wireless router and the AP unique identifier in the electronic device, the problem of failure of the function settings caused by the random MAC address is solved, ensuring that the management settings on the wireless router are still valid during repeated connections. Improves the stability of user experience and device management.
Patent Information
- Application Number
- CN202310567291.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2043-05-18
AI Technical Summary
When electronic devices use random MAC addresses to access wireless routers, the function settings on the router are invalid, such as black and white list management failure.
The electronic device records the mapping relationship between the random MAC address and the AP unique identifier, and uses the same MAC address when repeated connections to ensure the validity of the function settings.
It effectively solves the problem of failure of function settings caused by random MAC addresses, ensures that the management settings on the wireless router are still effective during repeated connections, and improves the stability of user experience and device management.
Smart Images

Figure CN117714995B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a wireless connection method, electronic equipment, wireless router, and storage medium. Background Art
[0002] As electronic devices become increasingly powerful, users are increasingly concerned about the security of their devices. To protect privacy, electronic devices can use different random private Media Access Control Addresses (MAC addresses) when accessing different wireless access points.
[0003] However, the management of electronic devices and the setting of various functions on wireless routers, such as blacklists and whitelists, are usually based on the MAC addresses of electronic devices. Therefore, the use of random MAC addresses will cause the set functions to fail. Summary of the Invention
[0004] The present application provides a wireless connection method, an electronic device, a wireless router, and a storage medium, which can solve the problem that when an electronic device uses a random MAC address to access a wireless router, the function settings of the electronic device on the wireless router become invalid.
[0005] To achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a wireless connection method, comprising:
[0007] The electronic device receives first broadcast information sent by a first AP of a first router, where the first router includes the first AP and a second AP;
[0008] The electronic device sends a first connection request to the first AP of the first router, where the first connection request carries a first random MAC address of the electronic device;
[0009] The electronic device receives a first response message sent by the first AP of the first router, where the first response message carries a first unique identifier of the first AP and a second unique identifier of the second AP;
[0010] The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the first response information, and a second mapping relationship between the first random MAC address and the second unique identifier in the first response information;
[0011] The wireless connection between the electronic device and the first AP of the first router is disconnected;
[0012] The electronic device receives second broadcast information sent by a second AP of the first router, where the second broadcast information carries a second unique identifier of the second AP;
[0013] The electronic device sends a second connection request to the second AP of the first router, where the second connection request carries the first random MAC address corresponding to the second unique identifier carried by the second broadcast information in the second mapping relationship, and the second connection request is used to establish a wireless connection with the second AP of the first router.
[0014] In the present application, when an electronic device connects to an AP on a router for the first time, the generated random MAC address can be carried in the connection request. After the wireless router determines that a communication connection is established, the response message sent to the electronic device can carry the unique identifier of each AP in the wireless router. After the electronic device receives the response information, it can record the mapping relationship between the generated random MAC address and the unique identifier of each AP in the received response message. When the electronic device accesses any AP in the same router again, it will receive the broadcast information sent by the wireless router, which usually carries the unique identifier of the AP. Therefore, the electronic device first queries the stored mapping relationship. If the unique identifier of the AP to be accessed already has a MAC address with a mapping relationship, the connection request is sent using the random MAC address in the mapping relationship. This allows the same MAC address to be used when connecting to the AP in the same wireless router, thereby reducing the occurrence of MAC address function failure on the wireless router when using a random MAC address to connect to the wireless router.
[0015] In an implementation of the first aspect, the first broadcast information carries a first unique identifier of the first AP. Before the electronic device sends the first connection request to the first AP of the first router, the method further includes:
[0016] The electronic device fails to find the MAC address corresponding to the first unique identifier carried in the first broadcast information;
[0017] The electronic device generates the first random MAC address.
[0018] In the present application, the electronic device may search for the unique identifier carried in the received broadcast information in the stored mapping relationship to determine whether it is the first time to establish a connection with the wireless router.
[0019] Of course, the first time in this application is expressed as a reference to whether the mapping relationship corresponding to the unique identifier is stored, not the first time since the electronic device was manufactured.
[0020] In another implementation of the first aspect, after the electronic device sends the second connection request to the second AP of the first router, the method further includes:
[0021] The electronic device receives a second response message sent by a second AP of the first router, where the second response message carries a first unique identifier of the first AP and a second unique identifier of the second AP;
[0022] The electronic device deletes the stored mapping relationship related to the first random MAC address;
[0023] The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the second response information, and a second mapping relationship between the first random MAC address and the second unique identifier in the second response information.
[0024] In this application, the response information sent by the wireless router can be configured to store the unique identifier of each AP on the current wireless router. This may cause the electronic device to repeatedly establish a random MAC address and the unique identifier of each AP on the wireless router. Therefore, to avoid conflicts, the mapping relationship related to the already stored random MAC address can be deleted, and a new mapping relationship can be established based on the random MAC address of the current wireless connection and the unique identifier in the received response information.
[0025] In another implementation of the first aspect, after the electronic device sends the second connection request to the second AP of the first router, the method further includes:
[0026] The electronic device receives a second response message sent by a second AP of the first router, where the second response message carries a first unique identifier of the first AP and a second unique identifier of the second AP;
[0027] The electronic device determines that the mapping relationship of the first random MAC address has been stored, and no longer stores the mapping relationship between the first random MAC address and the unique identifier in the second response information.
[0028] In the present application, in order to reduce power consumption, when a mapping relationship of a random MAC address has been stored, the mapping relationship for storing the random MAC address is no longer repeatedly established.
[0029] In another implementation of the first aspect, the electronic device includes a first module for establishing a wireless connection with the first AP and a second module for establishing a wireless connection with the second AP;
[0030] The operating frequency band of the first AP and the first module is 2.4 GHz, and the operating frequency band of the second AP and the second module is 5 GHz;
[0031] Alternatively, the operating frequency band of the first AP and the first module is 5 GHz, and the operating frequency band of the second AP and the second module is 2.4 GHz.
[0032] This application does not limit the operating frequency bands of multiple APs in a wireless router to be the same when applied, and is therefore widely applicable. In a second aspect, this application provides a wireless connection method, including:
[0033] The electronic device receives third broadcast information sent by a first AP of a first router, where the mesh network where the first router is located also includes a second router, and the second router includes a third AP;
[0034] The electronic device sends a third connection request to the first AP of the first router, where the third connection request carries the first random MAC address of the electronic device;
[0035] The electronic device receives third response information sent by the first AP of the first router, where the third response information carries the first unique identifier of the first AP and the third unique identifier of the third AP;
[0036] The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the third response information, and a third mapping relationship between the first random MAC address and the third unique identifier in the third response information;
[0037] The wireless connection between the electronic device and the first AP of the first router is disconnected;
[0038] The electronic device receives fourth broadcast information sent by the third AP of the second router, where the fourth broadcast information carries a third unique identifier of the third AP;
[0039] The electronic device sends a fourth connection request to the third AP of the second router, where the fourth connection request carries the first random MAC address corresponding to the third unique identifier carried by the third broadcast information in the third mapping relationship, and the fourth connection request is used to establish a wireless connection with the third AP of the second router.
[0040] This application can also be applied to multiple wireless routers in the same mesh network. The specific effects can be referred to the description in the first aspect.
[0041] In an implementation of the second aspect, the third broadcast information carries the first unique identifier of the first AP, and before the electronic device sends the third connection request to the first AP of the first router, the method further includes:
[0042] The electronic device fails to find the MAC address corresponding to the first unique identifier carried in the third broadcast information;
[0043] The electronic device generates the first random MAC address.
[0044] In another implementation of the second aspect, after the electronic device sends the fourth connection request to the third AP of the second router, the method further includes:
[0045] The electronic device receives fourth response information sent by the third AP of the second router, where the fourth response information carries the first unique identifier of the first AP and the third unique identifier of the third AP;
[0046] The electronic device deletes the stored mapping relationship related to the first random MAC address;
[0047] The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the fourth response information, and a second mapping relationship between the first random MAC address and the third unique identifier in the fourth response information.
[0048] In another implementation of the second aspect, after the electronic device sends the fourth connection request to the third AP of the second router, the method further includes:
[0049] The electronic device receives fourth response information sent by the third AP of the second router, where the fourth response information carries the first unique identifier of the first AP and the third unique identifier of the third AP;
[0050] The electronic device determines that the mapping relationship of the first random MAC address has been stored, and no longer stores the mapping relationship between the first random MAC address and the unique identifier in the fourth response information.
[0051] In another implementation of the second aspect, the electronic device includes a first module for establishing a wireless connection with the first AP and a second module for establishing a wireless connection with the third AP;
[0052] The operating frequency band of the first AP and the first module is 2.4 GHz, and the operating frequency band of the third AP and the second module is 5 GHz;
[0053] Alternatively, the operating frequency band of the first AP and the first module is 5 GHz, and the operating frequency band of the third AP and the second module is 2.4 GHz.
[0054] In another implementation of the second aspect, the electronic device includes a first module for establishing a wireless connection with the first AP and the third AP;
[0055] The operating frequency bands of the first module, the first AP, and the third AP are all 2.4 GHz;
[0056] Alternatively, the operating frequency bands of the first module, the first AP, and the third AP are all 5 GHz.
[0057] In a third aspect, the present application provides a wireless connection method, comprising:
[0058] The first router receives a connection request sent by the electronic device, where the connection request carries a first random MAC address of the electronic device;
[0059] The first router sends response information to the electronic device based on the connection request, where the response information carries the unique identifier of each AP in the first router, and the response information is used to instruct the electronic device to establish a mapping relationship between the first random MAC address and the unique identifier of each AP in the first router.
[0060] In an implementation of the third aspect, the mesh network in which the first router is located also includes a second router; the response information also carries a unique identifier of each AP in the second router, and the response information is further used to instruct the electronic device to establish a mapping relationship between the first random MAC address and the unique identifier of each AP in the second router.
[0061] In a fourth aspect, an electronic device is provided, comprising a processor, the processor being configured to run a computer program stored in a memory to implement any method of the first aspect or any method of the second aspect of the present application.
[0062] In a fifth aspect, a wireless router is provided, comprising a processor, the processor being configured to run a computer program stored in a memory to implement any one of the methods of the third aspect of the present application.
[0063] In the sixth aspect, a chip system is provided, comprising a processor coupled to a memory, wherein the processor executes a computer program stored in the memory to implement any method of the first aspect, or any method of the second aspect, or any method of the third aspect of the present application.
[0064] In the seventh aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by one or more processors, it implements any method of the first aspect, or any method of the second aspect, or any method of the third aspect of the present application.
[0065] In an eighth aspect, an embodiment of the present application provides a computer program product, which, when running on a device, enables the device to execute any method of the first aspect, or any method of the second aspect, or any method of the third aspect of the present application.
[0066] It can be understood that the beneficial effects of the second to eighth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 A schematic diagram of the hardware structure of an electronic device used in the wireless connection method provided in an embodiment of the present application;
[0068] Figure 2 A schematic diagram of a wireless connection method according to an embodiment of the present invention;
[0069] Figure 3 A schematic diagram of a router interface in a wireless connection method provided in an embodiment of the present application;
[0070] Figure 4 A schematic diagram of a wireless connection method according to an embodiment of the present invention;
[0071] Figure 5 A schematic diagram of a wireless connection method according to an embodiment of the present invention;
[0072] Figure 6 A timing diagram of a wireless connection method provided in an embodiment of the present application;
[0073] Figure 7 A timing diagram of another wireless connection method provided in an embodiment of the present application;
[0074] Figure 8 A schematic diagram of a wireless connection method according to an embodiment of the present invention;
[0075] Figure 9 A timing diagram of a wireless connection method provided in an embodiment of the present application;
[0076] Figure 10 This is a timing diagram of another wireless connection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details.
[0078] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0079] It should also be understood that in the embodiments of this application, "one or more" refers to one, two, or more than two; "and / or" describes the relationship between associated objects, indicating that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0080] In addition, in the description of this application specification and the appended claims, the terms "first", "second", "third", "fourth", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0081] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0082] The wireless connection method provided in the embodiments of the present application can be applied to the following electronic devices. The electronic device can be a tablet computer, a mobile phone, a wearable device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or other electronic device. The embodiments of the present application do not limit the specific type of electronic device. The wireless connection method provided in the embodiments of the present application can also be applied to wireless routers.
[0083] Figure 1 The schematic diagram of the structure of an electronic device is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180K, an ambient light sensor 180L, etc.
[0084] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0085] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a coprocessor (SCP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. For example, the processor 110 is used to execute the wireless connection method in the embodiment of the present application.
[0086] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0087] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0088] The USB interface 130 is an interface that complies with USB standards, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and peripheral devices.
[0089] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0090] 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 electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0091] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.).
[0092] In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0093] The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from the wired charger via the USB interface 130.
[0094] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.
[0095] In some other embodiments, the power management module 141 may also be provided in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
[0096] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0097] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0098] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1.
[0099] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0100] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0101] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0102] The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0103] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0104] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0105] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only monitor voice information but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording functions. The headphone jack 170D is used to connect wired headphones. The headphone jack 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0106] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be provided on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a device comprising at least two parallel plates having a conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A.
[0107] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.
[0108] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.
[0109] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0110] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback.
[0111] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0112] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0113] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0114] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or removed from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0115] The embodiments of the present application do not particularly limit the specific structure of the execution subject of a wireless connection method. As long as the code recording a wireless connection method of the embodiments of the present application can be executed to communicate according to a wireless connection method provided by the embodiments of the present application, it is sufficient. For example, the execution subject of a wireless connection method provided by the embodiments of the present application can be a functional module in an electronic device that can call and execute a program, or a communication device used in an electronic device, such as a chip.
[0116] As electronic devices become increasingly powerful, users are increasingly concerned about the security of their devices. To protect user privacy, electronic devices use different private Media Access Control Addresses (MAC addresses) when accessing different wireless access points (AP hotspots). For example, an electronic device can generate a first random MAC address and use it to access a first AP; when accessing a second AP, it generates a second random MAC address and uses it to access the second AP.
[0117] In some scenarios, users can set up device blacklists and whitelists or perform other forms of device management on routers. Generally, MAC addresses are used as unique identifiers for electronic devices, theoretically distinguishing them from one another. However, the advent of random MAC address functionality on electronic devices has rendered blacklists and whitelists or device management on routers ineffective.
[0118] As an example, see Figure 2 The first router is a dual-band wireless router, including a first AP operating in the 2.4GHz frequency band and a second AP operating in the 5GHz frequency band. During operation, the first AP transmits a broadcast signal in the 2.4GHz frequency band, which carries the basic service set identifier (BSSid) of the first AP. The BSSid is used to identify a wireless base station device, and the BSSids of different APs are different. During operation, the second AP transmits a broadcast signal in the 5GHz frequency band, which carries the BSSid of the second AP. A mobile phone, as an example of an electronic device, includes a first module and a second module. The first module operates at 2.4GHz and can receive the broadcast signal of the first AP of the first router when it is within the coverage range of the broadcast signal of the first AP of the first router; the second module operates at 5GHz and can receive the broadcast signal of the second AP of the first router when it is within the coverage range of the broadcast signal of the second AP of the first router. The mobile phone can access the first AP of the first router using a first random MAC address; the user can add the first random MAC address to the blacklist of the first router to add the mobile phone to the blacklist. After the mobile phone is disconnected from the first AP (or the connection is not disconnected), the mobile phone can still use the second random MAC address to access the second AP of the first router. However, since the first random MAC address is on the blacklist and the second random MAC address is not on the blacklist, the blacklist on the router is invalid for the mobile phone using the 5GHz wireless network with the second random MAC address.
[0119] In this example, two mobile phones of the same model will be displayed on the device management page of the first router, but the first router cannot determine whether the device corresponding to the first random MAC address and the device corresponding to the second random MAC address are the same device. Figure 3 , which is an example of the device management page of the first router provided in an embodiment of the present application. In this page, the two devices have the same model but different MAC addresses, and one of the two devices displays network speed limit (speed limit is set based on the first random MAC address), and the other displays network no speed limit (speed limit is not set based on the second random MAC address). In actual application, the user may only use one mobile phone of this model to connect to the first router, causing the user to believe that an abnormality has occurred.
[0120] As another example, refer to Figure 4 The mesh network where the first router is located also includes a second router. The first router includes one or more APs, wherein the first AP operates in the 2.4GHz frequency band; the second router includes one or more APs, wherein the third AP operates in the 2.4GHz frequency band. The first module in the mobile phone can access the first AP in the first router with a first random MAC address. The user adds the first random MAC address to the blacklist to add the mobile phone to the blacklist. The routers in the mesh network can share the blacklist, that is, the blacklist in the second router also includes the mobile phone corresponding to the first random MAC address; after the mobile phone and the first router are disconnected, the first module of the mobile phone can access the third AP in the second router with a second random MAC address. However, the MAC address in the blacklist shared by the second router is the first random MAC address and does not include the second random MAC address. Therefore, the blacklist on the second router is invalid for the mobile phone that uses the wireless network provided by the second router with the second random MAC address.
[0121] Of course, the blacklist in the above example is only an example of an application scenario. In actual applications, some whitelists, child Internet protection settings, and other functions that require the MAC address as the unique identifier of the electronic device will become invalid, or the random MAC address must be repeatedly set each time to take effect.
[0122] To solve the above problem, an embodiment of the present application provides a wireless connection method. When an electronic device first accesses any AP in a wireless router, the BSSid of each AP in the wireless router is added to the response message returned by the wireless router. Of course, other information can also be used as the unique identifier of different APs, and this embodiment of the present application does not limit this. The electronic device can record the mapping relationship between the random MAC address of the currently accessed wireless router and the BSSid of each AP in the received response message. When the electronic device accesses any AP in the same wireless router again, the random MAC address corresponding to the BSSid of the AP to be accessed is searched from the mapping relationship; and the AP to be accessed on the same wireless router is accessed using the queried random MAC address.
[0123] When the BSSid of each AP in the wireless router is added to the response message, a manufacturer-defined field may be added to the response message, and the content of the field is the BSSid of each AP in the wireless router or other unique identifier of each AP in the wireless router.
[0124] When an electronic device first accesses any AP of any wireless router in a mesh network, the BSSid of each AP in each wireless router in the mesh network where the wireless router is located is added to the response message returned by the wireless router connected to the electronic device. The electronic device can record the mapping relationship between the random MAC address of the currently connected wireless router and the BSSid of each AP in each wireless router in the received response message. When the mobile phone accesses any AP of any wireless router in the same mesh network again, the random MAC address corresponding to the BSSid of the AP to be accessed is searched from the mapping relationship; and the mobile phone accesses the AP to be accessed of the wireless router to be accessed in the same mesh network using the queried random MAC address.
[0125] When adding the BSSid of each AP in each wireless router in the mesh network where the wireless router is located to the response message, a manufacturer-defined field can be added to the response message. The content of this field is the BSSid of each AP in each wireless router in the mesh network where the wireless router is located or other unique identifiers of each AP in each wireless router in the mesh network where the wireless router is located.
[0126] Specifically, the vendor-customizable data in the Vendor Specific field of the response message can be used to add the BSSIDs of the APs in the above example to the Vendor Specific field. This tells the electronic device that the BSSID in this field belongs to the same router or mesh network and that the same MAC address should be used when accessing the BSSID.
[0127] As an example of the Vendor Specific field, Vendor Specific ID=221 Vendor Specific Len=15 Value=0XA069740109AAAAAABBBBBBCCCCCC. For the meaning of each character, refer to Table 1.
[0128] Table 1 Meaning of each character in Vendor Specific
[0129]
[0130] In practical applications, the number of bits in the Vendor Specific field can be reduced or increased based on the number of APs carried. Table 1 shows the BSSIDs of three APs carried in the response information.
[0131] In order to more clearly understand the wireless connection method provided in the embodiment of the present application, the process of establishing a wireless connection between an electronic device (eg, a mobile phone) and a wireless router will be described in detail below.
[0132] Reference Figure 5 , which is a scenario diagram of a wireless connection method provided in an embodiment of the present application.
[0133] A1. A first module in the electronic device sends a connection request to a first AP of a first router. The connection request carries a first random MAC address of the electronic device.
[0134] A2: After receiving and matching the connection request, the first router sends a connection response to the electronic device. The connection response carries the BSSid of the first AP and the BSSid of the second AP in the first router.
[0135] Of course, in actual applications, when the first router also includes other APs, the connection response also includes the BSSids of other APs, that is, the connection response includes the BSSid of each AP in the first router.
[0136] A3. The electronic device stores a mapping relationship between the first random MAC address and the BSSid of the first AP in the received connection response, and a mapping relationship between the first random MAC address and the BSSid of the second AP.
[0137] Of course, when the received connection response also includes the BSSid of other APs, it is also necessary to store the mapping relationship between the first random MAC address and the BSSid of other APs.
[0138] A4: The first router receives the setting information and adds the first random MAC address to the blacklist based on the setting information.
[0139] The wireless connection between the first module of the electronic device and the first AP is disconnected.
[0140] A5. After querying the mapping relationship, the electronic device sends a connection request to the second AP of the first router through the second module. The connection request carries the MAC address corresponding to the BSSid of the second AP in the mapping relationship, that is, the first random MAC address.
[0141] From this scenario, we can understand that when the same electronic device accesses another AP of the same wireless router again, using the same random MAC address as when establishing the wireless communication connection before, the functions previously set based on the random MAC address can still take effect.
[0142] To better understand this scenario, the following describes the specific implementation process in detail.
[0143] See also Figure 6 , provided in the embodiments of this application Figure 5 Timing diagram of the scenario shown.
[0144] S101: A first AP of a first router sends a 2.4 GHz broadcast message (referred to as first broadcast message). The broadcast message carries BSSid1 of the first AP. A first module of an electronic device receives the broadcast message.
[0145] When the electronic device is within the wireless broadcast coverage of the first AP of the first router, the first module of the electronic device can receive 2.4 GHz broadcast information sent by the first AP of the first router.
[0146] Generally, wireless modules and APs in the same frequency band can communicate with each other, but wireless modules and APs in different frequency bands cannot recognize each other's wireless signals.
[0147] When the first module and the second module of the electronic device are simultaneously turned on, the first AP of the first router is turned on, and the second AP is turned off, the first module of the electronic device can receive broadcast information sent by the first AP.
[0148] When the first module of the electronic device is turned on, the second module is turned off, and the first AP and the second AP of the second router are turned on at the same time, the first module of the electronic device can receive broadcast information sent by the first AP.
[0149] When the first module and the second module of the electronic device are turned on at the same time, and the first AP and the second AP of the first router are turned on at the same time, the first module of the electronic device can receive broadcast information sent by the first AP, and the second module of the electronic device can receive broadcast information sent by the second AP.
[0150] In the embodiment of the present application, in steps S101 to S107, it is assumed that the first AP and the second AP of the first router are both turned on, the first module of the electronic device is turned on, and the second module is turned off.
[0151] S102: A first module of the electronic device receives an instruction to connect to a first AP.
[0152] In the embodiment of the present application, the user can perform an operation on the electronic device, and the first module on the electronic device receives an instruction to connect to the first AP.
[0153] Of course, in the specific implementation, the first module of the electronic device can receive the broadcast information sent by the first AP, and the second module can receive the broadcast information sent by the second AP. The user can also operate on the electronic device to trigger the electronic device to establish a wireless connection with the second AP, and the second module on the electronic device will receive the instruction to connect to the second AP.
[0154] S103: The first module of the electronic device queries the mapping table, and the query result is: no MAC address corresponding to BSSid1 in the broadcast information is found.
[0155] If the MAC address corresponding to the BSSid1 in the broadcast information is found in the mapping table stored in the electronic device, it means that the electronic device has previously established a wireless connection with the first router, and the mapping relationship between the random MAC address used when establishing the wireless connection and the BSSid of the AP on the first router is stored; if the MAC address corresponding to the BSSid1 in the broadcast information is not found in the mapping table stored in the electronic device, it means that the electronic device has previously established a wireless connection with the first router, but the mapping relationship between the random MAC address used when establishing the wireless connection and the BSSid of the AP on the first router is not stored; or this is the first time the electronic device and the first router are connected.
[0156] S104 : If the MAC address corresponding to BSSid1 in the broadcast information is not found in the query, the first module of the electronic device generates a first random MAC address.
[0157] It should be noted that steps S102 to S104 may also be implemented by other software function modules other than the first module in the electronic device. The embodiment of the present application does not limit the execution modules of steps S102 to S104.
[0158] S105: The first module of the electronic device sends a connection request (which may be recorded as a first connection request) to the first router. The connection request carries the generated first random MAC address.
[0159] S106, after the first AP in the first router receives and matches the connection request, it sends a response message (which can be recorded as the first response information), which carries the BSSid1 of the first AP (which can be recorded as the first unique identifier) and the BSSid2 of the second AP (which can be recorded as the second unique identifier).
[0160] In the embodiment of the present application, if the first router further includes other APs, the response message carries the BSSids of the other APs.
[0161] S107, after receiving the response message, the first module of the electronic device establishes a mapping relationship between the first random MAC address and the BSSid1 of the first AP in the response message (which can be recorded as the first mapping relationship), and a mapping relationship between the first random MAC address and the BSSid2 of the second AP (which can be recorded as the second mapping relationship).
[0162] Similarly, the step of establishing a mapping relationship in step S107 may also be implemented by other software function modules in the electronic device.
[0163] Subsequently, the user can add the first random MAC address to the blacklist on the first router, or set other functions related to the MAC address.
[0164] Subsequently, the wireless connection between the first module of the electronic device and the first AP of the first router may be disconnected. For example, if the user carries the electronic device out of the coverage range of the wireless signal of the first AP of the first router, the wireless connection between the first module of the electronic device and the first AP of the first router will be disconnected.
[0165] In the embodiment of the present application, subsequent steps S201 to S206 are based on the example that the first AP and the second AP of the first router are both turned on, the first module of the electronic device is turned off, and the second module is turned on.
[0166] When the user brings the electronic device (with the first module turned off and the second module turned on) into the wireless coverage range of the second AP of the first router again:
[0167] S201, the second AP of the first router sends a 5GHz broadcast message (which can be recorded as the second broadcast message), which carries the BSSid2 of the second AP. The second module of the electronic device receives the broadcast message.
[0168] S202: The second module of the electronic device receives an instruction to connect to a second AP.
[0169] In the embodiment of the present application, the user can perform an operation on the electronic device, and the second module on the electronic device receives an instruction to connect to the second AP.
[0170] S203: The second module of the electronic device queries the mapping table, and the query result is: the first random MAC address corresponding to the BSSid2 in the broadcast information is found.
[0171] It should be noted that steps S202 to S203 may also be implemented by other software function modules other than the second module in the electronic device. The embodiment of the present application does not limit the execution module of steps S202 to S203.
[0172] S204: When the second module of the electronic device finds the MAC address corresponding to BSSid2 in the broadcast information, it sends a connection request (which may be recorded as a second connection request) to the first router. The connection request carries the found first random MAC address.
[0173] S205 , after receiving and matching the connection request, the second AP in the first router sends a response message (which may be recorded as second response information), which carries BSSid1 of the first AP and BSSid2 of the second AP.
[0174] In the embodiment of the present application, if the first router further includes other APs, the response message carries the BSSids of the other APs.
[0175] S206: The second module of the electronic device has previously queried the mapping relationship of the first random MAC address, and no mapping relationship is established.
[0176] In the embodiment of the present application, since the mapping relationship of the first random MAC address for establishing the communication connection this time already exists in the electronic device, it is not necessary to repeatedly establish the mapping relationship.
[0177] Of course, in practical applications, step S206 may also be replaced by step S206'.
[0178] S206', after receiving the response message, the second module of the electronic device establishes a mapping relationship between the first random MAC address and the BSSid1 of the first AP in the response message, as well as a mapping relationship between the first random MAC address and the BSSid2 of the second AP, and overwrites (can also be understood as deleting) the original mapping relationship of the first random MAC address.
[0179] In this embodiment, after a new AP is added to the first router, a mapping relationship between a random MAC address that has been wirelessly connected before and the new AP may be established.
[0180] In this way, even if the electronic device is connected to another AP in the first router through the second module, since the same random MAC address is used, the electronic device is also in the blacklist on the first router side, so some functions set using the MAC address will not be invalid.
[0181] In the above embodiment, the operating frequency band of the first AP and the first module is 2.4 GHz, and the operating frequency band of the second AP and the second module is 5 GHz. In actual applications, the operating frequency band of the first AP and the first module can also be 5 GHz, and the operating frequency band of the second AP and the second module can also be 2.4 GHz. Of course, the operating frequency bands of the first AP, the first module, the second AP, and the second module can also all be 5 GHz or all be 2.4 GHz. The subsequent embodiments of this application will not illustrate each case.
[0182] As another embodiment of the present application, the present application embodiment can also set some of the above steps in other software function modules, which can be specifically referred to Figure 7 The embodiment shown provides a wireless connection method. The steps of the same content can refer to Figure 6 The description in the illustrated embodiment will not be repeated here.
[0183] S301: A first AP of a first router sends a 2.4 GHz broadcast message carrying BSSid1 of the first AP. A first module of an electronic device receives the broadcast message.
[0184] S302: The first module of the electronic device sends the BSSid1 in the broadcast information to the auxiliary communication module, so as to query the MAC address when it needs to connect to the AP later.
[0185] S303, the auxiliary communication module (in actual application, it can also be other names, and the embodiment of the present application does not limit the name) of the electronic device receives an instruction to connect to the first AP.
[0186] In the embodiment of the present application, the user may perform an operation on the electronic device, and the auxiliary communication module on the electronic device receives an instruction to connect to the first AP.
[0187] S304 , the auxiliary communication module of the electronic device queries the mapping table, and the query result is: no MAC address corresponding to BSSid1 in the broadcast information is found.
[0188] S305 : If the MAC address corresponding to BSSid1 in the broadcast information is not found in the query, the first module of the electronic device generates a first random MAC address.
[0189] S306: The auxiliary communication module of the electronic device sends the generated first random MAC address to the first module.
[0190] S307: After receiving the first random MAC address, the first module of the electronic device sends a connection request to the first router, where the connection request carries the received first random MAC address.
[0191] S308. After receiving and matching the connection request, the first AP in the first router sends the first random MAC address to the setting module of the first router (which may have other names in actual applications and is not limited to the name in the embodiment of the present application) to facilitate the relevant function settings of the first random MAC address.
[0192] S309: After receiving and matching the connection request, the first AP of the first router sends a response message. The response message carries BSSid1 of the first AP and BSSid2 of the second AP.
[0193] There is no fixed relationship between the execution order of step S308 and step S309, and they can be set according to actual conditions.
[0194] S310: After receiving the response message, the first module of the electronic device sends the BSSid1 of the first AP and the BSSid2 of the second AP in the response message to the assisting communication module.
[0195] S311 , after receiving BSSid1 of the first AP and BSSid2 of the second AP, the auxiliary communication module of the electronic device establishes a mapping relationship between the generated first random MAC address and BSSid1 , and a mapping relationship between the first random MAC address and BSSid2 .
[0196] Subsequently, the user can add the first random MAC address to the blacklist on the first router, or set other functions related to the MAC address.
[0197] S401: A setting module of a first router receives an instruction to add a first random MAC address to a blacklist.
[0198] S402: After receiving the instruction, the setting module of the first router adds the first random MAC address to the blacklist.
[0199] Subsequently, the wireless connection between the first module of the electronic device and the first AP of the first router may be disconnected. For example, if the user carries the electronic device out of the coverage range of the wireless signal of the first AP of the first router, the wireless connection between the first module of the electronic device and the first AP of the first router will be disconnected.
[0200] The subsequent steps of the embodiment of the present application are based on the example that the first AP and the second AP of the first router are both turned on, the first module of the electronic device is turned off, and the second module is turned on. Of course, turning them on at the same time does not affect the implementation of the embodiment of the present application.
[0201] When the user brings the electronic device (with the first module turned off and the second module turned on) into the wireless coverage range of the second AP of the first router again:
[0202] S501: The second AP of the first router sends a 5 GHz broadcast message, which carries the BSSid2 of the second AP. The second module of the electronic device receives the broadcast message.
[0203] S502: The second module of the electronic device sends the BSSid2 in the broadcast information to the auxiliary communication module, so as to query the MAC address when it needs to connect to the AP later.
[0204] S503: The auxiliary communication module of the electronic device receives an instruction to connect to a second AP.
[0205] S504 , the auxiliary communication module of the electronic device queries the mapping table, and the query result is: the first random MAC address corresponding to the BSSid2 in the broadcast information is found.
[0206] S505: The auxiliary communication module of the electronic device sends the retrieved first random MAC address to the second module.
[0207] S506: After receiving the first random MAC address, the second module of the electronic device sends a connection request to the first router, where the connection request carries the received first random MAC address.
[0208] S507: After receiving and matching the connection request, the second AP in the first router sends the first random MAC address to the setting module of the first router.
[0209] S508: After receiving and matching the connection request, the second AP of the first router sends a response message. The response message carries the BSSid1 of the first AP and the BSSid2 of the second AP.
[0210] S509 , after receiving the response message, the second module of the electronic device sends the BSSid1 of the first AP and the BSSid2 of the second AP in the response message to the assisting communication module.
[0211] S510: The auxiliary communication module of the electronic device has previously searched for a mapping relationship of the first random MAC address, and no mapping relationship is established.
[0212] In the embodiment of the present application, since the mapping relationship of the first random MAC address for establishing the communication connection this time already exists in the electronic device, it is not necessary to repeatedly establish the mapping relationship.
[0213] Similarly, in practical applications, step S510 may also be replaced by step S510'.
[0214] S510', the auxiliary communication module of the electronic device establishes a mapping relationship between the first random MAC address and BSSid1, and a mapping relationship between the first random MAC address and BSSid2, and overwrites the original mapping relationship of the first random MAC address.
[0215] above Figure 6 and Figure 7 In the embodiment shown, on the first router side, if the MAC addresses of the electronic devices establishing communication connections twice are the same, the two communication connections will be considered to be the same electronic device, and the relevant settings for the first random MAC address will also take effect in the second connection, that is, no error will occur. Figure 3 The phenomenon of the interface shown is that the network speed is limited when the communication connection is established for the first time (between the first module and the first AP), but the speed is not limited when the communication connection is established for the second time (between the second module and the second AP).
[0216] The following describes in detail the process of establishing a wireless connection between an electronic device (eg, a mobile phone) and any AP in any wireless router in a mesh network.
[0217] Reference Figure 8 , which is a scenario diagram of a wireless connection method provided in an embodiment of the present application.
[0218] B1. A first module in the electronic device sends a connection request to a first AP of a first router. The connection request carries a first random MAC address of the electronic device.
[0219] B2. After receiving and matching the connection request, the first router sends a connection response to the electronic device. The connection response carries the BSSid of the first AP in the first router and the BSSid of the third AP in the second router in the mesh network.
[0220] Of course, in actual applications, when the first router also includes other APs, the connection response also includes the BSSids of other APs in the first router, that is, the connection response includes the BSSid of each AP in the first router.
[0221] In the case that the second router further includes other APs, the connection response further includes the BSSids of the other APs in the second router, that is, the connection response includes the BSSid of each AP in the second router.
[0222] In the case that the mesh network further includes other routers, the connection response further includes the BSSid of each AP in the other routers in the mesh network.
[0223] B3. The electronic device stores a mapping relationship between the first random MAC address and the BSSid of the first AP in the received connection response, and a mapping relationship between the first random MAC address and the BSSid of the third AP.
[0224] B4. The first router receives the setting information and adds the first random MAC address to the blacklist based on the setting information.
[0225] In the embodiment of the present application, each router in the mesh network can share a blacklist, so the first random MAC address will also be stored in the blacklist in the second router.
[0226] The wireless connection between the electronic device and the first AP of the first router is disconnected.
[0227] B5. After querying the mapping relationship, the electronic device sends a connection request to the third AP of the second router through the first module. The connection request carries the MAC address corresponding to the BSSid of the third AP in the mapping relationship, that is, the first random MAC address.
[0228] From this scenario, we can understand that when the same electronic device accesses the AP of another wireless router in the same mesh network again, using the same random MAC address as when establishing the wireless communication connection before, the functions previously set based on the random MAC address can still take effect.
[0229] To better understand this scenario, the following describes the specific implementation process in detail.
[0230] See also Figure 9 , provided in the embodiments of this application Figure 8 Timing diagram of the scenario shown.
[0231] S601: The first AP of the first router sends a 2.4 GHz broadcast message (which may be recorded as the third broadcast message). The broadcast message carries the BSSid1 of the first AP. The first module of the electronic device receives the broadcast message.
[0232] S601', the third AP of the second router sends a 2.4 GHz broadcast message, the broadcast message carries the BSSid3 of the third AP, and the first module of the electronic device receives the broadcast message.
[0233] When the electronic device is within the wireless broadcast coverage of the first AP of the first router, the first module of the electronic device can receive 2.4 GHz broadcast information sent by the first AP of the first router.
[0234] When there is a second router in the mesh network where the first router is located, the third AP of the second router also sends out 2.4GHz broadcast information; when the electronic device is also within the wireless broadcast coverage range of the third AP of the second router, the first module of the electronic device can also receive the 2.4GHz broadcast information sent by the third AP of the second router.
[0235] S602: A first module of the electronic device receives an instruction to connect to a first AP.
[0236] In an embodiment of the present application, a user can perform an operation on the electronic device to trigger the electronic device to connect to the first router or the second router. In the embodiment of the present application, the user's operation triggers the electronic device to connect to the first AP of the first router as an example, and the first module on the electronic device receives an instruction to connect to the first AP.
[0237] S603: The first module of the electronic device queries the mapping table, and the query result is: no MAC address corresponding to BSSid1 in the broadcast information is found.
[0238] When the MAC address corresponding to the BSSid1 in the broadcast information is queried in the mapping table stored in the electronic device, it means that the electronic device has previously established a wireless connection with the first router or other routers in the mesh network where the first router is located, and has stored the mapping relationship between the random MAC address used when establishing the wireless connection before and the BSSid1 of the first AP on the first router.
[0239] If the MAC address corresponding to the BSSid1 in the broadcast information is not found in the mapping table stored in the electronic device, it means that the electronic device has previously established a wireless connection with the first router or other routers in the mesh network where the first router is located, but the mapping relationship between the random MAC address used when establishing the wireless connection before and the BSSid1 of the first AP on the first router is not stored; or the electronic device and the first router or other routers in the mesh network where the first router is located are connected for the first time.
[0240] S604: If no MAC address corresponding to BSSid1 in the broadcast information is found, the first module of the electronic device generates a first random MAC address.
[0241] It should be noted that steps S602 to S604 may also be implemented by other software function modules other than the first module in the electronic device. The embodiment of the present application does not limit the execution module of steps S602 to S604.
[0242] S605: The first module of the electronic device sends a connection request (which may be recorded as a third connection request) to the first router. The connection request carries the generated first random MAC address.
[0243] S606, after receiving and matching the connection request, the first AP in the first router sends a response message (which can be recorded as the third response information), which carries BSSid1 of the first AP and BSSid3 of the third AP (which can be recorded as the third unique identifier).
[0244] In this embodiment of the present application, if the first router also includes other APs, the response message carries the BSSIDs of the other APs of the first router. If the second router also includes other APs, the response message carries the BSSIDs of the other APs of the second router. If there are other routers in the mesh network where the first router is located, the response message also carries the BSSIDs of the APs in the other routers.
[0245] S607, after receiving the response message, the first module of the electronic device establishes a mapping relationship between the first random MAC address and the BSSid1 of the first AP in the response message, and a mapping relationship between the first random MAC address and the BSSid3 of the third AP (which can be recorded as a third mapping relationship).
[0246] Similarly, the step of establishing a mapping relationship in step S607 may also be implemented by other software function modules in the electronic device.
[0247] Later, the user can add the first random MAC address to the blacklist on the first router, or set other MAC address-related functions. Routers in the same mesh network can share blacklists (or other MAC address-related functions), so the first random MAC address will also be added to the blacklist on the second router.
[0248] Subsequently, the wireless connection between the first module of the electronic device and the first AP of the first router may be disconnected. For example, if the user carries the electronic device out of the coverage range of the wireless signal of the first AP of the first router, the wireless connection between the first module of the electronic device and the first AP of the first router will be disconnected.
[0249] When the user brings the electronic device (with the first module turned off and the second module turned on) into the wireless coverage of the third AP of the second router (of course, it can also be within the wireless coverage of the first AP of the first router at the same time):
[0250] S701: The third AP of the second router sends a 2.4 GHz broadcast message (which may be recorded as the fourth broadcast message). The broadcast message carries the BSSid3 of the third AP. The first module of the electronic device receives the broadcast message.
[0251] S701', a first AP of a first router sends a 2.4 GHz broadcast message, the broadcast message carries the BSSid1 of the first AP, and a first module of the electronic device receives the broadcast message.
[0252] S702: The first module of the electronic device receives an instruction to connect to a third AP.
[0253] In an embodiment of the present application, a user can perform an operation on the electronic device to trigger the electronic device to connect to the first router or the second router. In the embodiment of the present application, the user's operation triggers the electronic device to connect to the third AP of the second router as an example, and the first module on the electronic device receives an instruction to connect to the third AP.
[0254] S703: The first module of the electronic device queries the mapping table, and the query result is: the first random MAC address corresponding to the BSSid3 in the broadcast information is found.
[0255] It should be noted that steps S702 to S703 may also be implemented by other software function modules other than the first module in the electronic device. The embodiment of the present application does not limit the execution module of steps S702 to S703.
[0256] S704, when the first module of the electronic device finds the MAC address corresponding to BSSid3 in the broadcast information, it sends a connection request (which may be recorded as a fourth connection request) to the third router, and the connection request carries the found first random MAC address.
[0257] S705 , after receiving and matching the connection request, the third AP in the second router sends a response message (which may be recorded as fourth response information), which carries BSSid1 of the first AP and BSSid3 of the third AP.
[0258] In this embodiment of the present application, if the second router also includes other APs, the response message carries the BSSIDs of the other APs of the second router. If the first router also includes other APs, the response message carries the BSSIDs of the other APs of the first router. If there are other routers in the mesh network where the second router is located, the response message also carries the BSSIDs of the APs of the other routers.
[0259] S706, after receiving the response message, the first module of the electronic device establishes a mapping relationship between the first random MAC address and the BSSid1 of the first AP in the response message, and a mapping relationship between the first random MAC address and the BSSid3 of the third AP, and overwrites the previous mapping relationship of the first random MAC address.
[0260] In this embodiment, after a new router is added to the mesh network where the second router resides, the mapping relationship for the current random MAC address is re-established, overwriting the previously established mapping relationship for the random MAC address. This allows the AP of the newly added router to also establish a mapping relationship with the first random MAC address. Similarly, after a router is removed from the mesh network where the second router resides, the mapping relationship for the current random MAC address is re-established, overwriting the previously established mapping relationship for the random MAC address. This allows the mapping relationship between the AP of the removed router and the first random MAC address to also be overwritten.
[0261] In this way, even if the electronic device connects to another router (for example, a second router) in the same mesh network as the first router through the first module, the electronic device will still be blacklisted on the second router because it uses the same random MAC address. Therefore, some functions configured using the MAC address will not be disabled. Furthermore, the mapping relationship of newly added routers can be added to the mesh network, and the mapping relationship of newly removed routers can be overwritten.
[0262] In the above embodiment, it is taken as an example that the operating frequency bands of the first module, the first AP, and the third AP are all 2.4 GHz. In actual applications, the operating frequency bands of the first module, the first AP, and the third AP may also be 5 GHz.
[0263] Of course, in the same mesh network, the first AP of the first router can also be 2.4 GHz, and the third AP of the second router can also be 5 GHz. Then, the first module of the electronic device operating at 2.4 GHz establishes a wireless connection with the first AP, and the second module of the electronic device operating at 5 GHz establishes a wireless connection with the third AP.
[0264] Alternatively, the first AP of the first router in the same mesh network can also be 5 GHz, and the third AP of the second router can also be 2.4 GHz. Then, the first module of the electronic device operating at 5 GHz establishes a wireless connection with the first AP, and the second module of the electronic device operating at 2.4 GHz establishes a wireless connection with the third AP.
[0265] As another embodiment of the present application, the present application embodiment can also set some of the above steps in other software function modules, which can be specifically referred to Figure 10 The embodiment shown provides a wireless connection method. The steps of the same content can refer to Figure 9 The description in the illustrated embodiment will not be repeated here.
[0266] S801: A first AP of a first router sends a 2.4 GHz broadcast message carrying BSSid1 of the first AP. A first module of an electronic device receives the broadcast message.
[0267] S802: The first module of the electronic device sends the BSSid1 in the broadcast information to the auxiliary communication module, so as to query the MAC address when it needs to connect to the AP later.
[0268] S801′: The third AP of the second router sends a 2.4 GHz broadcast message, which carries the BSSid3 of the third AP. The first module of the electronic device receives the broadcast message.
[0269] S802', the first module of the electronic device sends the BSSid3 in the broadcast information to the auxiliary communication module, so as to query the MAC address when it needs to connect to the AP later.
[0270] S803: The auxiliary communication module of the electronic device receives an instruction to connect to the first AP.
[0271] In the embodiment of the present application, the user may perform an operation on the electronic device, and the auxiliary communication module on the electronic device receives an instruction to connect to the first AP.
[0272] S804 , the auxiliary communication module of the electronic device queries the mapping table, and the query result is: no MAC address corresponding to BSSid1 in the broadcast information is found.
[0273] S805 : If the MAC address corresponding to BSSid1 in the broadcast information is not found in the query, the first module of the electronic device generates a first random MAC address.
[0274] S806: The auxiliary communication module of the electronic device sends the generated first random MAC address to the first module.
[0275] S807: After receiving the first random MAC address, the first module of the electronic device sends a connection request to the first router. The connection request carries the received first random MAC address.
[0276] S808: After receiving and matching the connection request, the first AP of the first router sends a response message. The response message carries BSSid1 of the first AP and BSSid3 of the third AP.
[0277] S809 , after receiving the response message, the first module of the electronic device sends the BSSid1 of the first AP and the BSSid3 of the third AP in the response message to the assisting communication module.
[0278] S810 , after receiving BSSid1 of the first AP and BSSid3 of the third AP, the assisting communication module of the electronic device establishes a mapping relationship between the generated first random MAC address and BSSid1 , and a mapping relationship between the first random MAC address and BSSid3 .
[0279] Later, the user can add the first random MAC address to the blacklist on the first router, or set other MAC address-related functions. Routers in the same mesh network can share blacklists (or other MAC address-related functions), so the first random MAC address will also be added to the blacklist on the second router.
[0280] Subsequently, the wireless connection between the first module of the electronic device and the first AP of the first router may be disconnected. For example, if the user carries the electronic device out of the coverage range of the wireless signal of the first AP of the first router, the wireless connection between the first module of the electronic device and the first AP of the first router will be disconnected.
[0281] When the user brings the electronic device into the wireless coverage range of the third AP of the second router again (of course, it can also be within the wireless coverage range of the first AP of the first router at the same time):
[0282] S901: The third AP of the second router sends a 2.4 GHz broadcast message, which carries the BSSid3 of the third AP. The first module of the electronic device receives the broadcast message.
[0283] S902: The first module of the electronic device sends the BSSid3 of the third AP in the received broadcast information to the assisting communication module.
[0284] In the embodiment of the present application, the first module of the electronic device may also receive broadcast information of the first AP of the first router, so step S901' and step S902' may also be included.
[0285] S901', a first AP of a first router sends a 2.4 GHz broadcast message, the broadcast message carries BSSid1 of the first AP, and a first module of an electronic device receives the broadcast message.
[0286] S902': The first module of the electronic device sends the BSSid1 of the first AP in the broadcast information to the assisting communication module.
[0287] S903: The auxiliary communication module of the electronic device receives an instruction to connect to a third AP.
[0288] The user can operate on the interface of the electronic device to trigger the electronic device to connect to the third AP.
[0289] S904 , the auxiliary communication module of the electronic device queries the mapping table, and the query result is: the first random MAC address corresponding to the BSSid3 of the third AP is found.
[0290] S905: The auxiliary communication module of the electronic device sends the queried first random MAC address to the first module.
[0291] S906: After receiving the first random MAC address, the first module of the electronic device sends a connection request to the second router, where the connection request carries the received first random MAC address.
[0292] S907: After receiving and matching the connection request, the third AP of the second router sends a response message. The response message carries BSSid1 of the first AP and BSSid3 of the third AP.
[0293] S908 , after receiving the response message, the first module of the electronic device sends the BSSid1 of the first AP and the BSSid3 of the third AP in the response message to the assisting communication module.
[0294] S909: The auxiliary communication module of the electronic device has previously queried the mapping relationship of the first random MAC address, and no mapping relationship is established.
[0295] In the embodiment of the present application, since the mapping relationship of the first random MAC address for establishing the communication connection this time already exists in the electronic device, it is not necessary to repeatedly establish the mapping relationship.
[0296] Similarly, in practical applications, step S510 may also be replaced by step S510'.
[0297] S909 , the auxiliary communication module of the electronic device establishes a mapping relationship between the first random MAC address and BSSid1 , and a mapping relationship between the first random MAC address and BSSid3 , and overwrites the original mapping relationship of the first random MAC address.
[0298] above Figure 9 and Figure 10 In the illustrated embodiment, if the MAC address of an electronic device that establishes communication connections twice with two routers in the same mesh network is the same, the two communication connections will be considered to be with the same electronic device, and the relevant settings for the first random MAC address will also take effect when connecting to the third router.
[0299] Of course, since the router sends the BSSid of each AP of each router in the mesh network every time it connects, even if routers are added or deleted in the mesh network, the mapping relationship between the MAC address and the BSSid of the AP of the latest router in the mesh network can be updated.
[0300] Based on the above embodiments, it can be understood that the embodiments of the present application further provide a wireless connection system, which includes the electronic device and the first router in the above examples. Of course, the system may also include other routers in the mesh network where the first router is located.
[0301] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0302] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0303] The embodiments of the present application further provide a computer program product. When the computer program product is run on an electronic device or a wireless router, the electronic device can implement the steps in the above-mentioned various method embodiments.
[0304] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the first device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0305] The present application also provides a chip system, comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.
[0306] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0307] Those skilled in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0308] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A wireless connection method, characterized in that: include: The electronic device receives first broadcast information sent by a first AP of a first router, where the first router includes the first AP and a second AP; The electronic device sends a first connection request to the first AP of the first router, where the first connection request carries a first random MAC address of the electronic device; The electronic device receives a first response message sent by a first AP of the first router, where the first response message carries a first unique identifier of the first AP and a second unique identifier of the second AP, where the first unique identifier of the first AP is a BSSID of the first AP, and the second unique identifier of the second AP is a BSSID of the second AP; The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the first response information, and a second mapping relationship between the first random MAC address and the second unique identifier in the first response information; The wireless connection between the electronic device and the first AP of the first router is disconnected; The electronic device receives second broadcast information sent by a second AP of the first router, where the second broadcast information carries a second unique identifier of the second AP; The electronic device sends a second connection request to the second AP of the first router, the second connection request carries the first random MAC address corresponding to the second unique identifier carried by the second broadcast information in the second mapping relationship, and the second connection request is used to establish a wireless connection with the second AP of the first router.
2. The method according to claim 1, characterized in that The first broadcast information carries a first unique identifier of the first AP. Before the electronic device sends a first connection request to the first AP of the first router, the method further includes: The electronic device fails to query the MAC address corresponding to the first unique identifier carried in the first broadcast information; The electronic device generates the first random MAC address.
3. The method according to claim 1 or 2, characterized in that After the electronic device sends a second connection request to the second AP of the first router, the method further includes: The electronic device receives second response information sent by the second AP of the first router, where the second response information carries a first unique identifier of the first AP and a second unique identifier of the second AP; The electronic device deletes the stored mapping relationship related to the first random MAC address; The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the second response information, and a second mapping relationship between the first random MAC address and the second unique identifier in the second response information.
4. The method according to claim 1 or 2, characterized in that: After the electronic device sends a second connection request to the second AP of the first router, the method further includes: The electronic device receives second response information sent by the second AP of the first router, where the second response information carries a first unique identifier of the first AP and a second unique identifier of the second AP; The electronic device determines that the mapping relationship of the first random MAC address has been stored, and no longer stores the mapping relationship between the first random MAC address and the unique identifier in the second response information.
5. The method according to claim 1 or 2, characterized in that: The electronic device comprises a first module for establishing a wireless connection with the first AP and a second module for establishing a wireless connection with the second AP; The operating frequency band of the first AP and the first module is 2.4 GHz, and the operating frequency band of the second AP and the second module is 5 GHz; Alternatively, the operating frequency band of the first AP and the first module is 5 GHz, and the operating frequency band of the second AP and the second module is 2.4 GHz.
6. A wireless connection method, characterized in that: include: The electronic device receives third broadcast information sent by a first AP of a first router, the mesh network where the first router is located also includes a second router, and the second router includes a third AP; The electronic device sends a third connection request to the first AP of the first router, where the third connection request carries the first random MAC address of the electronic device; The electronic device receives third response information sent by the first AP of the first router, where the third response information carries the first unique identifier of the first AP and the third unique identifier of the third AP; The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the third response information, and a third mapping relationship between the first random MAC address and the third unique identifier in the third response information; The wireless connection between the electronic device and the first AP of the first router is disconnected; The electronic device receives fourth broadcast information sent by the third AP of the second router, where the fourth broadcast information carries a third unique identifier of the third AP; The electronic device sends a fourth connection request to the third AP of the second router, the fourth connection request carries the first random MAC address corresponding to the third unique identifier carried by the third broadcast information in the third mapping relationship, and the fourth connection request is used to establish a wireless connection with the third AP of the second router.
7. The method according to claim 6, characterized in that The third broadcast information carries the first unique identifier of the first AP. Before the electronic device sends the third connection request to the first AP of the first router, the method further includes: The electronic device fails to query the MAC address corresponding to the first unique identifier carried by the third broadcast information; The electronic device generates the first random MAC address.
8. The method according to claim 6 or 7, characterized in that After the electronic device sends a fourth connection request to the third AP of the second router, the method further includes: The electronic device receives fourth response information sent by the third AP of the second router, where the fourth response information carries the first unique identifier of the first AP and the third unique identifier of the third AP; The electronic device deletes the stored mapping relationship related to the first random MAC address; The electronic device stores a first mapping relationship between the first random MAC address and the first unique identifier in the fourth response information, and a second mapping relationship between the first random MAC address and the third unique identifier in the fourth response information.
9. The method according to claim 6 or 7, characterized in that After the electronic device sends a fourth connection request to the third AP of the second router, the method further includes: The electronic device receives fourth response information sent by the third AP of the second router, where the fourth response information carries the first unique identifier of the first AP and the third unique identifier of the third AP; The electronic device determines that the mapping relationship of the first random MAC address has been stored, and no longer stores the mapping relationship between the first random MAC address and the unique identifier in the fourth response information.
10. The method according to claim 6 or 7, characterized in that: The electronic device comprises a first module for establishing a wireless connection with the first AP and a second module for establishing a wireless connection with the third AP; The operating frequency band of the first AP and the first module is 2.4 GHz, and the operating frequency band of the third AP and the second module is 5 GHz; Alternatively, the operating frequency band of the first AP and the first module is 5 GHz, and the operating frequency band of the third AP and the second module is 2.4 GHz.
11. The method according to claim 6 or 7, characterized in that: The electronic device comprises a first module for establishing a wireless connection with the first AP and the third AP; The operating frequency bands of the first module, the first AP and the third AP are all 2.4 GHz; Alternatively, the operating frequency bands of the first module, the first AP, and the third AP are all 5 GHz.
12. A wireless connection method, characterized in that: include: The first router receives a connection request sent by the electronic device, where the connection request carries a first random MAC address of the electronic device; The first router sends response information to the electronic device based on the connection request, the response information carrying a unique identifier of each AP in the first router, and the response information is used to instruct the electronic device to use a unified MAC address when accessing the AP corresponding to each unique identifier carried in the response information, and the unique identifier of each AP is a BSSID of each AP.
13. The method according to claim 12, characterized in that The mesh network where the first router is located also includes a second router; the response information also carries a unique identifier of each AP in the second router, and the response information is also used to instruct the electronic device to use a unified MAC address when accessing the AP corresponding to each unique identifier carried by the response information, and the unique identifier of each AP is the BSSID of each AP.
14. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to run a computer program stored in a memory, so that the electronic device implements the method according to any one of claims 1 to 11.
15. A wireless router, characterized in that: The wireless router comprises a processor, and the processor is used to run a computer program stored in a memory, so that the wireless router implements the method according to any one of claims 12 to 13.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, it implements the method according to any one of claims 1 to 5, or any one of claims 6 to 11, or any one of claims 12 to 13.
