Wireless communication method and device, electronic equipment and storage medium
By establishing a Bluetooth connection between devices, directly sending and receiving data packets, omitting handshake message interactions, and generating keys for communication, the problem of wireless connection is solved, and a more efficient wireless connection is achieved.
Patent Information
- Application Number
- CN202410526600.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, the number of messages interacts frequently and takes a long time during wireless connection, resulting in low wireless connection efficiency.
After establishing a Bluetooth connection between devices, data packets are directly sent and received to establish a wireless connection, the handshake message interaction process is omitted, and the data packet generation key is used for communication.
Reduces the number of packet interactions, shortens wireless connection time, and improves wireless connection efficiency.
Smart Images

Figure CN120379070A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of wireless communication technologies, and in particular, to a wireless communication method, apparatus, electronic device, and storage medium. Background Art
[0002] Currently, wireless communication has the advantages of high flexibility, convenience, and simplicity in setting up a wireless network, and has been widely used in fields such as file transfer, screen mirroring, Internet of Things, and intelligent transportation. However, in related technologies, when establishing a wireless connection between two devices, the number of message interactions is large and the message interaction takes a long time, resulting in a long time for wireless connection and low wireless connection efficiency. Summary of the Invention
[0003] The present disclosure provides a wireless communication method, apparatus, electronic device, computer-readable storage medium, and computer program product to at least solve the problem of long wireless connection time and low wireless connection efficiency in related technologies. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a wireless communication method is provided, including: establishing a Bluetooth connection between a first device and a second device; based on the Bluetooth channel between the first device and the second device, sending a first data packet to the second device and receiving a second data packet sent by the second device, where the first data packet and the second data packet are both used for wireless communication between the first device and the second device; establishing a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include an interaction process of handshake messages; and performing wireless communication between the first device and the second device based on the first data packet and the second data packet.
[0005] In an embodiment of the present disclosure, the performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: generating a first key based on the first data packet and the second data packet; and performing wireless communication between the first device and the second device based on the first key.
[0006] In an embodiment of the present disclosure, the first key is used for unicast communication between the first device and the second device.
[0007] In an embodiment of the present disclosure, the second data packet carries first message integrity check (MIC) data and first original data, where the first MIC data is obtained based on a second key local to the second device and the first original data;
[0008] Before establishing the wireless connection between the first device and the second device, the method further includes: obtaining second MIC data based on the first key and the first original data; performing message integrity verification on the second data packet based on the first MIC data and the second MIC data, and performing consistency verification on the first key and the second key.
[0009] In an embodiment of the present disclosure, before establishing the wireless connection between the first device and the second device, the method further includes: obtaining third MIC data based on the first key and second original data; adding the third MIC data and the second original data to a third data packet, where the third MIC data is used to perform message integrity verification on the third data packet, and perform consistency verification on the first key and the second key local to the second device; sending the third data packet to the second device based on the Bluetooth channel between the first device and the second device.
[0010] In an embodiment of the present disclosure, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
[0011] In an embodiment of the present disclosure, before establishing the wireless connection between the first device and the second device, the method further includes: receiving, based on the Bluetooth channel between the first device and the second device, a fourth data packet sent by the second device, where the fourth data packet carries third original data and fourth MIC data, the third original data includes first indication information for indicating the first device to establish a wireless connection between itself and the second device, and the fourth MIC data is obtained based on the second key local to the second terminal and the third original data; obtaining fifth MIC data based on the first key and the third original data; performing message integrity verification on the fourth data packet based on the fourth MIC data and the fifth MIC data.
[0012] In an embodiment of the present disclosure, before sending the first data packet to the second device, the method further includes: obtaining an Internet Protocol (IP) address assigned to the second device; adding the IP address of the second device to the first data packet.
[0013] In an embodiment of the present disclosure, the second data packet carries the media access control (MAC) address of the second device; performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: configuring the address resolution protocol (ARP) table of the first device based on the IP address of the first device and the MAC address of the first device; configuring the ARP table of the first device based on the IP address of the second device and the MAC address of the second device; and performing wireless communication between the first device and the second device based on the ARP table of the first device.
[0014] In an embodiment of the present disclosure, the first data packet further carries the IP address of the first device and the MAC address of the first device.
[0015] In an embodiment of the present disclosure, establishing a wireless connection between the first device and the second device includes: creating a wireless access point or creating a group and designating the first device as the owner of the group; receiving an authentication request message sent by the second device; sending an authentication response message to the second device; receiving an association request message sent by the second device; and sending an association response message to the second device.
[0016] According to a second aspect of the embodiments of the present disclosure, another wireless communication method is provided, including: establishing a Bluetooth connection between a first device and a second device; receiving a first data packet sent by the first device and sending a second data packet to the first device based on a Bluetooth channel between the first device and the second device, where the first data packet and the second data packet are both used for wireless communication between the first device and the second device; establishing a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include an interaction process of handshake messages; and performing wireless communication between the first device and the second device based on the first data packet and the second data packet.
[0017] In an embodiment of the present disclosure, performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: generating a second key based on the first data packet and the second data packet; and performing wireless communication between the first device and the second device based on the second key.
[0018] In an embodiment of the present disclosure, the second key is used for unicast communication between the first device and the second device.
[0019] In one embodiment of the present disclosure, before sending the second data packet to the first device, it further includes: obtaining first MIC data based on the second key and the first original data in the second data packet; adding the first MIC data to the second data packet, where the first MIC data is used for message integrity verification of the second data packet and consistency verification of the first key and the second key local to the first terminal.
[0020] In one embodiment of the present disclosure, before establishing a wireless connection between the first device and the second device, it further includes: receiving, based on the Bluetooth channel between the first device and the second device, a third data packet sent by the first device, where the third data packet carries third MIC data and second original data, and the third MIC data is obtained based on the first key local to the first terminal and the second original data; obtaining sixth MIC data based on the second key and the second original data; performing message integrity verification on the third data packet based on the third MIC data and the sixth MIC data, and performing consistency verification on the first key and the second key.
[0021] In one embodiment of the present disclosure, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
[0022] In one embodiment of the present disclosure, before establishing a wireless connection between the first device and the second device, it further includes: obtaining fourth MIC data based on the second key and third original data, where the third original data includes first indication information for indicating the first device to establish a wireless connection between itself and the second device; adding the fourth MIC data and the third original data to a fourth data packet, where the fourth MIC data is used for message integrity verification of the fourth data packet; sending the fourth data packet to the first device based on the Bluetooth channel between the first device and the second device.
[0023] In one embodiment of the present disclosure, the first data packet carries an IP address assigned to the second device.
[0024] In one embodiment of the present disclosure, the second data packet carries the MAC address of the second device.
[0025] In one embodiment of the present disclosure, the first data packet further carries the IP address of the first device and the MAC address of the first device;
[0026] Performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: configuring the ARP table of the second device based on the IP address and MAC address of the first device; configuring the ARP table of the second device based on the IP address and MAC address of the second device; and performing wireless communication between the first device and the second device based on the ARP table of the second device.
[0027] In an embodiment of the present disclosure, the second device is a client of the wireless access point created by the first device, or the second device is a client of the group created by the first device;
[0028] Establishing a wireless connection between the first device and the second device includes: sending an authentication request message to the first device; receiving an authentication response message sent by the first device; sending an association request message to the first device; and receiving an association response message sent by the first device.
[0029] According to a third aspect of the embodiments of the present disclosure, there is provided a wireless communication device, including: a first connection module configured to establish a Bluetooth connection between a first device and a second device; a first communication module configured to send a first data packet to the second device and receive a second data packet sent by the second device based on a Bluetooth channel between the first device and the second device, where the first data packet and the second data packet are both used for wireless communication between the first device and the second device; a second connection module configured to establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include an interaction process of handshake messages; and a second communication module configured to perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
[0030] In an embodiment of the present disclosure, the second communication module is further configured to: generate a first key based on the first data packet and the second data packet; and perform wireless communication between the first device and the second device based on the first key.
[0031] In an embodiment of the present disclosure, the first key is used for unicast communication between the first device and the second device.
[0032] In an embodiment of the present disclosure, the second data packet carries first message integrity check (MIC) data and first original data, where the first MIC data is obtained based on a second key local to the second device and the first original data;
[0033] Before establishing the wireless connection between the first device and the second device, the first communication module is further configured to perform: obtaining second MIC data based on the first key and the first original data; performing message integrity verification on the second data packet based on the first MIC data and the second MIC data, and performing consistency verification on the first key and the second key.
[0034] In an embodiment of the present disclosure, before establishing the wireless connection between the first device and the second device, the first communication module is further configured to perform: obtaining third MIC data based on the first key and second original data; adding the third MIC data and the second original data to a third data packet, where the third MIC data is used to perform message integrity verification on the third data packet, and perform consistency verification on the first key and the second key local to the second device; sending the third data packet to the second device based on the Bluetooth channel between the first device and the second device.
[0035] In an embodiment of the present disclosure, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
[0036] In an embodiment of the present disclosure, before establishing the wireless connection between the first device and the second device, the first communication module is further configured to perform: receiving a fourth data packet sent by the second device based on the Bluetooth channel between the first device and the second device, where the fourth data packet carries third original data and fourth MIC data, the third original data includes first indication information for indicating the first device to establish a wireless connection between itself and the second device, and the fourth MIC data is obtained based on the second key local to the second terminal and the third original data; obtaining fifth MIC data based on the first key and the third original data; performing message integrity verification on the fourth data packet based on the fourth MIC data and the fifth MIC data.
[0037] In an embodiment of the present disclosure, before sending the first data packet to the second device, the first communication module is further configured to perform: obtaining the Internet Protocol (IP) address assigned to the second device; adding the IP address of the second device to the first data packet.
[0038] In one embodiment of the present disclosure, the second data packet carries the Media Access Control (MAC) address of the second device; the second communication module is further configured to perform: configuring the Address Resolution Protocol (ARP) table of the first device based on the IP address and the MAC address of the first device; configuring the ARP table of the first device based on the IP address and the MAC address of the second device; and performing wireless communication between the first device and the second device based on the ARP table of the first device.
[0039] In one embodiment of the present disclosure, the first data packet further carries the IP address and the MAC address of the first device.
[0040] In one embodiment of the present disclosure, the second connection module is further configured to perform: creating a wireless access point, or creating a group and designating the first device as the owner of the group; receiving an authentication request message sent by the second device; sending an authentication response message to the second device; receiving an association request message sent by the second device; and sending an association response message to the second device.
[0041] According to a fourth aspect of the embodiments of the present disclosure, there is provided another wireless communication device, including: a first connection module configured to establish a Bluetooth connection between a first device and a second device; a first communication module configured to receive a first data packet sent by the first device and send a second data packet to the first device based on a Bluetooth channel between the first device and the second device, where the first data packet and the second data packet are both used for wireless communication between the first device and the second device; a second connection module configured to establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include an interaction process of handshake messages; and a second communication module configured to perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
[0042] In one embodiment of the present disclosure, the second communication module is further configured to perform: generating a second key based on the first data packet and the second data packet; and performing wireless communication between the first device and the second device based on the second key.
[0043] In one embodiment of the present disclosure, the second key is used for unicast communication between the first device and the second device.
[0044] In one embodiment of the present disclosure, before sending the second data packet to the first device, the first communication module is further configured to perform: obtaining first MIC data based on the second key and first original data in the second data packet; adding the first MIC data to the second data packet, where the first MIC data is used for message integrity verification of the second data packet and consistency verification of the first key and the second key local to the first terminal.
[0045] In one embodiment of the present disclosure, before establishing a wireless connection between the first device and the second device, the first communication module is further configured to perform: receiving a third data packet sent by the first device based on a Bluetooth channel between the first device and the second device, where the third data packet carries third MIC data and second original data, and the third MIC data is obtained based on the first key local to the first terminal and the second original data; obtaining sixth MIC data based on the second key and the second original data; performing message integrity verification on the third data packet and consistency verification on the first key and the second key based on the third MIC data and the sixth MIC data.
[0046] In one embodiment of the present disclosure, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
[0047] In one embodiment of the present disclosure, before establishing a wireless connection between the first device and the second device, the first communication module is further configured to perform: obtaining fourth MIC data based on the second key and third original data, where the third original data includes first indication information for indicating the first device to establish a wireless connection between itself and the second device; adding the fourth MIC data and the third original data to a fourth data packet, where the fourth MIC data is used for message integrity verification of the fourth data packet; sending the fourth data packet to the first device based on a Bluetooth channel between the first device and the second device.
[0048] In one embodiment of the present disclosure, the first data packet carries an IP address assigned to the second device.
[0049] In one embodiment of the present disclosure, the second data packet carries the MAC address of the second device.
[0050] In one embodiment of the present disclosure, the first data packet further carries the IP address of the first device and the MAC address of the first device;
[0051] The second communication module is further configured to perform: configuring the ARP table of the second device based on the IP address and the MAC address of the first device; configuring the ARP table of the second device based on the IP address and the MAC address of the second device; and performing wireless communication between the first device and the second device based on the ARP table of the second device.
[0052] In an embodiment of the present disclosure, the second device is a client of the wireless access point created by the first device, or the second device is a client of the group created by the first device;
[0053] The second connection module is further configured to perform: sending an authentication request message to the first device; receiving an authentication response message sent by the first device; sending an association request message to the first device; and receiving an association response message sent by the first device.
[0054] According to a fifth aspect of the embodiments of the present disclosure, there is provided an electronic device, including a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to implement the steps of the methods described in the first aspect and the second aspect of the embodiments of the present disclosure.
[0055] According to a sixth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the program instructions are executed by a processor, the steps of the methods described in the first aspect and the second aspect of the embodiments of the present disclosure are implemented.
[0056] According to a seventh aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program, characterized in that when the computer program is executed by a processor of an electronic device, the steps of the methods described in the first aspect and the second aspect of the embodiments of the present disclosure are implemented.
[0057] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects: Establish a Bluetooth connection between a first device and a second device, send a first data packet to the second device based on the Bluetooth channel between the first device and the second device, and receive a second data packet sent by the second device. Among them, both the first data packet and the second data packet are used for wireless communication between the first device and the second device. Establish a wireless connection between the first device and the second device. Among them, the process of establishing the wireless connection does not include the interaction process of handshake messages. Based on the first data packet and the second data packet, perform wireless communication between the first device and the second device. Thus, the first data packet and the second data packet can be transmitted through the Bluetooth channel between the two devices, that is, the sharing of the two data packets between the two devices can be realized through the Bluetooth channel, so that the interaction process of handshake messages can be omitted during the process of establishing the wireless connection, which helps to reduce the number of message interactions and shorten the message interaction duration, thereby shortening the wireless connection duration and improving the wireless connection efficiency.
[0058] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0060] Figure 1 is a flowchart of a wireless communication method shown according to an exemplary embodiment.
[0061] Figure 2 is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0062] Figure 3 is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0063] Figure 4 is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0064] Figure 5 is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0065] Figure 6 is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0066] Figure 7 is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0067] Figure 8 It is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0068] Figure 9 It is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0069] Figure 10 It is a flowchart of a wireless communication method shown according to another exemplary embodiment.
[0070] Figure 11 It is an interaction flowchart of a wireless communication method shown according to an exemplary embodiment.
[0071] Figure 12 It is a block diagram of a wireless communication device shown according to an exemplary embodiment.
[0072] Figure 13 It is a block diagram of a wireless communication device shown according to another exemplary embodiment.
[0073] Figure 14 It is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manners
[0074] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0075] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0076] In the technical solutions of the present disclosure, the acquisition, storage, use, processing, etc. of data all comply with the provisions of relevant laws and regulations.
[0077] Figure 1 It is a flowchart of a wireless communication method shown according to an exemplary embodiment. As Figure 1 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0078] S101, establish a Bluetooth connection between the first device and the second device.
[0079] It should be noted that the execution subject of the wireless communication method in the embodiments of the present disclosure is an electronic device. For example, it may include a mobile phone, a notebook, a desktop computer, a vehicle-mounted terminal, a smart home appliance, a wearable device, etc. Among them, the wearable device may include a wrist-worn device (such as a smart watch, a smart bracelet), a head-worn device, a foot-worn device, etc. The wireless communication method in the embodiments of the present disclosure may be executed by the wireless communication device in the embodiments of the present disclosure. The wireless communication device in the embodiments of the present disclosure may be configured in any electronic device to execute the wireless communication method in the embodiments of the present disclosure.
[0080] In one implementation manner, the execution subject may include a first device, and the first device and the second device are different electronic devices.
[0081] It should be noted that establishing a Bluetooth connection between the first device and the second device may be implemented by using any Bluetooth connection method in the related art, and no further limitation is made here.
[0082] In one implementation manner, establishing a Bluetooth connection between the first device and the second device includes broadcasting a fifth data packet to the second device, where the fifth data packet carries the identifier of the first device, and receiving the second indication information sent by the second device, where the second indication information is used to instruct the first device to establish a Bluetooth connection between itself and the second device, and establishing a Bluetooth connection between the first device and the second device.
[0083] In one implementation manner, establishing a Bluetooth connection between the first device and the second device includes receiving sixth data packets broadcast by multiple candidate devices, where the sixth data packet carries the identifier of the candidate device, determining the second device from the multiple candidate devices, and establishing a Bluetooth connection between the first device and the second device. For example, a list of candidate devices may be displayed on the page of the first device, and the second device is determined from the multiple candidate devices based on the user's selection operation on the second device in the list of candidate devices.
[0084] In some examples, the fifth data packet carries the CAP (Capability) capability identifier indicating whether the first device supports fast wireless connection, and the sixth data packet carries the CAP capability identifier indicating whether the candidate device supports fast wireless connection. For example, if both the first device and the second device support fast wireless connection, step S102 and its subsequent steps may be continued; otherwise, if the first device and / or the second device does not support fast wireless connection, the original wireless communication process may be executed.
[0085] In one embodiment, establishing a Bluetooth connection between a first device and a second device includes scanning for Bluetooth devices in the surrounding area of the first device. If the second device is scanned, the first device and the second device are paired. If the pairing between the first device and the second device is successful, a Bluetooth connection between the first device and the second device is established.
[0086] S102, based on the Bluetooth channel between the first device and the second device, send a first data packet to the second device and receive a second data packet sent by the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0087] It should be noted that there are no excessive limitations on the first data packet and the second data packet.
[0088] In one embodiment, the first device serves as the creator of a wireless AP (Access Point) or the owner of a group (Group Owner). The first data packet carries the connection password of the wireless network, the channel where the first device is located, the SSID (Service Set Identifier) of the wireless network, the MAC (Media Access Control) address of the first device, the IP (Internet Protocol) address assigned to the second device, ANonce (Access Point Nonce), the third key, the capability identifier of the first device, etc.
[0089] In one embodiment, the second device serves as a client of the wireless access point created by the first device, that is, the second device serves as a STA (Station), or the second device serves as a client of the group created by the first device (Group Client). The second data packet carries the MAC address of the second device, SNonce (Supplicant Nonce), and the capability identifier of the second device, etc.
[0090] It should be noted that if the first device is the owner of the group, the connection password of the wireless network includes the password for joining the group created by the first device. ANonce is a random number generated by the first device, and SNonce is a random number generated by the second device. There are no excessive limitations on the third key. For example, the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices. For example, the third key may include GTK (Group Temporal Key). To generate the third key, any key generation method in related technologies can be used to implement it, and there are no excessive limitations here.
[0091] In one embodiment, generating a third key may include concatenating the MAC address of the first device and the GNonce (Group Nonce) to obtain a first concatenation result, and generating a GTK based on the first concatenation result and the GMK (Group Master Key). It should be noted that the GNonce is a random number generated by the first device, and the ANonce and GNonce are different random numbers.
[0092] In some examples, the GTK may be obtained by performing key derivation on the GMK based on the first concatenation result. It should be noted that the key derivation of the GMK can be implemented by any key derivation method in related technologies, and the key derivation method may include a PRF (Pseudo-Random Function).
[0093] It should be noted that the execution order of sending the first data packet to the second device and receiving the second data packet sent by the second device is not overly limited. For example, after sending the first data packet to the second device, the second data packet sent by the second device is received, or after receiving the second data packet sent by the second device, the first data packet is sent to the second device.
[0094] S103, establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0095] It should be noted that the handshake message may include handshake messages defined by any wireless communication protocol in related technologies. For example, it may include a Four-Way Handshake message.
[0096] In one embodiment, establishing a wireless connection between a first device and a second device includes creating a wireless access point or creating a group with the first device as the owner of the group, receiving an Authentication Request (Auth Request) message sent by the second device, sending an Authentication Response (Auth Response) message to the second device, receiving an Association Request (Assoc Request) message sent by the second device, and sending an Association Response (Assoc Response) message to the second device. It can be understood that the process of establishing a wireless connection includes the interaction process of two Auth messages (i.e., Auth Request and Auth Response) and the interaction process of two Assoc messages (i.e., Assoc Request and Assoc Response).
[0097] In one embodiment, establishing a wireless connection between a first device and a second device includes installing a first key and a third key. It should be noted that the first key and the third key are different keys, and no excessive limitation is imposed on the first key. For example, the first key is used for unicast communication between the first device and the second device. For example, the first key may include a PTK (Pairwise Temporal Key). For the relevant content of generating the first key, reference can be made to the following embodiments and will not be elaborated here.
[0098] In some examples, establishing a wireless connection between a first device and a second device includes installing a PTK and a GTK.
[0099] S104, perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
[0100] In one embodiment, performing wireless communication between a first device and a second device based on the first data packet and the second data packet includes extracting first target data required for wireless communication from the first data packet and the second data packet, and / or generating first target data based on the first data packet and the second data packet, and performing wireless communication between the first device and the second device based on the first target data. It should be noted that no excessive limitation is imposed on the first target data. For example, it may include the first key, the third key, the IP address of the first device, the MAC address of the first device, the IP address of the second device, the MAC address of the second device, etc.
[0101] It should be noted that, based on the first data packet and the second data packet, the generation of the first target data can be implemented by any wireless communication method in the related art, and no excessive limitation is imposed here.
[0102] In one implementation, before performing wireless communication between the first device and the second device, it further includes receiving an ARP (Address Resolution Protocol) request message (abbreviated as ARP Request) sent by the second device, and sending an ARP response message (abbreviated as ARP Response) to the second device. Among them, the ARP request message carries the MAC address of the second device, and the ARP response message carries the MAC address of the first device. Thus, through the interaction process of two ARP messages (i.e., ARP Request and ARP Response), the MAC addresses of the first device and the second device can be shared between the two devices.
[0103] The wireless communication method provided by the embodiments of the present disclosure establishes a Bluetooth connection between the first device and the second device, sends a first data packet to the second device based on the Bluetooth channel between the first device and the second device, and receives a second data packet sent by the second device. Among them, both the first data packet and the second data packet are used for wireless communication between the first device and the second device, and a wireless connection between the first device and the second device is established. Among them, the process of establishing the wireless connection does not include the interaction process of handshake messages, and wireless communication between the first device and the second device is performed based on the first data packet and the second data packet. Thus, the transmission of the first data packet and the second data packet can be performed through the Bluetooth channel between the two devices, that is, the sharing of the two data packets between the two devices can be realized through the Bluetooth channel, so that the interaction process of handshake messages can be omitted during the process of establishing the wireless connection, which helps to reduce the number of message interactions and shorten the message interaction duration, thereby shortening the wireless connection duration and improving the wireless connection efficiency.
[0104] Figure 2 is a flowchart of a wireless communication method shown according to another exemplary embodiment, as Figure 2 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0105] S201, establish a Bluetooth connection between the first device and the second device.
[0106] S202, based on the Bluetooth channel between the first device and the second device, send a first data packet to the second device, and receive a second data packet sent by the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0107] S203. Establish a wireless connection between the first device and the second device. The process of establishing the wireless connection does not include the interaction process of handshake messages.
[0108] For the relevant content of steps S201 - S203, reference can be made to the above - mentioned embodiments and will not be elaborated here.
[0109] S204. Generate a first key based on the first data packet and the second data packet.
[0110] It should be noted that there is no strict limitation on the execution order of steps S204 and S203. For example, after step S203, step S204 is executed, or after step S204, step S203 is executed.
[0111] It should be noted that for the relevant content of the first key, reference can be made to the above - mentioned embodiments and will not be elaborated here. The generation of the first key can be implemented by any key - generation method in the related technologies and is not strictly limited here.
[0112] In one implementation, the first data packet carries the connection password of the wireless network, the SSID of the wireless network, the MAC address of the first device, and ANonce, and the second data packet carries the MAC address of the second device and SNonce.
[0113] Generating the first key based on the first data packet and the second data packet may include generating a PMK (Pairwise Master Key) based on the connection password of the wireless network and the SSID of the wireless network, splicing the MAC address of the first device, the MAC address of the second device, ANonce, and SNonce to obtain a second splicing result, and generating a PTK based on the second splicing result and the PMK.
[0114] In some examples, generating the PMK based on the connection password of the wireless network and the SSID of the wireless network includes performing key derivation on the connection password of the wireless network based on the SSID of the wireless network to obtain the PMK. It should be noted that the key derivation of the GMK can be implemented by any key - derivation method in the related technologies, and the key - derivation method may include PBKDF2 (Password - Based Key Derivation Function 2).
[0115] In some examples, generating the PTK based on the second splicing result and the PMK includes performing key derivation on the PMK based on the second splicing result to obtain the PTK. It should be noted that the key derivation of the PTK can be implemented by any key - derivation method in the related technologies, and the key - derivation method may include PRF.
[0116] In some examples, the MAC address of the first device, the MAC address of the second device, ANonce, and SNonce are concatenated to obtain a second concatenation result, including obtaining the first maximum value and the first minimum value from the MAC address of the first device and the MAC address of the second device, obtaining the second maximum value and the second minimum value from ANonce and SNonce, and concatenating the first minimum value, the first maximum value, the second minimum value, and the second maximum value in the order of the first minimum value, the first maximum value, the second minimum value, and the second maximum value to obtain the second concatenation result.
[0117] S205, perform wireless communication between the first device and the second device based on the first key.
[0118] It should be noted that the relevant content of performing wireless communication between the first device and the second device based on the first key can be implemented by any wireless communication method in the related art, and no excessive limitation is made here.
[0119] In one implementation, performing wireless communication between the first device and the second device based on the first key includes encrypting the seventh data packet based on the first key to obtain a first encrypted data packet, and sending the first encrypted data packet to the second device based on the wireless channel between the first device and the second device.
[0120] In one implementation, performing wireless communication between the first device and the second device based on the first key includes receiving a second encrypted data packet sent by the second device based on the wireless channel between the first device and the second device, and decrypting the second encrypted data packet based on the first key to obtain an eighth data packet.
[0121] The wireless communication method provided by the embodiments of the present disclosure generates a first key based on the first data packet and the second data packet, and performs wireless communication between the first device and the second device based on the first key. Thus, the first key can be generated by comprehensively considering the first data packet and the second data packet to perform wireless communication between the two devices.
[0122] Figure 3 is a flowchart of a wireless communication method shown according to another exemplary embodiment, as Figure 3 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0123] S301, establish a Bluetooth connection between the first device and the second device.
[0124] For the relevant content of step S301, reference can be made to the above embodiments, and details are not described here again.
[0125] S302, obtain the Internet Protocol IP address assigned to the second device.
[0126] S303. Add the IP address of the second device to the first data packet.
[0127] It should be noted that to obtain the IP address assigned to the second device, any IP address allocation method in the related art can be used to achieve this, and no excessive limitations are imposed here. The IP address of the second device refers to the IP address assigned to the second device, and the first data packet carries the IP address of the second device.
[0128] In one implementation, to obtain the IP address assigned to the second device, it includes receiving the IP address assigned to the second device sent by a DHCP (Dynamic Host Configuration Protocol) server.
[0129] In one implementation, to obtain the IP address assigned to the second device, it includes sending a DHCP Discover message (abbreviated as DHCP Discover) to the DHCP server, receiving a DHCP ACK message (abbreviated as DHCP ACK) sent by the DHCP server, sending a DHCP Request message (abbreviated as DHCP Request) to the DHCP server, and receiving a DHCP Response message (abbreviated as DHCP Response) sent by the DHCP server.
[0130] In one implementation, to obtain the IP address assigned to the second device, it includes screening out a target IP address from an IP address list as the IP address assigned to the second device. It can be understood that the IP address list includes multiple unoccupied candidate IP addresses.
[0131] S304. Based on the Bluetooth channel between the first device and the second device, send the first data packet to the second device and receive the second data packet sent by the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0132] S305. Establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0133] For the relevant content of steps S304 - S305, reference can be made to the above embodiments, and details are not elaborated here.
[0134] S306. Configure the Address Resolution Protocol ARP table of the first device based on the IP address of the first device and the MAC address of the first device.
[0135] S307. Configure the ARP table of the first device based on the IP address of the second device and the MAC address of the second device.
[0136] It should be noted that the second data packet carries the MAC address of the second device.
[0137] In one embodiment, based on the IP address and the MAC address of the first device, configure the Address Resolution Protocol (ARP) table of the first device, including establishing a mapping relationship between the IP address and the MAC address of the first device, and storing the mapping relationship between the IP address and the MAC address of the first device in the ARP table of the first device.
[0138] In one embodiment, based on the IP address and the MAC address of the second device, configure the Address Resolution Protocol (ARP) table of the first device, including establishing a mapping relationship between the IP address and the MAC address of the second device, and storing the mapping relationship between the IP address and the MAC address of the second device in the ARP table of the first device.
[0139] S308, perform wireless communication between the first device and the second device based on the ARP table of the first device.
[0140] It should be noted that the relevant content of performing wireless communication between the first device and the second device based on the ARP table of the first device can be implemented by any wireless communication method in the related art, and no excessive limitation is made here.
[0141] In one embodiment, perform wireless communication between the first device and the second device based on the ARP table of the first device, including obtaining, from the ARP table of the first device, the MAC address that has a mapping relationship with the IP address of the second device as the MAC address of the second device, and performing wireless communication between the first device and the second device based on the MAC address of the second device. For example, the MAC address of the second device can be added to the first encrypted data packet and the first encrypted data packet can be sent to the second device.
[0142] In one embodiment, perform wireless communication between the first device and the second device based on the ARP table of the first device, including receiving the second encrypted data packet sent by the second device, obtaining, from the ARP table of the first device, the candidate MAC address that has a mapping relationship with the IP address of the second device as the MAC address of the second device, and performing identity verification on the second encrypted data packet based on the MAC address of the second device.
[0143] In some examples, based on the MAC address of the second device, identity verification is performed on the second encrypted data packet, including extracting the MAC address from the second encrypted data packet. If the extracted MAC address is inconsistent with the MAC address of the second device, it is determined that the second encrypted data packet fails the identity verification. If the extracted MAC address is consistent with the MAC address of the second device, it is determined that the second encrypted data packet passes the identity verification.
[0144] The wireless communication method provided by the embodiments of the present disclosure further includes obtaining the IP address assigned to the second device before sending the first data packet to the second device, and adding the IP address of the second device to the first data packet, so that the IP address of the second device can be shared between the two devices through the Bluetooth channel, thereby omitting the interaction process of DHCP packets during the wireless communication process, which helps to reduce the number of packet interactions and shorten the packet interaction duration, thus shortening the wireless communication duration and improving the wireless communication efficiency. In addition, based on the IP address of the first device and the MAC address of the first device, the ARP table of the first device is configured. Based on the IP address of the second device and the MAC address of the second device, the ARP table of the first device is configured. Based on the ARP table of the first device, wireless communication between the first device and the second device is performed. That is, the ARP table of the first device can be configured by comprehensively considering the IP addresses and MAC addresses of the two devices respectively, thereby omitting the interaction process of ARP packets during the wireless communication process, which helps to reduce the number of packet interactions and shorten the packet interaction duration, thus shortening the wireless communication duration and improving the wireless communication efficiency.
[0145] Based on any of the above embodiments, the first data packet further carries the IP address of the first device and the MAC address of the first device. Thus, the IP address and MAC address of the first device can be shared between the two devices through the Bluetooth channel, so that the second device can configure the ARP table considering the IP address and MAC address of the first device, thereby omitting the interaction process of ARP packets during the wireless communication process, which helps to reduce the number of packet interactions and shorten the packet interaction duration, thus shortening the wireless communication duration and improving the wireless communication efficiency.
[0146] Figure 4 is a flowchart of a wireless communication method shown according to another exemplary embodiment, as Figure 4 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0147] S401, establish a Bluetooth connection between the first device and the second device.
[0148] S402, based on the Bluetooth channel between the first device and the second device, send a first data packet to the second device and receive a second data packet sent by the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0149] S403, generate a first key based on the first data packet and the second data packet.
[0150] For the relevant content of steps S401 - S403, reference can be made to the above embodiments and will not be elaborated here.
[0151] S404, obtain second MIC data based on the first key and the first original data.
[0152] It should be noted that the second data packet carries first MIC (Message Integrity Check) data and the first original data, where the first MIC data is obtained based on a second key local to the second device and the first original data. There are no excessive limitations on the first original data. For example, it may include the MAC address of the second device, SNonce (Supplicant Nonce), and the capability identifier of the second device, etc. For the relevant content of the second key and the first MIC data, reference can be made to the following embodiments and will not be elaborated here.
[0153] It should be noted that to obtain second MIC data based on the first key and the first original data, any method for obtaining MIC data in related technologies can be used and is not overly limited here. The methods for obtaining MIC data may include the Michael algorithm, the AES (Advanced Encryption Standard) algorithm, etc.
[0154] In one implementation, the first key is PTK, and PTK includes KCK (Key Confirmation Key). Obtaining second MIC data based on the first key and the first original data includes encrypting the first original data based on KCK to obtain the second MIC data.
[0155] S405, perform message integrity check on the second data packet based on the first MIC data and the second MIC data, and perform consistency check on the first key and the second key.
[0156] In one embodiment, based on the first MIC data and the second MIC data, perform message integrity verification on the second data packet, and perform consistency verification on the first key and the second key, including: if the first MIC data and the second MIC data are consistent, determine that the second data packet passes the message integrity verification, and determine that the first key and the second key pass the consistency verification; if the first MIC data and the second MIC data are inconsistent, determine that the second data packet fails the message integrity verification, and / or determine that the first key and the second key fail the consistency verification.
[0157] In one embodiment, the method further includes: if the second data packet fails the message integrity verification, and / or if the first key and the second key fail the consistency verification, send third indication information to the second device, where the third indication information is used to instruct the second device to retransmit the second data packet, and return to execute the subsequent steps of sending the first data packet to the second device based on the Bluetooth channel between the first device and the second device.
[0158] S406. Establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0159] S407. Perform wireless communication between the first device and the second device based on the first key.
[0160] For the relevant content of steps S406 - S407, reference can be made to the above embodiments, which will not be elaborated here.
[0161] Before establishing a wireless connection between the first device and the second device, the wireless communication method provided by the embodiments of the present disclosure further includes: obtaining the second MIC data based on the first key and the first original data, performing message integrity verification on the second data packet based on the first MIC data and the second MIC data, and performing consistency verification on the first key and the second key, which can avoid the second data packet being tampered with during the transmission process, improve the security of wireless communication, and verify whether the first key and the second key are consistent.
[0162] Figure 5 is a flowchart of a wireless communication method shown according to another exemplary embodiment. As Figure 5 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0163] S501. Establish a Bluetooth connection between the first device and the second device.
[0164] S502. Based on the Bluetooth channel between the first device and the second device, send a first data packet to the second device, and receive a second data packet sent by the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0165] S503, generate a first key based on the first data packet and the second data packet.
[0166] For the relevant content of steps S501 - S503, reference can be made to the above - mentioned embodiments and will not be elaborated here.
[0167] S504, obtain the third MIC data based on the first key and the second original data.
[0168] It should be noted that there are no excessive limitations on the second original data. For example, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices. For the relevant content of the third key, reference can be made to the above - mentioned embodiments and will not be elaborated here.
[0169] It should be noted that for the relevant content of step S504, reference can be made to the relevant content of step S404 in the above - mentioned embodiments and will not be elaborated here.
[0170] S505, add the third MIC data and the second original data to the third data packet, where the third MIC data is used for message integrity verification of the third data packet and consistency verification of the first key and the second key on the second device locally.
[0171] S506, send the third data packet to the second device based on the Bluetooth channel between the first device and the second device.
[0172] It should be noted that the third data packet carries the third MIC data and the second original data.
[0173] S507, establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0174] S508, perform wireless communication between the first device and the second device based on the first key.
[0175] For the relevant content of steps S507 - S508, reference can be made to the above - mentioned embodiments and will not be elaborated here.
[0176] Before establishing a wireless connection between a first device and a second device, the wireless communication method provided by an embodiment of the present disclosure further includes obtaining third MIC data based on a first key and second original data, and adding the third MIC data and the second original data to a third data packet, where the third MIC data is used for message integrity verification of the third data packet and for consistency verification of the first key and a second key on the second device side. Sending the third data packet to the second device based on the Bluetooth channel between the first device and the second device can prevent the third data packet from being tampered with during transmission, improve the security of wireless communication, and verify whether the first key and the second key are consistent.
[0177] Figure 6 is a flowchart of a wireless communication method shown according to another exemplary embodiment. As Figure 6 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0178] S601, establish a Bluetooth connection between the first device and the second device.
[0179] S602, based on the Bluetooth channel between the first device and the second device, send a first data packet to the second device and receive a second data packet sent by the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0180] S603, generate a first key based on the first data packet and the second data packet.
[0181] For the relevant content of steps S601 - S603, reference can be made to the above embodiments and will not be elaborated here.
[0182] S604, based on the Bluetooth channel between the first device and the second device, receive a fourth data packet sent by the second device, where the fourth data packet carries third original data and fourth MIC data, the third original data includes first indication information, and the first indication information is used to instruct the first device to establish a wireless connection between itself and the second device, and the fourth MIC data is obtained based on the second key on the second device side and the third original data.
[0183] S605, obtain fifth MIC data based on the first key and the third original data.
[0184] S606, perform message integrity verification on the fourth data packet based on the fourth MIC data and the fifth MIC data.
[0185] It should be noted that there are no excessive restrictions on the third original data. For the relevant content of the fourth MIC data, reference can be made to the following embodiments. For the relevant content of step S605, reference can be made to the relevant content of step S404 in the above embodiments. For the relevant content of step S606, reference can be made to the relevant content of step S405 in the above embodiments, which will not be elaborated here.
[0186] S607. Establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0187] S608. Perform wireless communication between the first device and the second device based on the first key.
[0188] For the relevant content of steps S607 - S608, reference can be made to the above embodiments, which will not be elaborated here.
[0189] Before establishing a wireless connection between the first device and the second device, the wireless communication method provided by the embodiments of the present disclosure further includes receiving, based on the Bluetooth channel between the first device and the second device, a fourth data packet sent by the second device, where the fourth data packet carries the third original data and the fourth MIC data. The third original data includes a first indication information for indicating the first device to establish a wireless connection between itself and the second device. The fourth MIC data is obtained based on the second key local to the second terminal and the third original data. A fifth MIC data is obtained based on the first key and the third original data. Message integrity verification is performed on the fourth data packet based on the fourth MIC data and the fifth MIC data, which can avoid the fourth data packet being tampered with during the transmission process and improve the security of wireless communication.
[0190] Figure 7 is a flowchart of a wireless communication method shown according to another exemplary embodiment. As Figure 7 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0191] S701. Establish a Bluetooth connection between the first device and the second device.
[0192] S702. Based on the Bluetooth channel between the first device and the second device, receive a first data packet sent by the first device and send a second data packet to the first device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0193] S703. Establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0194] It should be noted that the execution subject of the wireless communication method in the embodiments of the present disclosure is an electronic device. For example, it may include a mobile phone, a notebook, a desktop computer, a vehicle-mounted terminal, a smart home appliance, a wearable device, etc. Among them, the wearable device may include a wrist-worn device (such as a smart watch, a smart bracelet), a head-mounted device, a foot-worn device, etc. The wireless communication method in the embodiments of the present disclosure may be executed by the wireless communication device in the embodiments of the present disclosure. The wireless communication device in the embodiments of the present disclosure may be configured in any electronic device to execute the wireless communication method in the embodiments of the present disclosure.
[0195] In one implementation, the execution subject may include a second device, and the first device and the second device are different electronic devices.
[0196] It should be noted that for the relevant content of steps S701 - S703, reference may be made to the relevant content of steps S101 - S103 in the above embodiments, which will not be elaborated here.
[0197] In one implementation, the second device acts as a client of the wireless access point created by the first device, that is, the second device acts as a STA (Station), or the second device acts as a client (GroupClient) of the group created by the first device, to establish a wireless connection between the first device and the second device, including sending an authentication request message (Authentication Request, abbreviated as Auth Request) to the first device, receiving an authentication response message (Authentication Response, abbreviated as Auth Response) sent by the first device, sending an association request message (Association Request, abbreviated as Assoc Request) to the first device, and receiving an association response message (Association Response, abbreviated as Assoc Response) sent by the first device. It can be understood that the process of establishing a wireless connection includes an interaction process of two Auth messages (i.e., Auth Request and Auth Response) and an interaction process of two Assoc messages (i.e., AssocRequest and Assoc Response).
[0198] In one implementation, establishing a wireless connection between the first device and the second device includes installing a second key and a third key. In some examples, establishing a wireless connection between the first device and the second device includes installing a PTK and a GTK.
[0199] It should be noted that there are no strict restrictions on the execution order of sending the second data packet to the first device after receiving the first data packet sent by the first device. For example, the second data packet can be sent to the first device after receiving the first data packet sent by the first device, or the first data packet sent by the first device can be received after sending the second data packet to the first device.
[0200] S704. Based on the first data packet and the second data packet, perform wireless communication between the first device and the second device.
[0201] It should be noted that for the relevant content of step S704, reference can be made to the relevant content of step S104 in the above embodiments, and details will not be repeated here.
[0202] In one implementation, performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes extracting second target data required for wireless communication from the first data packet and the second data packet, and / or generating second target data based on the first data packet and the second data packet, and performing wireless communication between the first device and the second device based on the second target data. It should be noted that there are no strict restrictions on the second target data. For example, it may include a second key, a third key, the IP address of the first device, the MAC address of the first device, the IP address of the second device, the MAC address of the second device, etc.
[0203] In one implementation, performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes generating a second key based on the first data packet and the second data packet, and performing wireless communication between the first device and the second device based on the second key. Thus, the second key can be generated by comprehensively considering the first data packet and the second data packet to perform wireless communication between the two devices.
[0204] It should be noted that for the relevant content of the second key, reference can be made to the relevant content of the first key in the above embodiments, and details will not be repeated here. In some examples, the second key is used for unicast communication between the first device and the second device.
[0205] It should be noted that there are no strict restrictions on the execution order of generating the second key based on the first data packet and the second data packet in step S703. For example, step S703 is executed after generating the second key based on the first data packet and the second data packet, or the second key is generated based on the first data packet and the second data packet after step S703.
[0206] In one embodiment, the first data packet carries the IP address assigned to the second device. Thus, the sharing of the IP address of the second device between the two devices can be achieved through the Bluetooth channel, so that the interaction process of DHCP packets can be omitted during the wireless communication process, which helps to reduce the number of packet interactions and shorten the packet interaction duration, thereby shortening the wireless communication duration and improving the wireless communication efficiency.
[0207] In one embodiment, the second data packet carries the MAC address of the second device. Thus, the sharing of the MAC address of the second device between the two devices can be achieved through the Bluetooth channel, so that the first device can configure the ARP table considering the IP address and MAC address of the second device, and thus the interaction process of ARP packets can be omitted during the wireless communication process, which helps to reduce the number of packet interactions and shorten the packet interaction duration, thereby shortening the wireless communication duration and improving the wireless communication efficiency.
[0208] In one embodiment, the first data packet further carries the IP address of the first device and the MAC address of the first device. Based on the first data packet and the second data packet, wireless communication between the first device and the second device is performed, including configuring the ARP table of the second device based on the IP address of the first device and the MAC address of the first device, configuring the ARP table of the second device based on the IP address of the second device and the MAC address of the second device, and performing wireless communication between the first device and the second device based on the ARP table of the second device. Thus, the ARP table of the second device can be configured by comprehensively considering the IP addresses and MAC addresses of the two devices respectively, and thus the interaction process of ARP packets can be omitted during the wireless communication process, which helps to reduce the number of packet interactions and shorten the packet interaction duration, thereby shortening the wireless communication duration and improving the wireless communication efficiency.
[0209] It should be noted that for the relevant content of configuring the ARP table of the second device, reference can be made to the relevant content of configuring the ARP table of the first device in the above embodiments, which will not be elaborated here.
[0210] The wireless communication method provided by the embodiments of the present disclosure establishes a Bluetooth connection between a first device and a second device, receives a first data packet sent by the first device based on the Bluetooth channel between the first device and the second device, and sends a second data packet to the first device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device. A wireless connection between the first device and the second device is established, where the process of establishing the wireless connection does not include an interaction process of handshake messages. Based on the first data packet and the second data packet, wireless communication between the first device and the second device is performed. Thus, the first data packet and the second data packet can be transmitted through the Bluetooth channel between the two devices, that is, the sharing of two data packets between the two devices can be achieved through the Bluetooth channel, so that the interaction process of handshake messages can be omitted during the process of establishing the wireless connection, which helps to reduce the number of message interactions and shorten the message interaction duration, thereby shortening the wireless connection duration and improving the wireless connection efficiency.
[0211] Figure 8 is a flowchart of a wireless communication method shown according to another exemplary embodiment, as Figure 8 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0212] S801, establish a Bluetooth connection between a first device and a second device.
[0213] S802, receive a first data packet sent by the first device based on the Bluetooth channel between the first device and the second device.
[0214] S803, generate a second key based on the first data packet and the second data packet.
[0215] For the relevant content of steps S801 - S803, reference can be made to the above embodiments and will not be elaborated here.
[0216] S804, obtain first MIC data based on the second key and the first original data in the second data packet.
[0217] S805, add the first MIC data to the second data packet, where the first MIC data is used for message integrity verification of the second data packet and consistency verification of the first key and the second key on the first terminal locally.
[0218] It should be noted that the second data packet carries the first MIC data and the first original data. For the relevant content of the first original data, reference can be made to the above embodiments and will not be elaborated here. For the relevant content of step S804, reference can be made to the relevant content of step S404 in the above embodiments and will not be elaborated here.
[0219] S806, send a second data packet to the first device based on the Bluetooth channel between the first device and the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0220] S807, establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0221] S808, perform wireless communication between the first device and the second device based on the second key.
[0222] For the relevant content of steps S806 - S808, refer to the above embodiments and will not be elaborated here.
[0223] Before sending the second data packet to the first device, the wireless communication method provided by the embodiments of the present disclosure further includes obtaining first MIC data based on the second key and the first original data in the second data packet, and adding the first MIC data to the second data packet, where the first MIC data is used for message integrity verification of the second data packet and consistency verification of the first key and the second key on the first terminal locally, which can avoid the second data packet being tampered with during transmission, improve the security of wireless communication, and can verify whether the first key and the second key are consistent.
[0224] Figure 9 It is a flowchart of a wireless communication method shown according to another exemplary embodiment. As Figure 9 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0225] S901, establish a Bluetooth connection between the first device and the second device.
[0226] S902, based on the Bluetooth channel between the first device and the second device, receive the first data packet sent by the first device and send a second data packet to the first device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0227] S903, generate a second key based on the first data packet and the second data packet.
[0228] For the relevant content of steps S901 - S903, refer to the above embodiments and will not be elaborated here.
[0229] S904, based on the Bluetooth channel between the first device and the second device, receive a third data packet sent by the first device, where the third data packet carries third MIC data and second original data, and the third MIC data is obtained based on the first key on the first terminal locally and the second original data.
[0230] S905. Obtain the sixth MIC data based on the second key and the second original data.
[0231] S906. Perform message integrity verification on the third data packet based on the third MIC data and the sixth MIC data, and perform consistency verification on the first key and the second key.
[0232] It should be noted that for the relevant content of the second original data, reference can be made to the above embodiments. For the relevant content of step S905, reference can be made to the relevant content of step S404 in the above embodiments. For the relevant content of step S906, reference can be made to the relevant content of step S405 in the above embodiments, and details are not described herein again.
[0233] In one implementation, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
[0234] S907. Establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0235] S908. Perform wireless communication between the first device and the second device based on the second key.
[0236] For the relevant content of steps S907 - S908, reference can be made to the above embodiments, and details are not described herein again.
[0237] The wireless communication method provided by the embodiments of the present disclosure further includes, before establishing a wireless connection between the first device and the second device, receiving a third data packet sent by the first device based on the Bluetooth channel between the first device and the second device. The third data packet carries the third MIC data and the second original data. The third MIC data is obtained based on the first key and the second original data of the first terminal locally. Obtain the sixth MIC data based on the second key and the second original data. Perform message integrity verification on the third data packet based on the third MIC data and the sixth MIC data, and perform consistency verification on the first key and the second key, which can avoid the third data packet being tampered with during transmission, improve the security of wireless communication, and can verify whether the first key and the second key are consistent.
[0238] Figure 10 It is a flowchart of a wireless communication method shown according to another exemplary embodiment. As Figure 10 shown, the wireless communication method of the embodiments of the present disclosure includes the following steps.
[0239] S1001. Establish a Bluetooth connection between the first device and the second device.
[0240] S1002, receive a first data packet sent by the first device via the Bluetooth channel between the first device and the second device, and send a second data packet to the first device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device.
[0241] S1003, generate a second key based on the first data packet and the second data packet.
[0242] For the relevant content of steps S1001 - S1003, refer to the above embodiments, which will not be elaborated here.
[0243] S1004, obtain a fourth MIC data based on the second key and third original data, where the third original data includes a first indication information for indicating the first device to establish a wireless connection between itself and the second device.
[0244] S1005, add the fourth MIC data and the third original data to a fourth data packet, where the fourth MIC data is used to perform message integrity check on the fourth data packet.
[0245] S1006, send the fourth data packet to the first device via the Bluetooth channel between the first device and the second device.
[0246] It should be noted that the fourth data packet carries the fourth MIC data and the third original data, and there is no excessive limitation on the third original data. For the relevant content of step S1004, refer to the relevant content of step S404 in the above embodiments, which will not be elaborated here.
[0247] S1007, establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages.
[0248] S1008, perform wireless communication between the first device and the second device based on the second key.
[0249] For the relevant content of steps S1007 - S1008, refer to the above embodiments, which will not be elaborated here.
[0250] Before establishing a wireless connection between a first device and a second device, the wireless communication method provided by an embodiment of the present disclosure further includes obtaining a fourth MIC data based on a second key and third original data, where the third original data includes a first indication information for indicating the first device to establish a wireless connection between itself and the second device, adding the fourth MIC data and the third original data to a fourth data packet, where the fourth MIC data is used to perform message integrity verification on the fourth data packet, and sending the fourth data packet to the first device based on a Bluetooth channel between the first device and the second device, which can avoid the fourth data packet from being tampered with during transmission and improve the security of wireless communication.
[0251] Figure 11 is an interaction flowchart of a wireless communication method shown according to an exemplary embodiment, as Figure 11 shown, the wireless communication method of the embodiment of the present disclosure includes the following steps.
[0252] S1101, the first device and the second device perform Bluetooth mutual discovery.
[0253] S1102, the first device and the second device establish a Bluetooth connection between the first device and the second device.
[0254] S1103, the first device sends a first data packet to the second device based on a Bluetooth channel between the first device and the second device.
[0255] S1104, the second device generates a second key based on the first data packet and a second data packet.
[0256] S1105, the second device sends a second data packet to the first device based on a Bluetooth channel between the first device and the second device.
[0257] S1106, the first device generates a first key based on the first data packet and the second data packet.
[0258] S1107, the first device sends a third data packet to the second device based on a Bluetooth channel between the first device and the second device, where the third data packet carries a third key.
[0259] S1108, the second device sends a fourth data packet to the first device based on a Bluetooth channel between the first device and the second device.
[0260] S1109, the first device creates a wireless access point or creates a group and makes the first device the owner of the group.
[0261] S1110, the second device sends an authentication request message (Authentication Request, abbreviated as Auth Request) to the first device.
[0262] S1111, The first device sends an authentication response message (Authentication Response, abbreviated as Auth Response) to the second device.
[0263] S1112, The second device sends an association request message (Association Request, abbreviated as Assoc Request) to the first device.
[0264] S1113, The first device sends an association response message (Association Response, abbreviated as Assoc Response) to the second device.
[0265] S1114, The first device installs the first key and the third key, and configures the ARP table of the first device.
[0266] S1115, The second device installs the second key and the third key, and configures the ARP table of the second device.
[0267] S1116, The first device and the second device perform wireless communication between the first device and the second device.
[0268] For the relevant content of steps S1101 - S1116, reference can be made to the above - mentioned embodiments, which will not be elaborated here.
[0269] S1117, After the wireless communication between the first device and the second device ends, the first device clears the first resource.
[0270] S1118, After the wireless communication between the first device and the second device ends, the second device clears the first resource.
[0271] It should be noted that the first resource refers to the resources required for the first device to perform wireless communication between itself and the second device, which are the local resources of the first device. The second resource refers to the resources required for the second device to perform wireless communication between itself and the first device, which are the local resources of the second device. There are no excessive restrictions on the first resource and the second resource. For example, the first resource may include the IP address of the first device, the ARP table of the first device, the first key, the third key, etc. The second resource may include the IP address of the second device, the ARP table of the second device, the second key, the third key, etc.
[0272] In an implementation manner, before configuring the ARP table of the first device, it further includes the first device configuring the IP address of the first device. For example, the first device may configure the IP address of the first device as the default IP address.
[0273] In one embodiment, the first data packet carries the IP address assigned to the second device. Before configuring the ARP table of the second device, it further includes the second device configuring the IP address of the second device as the IP address assigned to the second device.
[0274] Figure 12 It is a block diagram of a wireless communication device shown according to an exemplary embodiment. Referring to Figure 12 The wireless communication device 100 according to the embodiments of the present disclosure includes: a first connection module 110, a first communication module 120, a second connection module 130, and a second communication module 140.
[0275] The first connection module 110 is configured to establish a Bluetooth connection between the first device and the second device;
[0276] The first communication module 120 is configured to send a first data packet to the second device and receive a second data packet sent by the second device based on the Bluetooth channel between the first device and the second device, wherein both the first data packet and the second data packet are used for wireless communication between the first device and the second device;
[0277] The second connection module 130 is configured to establish a wireless connection between the first device and the second device, wherein the process of establishing the wireless connection does not include an interaction process of handshake messages;
[0278] The second communication module 140 is configured to perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
[0279] In an embodiment of the present disclosure, the second communication module 140 is further configured to perform: generating a first key based on the first data packet and the second data packet; and performing wireless communication between the first device and the second device based on the first key.
[0280] In an embodiment of the present disclosure, the first key is used for unicast communication between the first device and the second device.
[0281] In an embodiment of the present disclosure, the second data packet carries first message integrity check (MIC) data and first original data, wherein the first MIC data is obtained based on a second key local to the second device and the first original data;
[0282] Before establishing the wireless connection between the first device and the second device, the first communication module 120 is further configured to perform: obtaining second MIC data based on the first key and the first original data; performing message integrity verification on the second data packet based on the first MIC data and the second MIC data, and performing consistency verification on the first key and the second key.
[0283] In an embodiment of the present disclosure, before establishing the wireless connection between the first device and the second device, the first communication module 120 is further configured to perform: obtaining third MIC data based on the first key and second original data; adding the third MIC data and the second original data to a third data packet, where the third MIC data is used to perform message integrity verification on the third data packet, and perform consistency verification on the first key and a second key of the second device locally; sending the third data packet to the second device based on the Bluetooth channel between the first device and the second device.
[0284] In an embodiment of the present disclosure, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
[0285] In an embodiment of the present disclosure, before establishing the wireless connection between the first device and the second device, the first communication module 120 is further configured to perform: receiving a fourth data packet sent by the second device based on the Bluetooth channel between the first device and the second device, where the fourth data packet carries third original data and fourth MIC data, the third original data includes first indication information, the first indication information is used to instruct the first device to establish a wireless connection between itself and the second device, and the fourth MIC data is obtained based on the second key of the second terminal locally and the third original data; obtaining fifth MIC data based on the first key and the third original data; performing message integrity verification on the fourth data packet based on the fourth MIC data and the fifth MIC data.
[0286] In an embodiment of the present disclosure, before sending the first data packet to the second device, the first communication module 120 is further configured to perform: obtaining an Internet Protocol IP address assigned to the second device; adding the IP address of the second device to the first data packet.
[0287] In an embodiment of the present disclosure, the second data packet carries the Media Access Control (MAC) address of the second device; the second communication module 140 is further configured to perform: configuring the Address Resolution Protocol (ARP) table of the first device based on the IP address and the MAC address of the first device; configuring the ARP table of the first device based on the IP address and the MAC address of the second device; and performing wireless communication between the first device and the second device based on the ARP table of the first device.
[0288] In an embodiment of the present disclosure, the first data packet further carries the IP address and the MAC address of the first device.
[0289] In an embodiment of the present disclosure, the second connection module 130 is further configured to perform: creating a wireless access point or creating a group and designating the first device as the owner of the group; receiving an authentication request message sent by the second device; sending an authentication response message to the second device; receiving an association request message sent by the second device; and sending an association response message to the second device.
[0290] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.
[0291] The wireless communication device provided by the embodiments of the present disclosure establishes a Bluetooth connection between a first device and a second device, sends a first data packet to the second device based on the Bluetooth channel between the first device and the second device, and receives a second data packet sent by the second device. The first data packet and the second data packet are both used for wireless communication between the first device and the second device. A wireless connection between the first device and the second device is established, and the process of establishing the wireless connection does not include an interaction process of handshake messages. Wireless communication between the first device and the second device is performed based on the first data packet and the second data packet. Thus, the first data packet and the second data packet can be transmitted through the Bluetooth channel between the two devices, that is, the sharing of the two data packets between the two devices can be realized through the Bluetooth channel, so that the interaction process of handshake messages can be omitted during the process of establishing the wireless connection, which helps to reduce the number of message interactions and shorten the message interaction duration, thereby shortening the wireless connection duration and improving the wireless connection efficiency.
[0292] Figure 13 is a block diagram of a wireless communication device shown according to another exemplary embodiment. Referring to Figure 13 , the wireless communication device 200 according to the embodiments of the present disclosure includes: a first connection module 210, a first communication module 220, a second connection module 230, and a second communication module 240.
[0293] The first connection module 210 is configured to establish a Bluetooth connection between the first device and the second device;
[0294] The first communication module 220 is configured to receive a first data packet sent by the first device and send a second data packet to the first device based on a Bluetooth channel between the first device and the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device;
[0295] The second connection module 230 is configured to establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include an interaction process of handshake messages;
[0296] The second communication module 240 is configured to perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
[0297] In an embodiment of the present disclosure, the second communication module 240 is further configured to: generate a second key based on the first data packet and the second data packet; perform wireless communication between the first device and the second device based on the second key.
[0298] In an embodiment of the present disclosure, the second key is used for unicast communication between the first device and the second device.
[0299] In an embodiment of the present disclosure, before sending the second data packet to the first device, the first communication module 220 is further configured to: obtain first MIC data based on the second key and first original data in the second data packet; add the first MIC data to the second data packet, where the first MIC data is used for message integrity verification of the second data packet and consistency verification of a first key and the second key locally at the first terminal.
[0300] In one embodiment of the present disclosure, before establishing a wireless connection between the first device and the second device, the first communication module 220 is further configured to perform: receiving, based on a Bluetooth channel between the first device and the second device, a third data packet sent by the first device, where the third data packet carries third MIC data and second original data, and the third MIC data is obtained based on a first key local to the first terminal and the second original data; obtaining sixth MIC data based on the second key and the second original data; performing message integrity verification on the third data packet based on the third MIC data and the sixth MIC data, and performing consistency verification on the first key and the second key.
[0301] In one embodiment of the present disclosure, the second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
[0302] In one embodiment of the present disclosure, before establishing a wireless connection between the first device and the second device, the first communication module 220 is further configured to perform: obtaining fourth MIC data based on the second key and third original data, where the third original data includes first indication information for indicating the first device to establish a wireless connection between itself and the second device; adding the fourth MIC data and the third original data to a fourth data packet, where the fourth MIC data is used for performing message integrity verification on the fourth data packet; and sending the fourth data packet to the first device based on a Bluetooth channel between the first device and the second device.
[0303] In one embodiment of the present disclosure, the first data packet carries an IP address assigned to the second device.
[0304] In one embodiment of the present disclosure, the second data packet carries the MAC address of the second device.
[0305] In one embodiment of the present disclosure, the first data packet further carries the IP address of the first device and the MAC address of the first device;
[0306] The second communication module 240 is further configured to perform: configuring the ARP table of the second device based on the IP address of the first device and the MAC address of the first device; configuring the ARP table of the second device based on the IP address of the second device and the MAC address of the second device; and performing wireless communication between the first device and the second device based on the ARP table of the second device.
[0307] In one embodiment of the present disclosure, the second device is a client of the wireless access point created by the first device, or the second device is a client of the group created by the first device;
[0308] The second connection module 230 is further configured to perform: sending an authentication request message to the first device; receiving an authentication response message sent by the first device; sending an association request message to the first device; receiving an association response message sent by the first device.
[0309] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment related to the method, and will not be elaborated here.
[0310] The wireless communication device provided by the embodiment of the present disclosure establishes a Bluetooth connection between a first device and a second device, receives a first data packet sent by the first device based on the Bluetooth channel between the first device and the second device, and sends a second data packet to the first device. Among them, both the first data packet and the second data packet are used for wireless communication between the first device and the second device. A wireless connection between the first device and the second device is established, and the process of establishing the wireless connection does not include an interaction process of handshake messages. Based on the first data packet and the second data packet, wireless communication between the first device and the second device is performed. Thus, the first data packet and the second data packet can be transmitted through the Bluetooth channel between the two devices, that is, the sharing of the two data packets between the two devices can be achieved through the Bluetooth channel, so that the interaction process of handshake messages can be omitted during the process of establishing the wireless connection, which helps to reduce the number of message interactions and shorten the message interaction duration, thereby shortening the wireless connection duration and improving the wireless connection efficiency.
[0311] Figure 14 It is a block diagram of an electronic device shown according to an exemplary embodiment.
[0312] As Figure 14 shown, the above electronic device 300 includes:
[0313] A memory 310 and a processor 320, a bus 330 connecting different components (including the memory 310 and the processor 320), and the memory 310 stores a computer program, and when the processor 320 executes the program, the wireless communication method described in the embodiment of the present disclosure is implemented.
[0314] Bus 330 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, an Accelerated Graphics Port, a processor bus, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures can include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0315] Electronic device 300 typically includes a variety of computer-readable media. These media can be any available media that can be accessed by electronic device 300, including both volatile and nonvolatile media, removable and non-removable media.
[0316] Memory 310 may also include computer-system-readable media in the form of volatile memory, such as random access memory (RAM) 340 and / or cache memory 350. Electronic device 300 may further include other removable / non-removable, volatile / nonvolatile computer system storage media. By way of example only, storage system 360 can be used for reading from and writing to non-removable, nonvolatile magnetic media ( Figure 14 not shown and typically called a "hard disk drive"). Although Figure 14 not shown in FIG., a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from and writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) can be provided. In such cases, each drive can be connected to bus 330 by one or more data media interfaces. Memory 310 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of the embodiments of the present disclosure.
[0317] A program / utility 380 having a set (at least one) of program modules 370 can be stored, for example, in memory 310, and such program modules 370 include—but are not limited to—an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment. The program modules 370 generally carry out the functions and / or methods of the embodiments described herein.
[0318] The electronic device 300 can also communicate with one or more external devices 390 (such as a keyboard, a pointing device, a display 391, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 300, and / or communicate with any device that enables the electronic device 300 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface 392. Moreover, the electronic device 300 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 393. As Figure 14 shown, the network adapter 393 communicates with other modules of the electronic device 300 through a bus 330. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0319] The processor 320 executes various functional applications and data processing by running programs stored in the memory 310.
[0320] It should be noted that for the implementation process and technical principle of the electronic device in this embodiment, refer to the foregoing explanation of the wireless communication method in the embodiments of the present disclosure, and details are not described herein again.
[0321] The electronic device provided by the embodiments of the present disclosure can execute the wireless communication method as described above, establish a Bluetooth connection between a first device and a second device, send a first data packet to the second device based on the Bluetooth channel between the first device and the second device, and receive a second data packet sent by the second device, where the first data packet and the second data packet are both used for wireless communication between the first device and the second device, establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages, and perform wireless communication between the first device and the second device based on the first data packet and the second data packet. Thus, the first data packet and the second data packet can be transmitted through the Bluetooth channel between the two devices, that is, the sharing of the two data packets between the two devices can be realized through the Bluetooth channel, so that the interaction process of handshake messages can be omitted during the process of establishing the wireless connection, which helps to reduce the number of message interactions and shorten the message interaction duration, thereby shortening the wireless connection duration and improving the wireless connection efficiency.
[0322] To implement the above embodiments, the present disclosure also proposes a computer-readable storage medium, on which computer program instructions are stored, and when the program instructions are executed by a processor, the steps of the wireless communication method provided by the present disclosure are implemented.
[0323] Optionally, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0324] To implement the above embodiments, the present disclosure also provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor of an electronic device, the wireless communication method as described above is implemented.
[0325] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0326] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A wireless communication method, characterized in that, Including: Establish a Bluetooth connection between the first device and the second device; Based on the Bluetooth channel between the first device and the second device, send a first data packet to the second device and receive a second data packet sent by the second device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device; Establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include an interaction process of handshake messages; Based on the first data packet and the second data packet, perform wireless communication between the first device and the second device.
2. The method according to claim 1, characterized in that The performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: Generate a first secret key based on the first data packet and the second data packet; Based on the first secret key, perform wireless communication between the first device and the second device.
3. The method according to claim 2, wherein The first secret key is used for unicast communication between the first device and the second device.
4. The method according to claim 2, wherein The second data packet carries first Message Integrity Check (MIC) data and first original data, where the first MIC data is obtained based on a second secret key local to the second device and the first original data; Before establishing the wireless connection between the first device and the second device, it further includes: Obtain second MIC data based on the first secret key and the first original data; Based on the first MIC data and the second MIC data, perform message integrity check on the second data packet, and perform consistency check on the first secret key and the second secret key.
5. The method according to claim 2, wherein Before establishing the wireless connection between the first device and the second device, it further includes: Obtain third MIC data based on the first secret key and second original data; Add the third MIC data and the second original data to a third data packet, where the third MIC data is used for message integrity check on the third data packet and for consistency check on the first secret key and the second secret key local to the second device; Based on the Bluetooth channel between the first device and the second device, send the third data packet to the second device.
6. The method according to claim 5, characterized in that The second original data includes a third secret key, where the third secret key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
7. The method according to claim 2, characterized in that, Before establishing the wireless connection between the first device and the second device, it further includes: Based on the Bluetooth channel between the first device and the second device, receive a fourth data packet sent by the second device, where the fourth data packet carries third original data and fourth MIC data, the third original data includes first indication information for indicating the first device to establish a wireless connection between itself and the second device, and the fourth MIC data is obtained based on the second secret key local to the second terminal and the third original data; Obtain fifth MIC data based on the first secret key and the third original data; Perform message integrity verification on the fourth data packet based on the fourth MIC data and the fifth MIC data.
8. The method according to claim 1, wherein Before sending the first data packet to the second device, it further includes: Obtain the Internet Protocol (IP) address assigned to the second device; Add the IP address of the second device to the first data packet.
9. The method according to claim 8, wherein The second data packet carries the Media Access Control (MAC) address of the second device; Performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: Configure the Address Resolution Protocol (ARP) table of the first device based on the IP address of the first device and the MAC address of the first device; Configure the ARP table of the first device based on the IP address of the second device and the MAC address of the second device; Perform wireless communication between the first device and the second device based on the ARP table of the first device.
10. The method according to claim 8, wherein The first data packet also carries the IP address of the first device and the MAC address of the first device.
11. The method according to any one of claims 1-10, characterized in that Establishing a wireless connection between the first device and the second device includes: Create a wireless access point or create a group and make the first device the owner of the group; Receive an authentication request message sent by the second device; Send an authentication response message to the second device; Receive an association request message sent by the second device; Send an association response message to the second device.
12. A wireless communication method, characterized in that, It includes: Establish a Bluetooth connection between the first device and the second device; Receive the first data packet sent by the first device based on the Bluetooth channel between the first device and the second device, and send the second data packet to the first device, where both the first data packet and the second data packet are used for wireless communication between the first device and the second device; Establish a wireless connection between the first device and the second device, where the process of establishing the wireless connection does not include the interaction process of handshake messages; Perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
13. The method according to claim 12, wherein Performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: Generate a second key based on the first data packet and the second data packet; Perform wireless communication between the first device and the second device based on the second key.
14. The method according to claim 13, wherein The second key is used for unicast communication between the first device and the second device.
15. The method according to claim 13, wherein Before sending the second data packet to the first device, it further includes: Obtain the first MIC data based on the second key and the first original data in the second data packet; Add the first MIC data to the second data packet, where the first MIC data is used for message integrity verification of the second data packet and consistency verification of the first key and the second key on the first terminal locally.
16. The method according to claim 13, wherein Before establishing the wireless connection between the first device and the second device, it further includes: Receive a third data packet sent by the first device based on the Bluetooth channel between the first device and the second device, where the third data packet carries third MIC data and second original data, and the third MIC data is obtained based on a first key local to the first terminal and the second original data; Obtain sixth MIC data based on the second key and the second original data; Perform message integrity verification on the third data packet based on the third MIC data and the sixth MIC data, and perform consistency verification on the first key and the second key.
17. The method according to claim 16, wherein The second original data includes a third key, where the third key is used for multicast communication and / or broadcast communication between the first device and multiple second devices.
18. The method according to claim 13, characterized in that Before establishing the wireless connection between the first device and the second device, it further includes: Obtain fourth MIC data based on the second key and third original data, where the third original data includes first indication information for indicating the first device to establish a wireless connection between itself and the second device; Add the fourth MIC data and the third original data to a fourth data packet, where the fourth MIC data is used for message integrity verification of the fourth data packet; Send the fourth data packet to the first device based on the Bluetooth channel between the first device and the second device.
19. The method according to claim 12, wherein The first data packet carries an IP address assigned to the second device.
20. The method according to claim 19, wherein The second data packet carries the MAC address of the second device.
21. The method according to claim 19, wherein The first data packet further carries the IP address of the first device and the MAC address of the first device; The performing wireless communication between the first device and the second device based on the first data packet and the second data packet includes: Configure the ARP table of the second device based on the IP address of the first device and the MAC address of the first device; Configure the ARP table of the second device based on the IP address of the second device and the MAC address of the second device; Perform wireless communication between the first device and the second device based on the ARP table of the second device.
22. The method according to any one of claims 12-21, characterized in that, The second device is a client of a wireless access point created by the first device, or the second device is a client of a group created by the first device; The establishing the wireless connection between the first device and the second device includes: Send an authentication request message to the first device; Receive an authentication response message sent by the first device; Send an association request message to the first device; Receive an association response message sent by the first device.
23. A wireless communication device, characterized in that, It includes: A first connection module configured to establish a Bluetooth connection between a first device and a second device; A first communication module, configured to send a first data packet to the second device and receive a second data packet sent by the second device based on a Bluetooth channel between the first device and the second device, wherein both the first data packet and the second data packet are used for wireless communication between the first device and the second device; A second connection module, configured to establish a wireless connection between the first device and the second device, wherein the process of establishing the wireless connection does not include an interaction process of handshake messages; A second communication module, configured to perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
24. A wireless communication device, characterized in that, Comprising: A first connection module, configured to establish a Bluetooth connection between a first device and a second device; A first communication module, configured to receive a first data packet sent by the first device and send a second data packet to the first device based on a Bluetooth channel between the first device and the second device, wherein both the first data packet and the second data packet are used for wireless communication between the first device and the second device; A second connection module, configured to establish a wireless connection between the first device and the second device, wherein the process of establishing the wireless connection does not include an interaction process of handshake messages; A second communication module, configured to perform wireless communication between the first device and the second device based on the first data packet and the second data packet.
25. An electronic device, characterized in that, Comprising: A processor; A memory for storing processor-executable instructions; Wherein, the processor is configured to: Implement the steps of the method according to any one of claims 1-22.
26. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, the steps of the method according to any one of claims 1-22 are implemented.