Antenna mode switching method, electronic device, chip system and storage medium
By detecting and re-establishing the SISO mode connection between the electronic device and the wireless router, the problem of antenna mode switching failure is solved, and the communication stability and success rate are improved.
Patent Information
- Application Number
- PCT/CN2025/076858
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-29
- Filing Date
- 2025-02-11
- Publication Date
- 2025-10-02
AI Technical Summary
The antenna mode switching between the electronic device and the wireless router failed, resulting in abnormal communication.
When the electronic device detects a switching failure, it interrupts the wireless connection and re-establishes a connection with the wireless router in SISO mode. It detects the switching status of the wireless router by sending switching information, heartbeat requests, data packet confirmation characters and de-authentication information to ensure that the modes of both parties are consistent.
The success rate of antenna mode switching is improved, the occurrence of communication anomalies is reduced, and stable communication between electronic devices and wireless routers is ensured.
Smart Images

Figure CN2025076858_02102025_PF_FP_ABST
Abstract
Description
Antenna mode switching method, electronic device, chip system and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 29, 2024, with application number 202410385227.6 and application name “Antenna mode switching method, electronic device, chip system and storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of wireless communication technology, and in particular to an antenna mode switching method, electronic equipment, chip system and storage medium. Background Art
[0003] In the field of wireless communications, technologies for sending and receiving signals using antennas include single input single output (SISO) technology and multiple input multiple output (MIMO) technology.
[0004] Currently, the antenna mode used for signal transmission between electronic devices and wireless routers is mostly MIMO. In some scenarios, it is necessary to switch the antenna mode between the electronic device and the wireless router to SISO mode. However, when the electronic device triggers the switching of the antenna mode between the electronic device and the wireless router, the switching often fails, resulting in communication anomalies between the electronic device and the wireless router. Summary of the Invention
[0005] The present application provides an antenna mode switching method, an electronic device, a chip system, and a storage medium, which can improve the success rate of antenna mode switching between an electronic device and a wireless router and reduce communication anomalies between the electronic device and the wireless router.
[0006] To achieve the above objectives, the first aspect of this application adopts the following technical solutions:
[0007] A method for switching an antenna mode includes:
[0008] When a wireless communication connection is established between an electronic device and a wireless router in MIMO mode, the electronic device sends switching information to the wireless router, where the switching information is used to instruct the wireless router to switch the antenna mode for communicating with the electronic device to the SISO mode;
[0009] The electronic device interrupts the wireless communication connection with the wireless router when determining that the antenna mode switching for communication between the wireless router and the electronic device fails;
[0010] After interrupting the wireless communication connection between the electronic device and the wireless router, the electronic device sends an association request to the wireless router, where the antenna mode of the electronic device carried in the association request is the SISO mode, and the association request is used to establish a wireless communication connection with the wireless router through the SISO mode.
[0011] In the present application, when an electronic device and a wireless router establish a wireless connection in MIMO mode, if the electronic device needs to switch the MIMO mode to SISO mode due to a specific scenario, it can first switch its own antenna mode to SISO, and then send switching information to the wireless router; the electronic device can detect whether the wireless router has switched successfully. If the switch fails, it can re-establish a wireless connection with the wireless router by interrupting and reconnecting. When re-establishing the wireless connection, the electronic device can carry the antenna mode of the electronic device as SISO in the connection request, so that the electronic device and the wireless router establish a wireless connection through the SISO mode. In this way, the electronic device can successfully establish a wireless connection in SISO mode with the wireless router.
[0012] As another implementation of the first aspect, before the electronic device sends the switching information to the wireless router, the method further includes:
[0013] The electronic device switches an antenna mode for communicating with the wireless router to a SISO mode.
[0014] As another implementation of the first aspect, the method further includes:
[0015] After the electronic device sends the switching information to the wireless router for a first time period, sending a heartbeat request to the wireless router, the heartbeat request carrying a payload, and the heartbeat request is used to instruct the wireless router to return a heartbeat response carrying a payload;
[0016] The electronic device receives a heartbeat response sent by the wireless router;
[0017] When the electronic device fails to parse the heartbeat response, it determines that the switching of the antenna mode for communication between the wireless router and the electronic device has failed.
[0018] In this application, a heartbeat request with a payload is sent to trigger the wireless router to send a heartbeat response carrying the payload. When the wireless router switches to SISO mode, it will send a heartbeat response in SISO mode, and the electronic device switched to SISO mode can successfully parse the heartbeat response. If the wireless router fails to switch to SISO mode, it will send a heartbeat response carrying the payload in MIMO mode, and the electronic device switched to SISO mode cannot successfully parse the heartbeat response. Therefore, this method can be used to determine whether the wireless router has successfully switched to SISO mode.
[0019] As another implementation of the first aspect, after the electronic device sends the switching information to the wireless router, the method further includes:
[0020] The electronic device receives a first data packet sent by the wireless router;
[0021] The electronic device determines that the antenna mode switching for communication between the wireless router and the electronic device has failed when determining that the retransmission flag of the first data packet is a first identifier and successfully parsing the data content of the first data packet, and the first identifier indicates a retransmitted data packet.
[0022] In this application, the communication mechanism between the electronic device and the wireless router is as follows: after the wireless router sends a data packet to the electronic device, it needs to wait for the confirmation character fed back by the electronic device (indicating that the electronic device has received and successfully parsed the data packet). If the confirmation character of the data packet is not received within a certain period of time, the data packet will be resent, and the resent data packet will carry a retransmission flag; after waiting for the confirmation character of the data packet within a certain period of time, the data packet will not be resent. When resending a data packet, it is usually retransmitted at a reduced speed or with a reduced number of spatial streams (for example, switching to SISO mode). Therefore, the electronic device receives the data packet in SISO mode, and can determine whether the wireless router has switched successfully based on whether there is a retransmission flag in the received data packet.
[0023] As another implementation of the first aspect, before the electronic device receives the first data packet sent by the wireless router, the method further includes:
[0024] The electronic device receives a second data packet sent by the wireless router;
[0025] When the electronic device determines that the retransmission flag of the second data packet is a second identifier and fails to parse the data content of the second data packet, the electronic device no longer sends a confirmation character of the second data packet to the wireless router, and the second identifier indicates that the data packet is not a retransmitted data packet.
[0026] As another implementation of the first aspect, before the electronic device receives the first data packet sent by the wireless router, the method further includes:
[0027] The electronic device receives a third data packet sent by the wireless router;
[0028] When the electronic device determines that the retransmission flag of the third data packet is the first identifier and fails to parse the data content of the third data packet, the electronic device no longer sends a confirmation character of the third data packet to the wireless router, and the first data packet, the second data packet, and the third data packet are data packets with the same data content sent by the wireless router to the electronic device.
[0029] In this application, the wireless router is triggered to resend the data packet carrying the retransmission flag by not sending a confirmation character to the wireless router. Of course, in actual applications, if the wireless router fails to switch, it may repeat the data packet multiple times in MIMO mode and then retransmit the spatial stream number. The specific method is related to the mechanism on the wireless router side.
[0030] As another implementation of the first aspect, when the electronic device determines that the retransmission flag of the first data packet is the first identifier and the data content of the first data packet is parsed successfully, the method further includes:
[0031] The electronic device sends a confirmation character of the first data packet to the wireless router, where the confirmation character of the first data packet indicates that the electronic device has received the first data packet sent by the wireless router and successfully parsed the first data packet sent by the wireless router.
[0032] As another implementation of the first aspect, the electronic device interrupting the wireless connection with the wireless router includes:
[0033] The electronic device sends de-authentication information to the wireless router, where the de-authentication information is used to terminate the wireless communication connection with the wireless router.
[0034] As another implementation of the first aspect, when the electronic device determines that antenna mode switching for communication between the wireless router and the electronic device fails, the method further includes:
[0035] The electronic device adds the unique identifier of the wireless router to a blacklist.
[0036] As another implementation of the first aspect, after the electronic device sends the association request to the wireless router, the method further includes:
[0037] After the electronic device and the wireless router re-establish the wireless communication connection, the unique identifier of the wireless router is added to the blacklist.
[0038] As another implementation of the first aspect, before the electronic device sends the switching information to the wireless router, the method further includes:
[0039] The electronic device determines that the unique identifier of the wireless router does not exist in the blacklist.
[0040] As another implementation of the first aspect, the method further includes:
[0041] The electronic device determines that the unique identifier of the wireless router exists in the blacklist;
[0042] The electronic device interrupts the wireless connection with the wireless router;
[0043] After interrupting the wireless connection with the wireless router, the electronic device sends an association request to the wireless router.
[0044] In this application, the BSSID of the wireless router that failed to trigger the wireless router switching through switching information can be written into the blacklist. When the electronic device needs to switch to SISO mode again in the future, the wireless router will no longer be triggered to switch to SISO mode through switching information. Instead, the communication connection will be re-established in SISO mode by directly disconnecting and reconnecting, thereby improving the switching efficiency.
[0045] According to a second aspect, an electronic device is provided, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer programs, so that when the one or more processors execute the computer programs, the electronic device implements any one of the methods of the first aspect of the present application.
[0046] In a third aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device implements any method of the first aspect of this application.
[0047] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer instructions are executed on an electronic device, the electronic device implements any one of the methods of the first aspect of the present application.
[0048] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a device, enables the electronic device to execute any one of the methods in the first aspect of the present application.
[0049] It can be understood that the beneficial effects of the second to fifth 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
[0050] FIG1 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application;
[0051] FIG2 is a schematic diagram illustrating the differences in data transmission using different antenna modes in the field of wireless communications according to an embodiment of the present application;
[0052] FIG3 is a timing diagram of a switching method of antenna modes provided in an embodiment of the present application;
[0053] FIG4 is a schematic diagram of the data format of an action frame provided in an embodiment of the present application;
[0054] FIG5 is a schematic diagram of the data format of a connection request message provided in an embodiment of the present application;
[0055] FIG6 is a timing diagram of another antenna mode switching method provided in an embodiment of the present application;
[0056] FIG7 is a schematic diagram of the structure of a data packet sent by a wireless router according to an embodiment of the present application;
[0057] FIG8 is a schematic diagram of a flow chart of a method for switching antenna modes provided in an embodiment of the present application;
[0058] FIG9 is a schematic diagram of a flow chart of another antenna mode switching method provided in an embodiment of the present application;
[0059] FIG10 is a data format of some fields of the OMN provided in an embodiment of the present application;
[0060] FIG11 is a data format of some fields of the OMI provided in an embodiment of the present application;
[0061] FIG12 is a flow chart of triggering a wireless router to switch to SISO mode through multiple switching modes according to an embodiment of the present application;
[0062] FIG13 is a timing diagram of an antenna mode switching method provided in an embodiment of the present application;
[0063] FIG14 is a timing diagram of another antenna mode switching method provided in an embodiment of the present application;
[0064] FIG15 is a timing diagram of another antenna mode switching method provided in an embodiment of the present application;
[0065] FIG16 is a flow chart of another antenna mode switching method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] An embodiment of the present application provides an antenna mode switching method that can be applied to electronic devices. The electronic devices in the embodiments of the present application can be tablet computers, mobile phones, wearable devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not limit the specific type of electronic devices.
[0072] Figure 1 shows a schematic diagram of the structure of an electronic device. 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, an indicator 192, 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 gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0073] 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.
[0074] 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 baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0075] 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.
[0076] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include 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 an application required for at least one function (such as an image playback function, etc.). The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and 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 acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0077] 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.
[0078] 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.
[0079] The embodiments of the present application do not particularly limit the specific structure of the execution subject of the antenna mode switching method; as long as the code recording the antenna mode switching method of the embodiments of the present application can be executed to communicate according to the antenna mode switching method provided by the embodiments of the present application. For example, the execution subject of the antenna mode switching 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.
[0080] Technologies for sending and receiving signals using antennas in the field of wireless communications include single input single output (SISO), single transmit multiple receive (SIMO), multiple transmit single receive (MISO), and multiple input multiple output (MIMO).
[0081] Referring to (a) in Figure 2 , SISO technology requires that the path between the transmitting antenna at the transmitter and the receiving antenna at the receiver is unique, and that one signal is transmitted. In a wireless system, one signal can be defined as a spatial stream.
[0082] SIMO technology adds a receiving antenna at the receiving end so that the receiving end can receive two signals at the same time. Although there are two signals, the two signals are sent from the same transmitting antenna at the same transmitting end. Therefore, only one signal is still transmitted, which improves the transmission reliability compared to SISO technology.
[0083] MISO technology adds a transmitting antenna at the transmitting end, while maintaining one receiving antenna at the receiving end. However, since there is only one receiving antenna at the receiving end, the two signals transmitted by the two transmitting antennas at the transmitting end still need to be synthesized into one signal. That is, the two transmitting antennas at the transmitting end can only send the same data, and the transmitted signal is still one signal. Compared with SISO technology, the transmission reliability is improved.
[0084] Referring to (b) in FIG2 , MIMO technology adds a transmitting antenna to the transmitting end and a receiving antenna to the receiving end. In this way, the transmitting end has two transmitting antennas and the receiving end has two receiving antennas, and two signals can be sent independently.
[0085] Currently, the transmitting antenna and receiving antenna in the same electronic device can be a combined antenna with both transmitting and receiving functions, or two separate antennas, one with transmitting and the other with receiving functions. The subsequent embodiments of this application use the combined transmitting antenna and receiving antenna in the same electronic device as an example.
[0086] Two antennas can be set in an electronic device, each antenna has a transmitting function and a receiving function; two or more antennas can also be set in a wireless router, each antenna has a transmitting function and a receiving function. Electronic devices and wireless routers usually communicate with each other through MIMO. In some scenarios, the communication mode between electronic devices and wireless routers needs to be switched from MIMO mode (also understood as MIMO mode or MIMO technology) to SISO mode (also understood as SISO mode or SISO technology).
[0087] As an example, when transmitting the same data, the power consumption of using dual antennas is usually higher than that of using a single antenna. Therefore, in some scenarios where the transmission rate is not high but the power consumption is required, for example, when the electronic device is in sleep mode or the screen is off, in order to reduce power consumption, a single antenna transmission can be used, that is, the MIMO mode is switched to the SISO mode.
[0088] As another example, there may be other services in the electronic device that need to occupy an antenna for sending and receiving signals. In this case, one antenna needs to be given to other services (for example, when one of the antennas needs to be used for Bluetooth services), and the communication between the electronic device and the wireless router needs to use single-antenna transmission, that is, the MIMO mode is switched to the SISO mode.
[0089] However, when the electronic device triggers the switching of the communication between the electronic device and the wireless router to the SISO mode, the switching often fails, resulting in abnormal communication between the electronic device and the wireless router.
[0090] An embodiment of the present application provides an antenna mode switching method, in which an electronic device can trigger a wireless router to switch from MIMO mode to SISO mode. Because the wireless router in existing communication protocols does not actively inform the electronic device whether the wireless router has successfully switched, the electronic device can detect whether the wireless router has switched the communication mode between the electronic device and the wireless router from MIMO mode to SISO. If the electronic device determines that the wireless router has failed to switch, it can re-establish a communication connection with the wireless router in SISO mode by interrupting and reconnecting.
[0091] The antenna mode switching method provided by the embodiment of the present application is described in detail below with reference to Figure 3. The switching method is executed on the premise that a wireless communication connection has been established between the electronic device and the wireless router in the MIMO mode.
[0092] S01: The electronic device sends SISO switching information to the wireless router.
[0093] The electronic device can first switch to SISO mode and then send switching information to the wireless router. This switching information can indicate that the electronic device has switched to SISO mode. By sending this SISO switching information to the wireless router, the wireless router is informed that the electronic device has switched the antenna mode for communicating with the wireless router to SISO mode and instructs the wireless router to also switch to SISO mode for subsequent wireless communication with the electronic device. Of course, in actual applications, the wireless router can still use MIMO mode to communicate with other electronic devices.
[0094] In the embodiment of the present application, the electronic device may use a spatial multiplexing power save (SMPS) mode to send an action frame to instruct the wireless router to switch the antenna transmission mode from MIMO to SISO.
[0095] Refer to Figure 4, which shows the data format of the action frame provided in an embodiment of the present application.
[0096] When the B0 field is set to 0, it indicates static Spatial Multiplexing Power Save mode (or SM Power Save Enable), that is, the energy-saving mode of static multiple spatial streams. When it is set to 1, it indicates dynamic Spatial Multiplexing Power Save mode, that is, the energy-saving mode of dynamic multiple spatial streams. When it is set to 3, it indicates Spatial Multiplexing Power Save Disabled, that is, the multiple spatial stream mode with energy-saving mode disabled. Character 2 is reserved.
[0097] When the B1 field is set to 0, it indicates Spatial Multiplexing Mode (or SM Model), that is, multiple spatial stream mode; when it is set to 1, it indicates Spatial Single Mode, that is, single spatial stream mode.
[0098] B2 to B7 are reserved fields.
[0099] As an example of an action frame used to represent the switching information corresponding to the electronic device in an embodiment of the present application, the value of the B0 field is 1, and the value of the B1 field is 1.
[0100] S02: After receiving the SISO mode switching information, the wireless router sends a confirmation character to the electronic device. The confirmation character is used to indicate that the wireless router has received the SISO switching information sent by the electronic device.
[0101] S03: After receiving the SISO mode switching information, the wireless router performs SISO switching, but the switching fails.
[0102] In the embodiment of the present application, based on the communication protocol, the wireless router does not have a feedback mechanism when the switching fails, that is, the wireless router will also send a confirmation character to the electronic device when the switching fails.
[0103] Of course, in actual applications, there is no strict order in which S02 and S03 are executed.
[0104] As an example, after the wireless router successfully switches to the SISO mode, the electronic device and the wireless router can perform data transmission based on the SISO manner.
[0105] As another example, when the wireless router fails to successfully switch to SISO mode, the electronic device has already switched to SISO mode, and the wireless router is in MIMO mode. There are two receiving antennas on the wireless router, which can receive and successfully parse one channel of data sent by the electronic device in SISO mode; however, there is one receiving antenna on the electronic device. After receiving the two channels of data sent by the wireless router in MIMO mode, the electronic device cannot successfully parse the data, resulting in abnormal communication between the two.
[0106] As previously described, after the electronic device sends SISO switching information to the wireless router, the wireless router sends a confirmation character to the electronic device. This confirmation character is used to indicate that the wireless router has received the SISO switching information sent by the electronic device. The wireless router does not send information to the electronic device regarding whether the switch to SISO mode was successful. To reduce or avoid communication anomalies between the electronic device and the wireless router, embodiments of the present application may also be configured to detect whether the wireless router has successfully switched to SISO mode on the electronic device side.
[0107] S04: After receiving the confirmation character for the first duration, the electronic device sends a heartbeat request (Ping Req) to the wireless router, where the heartbeat request carries a payload.
[0108] In an embodiment of the present application, the electronic device may switch its MIMO mode to SISO mode before sending the SISO switching information. The electronic device needs to allow the wireless router time to perform the switching action, so it can be set to send a heartbeat request to the wireless router after receiving the confirmation character for a first time period.
[0109] Typically, heartbeat requests and heartbeat responses come in pairs. That is, when an electronic device sends a heartbeat request to a wireless router, the wireless router must return a heartbeat response if it receives and successfully interprets the request. By including a payload in the heartbeat request, the heartbeat response returned by the wireless router also carries a payload.
[0110] In current communication protocols, the maximum payload size is 32KB. In the embodiment of the present application, the payload carried in the heartbeat request can be set to 32KB. Of course, as the communication protocol is updated, the data size of the payload can also be changed, or as the communication protocol is updated, the payload can also be unchanged.
[0111] S05 , after receiving the heartbeat request sent by the electronic device, the wireless router sends a heartbeat response (Ping RSP) to the electronic device, and the heartbeat response also carries a payload.
[0112] In the embodiment of the present application, when the payload carried in the heartbeat response is 32KB, the wireless router needs to use the maximum number of spatial streams to send the heartbeat response.
[0113] If the wireless router successfully switches to the SISO mode, the maximum number of spatial streams is 1, and the heartbeat response is sent in the SISO mode. The electronic device can receive the heartbeat response sent by the wireless router in the SISO mode and correctly parse the heartbeat response.
[0114] If the wireless router fails to switch to SISO mode and remains in MIMO mode with a maximum of two spatial streams, the heartbeat response will be sent using MIMO. The electronic device may receive two MIMO signals from the wireless router (sending the heartbeat response via two signals), but may not be able to correctly interpret the heartbeat response. This inability to correctly interpret the heartbeat response is equivalent to a heartbeat timeout on the electronic device.
[0115] S06: When the electronic device receives a heartbeat response from the wireless router within the second time period and correctly analyzes the heartbeat response, it determines that the wireless router has successfully switched to the SISO mode (not shown).
[0116] The starting point of the second duration may be the moment when the electronic device sends the heartbeat request.
[0117] S07: If the electronic device does not receive a heartbeat response from the wireless router within the second time period, or receives a heartbeat response from the wireless router but cannot successfully parse the heartbeat response, it determines that the wireless router has not successfully switched to the SISO mode.
[0118] When the antenna patterns of the electronic device and the wireless router are inconsistent, there may be an abnormality in the communication between the electronic device and the wireless router. In order to restore the communication between the electronic device and the wireless router to normal, the electronic device can re-establish a communication connection with the wireless router to notify the electronic device that it is an electronic device in SISO mode.
[0119] S08: When the electronic device determines that the wireless router has not successfully switched to the SISO mode, the electronic device sends deauthentication information (Deauth) to the wireless router. The deauthentication information is used to forcibly interrupt the wireless connection between the electronic device and the wireless router.
[0120] In an embodiment of the present application, the electronic device may send a data packet for canceling authentication to forcibly interrupt the communication connection between the wireless router and the electronic device.
[0121] S09: After receiving the de-authentication information, the wireless router sends a confirmation character to the electronic device. The confirmation character is used to indicate that the wireless router has received the de-authentication information.
[0122] In the embodiment of the present application, the wireless router generally uses one spatial stream to send the confirmation character, so the electronic device can receive the confirmation character.
[0123] S10: The wireless router disconnects the MIMO mode wireless communication connection with the electronic device.
[0124] S11 , after receiving the confirmation character, the electronic device sends an authentication request (Auth REQ) to the wireless router.
[0125] S12: After receiving the authentication request, the wireless router sends a confirmation character to the electronic device, where the confirmation character is used to indicate that the wireless router has received the authentication request.
[0126] S13, the wireless router authenticates the authentication information carried in the authentication request.
[0127] S14, after the authentication is successful, the wireless router sends an authentication response to the electronic device, where the authentication response is used to indicate that the wireless router has successfully authenticated the authentication information of the electronic device.
[0128] S15, after receiving the authentication response, the electronic device sends a confirmation character to the wireless router, where the confirmation character is used to indicate that the electronic device has received the authentication response.
[0129] S16, after sending the confirmation character, the electronic device sends an association request (Assoc req) to the wireless router.
[0130] 5 , which shows some fields in an association request message according to an embodiment of the present application, the supported MCS Set in the association request message may be written as a 1x1 device (i.e., establishing a wireless communication connection with a wireless router in SISO mode).
[0131] S17, after receiving the association request, the wireless router sends a confirmation character to the electronic device, where the confirmation character is used to indicate that the wireless router has received the connection request.
[0132] S18: After receiving the association request, the wireless router sets the antenna mode for communicating with the electronic device to SISO.
[0133] Of course, the antenna mode for communicating with other electronic devices can still be MIMO. In a specific implementation, the execution order of S17 and S18 can be set according to actual conditions.
[0134] S19, after setting the antenna mode of the wireless router and the electronic device to SISO, the wireless router sends a connection response (Assoc RSP) to the electronic device.
[0135] S20: After receiving the connection response sent by the wireless router in the SISO mode, the electronic device sends a confirmation character to the wireless router, where the confirmation character is used to indicate that the electronic device has received the connection response sent by the wireless router.
[0136] Steps S09 to S20 are for the electronic device to reconnect using a disconnection and reconnection mechanism, and when reconnecting, notify the wireless router that it is a 1X1 device, thereby re-establishing a wireless communication connection with the wireless router in SISO mode.
[0137] As another embodiment of the present application, the electronic device may also detect whether the wireless router is switched successfully in another way.
[0138] As an example, after the wireless router successfully switches to SISO mode, when the wireless router needs to send a data packet to an electronic device, the wireless router sends the data packet to the electronic device in SISO mode. The electronic device can receive and correctly parse the data packet. After correctly parsing the data packet, the electronic device will send a confirmation character of the data packet to the wireless router. After receiving the confirmation character of the data packet, the wireless router determines that the electronic device has received and correctly parsed the data packet.
[0139] As another example, if the wireless router fails to successfully switch to SISO mode, and the wireless router needs to send a data packet to the electronic device, the wireless router sends the data packet (two-way data) to the electronic device in MIMO mode. Since the electronic device has switched to SISO mode, the electronic device receives one way of data in the data packet and cannot correctly parse the data. Therefore, the electronic device does not send an acknowledgment character to the wireless router. If the wireless router does not receive an acknowledgment character for the current data packet within a certain period of time, it may retransmit the data packet, for example, by retransmitting the data packet to the electronic device in MIMO mode and setting a retransmission flag in the retransmitted data packet. Similarly, if the electronic device still cannot successfully parse the data packet retransmitted in MIMO mode, it still will not send an acknowledgment character corresponding to the data packet retransmitted in MIMO mode to the wireless router. Therefore, the wireless router may retransmit the data packet at a reduced speed (retransmit with a reduced number of spatial streams). That is, the wireless router retransmits the data packet to the electronic device in SISO mode, and the data packet still has a retransmission flag. The electronic device can receive the complete data packet and can successfully parse the data packet. The electronic device can send an acknowledgment character for the data packet retransmitted in SISO mode to the wireless router. Of course, if the electronic device receives and successfully parses a data packet with a retransmission flag, it means that the wireless router has already transmitted the data packet in MIMO mode. The electronic device can determine that the wireless router has failed to switch to SISO mode.
[0140] To make the above embodiment clearer, reference is made to the timing diagram of the antenna mode switching method shown in FIG. 6 .
[0141] S01 to S03 can refer to the description in the embodiment shown in FIG3 , which will not be repeated here. The failure of wireless router switching is taken as an example.
[0142] After S03, the method further includes:
[0143] S34, when the wireless router needs to send a data packet, the wireless router sends the data packet to the electronic device in a MIMO manner (to avoid confusion, recorded as a second data packet).
[0144] S35, after receiving the data packet sent by the wireless router, the electronic device fails to parse the data packet.
[0145] Since the electronic device side is in SISO mode and the wireless router side is in MIMO mode, the electronic device side cannot successfully parse and obtain the second data packet.
[0146] Accordingly, the electronic device no longer sends the confirmation character of the second data packet to the wireless router.
[0147] S36: The wireless router does not receive a confirmation character of the second data packet sent by the electronic device within a certain period of time.
[0148] S37: If the electronic device does not receive an acknowledgment character for the second data packet sent by the electronic device within a certain period of time, the electronic device retransmits the data packet (referred to as a third data packet to avoid confusion) in MIMO mode. The third data packet carries a retransmission flag. The data content of the third data packet is the same as the data content of the second data packet.
[0149] S38, after the electronic device receives the data packet sent by the wireless router, it still fails to parse it.
[0150] The reason for the parsing failure can be found in the description in S35.
[0151] S39: The wireless router does not receive the confirmation character of the third data packet within a certain period of time.
[0152] In actual applications, if a wireless router cannot receive an acknowledgment character from an electronic device after resending a data packet (with a retransmission flag) multiple times in MIMO mode, it will reduce the speed or retransmit the data packet (still with a retransmission flag) using a different spatial stream. The specific details depend on the wireless router's mechanism.
[0153] The embodiment of the present application takes the resending of the data packet in SISO mode after step S39 as an example.
[0154] S40: If the wireless router does not receive an acknowledgment character for the third data packet within a certain period of time, it resends the data packet (referred to as the first data packet to avoid confusion) in SISO mode. The first data packet carries a retransmission flag. The data content of the first data packet is the same as the data content of the third data packet.
[0155] In the embodiment of the present application, the structure of the data packet sent by the wireless router is shown in FIG7 .
[0156] There is a retry field in the frame control of the MAC header of the data packet, and a corresponding flag can be written in the retry field as a retransmission flag. For example, the first flag indicates a retransmitted data packet, and the second flag indicates a non-retransmitted data packet.
[0157] S41, after the electronic device receives the data packet retransmitted in the SISO mode, it successfully parses it and determines that the data packet contains a retransmission identifier. Based on the retransmission identifier, it is determined that the wireless router has not successfully switched to the SISO mode. The wireless router currently retransmits the data packet in the SISO mode because the wireless router fails to send the data packet in the MIMO mode and the number of spatial streams is temporarily reduced for retransmission.
[0158] S42, after successfully parsing the data packet, the electronic device sends a confirmation character of the data packet to the wireless router.
[0159] Of course, when the wireless router receives the confirmation character of the first data packet sent in the SISO mode, it no longer repeatedly sends the data packet with the same data content.
[0160] After S42, if the electronic device determines that the wireless router has not successfully switched to the SISO mode, it executes S08 and subsequent steps. S08 and subsequent steps can be described with reference to the embodiment shown in FIG3.
[0161] Through the above examples, it can be understood that in some scenarios, electronic devices need to switch from MIMO mode to SISO mode. The electronic device can send switching information to the wireless router to inform the wireless router that the electronic device is in SISO mode, and instruct the wireless router to switch the antenna mode for communicating with the electronic device to SISO mode. At the same time, the electronic device can also detect whether the switch of the wireless router is successful. If it is detected that the wireless router has not successfully switched to SISO, it can also re-establish a communication connection with the wireless router by disconnecting and reconnecting, and notify the wireless router that the electronic device is a 1x1 device and can establish a communication connection in SISO mode when the communication connection is re-established. When the communication connection in SISO mode is re-established, abnormal situations in subsequent communications between the electronic device and the wireless router are reduced or avoided.
[0162] FIG3 and FIG6 respectively use different methods to determine whether the wireless router is switched successfully. In practical applications, the method shown in FIG3 or the method shown in FIG6 can be used. Of course, the methods shown in FIG3 and FIG6 can also be used at the same time. That is, after the electronic device receives the confirmation character of the SISO switching information sent by the wireless router, on the one hand, it executes S04 and sends a heartbeat request to the wireless router after a first time period; on the other hand, it waits to see whether a data packet with a retransmission flag is received and successfully parsed; if the electronic device first meets the condition of not successfully parsing the heartbeat response within the second time period, it determines that the wireless router switching has failed based on this condition; if the electronic device first meets the condition of receiving and successfully parsing the data packet with a retransmission flag, it determines that the wireless router switching has failed based on this condition.
[0163] As another embodiment of the present application, the present application also provides a blacklist mechanism, that is, the electronic device will add the wireless router with the switching failure record through the switching information to the blacklist. When the electronic device subsequently needs to switch from MIMO to SISO, it will no longer notify the wireless router to switch through the switching information, but will skip the sending of the switching information and the detection of whether the switching is successful, and directly re-establish the SISO mode wireless communication connection with the wireless router by disconnecting and reconnecting. When the wireless communication connection is re-established, the wireless router is notified at the same time that the electronic device is a 1X1 device.
[0164] That is, after S07, the method further includes: when the electronic device determines that the wireless router has not successfully switched to the SISO mode, the electronic device adds the basic service set identifier (BSSid) of the wireless router to the blacklist. And continue to execute S08 and subsequent steps. In addition, before the electronic device adds the BSSid of the wireless router to the blacklist, the electronic device needs to first query whether the BSSid of the current wireless router exists in the blacklist. If the wireless router is not found in the blacklist, the BSSid of the wireless router can be added to the blacklist. If the wireless router is found in the blacklist, there is no need to add the wireless router to the blacklist to avoid repeatedly adding the BSSid of the unified wireless router to the blacklist. Of course, the old record can also be overwritten by overwriting.
[0165] Of course, in actual applications, the electronic device can add the BSSid of the wireless router to the blacklist at any step after S07, not necessarily before S08.
[0166] As another embodiment of the present application, after S19, the method further includes: after the electronic device receives a connection response sent by the wireless router in the SISO mode, adding the BSSID of the wireless router carried in the connection response to a blacklist.
[0167] The BSSID of the wireless router may be used as the unique identifier of the wireless router. In practical applications, other information of the wireless router may also be used as the unique identifier of the wireless router.
[0168] Of course, after the electronic device and the wireless router re-establish the communication connection in the SISO manner in S19, it can be determined that the wireless router can communicate with the electronic device in the SISO manner.
[0169] To make it clearer that after S19 , the electronic device adds the BSSID of the wireless router to the blacklist, refer to the flowchart shown in FIG. 8 .
[0170] S71: The electronic device switches the antenna mode of the electronic device to the SISO mode.
[0171] S72, the electronic device sends switching information to the wireless router.
[0172] S73, the electronic device detects whether the wireless router is switched successfully.
[0173] S74: If the wireless router fails to switch to the SISO mode, a wireless connection in the SISO mode is established with the wireless router by disconnecting and reconnecting.
[0174] S75, the electronic device adds the unique identifier of the wireless router to the blacklist.
[0175] For detailed description of each step in FIG8 , reference may be made to the description of the embodiments shown in FIG3 and FIG6 .
[0176] The following describes a switching method when the electronic device needs to switch to the SISO mode for communication again after the wireless router is added to the blacklist, with reference to the flowchart shown in FIG9 .
[0177] S81: The electronic device switches the antenna mode of the electronic device to the SISO mode.
[0178] S82: The electronic device queries whether the unique identifier of the wireless router exists in the blacklist.
[0179] S83: If the unique identifier of the wireless router exists in the blacklist, the electronic device sends switching information to the wireless router, where the switching information is used to instruct the wireless router to switch to the SISO mode.
[0180] S84, the electronic device detects whether the wireless router is switched successfully.
[0181] S85: If the wireless router fails to switch, a wireless connection in SISO mode is established with the wireless router by disconnecting and reconnecting.
[0182] S86: After the electronic device re-establishes a wireless connection with the wireless router in the SISO mode, the unique identifier of the wireless router is added to the blacklist.
[0183] In addition, after S82, if the unique identifier of the wireless router does not exist in the blacklist, the electronic device directly executes S85, establishes a wireless connection in SISO mode with the wireless router by disconnecting and reconnecting, and executes S86. After the electronic device re-establishes a wireless connection with the wireless router in SISO mode, the unique identifier of the wireless router is added to the blacklist.
[0184] When adding the unique identifier of the wireless router to the blacklist, if the unique identifier of the current wireless router already exists in the blacklist, it is not necessary to add it again or add it in an overwritten manner.
[0185] In the above embodiment, the electronic device sends the Action frame in the SMPS manner when executing S01 to send the switching information to the wireless router.
[0186] In practical applications, the electronic device may also send the switching information to the wireless router in other ways.
[0187] As another example, S01, the electronic device sending SISO switching information to the wireless router includes:
[0188] The electronic device sends an operating mode notification (OMN) to the wireless router. The operating mode notification is located in an action frame. FIG10 shows the data format of some fields of the OMN.
[0189] The Rx NSS field and the Rx NSS Type field are used together to inform the wireless router that the electronic device has switched its antenna mode to SISO mode and to instruct the wireless router to also switch to SISO mode for subsequent wireless communication with the electronic device. If the value of the Rx NSS field is 0 and the value of the Rx NSS Type field is 0, it indicates that the electronic device has switched to SISO mode.
[0190] As another example, S01, the electronic device sending SISO switching information to the wireless router includes:
[0191] The electronic device sends an operating mode indication (OMI) to the wireless router. The OMI is located in a data packet, that is, the switching information is sent in the form of a data packet. Figure 11 shows the data format of some fields of the OMI.
[0192] The Rx NSS and Tx NSTS fields are used together to notify the wireless router that the electronic device has switched its antenna mode for communication with the wireless router to SISO mode, and to instruct the wireless router to also switch to SISO mode for subsequent wireless communication with the electronic device. If the Rx NSS field value is 0 and the Tx NSTS field value is 0, it indicates that the electronic device has switched to SISO mode.
[0193] SMPS, OMN, and OMI are different switching information defined in different versions of the Wi-Fi protocol. The electronic device can determine which switching information to use based on the protocol version of the wireless communication with the wireless router.
[0194] Of course, in actual applications, the electronic device may select one or more of SMPS, OMN and OMI as switching information, and send the switching information to the wireless router to instruct the wireless router to switch the antenna mode for communicating with the electronic device to SISO.
[0195] As another example, SMPS, OMN, and OMI may be sent sequentially to instruct the wireless router to switch to SISO until any switching information triggers the wireless router to successfully switch to SISO mode or until each switching information fails to successfully trigger the wireless router to switch to SISO mode.
[0196] 12 , which is a flow chart of another antenna mode switching method provided in an embodiment of the present application.
[0197] S91, the electronic device sends SISO switching information (SMPS) to the wireless router.
[0198] In the embodiment of the present application, this step can refer to S01 to S03 in Figure 3.
[0199] That is, after the electronic device sends the SISO switching information (SMPS) to the wireless router, the wireless router sends a confirmation character of the current switching information to the electronic device after receiving the SISO switching information. The wireless router also needs to execute the SISO mode switching (which may succeed or fail).
[0200] S92: The electronic device detects whether the wireless router is successfully switched to the SISO mode.
[0201] In the embodiment of the present application, the detection method (S04 to S07) shown in Figure 3 can be used, or the detection method (S34 to S41) shown in Figure 6 can be used. Of course, other detection methods can also be used.
[0202] 13 is a flow chart showing another method of detecting whether a wireless router has successfully switched to SISO mode according to an embodiment of the present application.
[0203] S101: The electronic device sends SISO switching information in the original MIMO mode.
[0204] Of course, in actual applications, the electronic device may also switch to the SISO mode first, send the switching information through the SISO mode, and then immediately switch back to the MIMO mode after sending.
[0205] S102: After receiving the switching information sent by the electronic device, the wireless router returns a confirmation character of the switching information to the electronic device.
[0206] S103: After receiving the switching information sent by the electronic device, the wireless router performs SISO switching.
[0207] The embodiment of the present application takes switching failure as an example.
[0208] S104: When the electronic device needs to send a data packet, it sends data packet A to the wireless router in SISO mode.
[0209] In the embodiment of the present application, the electronic device does not determine whether the wireless router is currently in the original MIMO mode or switched to the SISO mode, so it needs to send data packets in the SISO mode. In actual applications, the electronic device can send data packets in the SISO mode when in the MIMO mode.
[0210] In an embodiment of the present application, the data packet sent by the sender in SISO mode can be received and successfully parsed by the receiver in both MIMO mode and SISO mode; the data packet sent by the sender in MIMO mode can be received and successfully parsed by the receiver in MIMO mode, but cannot be successfully parsed in SISO mode.
[0211] After sending data packet A, the electronic device continues to maintain the MIMO mode.
[0212] In the embodiment of the present application, after sending data packet A, the electronic device continues to maintain the MIMO mode to monitor the data packets sent by the wireless router, so as to avoid failure to successfully receive and analyze the data packets sent by the wireless router in the MIMO mode in the SISO mode.
[0213] S105: After receiving data packet A, the wireless router sends a confirmation character to the electronic device.
[0214] S106 , when there is a need to send a data packet, the wireless router sends the data packet B in MIMO mode.
[0215] S107, the electronic device receives data packet B in MIMO mode, and is able to correctly parse it, and determines based on the information in the data packet that the wireless router is currently in MIMO mode, thereby determining that the wireless router switching has failed.
[0216] As an example, the data packets in this application (e.g., data packet A and data packet B) may be Quality of Service (QoS) data frames. The NSS field in the QoS data frame may indicate, using different characters, whether the sender of the data packet is sending the data packet in MIMO mode or SISO mode.
[0217] S108 , after successfully parsing data packet B, the electronic device sends a confirmation character of data packet B to the wireless router.
[0218] In this embodiment, steps S104 and S105 may not be present, that is, steps S104 and S105 are only executed when the electronic device needs to send a data packet to the wireless router. Similarly, steps S106 are only executed when the wireless router needs to send a data packet to the electronic device.
[0219] 14 is a flow chart showing another method of detecting whether a wireless router has successfully switched to SISO mode according to an embodiment of the present application.
[0220] The contents of S201 to S205 are similar to those of S101 to S105 , and the details can be referred to the description of S101 to S105 , which will not be repeated here. In S203 , the wireless router is switched successfully.
[0221] S206, the wireless router sends data packet B in SISO mode (successfully switched).
[0222] S207, after receiving data packet B, the electronic device successfully parses data packet B and determines based on the information in data packet B that the wireless router is currently in SISO mode, thereby determining that the wireless router is switched successfully.
[0223] S208: The electronic device sends a confirmation character of data packet B to the wireless router.
[0224] S209 , after determining that the wireless router has been switched successfully, the electronic device switches the antenna mode for communicating with the wireless router to the SISO mode.
[0225] Of course, in actual applications, the following situation may occur: the wireless router may temporarily use SISO mode when sending data packet B due to speed limits or other reasons, and may also use MIMO mode when speed limits are not required. Therefore, the wireless router sends data packet B in SISO mode, causing the electronic device to mistakenly believe that the wireless router has switched to SISO mode.
[0226] To avoid this, the electronic device can be configured to communicate with the wireless router in a time-division manner. Specifically, when a data packet needs to be sent, the device can be configured to send the data packet in SISO mode while in MIMO mode. After sending the data packet, the device can continue to maintain MIMO mode to listen for data packets sent by the wireless router. Once the device receives a data packet sent by the wireless router in MIMO mode, it will be determined that the wireless router has failed to switch to SISO mode (unsuccessfully switching to SISO mode). This is because the electronic device can send data packets in both SISO and MIMO modes in MIMO mode, but it must send data packets in SISO mode when in SISO mode.
[0227] 15 , in which a wireless router switching failure is used as an example.
[0228] After S105, it also includes:
[0229] S206: The wireless router sends data packet B in SISO mode due to a need to reduce speed or spatial flow.
[0230] S207, the electronic device receives data packet B in MIMO mode, and can correctly parse it, and determines based on the information in the data packet that the wireless router sent the data packet in SISO mode, thereby determining that the wireless router has successfully switched.
[0231] S208: The electronic device sends a confirmation character of data packet B to the wireless router.
[0232] In order to avoid misjudgment by electronic devices, subsequent electronic devices communicate with the wireless router in a time-sharing manner.
[0233] S302: The electronic device determines that there is a need to send data packet C.
[0234] S303: The electronic device sends data packet C to the wireless router in SISO mode.
[0235] S304: After sending the data packet C, the electronic device continues to monitor the data packets from the wireless router in MIMO mode.
[0236] S305: The wireless router sends a confirmation character of the data packet C to the electronic device.
[0237] S306: When the wireless router needs to send data packet D to the electronic device, since there is no need to reduce the speed or the number of spatial streams, the data packet D is sent to the electronic device in the current MIMO mode.
[0238] S307: The electronic device successfully parses the data packet D and determines based on the information in the data packet that the wireless router is currently in MIMO mode, thereby determining that the wireless router switching has failed.
[0239] It can be understood that this approach can avoid or reduce misjudgment of the switching status of the wireless router.
[0240] If the electronic device detects that the wireless router has successfully switched to the SISO mode, the switching process ends.
[0241] Of course, in actual applications, after the electronic device determines that the wireless router has been successfully switched in S207, it maintains the time-division mode for a certain period of time. If it is determined that the wireless router is in MIMO mode based on the data packets sent by the wireless router within the certain period of time, it is determined that the wireless router switching has failed; if it is not determined that the wireless router switching has failed based on the data packets sent by the wireless router within the certain period of time, it is considered that the wireless router switching has been successful. Therefore, the time-division mode (monitoring the data packets of the wireless router in MIMO mode) can be ended, and the antenna mode for communication between the electronic device and the wireless router is switched to SISO mode.
[0242] 13 to 15 are all about the method of detecting whether the wireless router is switched successfully in S92. Continuing to describe the flow chart of the switching method shown in FIG12.
[0243] S93: If the electronic device detects that the wireless router fails to switch to the SISO mode, it sends SISO switching information (OMN) to the wireless router.
[0244] This step may refer to S01 to S03 in FIG. 3 , where the switching information is the OMN.
[0245] That is, after the electronic device sends the SISO switching information (OMN) to the wireless router, the wireless router sends a confirmation character of the current switching information to the electronic device after receiving the SISO switching information. The wireless router also needs to execute the SISO mode switching (which may succeed or fail).
[0246] S94, the electronic device detects whether the wireless router is successfully switched to the SISO mode.
[0247] In the embodiment of the present application, the detection method shown in Figure 3 (S04 to S07) can be adopted, or the detection method shown in Figure 6 (S34 to S41) can be adopted, and of course the detection method in S92 (shown in Figures 13 to 15) can also be adopted.
[0248] If the electronic device detects that the wireless router has successfully switched to the SISO mode, the switching process ends.
[0249] S95: If the electronic device detects that the wireless router fails to switch to the SISO mode, it sends SISO switching information (OMI) to the wireless router.
[0250] This step may refer to S01 to S03 in FIG. 3 , where the switching information is OMI.
[0251] That is, after the electronic device sends the SISO switching information (OMI) to the wireless router, the wireless router sends a confirmation character of the current switching information to the electronic device after receiving the SISO switching information. The wireless router also needs to execute the SISO mode switching (which may succeed or fail).
[0252] S96, the electronic device detects whether the wireless router is successfully switched to the SISO mode.
[0253] In the embodiment of the present application, the detection method shown in Figure 3 (S04 to S07) can be adopted, or the detection method shown in Figure 6 (S34 to S41) can be adopted. Of course, the detection method in S92 can also be adopted.
[0254] If the electronic device detects that the wireless router has successfully switched to the SISO mode, the switching process ends.
[0255] If the electronic device detects that the wireless router fails to switch to the SISO mode, it may execute a disconnection and reconnection process (specifically, refer to S08 to S20 shown in FIG. 3 ).
[0256] In the above example, the wireless router is triggered to switch to SISO mode in the order of SMPS, OMN, and OMI. In actual applications, other orders can also be set, and this application does not limit the specific order.
[0257] Accordingly, if the switching method shown in FIG12 can be used to trigger the wireless router to switch to SISO mode, a corresponding blacklist and whitelist mechanism is also set up. For details, refer to the switching method shown in FIG16.
[0258] A communication connection is established between the electronic device and the wireless router in MIMO mode.
[0259] S401: The electronic device searches the blacklist for the BSSID of the wireless router.
[0260] S402: If the electronic device finds the BSSID of the wireless router in the blacklist, it re-establishes a communication connection with the wireless router in the SISO mode by using the disconnection and reconnection method in the above embodiment.
[0261] S403: If the electronic device does not find the BSSID of the wireless router in the blacklist, it searches the BSSID of the wireless router in the whitelist.
[0262] S404: If the electronic device finds the BSSID of the wireless router in the white list, it obtains the historical successful switching method of the BSSID recorded in the white list.
[0263] In the embodiment of the present application, if the BSSID of the wireless router exists in the whitelist, it means that in the past, when the electronic device and the wireless router established a communication connection in MIMO mode, the electronic device successfully triggered the wireless router to switch to SISO mode through switching information.
[0264] S405: The electronic device sends switching information to the wireless router based on the switching mode corresponding to the BSSID of the wireless router in the whitelist.
[0265] As an example, if the switching mode recorded in the whitelist is SMPS, the Action frame of the SMPS mode continues to be sent to the wireless router. For details, please refer to the description in S91.
[0266] As another example, if the switching mode recorded in the whitelist is OMN, then the OMN continues to be sent to the wireless router. For details, please refer to the description in S93.
[0267] As another example, if the switching mode recorded in the whitelist is OMI, then OMI is continued to be sent to the wireless router. For details, please refer to the description in S95.
[0268] S406: The electronic device detects whether the wireless router is switched successfully.
[0269] If it is detected that the wireless router is switched successfully, communication with the wireless router can be carried out in a time-division manner, and details are described in the above embodiment.
[0270] If it is detected that the wireless router switching fails, the BSSID of the wireless router can be added to the blacklist, and a communication connection can be established with the wireless router in SISO mode by disconnecting and reconnecting.
[0271] After S403, there may be another situation: the BSSID of the wireless router is not found in the whitelist. That is, the BSSID of the wireless router does not exist in both the blacklist and the whitelist, which is equivalent to the electronic device establishing a communication connection with the wireless router in MIMO mode, but has not yet triggered the wireless router to switch to SISO mode by sending switching information. That is, it is executed according to the flow chart shown in Figure 12. Among them, when it is detected that the wireless router switches successfully, the BSSID of the wireless router and the switching method (SMPS, OMN or OMI) used when the switching is successful can be recorded in the whitelist. For details, please refer to S407, S408 and S409 in Figure 16. When it is detected that the wireless router switches unsuccessfully, the BSSID of the wireless router can be added to the blacklist.
[0272] In the embodiment shown in FIG15 , if the wireless router fails to switch but is mistakenly judged to be a successful switch, the BSSID of the wireless router will be added to the whitelist. However, if a subsequent switch failure is detected, the wireless router will continue to be triggered to switch to SISO mode through other switching methods. If the wireless router is successfully triggered to switch to SISO mode through other methods, the successful switching method corresponding to the BSSID of the wireless router is recorded in the whitelist in an overwritten manner (the switching method previously recorded in the whitelist may be a mistaken judgment). Of course, if all other methods fail to trigger the wireless router to switch to SISO mode, the BSSID of the wireless router is added to the blacklist (at this time, the whitelist may record a switching method that was mistakenly judged to be successful). The implementation of the embodiment of the present application requires first executing S301 to query the BSSID of the wireless router in the blacklist. If the BSSID of the wireless router is found in the blacklist, the disconnection and reconnection method is directly adopted. Even if the whitelist may record a switching method that was mistakenly judged to be successful, it does not affect the implementation of the embodiment of the present application.
[0273] In actual application, when the BSSID of the wireless router is added to the blacklist, it is possible to check whether the BSSID of the wireless router exists in the whitelist. If so, the BSSID of the wireless router and the corresponding switching method in the whitelist are deleted.
[0274] 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.
[0275] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is run on an electronic device, it can implement the steps in the above-mentioned various method embodiments.
[0276] 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.
[0277] 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.
[0278] The present application also provides a chip comprising a processor coupled to a memory, wherein the processor invokes a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip may be a single chip or a chip module composed of multiple chips.
[0279] 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.
[0280] 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.
[0281] 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 method for switching antenna modes, characterized in that: include: When a wireless communication connection is established between an electronic device and a wireless router in MIMO mode, the electronic device sends switching information to the wireless router, where the switching information is used to instruct the wireless router to switch the antenna mode for communicating with the electronic device to the SISO mode; The electronic device interrupts the wireless communication connection with the wireless router when determining that the antenna mode switching for communication between the wireless router and the electronic device fails; After interrupting the wireless communication connection between the electronic device and the wireless router, the electronic device sends an association request to the wireless router, where the antenna mode of the electronic device carried in the association request is the SISO mode, and the association request is used to establish a wireless communication connection with the wireless router through the SISO mode.
2. The method according to claim 1, wherein Before the electronic device sends the switching information to the wireless router, the method further includes: The electronic device switches an antenna mode for communicating with the wireless router to a SISO mode.
3. The method according to claim 1 or 2, wherein: The method further comprises: After the electronic device sends the switching information to the wireless router for a first time period, sending a heartbeat request to the wireless router, the heartbeat request carrying a payload, and the heartbeat request is used to instruct the wireless router to return a heartbeat response carrying a payload; The electronic device receives a heartbeat response sent by the wireless router; When the electronic device fails to parse the heartbeat response, it determines that the switching of the antenna mode for communication between the wireless router and the electronic device has failed.
4. The method according to any one of claims 1 to 3, wherein After the electronic device sends the switching information to the wireless router, the method further includes: The electronic device receives a first data packet sent by the wireless router; The electronic device determines that the antenna mode switching for communication between the wireless router and the electronic device has failed when determining that the retransmission flag of the first data packet is a first identifier and successfully parsing the data content of the first data packet, and the first identifier indicates a retransmitted data packet.
5. The method according to claim 4, wherein Before the electronic device receives the first data packet sent by the wireless router, the method further includes: The electronic device receives a second data packet sent by the wireless router; When the electronic device determines that the retransmission flag of the second data packet is a second identifier and fails to parse the data content of the second data packet, the electronic device no longer sends a confirmation character of the second data packet to the wireless router, and the second identifier indicates that the data packet is not a retransmitted data packet.
6. The method according to claim 5, wherein Before the electronic device receives the first data packet sent by the wireless router, the method further includes: The electronic device receives a third data packet sent by the wireless router; When the electronic device determines that the retransmission flag of the third data packet is the first identifier and fails to parse the data content of the third data packet, the electronic device no longer sends a confirmation character of the third data packet to the wireless router, and the first data packet, the second data packet, and the third data packet are data packets with the same data content sent by the wireless router to the electronic device.
7. The method according to any one of claims 4 to 6, characterized in that When the electronic device determines that the retransmission flag of the first data packet is the first identifier and the data content of the first data packet is successfully parsed, the method further includes: The electronic device sends a confirmation character of the first data packet to the wireless router, where the confirmation character of the first data packet indicates that the electronic device has received the first data packet sent by the wireless router and successfully parsed the first data packet sent by the wireless router.
8. The method according to any one of claims 1 to 7, wherein: The electronic device interrupting the wireless connection with the wireless router includes: The electronic device sends de-authentication information to the wireless router, where the de-authentication information is used to terminate the wireless communication connection with the wireless router.
9. The method according to any one of claims 1 to 8, wherein When the electronic device determines that the antenna mode switching for communication between the wireless router and the electronic device fails, the method further includes: The electronic device adds the unique identifier of the wireless router to a blacklist.
10. The method according to any one of claims 1 to 9, characterized in that After the electronic device sends the association request to the wireless router, the method further includes: After the electronic device and the wireless router re-establish the wireless communication connection, the unique identifier of the wireless router is added to the blacklist.
11. The method according to claim 9 or 10, wherein: Before the electronic device sends the switching information to the wireless router, the method further includes: The electronic device determines that the unique identifier of the wireless router does not exist in the blacklist.
12. The method according to claim 11, wherein The method further comprises: The electronic device determines that the unique identifier of the wireless router exists in the blacklist; The electronic device interrupts the wireless connection with the wireless router; After interrupting the wireless connection with the wireless router, the electronic device sends an association request to the wireless router.
13. An electronic device, characterized in that: The electronic device comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, and when the one or more processors execute the computer program, the electronic device executes the method according to any one of claims 1 to 12.
14. A chip system, applied to electronic equipment, comprising one or more processors, characterized in that: The processor is configured to call computer instructions so that the electronic device executes the method according to any one of claims 1 to 12.
15. A computer-readable storage medium comprising a computer program, characterized in that When the computer program is run on an electronic device, the electronic device is enabled to perform the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Wireless router and method for determining antenna working mode thereof
CN106412987A
Antenna control method, device, storage medium and electrode equipment
CN107634789A
Antenna adjusting method and device, and terminal
US20220045723A1
Mode Switching Method in Wi-Fi Network and Terminal Device
US20220060993A1