Connection Establishment Method and Electronic Device
By obtaining the Wi-Fi interface MAC address of the second electronic device, and using the Wi-Fi parameter negotiation capability to directly establish a Wi-Fi direct connection channel, solving the problem of chain building delay caused by poor Bluetooth connection stability, and improving the data interaction performance and user experience between electronic devices.
Patent Information
- Application Number
- CN202011620420.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2040-12-31
AI Technical Summary
In the prior art, due to poor Bluetooth connection performance and stability during the connection establishment process between electronic devices, the chain building delay is large, which affects the user experience.
By obtaining the Wi-Fi interface MAC address of the second electronic device, the Wi-Fi parameter negotiation capability is used to directly establish a Wi-Fi direct connection channel, avoiding the intermediate steps of Bluetooth connection and improving interactive performance.
Reduces connection establishment delay, improves user experience, and improves data interaction performance between electronic devices.
Smart Images

Figure CN114697929B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of embodiments and terminals, and particularly to a connection establishment method and an electronic device. Background Art
[0002] With the development of electronic devices, the collaboration and interaction capabilities between electronic devices have also been improved. For example, a mobile phone can send display content to a large-screen device for display through wireless screen mirroring technology to improve the display effect. Another example is that audio and video files can be shared between a mobile phone and a laptop through the near field communication (NFC) function.
[0003] However, in the process of implementing the above wireless screen mirroring technology and file sharing function, it is necessary to first establish a Bluetooth connection, and then establish a wireless fidelity (Wi-Fi) direct connection between two electronic devices based on the Bluetooth connection for data interaction. Due to the poor performance and stability of the Bluetooth connection, the link establishment delay between electronic devices is relatively large, affecting the user experience. Summary of the Invention
[0004] The connection establishment method and electronic device provided by the embodiments of this application can directly use the Wi-Fi network to establish a link between electronic devices, improve the link establishment performance, and enhance the user experience.
[0005] To achieve the above object, the embodiments of this application adopt the following technical solutions:
[0006] In a first aspect, the embodiments of this application provide a connection establishment method, which is applied to a first electronic device. The method may include: obtaining the media access control (MAC) address of the Wi-Fi interface of a second electronic device in the near field communication (NFC) tag of the second electronic device. Using the MAC address of the Wi-Fi interface, querying whether the second electronic device has the Wi-Fi parameter negotiation ability. If the second electronic device has the Wi-Fi parameter negotiation ability, negotiating Wi-Fi parameters with the second electronic device to obtain target radio frequency parameters. Establishing a Wi-Fi direct connection channel with the second electronic device using the target radio frequency parameters.
[0007] In some embodiments, the Wi-Fi parameter negotiation ability may include, for example, the Wi-Fi hotspot parameter negotiation ability. An electronic device with the Wi-Fi hotspot parameter negotiation ability can perform wireless screen mirroring and / or cross-device file sharing.
[0008] In some embodiments, after the first electronic device and the second electronic device complete Wi-Fi parameter negotiation, a Wi-Fi direct connection channel is established using the target radio frequency parameters. Among them, the Wi-Fi direct connection channel includes, for example, a Wi-Fi peer-to-peer connection channel or a Wi-Fi layer 2 network connection channel.
[0009] In some embodiments, the NFC tag contains NFC parameter information. By extending the NFC tag, the MAC address of the Wi-Fi interface is directly indicated in the NFC parameter information.
[0010] In this way, based on the NFC function, the first electronic device can directly obtain the MAC address of the Wi-Fi interface of the second electronic device in the NFC tag of the second electronic device. The first electronic device uses the MAC address of this Wi-Fi interface to negotiate Wi-Fi parameters with the second electronic device, establish a Wi-Fi direct connection channel, and perform data transmission. Compared with the connection method in the prior art, it is not necessary to first establish a Bluetooth connection and then establish a Wi-Fi direct connection channel based on the Bluetooth connection. This avoids the problem of a large connection establishment delay caused by the poor performance and stability of the Bluetooth connection, and improves the interaction performance.
[0011] In a possible implementation, before obtaining the media access control (MAC) address of the wireless fidelity (Wi-Fi) interface of the second electronic device in the near field communication (NFC) tag of the second electronic device, the method further includes: sending a registration request to an AP device, where the registration request is used to request registration of the second capability information of the first electronic device, and the second capability information includes Wi-Fi parameter negotiation capability.
[0012] In a possible implementation, the first electronic device and the second electronic device access the Wi-Fi network provided by the same wireless access point (AP) device. Using the MAC address of the Wi-Fi interface, query whether the second electronic device has Wi-Fi parameter negotiation capability, including: receiving the device list information sent by the AP device, where the device list information contains the capability information of the electronic devices accessing the AP device. In the device list information, query the first capability information of the second electronic device corresponding to the MAC address of the Wi-Fi interface, and determine whether the Wi-Fi parameter negotiation capability is included in the first capability information.
[0013] In a possible implementation, the first electronic device and the second electronic device are connected to the Wi-Fi network provided by the same wireless access point (AP) device, and use the MAC address of the Wi-Fi interface to query whether the second electronic device has the Wi-Fi parameter negotiation capability, including: sending a capability query request to the AP device, where the capability query request carries the MAC address of the Wi-Fi interface, and the capability query request is used to request to query whether the second electronic device has the Wi-Fi parameter negotiation capability. Receiving the capability query response sent by the AP device, where the capability query response is used to indicate whether the second electronic device has the Wi-Fi parameter negotiation capability.
[0014] That is to say, after the first electronic device and the second electronic device are connected to the network provided by the AP device, they will register the capabilities they support with the AP device. Based on the local security policy, the AP device broadcasts the device information registered by the connected electronic devices during the registration process and synchronizes it to each electronic device connected within the local area network. Then, after the first electronic device listens to the broadcast, it can save the device list information of the devices connected to the AP device, and based on this device list information, it can discover the neighboring devices within the local area network. Thus, after receiving the MAC address of the Wi-Fi interface, the first electronic device can discover the second electronic device that supports the Wi-Fi parameter negotiation capability among the neighboring devices. Alternatively, if the first electronic device does not find the electronic device corresponding to the MAC address of the Wi-Fi interface in the local device list, it can send a query request to the AP device, and the AP device will perform the query and receive the query result sent by the AP device, and then obtain the capability information of the second electronic device.
[0015] In this way, the first electronic device determines whether the second electronic device has the Wi-Fi parameter negotiation capability through the above method, so as to determine whether the second electronic device supports wireless screen mirroring and / or cross-device file sharing. After determining that the second electronic device supports the Wi-Fi parameter negotiation capability, it requests to perform Wi-Fi parameter negotiation to establish a Wi-Fi communication channel.
[0016] In a possible implementation, if the second electronic device has the Wi-Fi parameter negotiation capability, then perform Wi-Fi parameter negotiation with the second electronic device to obtain the target radio frequency parameters, including: sending a Wi-Fi parameter negotiation request to the AP device, where the Wi-Fi parameter negotiation request carries the identifier of the second electronic device and the first radio frequency parameters; the first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device, and the idle channels among the channels supported by the first electronic device. Receiving the Wi-Fi parameter negotiation response sent by the second electronic device forwarded by the AP device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
[0017] In some embodiments, when the first electronic device determines to establish a connection with the second electronic device, it is necessary to negotiate Wi-Fi channel connection parameters to establish a Wi-Fi direct connection channel. The first electronic device needs to send the radio frequency parameters that it supports and are available to the second electronic device. However, to ensure network security, the AP device sets up layer 2 isolation and does not allow direct communication between the first electronic device and the second electronic device. Instead, the AP device forwards the signals between the first electronic device and the second electronic device, thereby implementing the permission and traffic auditing of the electronic devices accessing the AP device network. Therefore, the first electronic device sends its available radio frequency parameters to the AP device, and the AP device forwards the received radio frequency parameters to the corresponding target device (i.e., the second electronic device) based on the target device identifier carried in the Wi-Fi parameter negotiation request.
[0018] In some embodiments, after receiving the first radio frequency parameters sent by the first electronic device, the second electronic device selects the best radio frequency band and channel as the target radio frequency parameters according to the first radio frequency parameters and the radio frequency parameters that it supports and are currently available. For example, the second electronic device selects the radio frequency band and channel with the best expected signal quality from the radio frequency bands and channels that both it and the first electronic device support and are available. Another example is that the second electronic device selects the radio frequency band and channel with the minimum latency from the radio frequency bands and channels that both it and the first electronic device support and are available.
[0019] In a possible implementation, if the second electronic device has the Wi-Fi parameter negotiation ability, it negotiates Wi-Fi parameters with the second electronic device to obtain the target radio frequency parameters, including: sending a Wi-Fi parameter negotiation request to the second electronic device, where the Wi-Fi parameter negotiation request carries the first radio frequency parameters; the first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device, and the idle channels among the channels supported by the first electronic device. Receiving the Wi-Fi parameter negotiation response sent by the second electronic device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
[0020] In some implementations, the AP device does not set up layer 2 isolation within the local area network, and the first electronic device and the second electronic device can directly communicate with each other. Then, during the process of negotiating Wi-Fi parameters between the first electronic device and the second electronic device, it is not necessary to use the AP device to forward the radio frequency parameters for negotiation.
[0021] In a possible implementation, a Wi-Fi direct connection channel is established with a second electronic device using target radio frequency parameters, including: sending a connection establishment request on a target radio frequency band and a target channel, where the connection establishment request is used to request the establishment of a Wi-Fi direct connection channel with the second electronic device. Receiving a connection establishment response sent by the second electronic device to complete the establishment of the Wi-Fi direct connection channel.
[0022] In some embodiments, after determining the target radio frequency parameters, the second electronic device creates a hotspot, uses itself as a soft access point (soft AP) device, and configures the radio frequency parameters of the radio frequency interface so that the subsequent first electronic device can access the radio frequency interface to transmit data. Further, the second electronic device, as a soft AP device, sends beacon frames at a preset period based on the target radio frequency parameters.
[0023] Correspondingly, after receiving the Wi-Fi parameter negotiation response, the first electronic device determines that the Wi-Fi parameter negotiation is successful. Based on the radio frequency band and channel specified in the negotiated target radio frequency parameters, it sends a probe request management frame based on the 802.11 protocol to search for the beacon frames sent by the second electronic device. After detecting the second electronic device, it automatically triggers the authentication and association process to create a Wi-Fi direct connection channel with the second electronic device, and then starts data transmission.
[0024] In a second aspect, an embodiment of the present application provides a connection establishment method applied to a first electronic device. The method may include: in response to a first operation, sending a device query request to a wireless access point AP device, where the device query request is used to request a query for a device with Wi-Fi parameter negotiation capabilities. Receiving a device query response sent by the AP device, where the device query response carries the MAC address of the wireless fidelity (Wi-Fi) interface of the second electronic device, and the second electronic device has Wi-Fi parameter negotiation capabilities. Using the MAC address of the Wi-Fi interface to perform Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters. Using the target radio frequency parameters to establish a Wi-Fi direct connection channel with the second electronic device.
[0025] In a possible implementation, before sending the device query request to the wireless access point AP device in response to the first operation, the method further includes: sending a registration request to the AP device, where the registration request is used to request the registration of the second capability information of the first electronic device, and the second capability information includes Wi-Fi parameter negotiation capabilities.
[0026] In some implementations, the first electronic device and the second electronic device are connected to the Wi-Fi network provided by the same AP device. After connecting to the AP device, they directly register the capabilities they support and interface information with the AP device, such as Bluetooth interface information, Wi-Fi interface information, etc. Subsequently, the first electronic device can directly query the AP device for devices with Wi-Fi parameter negotiation capabilities and the MAC address of the Wi-Fi interface of such devices.
[0027] Thus, without using NFC parameter information, the first electronic device can also obtain the MAC address of the Wi-Fi interface of the second electronic device and directly establish a Wi-Fi direct connection channel with the second electronic device based on the MAC address of the Wi-Fi interface, improving the link establishment performance and stability and enhancing the user experience.
[0028] In a possible implementation, use the MAC address of the Wi-Fi interface to negotiate Wi-Fi parameters with the second electronic device to obtain target radio frequency parameters, including: sending a Wi-Fi parameter negotiation request to the AP device, where the Wi-Fi parameter negotiation request carries the identifier of the second electronic device and the first radio frequency parameters; the first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device and the idle channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response forwarded by the AP device from the second electronic device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
[0029] In a possible implementation, use the MAC address of the Wi-Fi interface to negotiate Wi-Fi parameters with the second electronic device to obtain target radio frequency parameters, including: sending a Wi-Fi parameter negotiation request to the second electronic device, where the Wi-Fi parameter negotiation request carries the first radio frequency parameters; the first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device and the idle channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response sent by the second electronic device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
[0030] In a possible implementation, use the target radio frequency parameters to establish a Wi-Fi direct connection channel with the second electronic device, including: sending a connection establishment request on the target radio frequency band and target channel, where the connection establishment request is used to request to establish a Wi-Fi direct connection channel with the second electronic device. Receive the connection establishment response sent by the second electronic device to complete the establishment of the Wi-Fi direct connection channel.
[0031] In addition, for the technical effects of the connection establishment method in the second aspect, reference may be made to the technical effects of the connection establishment method in the first aspect, which will not be elaborated here.
[0032] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory; the memory is coupled to the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor reads the computer instructions from the memory, the electronic device is caused to perform the following operations: obtaining the media access control (MAC) address of the Wi-Fi interface of the second electronic device in the near field communication (NFC) tag of the second electronic device. Using the MAC address of the Wi-Fi interface, querying whether the second electronic device has Wi-Fi parameter negotiation capabilities. If the second electronic device has Wi-Fi parameter negotiation capabilities, performing Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters. Establishing a Wi-Fi direct connection channel with the second electronic device using the target radio frequency parameters.
[0033] In a possible implementation manner, when the first electronic device and the second electronic device are connected to the Wi-Fi network provided by the same wireless access point (AP) device, querying whether the second electronic device has Wi-Fi parameter negotiation capabilities using the MAC address of the Wi-Fi interface includes: receiving the device list information sent by the AP device, where the device list information contains the capability information of the electronic devices connected to the AP device. In the device list information, querying the first capability information of the second electronic device corresponding to the MAC address of the Wi-Fi interface, and determining whether the first capability information contains Wi-Fi parameter negotiation capabilities.
[0034] In a possible implementation manner, when the first electronic device and the second electronic device are connected to the Wi-Fi network provided by the same wireless access point (AP) device, querying whether the second electronic device has Wi-Fi parameter negotiation capabilities using the MAC address of the Wi-Fi interface includes: sending a capability query request to the AP device, where the capability query request carries the MAC address of the Wi-Fi interface, and the capability query request is used to request to query whether the second electronic device has Wi-Fi parameter negotiation capabilities. Receiving the capability query response sent by the AP device, where the capability query response is used to indicate whether the second electronic device has Wi-Fi parameter negotiation capabilities.
[0035] In a possible implementation manner, when the processor reads the computer instructions from the memory, the electronic device is further caused to perform the following operation: sending a registration request to the AP device, where the registration request is used to request to register the second capability information of the first electronic device, and the second capability information includes Wi-Fi parameter negotiation capabilities.
[0036] In a possible implementation, if the second electronic device has the Wi-Fi parameter negotiation capability, perform Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters, including: sending a Wi-Fi parameter negotiation request to the AP device, where the Wi-Fi parameter negotiation request carries the identifier of the second electronic device and the first radio frequency parameters; the first radio frequency parameters include the free radio frequency bands among the radio frequency bands supported by the first electronic device, and the free channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response sent by the second electronic device and forwarded by the AP device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the free radio frequency bands and the target channel selected from the free channels.
[0037] In a possible implementation, if the second electronic device has the Wi-Fi parameter negotiation capability, perform Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters, including: sending a Wi-Fi parameter negotiation request to the second electronic device, where the Wi-Fi parameter negotiation request carries the first radio frequency parameters; the first radio frequency parameters include the free radio frequency bands among the radio frequency bands supported by the first electronic device, and the free channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response sent by the second electronic device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the free radio frequency bands and the target channel selected from the free channels.
[0038] In a possible implementation, establish a Wi-Fi direct connection channel with the second electronic device using the target radio frequency parameters, including: sending a connection establishment request on the target radio frequency band and the target channel, where the connection establishment request is used to request to establish a Wi-Fi direct connection channel with the second electronic device. Receive the connection establishment response sent by the second electronic device to complete the establishment of the Wi-Fi direct connection channel.
[0039] In addition, the technical effects of the electronic device in the third aspect can refer to the technical effects of the connection establishment method in the first aspect, which will not be elaborated here.
[0040] Fourth aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory; the memory is coupled to the processor, and the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the electronic device is caused to perform the following operations: in response to a first operation, send a device query request to a wireless access point AP device, the device query request is used to request to query devices with Wi-Fi parameter negotiation capabilities. Receive a device query response sent by the AP device, the device query response carries the MAC address of the Wi-Fi interface of a second electronic device, and the second electronic device has Wi-Fi parameter negotiation capabilities. Use the MAC address of the Wi-Fi interface to perform Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters. Use the target radio frequency parameters to establish a Wi-Fi direct connection channel with the second electronic device.
[0041] In a possible implementation manner, when the processor reads the computer instructions from the memory, the electronic device is further caused to perform the following operations: send a registration request to the AP device, the registration request is used to request to register the second capability information of the first electronic device, and the second capability information includes Wi-Fi parameter negotiation capabilities.
[0042] In a possible implementation manner, using the MAC address of the Wi-Fi interface to perform Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters; includes: sending a Wi-Fi parameter negotiation request to the AP device, the Wi-Fi parameter negotiation request carries the identifier of the second electronic device and the first radio frequency parameters; the first radio frequency parameters include the free radio frequency bands in the radio frequency bands supported by the first electronic device, and the free channels in the channels supported by the first electronic device. Receive a Wi-Fi parameter negotiation response forwarded by the AP device from the second electronic device, the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the free radio frequency bands and the target channel selected from the free channels.
[0043] In a possible implementation manner, using the MAC address of the Wi-Fi interface to perform Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters; includes: sending a Wi-Fi parameter negotiation request to the second electronic device, the Wi-Fi parameter negotiation request carries the first radio frequency parameters; the first radio frequency parameters include the free radio frequency bands in the radio frequency bands supported by the first electronic device, and the free channels in the channels supported by the first electronic device. Receive a Wi-Fi parameter negotiation response sent by the second electronic device, the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the free radio frequency bands and the target channel selected from the free channels.
[0044] In a possible implementation, a Wi-Fi direct connection channel is established with a second electronic device by using target radio frequency parameters, including: sending a connection establishment request on a target radio frequency band and a target channel, where the connection establishment request is used to request to establish a Wi-Fi direct connection channel with the second electronic device. Receiving a connection establishment response sent by the second electronic device to complete the establishment of the Wi-Fi direct connection channel.
[0045] In addition, the technical effects of the electronic device in the fourth aspect can refer to the technical effects of the connection establishment method in the second aspect, which will not be elaborated here.
[0046] In a fifth aspect, an embodiment of the present application provides an electronic device, which has a function of implementing the connection establishment method described in the first aspect and any one of its possible implementations above; or, the electronic device has a function of implementing the connection establishment method described in the second aspect and any one of its possible implementations above. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0047] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including computer instructions, which when running on an electronic device, cause the electronic device to execute the connection establishment method described in any one of the first aspect and any one of its possible implementations above, or cause the electronic device to execute the connection establishment method described in any one of the second aspect and any one of its possible implementations above.
[0048] In a seventh aspect, an embodiment of the present application provides a computer program product, which when running on an electronic device, causes the electronic device to execute the connection establishment method described in any one of the first aspect and any one of its possible implementations above, or causes the electronic device to execute the connection establishment method described in any one of the second aspect and any one of its possible implementations above.
[0049] In an eighth aspect, an embodiment of the present application provides a circuit system, which includes a processing circuit configured to execute the connection establishment method described in the first aspect and any one of its possible implementations above; or configured to execute the connection establishment method described in the second aspect and any one of its possible implementations above.
[0050] In a ninth aspect, an embodiment of the present application provides a chip system, including at least one processor and at least one interface circuit. The at least one interface circuit is configured to perform transceiver functions and send instructions to the at least one processor. When the at least one processor executes the instructions, the at least one processor executes the connection establishment method described in the first aspect and any possible implementation manner thereof above; or, the at least one processor executes the connection establishment method described in the second aspect and any possible implementation manner thereof above. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of a communication system provided by an embodiment of the present application;
[0052] Figure 2 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0053] Figure 3 It is a schematic flow diagram of a data transmission method provided by an embodiment of the present application Figure 1 ;
[0054] Figure 4 It is a schematic flow diagram of a data transmission method provided by an embodiment of the present application Figure 2 ;
[0055] Figure 5 It is a schematic flow diagram of a data transmission method provided by an embodiment of the present application Figure 3 ;
[0056] Figure 6 It is a schematic diagram of the handshake interaction process of a Hilink session provided by an embodiment of the present application;
[0057] Figure 7 It is a schematic flow diagram of a connection establishment method provided by an embodiment of the present application Figure 1 ;
[0058] Figure 8 It is a schematic diagram of a message format provided by an embodiment of the present application;
[0059] Figure 9 It is a schematic diagram of an interface provided by an embodiment of the present application Figure 1 ;
[0060] Figure 10 It is a schematic flow diagram of a connection establishment method provided by an embodiment of the present application Figure 2 ;
[0061] Figure 11 It is a schematic flow diagram of a connection establishment method provided by an embodiment of the present application Figure 3 ;
[0062] Figure 12 It is a schematic diagram of an interface provided by an embodiment of the present application Figure 2 ;
[0063] Figure 13 This is a schematic structural diagram of the connection establishment device provided by the embodiment of the present application. Detailed implementation manners
[0064] The connection establishment method and electronic device provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0065] In the description of the embodiments of the present application, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes other steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0066] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0067] In the description of the embodiments of the present application, unless otherwise specified, "a plurality of" means two or more. The "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone.
[0068] First, for the convenience of understanding, the relevant terms and concepts that may be involved in the embodiments of the present application will be introduced below.
[0069] (1) Huawei Hilink
[0070] Huawei Hilink is an open ecosystem for smart hardware. An electronic device can join the Huawei Hilink ecosystem through hardware access or cloud access, etc., to achieve the interconnection and interoperability of electronic devices.
[0071] In some embodiments, the Hilink ecosystem can also be described as a smart connection network. The smart connection network includes a wireless access point (AP) device for providing a wireless network, and at least one electronic device accessing the AP device. The AP device is, for example Router. The electronic device can also be described as an intelligent connected device. The electronic device can access the AP device based on the protocols related to the Hilink ecosystem. Among them, the protocols related to Hilink include, for example, the Constrained Application Protocol (CoAP), the Universal Plug and Play (UPnP) protocol, etc.
[0072] Furthermore, the protocols related to the Hilink ecosystem can be used for intelligent discovery and network configuration processes. For example, in the Hlink network, the Hilink router can broadcast the functions supported by the connected electronic devices based on the protocols related to the Hilink ecosystem, so that other electronic devices can discover the electronic devices with the required functions. For example, if Electronic Device 1 needs to perform wireless screen mirroring, it receives the broadcast signal and discovers that Electronic Device 2 supports the wireless screen mirroring function. Then it can request to establish a connection with Electronic Device 2 to achieve wireless screen mirroring. In addition, the Hilink router can also configure the network of the connected electronic devices, and the router that supports network configuration can be used as an intelligent gateway device in the intelligent connected network.
[0073] It should be noted that in this embodiment of the application, the connection establishment method provided in this embodiment of the application is described by taking the Hilink ecosystem as an example. This connection establishment method can also be applied to other ecological environments that support intelligent connection, such as the Xiaomi ecological chain, etc.
[0074] (2) Near Field Communication (NFC) function
[0075] The NFC function is based on short-range wireless communication technology and can achieve point-to-point communication between electronic devices. For example, link two devices with NFC function to achieve point-to-point data transmission. Furthermore, the NFC function can also assist in quickly establishing a Bluetooth (BT) connection, exchanging business cards, and data communication between electronic devices.
[0076] In some embodiments, an electronic device with NFC function can also store some of its own information in the NFC module, and through the "touch and touch" function, realize the interaction of the NFC module information. For example, pre-place the merchant information in the NFC module, and the electronic device can achieve quick payment when it approaches the NFC sensing area. Another example is that two electronic devices touch and touch to obtain the NFC tags in each other's NFC modules. If the NFC tag contains parameter information such as a pre-set Bluetooth socket address, the electronic device can then establish Bluetooth communication based on the Bluetooth socket address.
[0077] (3)Wi-Fi Peer to Peer (P2P)
[0078] Wi-Fi P2P is proposed by the Wi-Fi Alliance and defines how two Wi-Fi electronic devices connect and communicate without a router. Specifically, electronic devices supporting Wi-Fi P2P form a peer-to-peer working group (P2P group), including a peer-to-peer working group owner (P2P group owner) and a peer-to-peer client (P2P client). Among them, the electronic device serving as the P2P group owner needs to have the functions of a traditional router, such as being able to control the communication of other electronic devices (P2P clients) in the Wi-Fi P2P working group as a soft AP (soft AP) device. The electronic device serving as the P2P working group client (group client, GC) needs to connect to the electronic device serving as the P2P group owner, thereby forming a communicable working group.
[0079] Exemplarily, the process of a P2P electronic device discovering and constructing a working group includes a scan phase and a find phase. Specifically, in the scan phase, the electronic device sends a probe request frame. After that, the electronic device enters the find phase. In the find phase, the electronic device switches between the search state of sending a probe request frame and the listen state of listening for a probe request frame and sending a probe response frame until it scans nearby P2P devices and constructs a P2P working group. In the process of constructing a P2P working group, it also includes the process of negotiating and determining the electronic device serving as the P2P group owner and the process of exchanging security configuration information between electronic devices.
[0080] Figure 1 Schematic diagram of a communication system to which a connection establishment method provided by an embodiment of the present application is applied. As Figure 1 shown, the communication system includes a first electronic device 100, a second electronic device 200, and a wireless access point (access point, AP) device 300. Among them, the first electronic device 100 and the second electronic device 200 are connected to the wireless network provided by the AP device 300.
[0081] Optionally, the first electronic device 100 may be, for example, a personal computer (PC), a mobile phone, a tablet computer (Pad), a laptop computer, a desktop computer, a laptop computer, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a wearable device, a vehicle-mounted device, or other terminal devices. The embodiments of the present application do not impose any special restrictions on the specific form of the first electronic device 100.
[0082] Optionally, the second electronic device 200 may be, for example, a PC, a mobile phone, a tablet computer, a laptop computer, a desktop computer, a laptop computer, a VR terminal device, an AR terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a wearable device, a vehicle-mounted device, or other terminal devices. The embodiments of the present application do not impose any special restrictions on the specific form of the second electronic device 200.
[0083] In some embodiments, the first electronic device 100 and the second electronic device 200 can use wireless communication technology to achieve wireless screen mirroring and file sharing. Among them, it is assumed that the first electronic device 100 is the source device and the second electronic device 200 is the target device. The first electronic device 100 uses the second electronic device 200 for wireless screen mirroring. Alternatively, the first electronic device 100 sends various types and / or formats of files to the second electronic device 200 for sharing, such as the first electronic device 100 sending a video file to the second electronic device 200 for sharing.
[0084] Optionally, the AP device 300 can be, for example, a wireless router for providing a Wi-Fi network. The first electronic device 100 and the second electronic device 200 are connected to the Wi-Fi network provided by the AP device 300, and the AP device 300 can forward the signals sent by the first electronic device 100 and the second electronic device 200. In some embodiments, the AP device 300 is, for example, a Hilink router, and the first electronic device 100 and the second electronic device 200 are intelligent devices connected to the Hilink router. Herein, the connection establishment method is described by taking the Hilink ecosystem-related protocol that supports intelligent discovery and network configuration as an example. It can be understood that the connection establishment method provided in the embodiments of the present application can also be applied to other standard protocols or private protocols that support intelligent discovery and network configuration.
[0085] Optionally, the first electronic device 100 and the second electronic device 200 in the embodiments of the present application can be implemented by different devices. For example, the first electronic device 100 and the second electronic device in the embodiments of the present application can be implemented by the Figure 2 electronic devices therein.
[0086] Figure 2 The structural schematic diagram of the electronic device is shown. The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0087] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware. For example, if the electronic device is the second electronic device 200 and the second electronic device 200 is a PC, the structure of the second device 200 may not include a mobile communication module 150, a motor 191, a SIM card interface 195, etc.
[0088] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0089] The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of instruction fetching and execution.
[0090] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may store the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0091] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0092] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are only illustrative descriptions and do not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection manners in the above embodiments, or a combination of multiple interface connection manners.
[0093] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
[0094] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives the inputs of the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, etc.
[0095] The wireless communication function of the electronic device can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, etc.
[0096] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0097] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be provided in the same device.
[0098] In some embodiments, the electronic device realizes point-to-point data transmission through NFC. For example, when the NFC function of the electronic device 1 is turned on and it approaches the NFC sensing area of the electronic device 2, files can be quickly shared to the electronic device 2.
[0099] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0100] In some embodiments, antenna 1 of the electronic device is coupled to the mobile communication module 150, and antenna 2 is coupled to the wireless communication module 160, enabling the electronic device to communicate with the network and other devices through wireless communication technologies. The wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).
[0101] The electronic device realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0102] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1.
[0103] In some embodiments, if the display screen of the electronic device is small, the wireless communication module 160 can be used to connect to other large-screen electronic devices, and based on the wireless screen mirroring technology, the display content is sent to the large-screen electronic device for display.
[0104] The electronic device can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0105] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image through algorithms. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0106] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in standard formats such as RGB and YUV. In some embodiments, the electronic device may include one or N cameras 193, where N is a positive integer greater than 1.
[0107] The external memory interface 120 can be used to connect to an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0108] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store the operating system and application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store data created during the use of the electronic device (such as audio data, phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor.
[0109] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or some functional modules of the audio module 170 may be provided in the processor 110. Among them, the audio module may include a speaker, a receiver, a microphone, and a headphone interface. In some embodiments, the electronic device can implement audio functions such as music playback and recording through the audio module 170, the speaker, the receiver, the microphone, the headphone interface, and the application processor.
[0110] The sensor module 180 may include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc. In some embodiments, the pressure sensor may be disposed on the display screen 194. When a touch operation acts on the display screen 194, the electronic device may calculate the position of the touch according to the detection signal of the pressure sensor.
[0111] The keys 190 include a power-on key, volume keys, etc. The keys 190 may be mechanical keys or touch keys. The electronic device may receive key inputs and generate key signal inputs related to the user settings and function controls of the electronic device.
[0112] The motor 191 may generate a vibration prompt. The motor 191 may be used for incoming call vibration prompts and may also be used for touch vibration feedback. For example, touch operations applied to different applications (such as taking pictures, playing audio, etc.) may correspond to different vibration feedback effects.
[0113] The indicator 192 may be an indicator light and may be used to indicate the charging state, the change in battery level, and may also be used to indicate messages, missed calls, notifications, etc.
[0114] The SIM card interface 195 is used to connect the SIM card. The SIM card may be in contact with and separated from the electronic device by being inserted into or removed from the SIM card interface 195. The electronic device may support one or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device interacts with the network through the SIM card to implement functions such as calls and data communication.
[0115] Hereinafter, the first electronic device 100 will be a mobile phone with the Figure 2 shown structure, the second electronic device 200 will be a PC with the Figure 2 shown structure, and the AP device 300 will be a router that provides a Wi-Fi network as an example to elaborate on the connection establishment method provided by the embodiments of the present application.
[0116] In some embodiments, data transmission can be achieved between the mobile phone and the PC using wireless communication technologies, such as data transmission in scenarios such as wireless screen mirroring scenarios, audio file sharing scenarios, video file sharing scenarios, etc. For example, the mobile phone and the PC can communicate through Miracast, the Digital Living Network Alliance (DLNA), (Wireless communication technologies developed by Apple Inc.) and other standard protocols or proprietary protocols to achieve multimedia (such as audio, video, pictures, etc.) content transmission, display and other operations on different multimedia terminals through a wireless local area network connection.
[0117] Exemplarily, as Figure 3 shown, the current method for wireless data transmission between a mobile phone and a PC includes S301 - S304.
[0118] S301. The mobile phone discovers the PC.
[0119] Exemplarily, the mobile phone and the PC generally support one or more of the NFC touch - to - discover function, the Bluetooth proximity - to - discover function, and the proximity - to - discover function based on the 802.11 protocol. For example, the mobile phone and the PC turn on the wireless local area network (WLAN) function and the Bluetooth function, and the PC starts an application for computer management, such as a computer manager. After the mobile phone touches the NFC sensing area on the PC, the mobile phone and the PC discover each other's devices, and a Wi - Fi connection is established between the mobile phone and the PC through the following steps S302 - S304. Or, after the mobile phone touches the NFC sensing area on the PC, the mobile phone and the PC discover each other's devices, and the mobile phone pops up a window to prompt the user whether to establish a connection with the PC and / or the PC pops up a window to prompt the user whether to establish a connection with the mobile phone. After detecting the user's click - to - confirm operation, a Wi - Fi connection is established between the mobile phone and the PC through the following steps S302 - S304.
[0120] S302. The mobile phone and the PC establish a Bluetooth connection.
[0121] Specifically, during the process of establishing a Wi - Fi connection between the mobile phone and the PC, a Bluetooth connection needs to be established first, so that a Wi - Fi connection can be established based on the Bluetooth connection channel subsequently.
[0122] Exemplarily, as Figure 4 shown, step S302 can be specifically implemented as steps S3021 - S3023.
[0123] S3021. Establish a Bluetooth socket connection between the PC and the mobile phone.
[0124] In some embodiments, in the above step S301, after the mobile phone and the PC touch each other, they can obtain the media access control (MAC) address of the Bluetooth module in the NFC tag of the other party, so as to determine the peer device for establishing the Bluetooth communication connection required for creating a Bluetooth socket. After that, a Bluetooth socket connection is created, triggering the Bluetooth modules of the mobile phone and the PC to establish a Bluetooth communication connection. Among them, during the process of establishing the Bluetooth communication connection, configuration information is exchanged based on protocols such as the Logical Link Control and Adaptation Protocol (L2CAP) and the RFCOMM protocol to implement the establishment of a protocol communication link.
[0125] S3022. The PC and the mobile phone perform Bluetooth pairing.
[0126] S3023. The PC performs Bluetooth authentication processing on the mobile phone.
[0127] In some embodiments, after the mobile phone and the PC create a socket connection, they cannot directly perform data interaction. They need to execute the pairing and authentication processes, such as allowing pairing and configuring keys, to make the other party a trusted device. After that, they can transfer data to each other. Among them, key configuration is an optional step. If password verification is not required, key configuration does not have to be performed.
[0128] S303. The mobile phone and the PC negotiate Wi-Fi communication parameters based on the Bluetooth connection channel.
[0129] Exemplarily, after the mobile phone and the PC negotiate and establish a Bluetooth connection through step S302, they can provide a Bluetooth connection session channel for layer 2 network communication for Wi-Fi to use for socket connection.
[0130] Such as Figure 5 shown, step S303 can be specifically implemented as steps S3031 - S3033.
[0131] S3031. Establish a Wi-Fi socket connection between the mobile phone and the PC.
[0132] In some embodiments, after the mobile phone and the PC establish a Bluetooth connection, they can negotiate or obtain the hotspot parameter information of the Wi-Fi of the peer and then perform a Wi-Fi socket connection.
[0133] S3032. The PC performs Wi-Fi authentication processing on the mobile phone.
[0134] In some embodiments, after the mobile phone and the PC establish a Wi-Fi socket connection, an authentication process also needs to be executed to set the peer device as a trusted device and confirm the security of the current Wi-Fi socket session.
[0135] S3033. The mobile phone and the PC negotiate Wi-Fi parameters.
[0136] In some embodiments, after the mobile phone and the PC establish a secure socket session based on a Bluetooth session, they start negotiating the parameters of the Wi-Fi P2P group. Specifically, the mobile phone sends the list information of the radio frequency bands and channels that it supports and are currently available to the PC. The PC selects appropriate radio frequency bands and channels therefrom, creates a P2P soft AP, and sets its own role as the group owner.
[0137] S304. A Wi-Fi connection is established between the mobile phone and the PC for data transmission.
[0138] In some embodiments, after the mobile phone and the PC form a Wi-Fi P2P workgroup, they can perform data interaction based on the Wi-Fi service channel. For example, processing the service data stream and the control information stream during wireless screen mirroring or audio / video file sharing.
[0139] It can be seen that currently, a Bluetooth connection needs to be established between the mobile phone and the PC first, and then based on the Bluetooth connection, a Wi-Fi P2P workgroup can be established by exchanging Wi-Fi parameters. However, due to the poor performance and stability of Bluetooth link establishment and pairing, and the limited data bandwidth for transmission, the link establishment delay is large, and the user waiting time is long, which affects the user experience.
[0140] Based on this, the embodiment of the present application provides a connection establishment method. After the mobile phone and the PC access the Wi-Fi network provided by the same AP device, they can directly exchange Wi-Fi parameters based on the Wi-Fi network, create a Wi-Fi P2P workgroup, and implement data interaction. Thereby avoiding the problem of large delay caused by Bluetooth connection.
[0141] The following takes the wireless screen mirroring scenario as an example to introduce the connection establishment method provided by the embodiment of the present application. Among them, the mobile phone and the PC access the router, the router serves as the Hilink gateway, and the mobile phone and the PC serve as Hilink devices.
[0142] In some embodiments, after the mobile phone and the PC are connected to the Wi-Fi network provided by the Hilink router, they automatically perform Hilink pairing. The Hilink router can obtain the device information of the mobile phone and the PC through the Hilink-related protocols. Among them, the Hilink-related protocols include, for example, the Constrained Application Protocol (CoAP), the Universal Plug and Play (UPnP) protocol, etc. The device information includes, for example, the Media Access Control (MAC) address, the device name, the device type, the device manufacturer identifier, the service capability set, etc. The service capability set includes, for example, support for network configuration synchronization, Wi-Fi hotspot parameter negotiation, etc. Among them, the ability of Wi-Fi hotspot parameter negotiation represents the ability of the device to support the WLAN channel, the synchronization and negotiation ability of Wi-Fi radio frequency parameters such as the radio frequency band and channel list supported by the Wi-Fi P2P group client (GC), and the service set identifier (SSID) parameter. It should be noted that the ability of Wi-Fi hotspot parameter negotiation can be used to support services such as wireless screen mirroring and file sharing, for example.
[0143] Exemplarily, as Figure 6 shown, it is a schematic diagram of the handshake interaction process for a device to access a Hilink gateway and establish a Hilink session with the Hilink gateway. Among them, the device is a mobile phone or a PC, and the interaction process between the mobile phone and the router is used as an example in the following steps for explanation.
[0144] S601. The device searches for the gateway service.
[0145] Specifically, after the mobile phone is powered on, that is, when the mobile phone is turned on and waiting to access the wireless network, it performs a network search to search for accessible gateway devices. Among them, taking the access gateway as an intelligent gateway, such as the Hilink gateway, as an example for explanation.
[0146] Exemplarily, the mobile phone broadcasts a message "GET / .well-known / core? st=home Center". Among them, the "st" field is used to indicate the filtering and screening conditions. For example, the "st=home Center" field is used to represent searching for intelligent gateway devices.
[0147] S602. The gateway sends a search response to the device.
[0148] Specifically, after receiving a message for searching for a gateway device, the router sends a response message to the mobile phone, notifying the mobile phone that it is the gateway device itself.
[0149] Exemplarily, a response message example is shown as follows.
[0150]
[0151] S603. The device sends a session application request to the gateway.
[0152] Specifically, after receiving the response message sent by the router, the mobile phone confirms that the router is a Hilink gateway device and provides a Wi-Fi network, and then sends a session application request to the router for interacting device information to access the Wi-Fi network.
[0153] Exemplarily, a session application request message example is shown as follows.
[0154]
[0155] S604. The gateway sends a session application response to the device.
[0156] Specifically, after receiving the session application request message, the router sends a session application response message to the mobile phone to establish a session channel.
[0157] Exemplarily, a session application response message example is shown as follows.
[0158]
[0159]
[0160] S605. The device calculates an encryption key.
[0161] S606. The gateway calculates an encryption key.
[0162] Specifically, in step S605 and step S606, to ensure session security, the mobile phone and the router need to calculate the encryption key respectively. For example, the pre-shared key (PSK) mode is used to calculate the encryption key, such as enc_key = PBKDF2(PSK, sn1|sn2). Here, sn is used to represent the serial number (SN), and the SN code is the unique identification code corresponding to the device.
[0163] S607. The device sends a registration request to the gateway.
[0164] Specifically, the mobile phone sends a registration request to the gateway device for registering device information. Subsequently, the router calls the corresponding device according to the device information. Optionally, the existing Hilik interface is extended for registering device information. For example, the Wi-Fi P2P parameter negotiation interface is extended.
[0165] Exemplarily, a registration request message example is shown as follows.
[0166]
[0167] In the above registration request message, the "st" field is used to indicate the filtering and screening conditions, such as the service capability set supported by itself. The "WifiCfg" field is used to indicate that the device has the ability to negotiate Wi-Fi hotspot parameters, that is, the mobile phone supports Wi-Fi parameter synchronization and negotiation. Then, subsequently, the router can assist the mobile phone to synchronize and negotiate Wi-Fi parameters with the PC based on the mobile phone's ability to negotiate Wi-Fi hotspot parameters, and thus realize wireless screen mirroring.
[0168] S608. The gateway sends a registration response to the device.
[0169] Specifically, after receiving the registration request message, the router sends a registration response message to the mobile phone to complete the registration of the mobile phone device information.
[0170] Exemplarily, a registration response message example is shown as follows.
[0171]
[0172] S609. The device sends a heartbeat packet to the gateway.
[0173] Specifically, based on the socket connection between the mobile phone and the router, if the socket connection is disconnected, the data transmission between the mobile phone and the router will fail. Therefore, the router needs to confirm that the socket connection is not disconnected. Based on this, the mobile phone periodically sends a heartbeat packet to the router to notify the router that the mobile phone is currently online to ensure the validity of the connection between the mobile phone and the router.
[0174] Exemplarily, a heartbeat packet message example is shown as follows.
[0175] POST / .sys / heartbeat?devSn=***
[0176] S610. The gateway sends a heartbeat packet reception response to the device.
[0177] Specifically, after receiving the heartbeat packet, the router determines that the mobile phone is online and sends a heartbeat packet reception response to notify the mobile phone that the current router is online.
[0178] Exemplarily, a heartbeat packet reception response message example is shown as follows.
[0179]
[0180] In some scenarios, a mobile phone and a PC use the Figure 6 shown method to access the Wi-Fi network provided by the same router. After establishing a Hilink session channel with the router, a Wi-Fi P2P workgroup can be established for data transmission.
[0181] Exemplarily, Figure 7 is a schematic flowchart of the connection establishment method provided by an embodiment of the present application. Among them, the screen mirroring source device is a mobile phone, and the screen mirroring target device is a PC. The mobile phone uses the PC to display the video picture. Refer to Figure 7 , this method includes S701 - S707.
[0182] S701. The mobile phone obtains the NFC parameter information of the PC, including the MAC address of the Wi-Fi interface.
[0183] In some embodiments, the PC includes a radio frequency identification (RFID) module. The mobile phone turns on the NFC function and approaches the NFC sensing area of the PC to read the NFC parameter information of the PC, such as the parameter information in the NFC tag, to obtain the MAC address of the PC Wi-Fi interface. Among them, the MAC address of the Wi-Fi interface in the NFC parameter information can be pre-configured in the NFC tag of the PC. Alternatively, when the PC boots up and starts a certain application to activate the Wi-Fi interface, the MAC address of the Wi-Fi interface is written into the NFC tag.
[0184] Exemplarily, the data in the NFC tag is saved in the form of a NFC data exchange format (NDEF) message. Each message can be composed of multiple records (which can also be described as multiple sub-packets). For example, as Figure 8 shown, an exemplary message format is given. Among them, the NDEF message includes a header sub-packet, an NDEF Record 0 sub-packet, and an NDEF Record 1 sub-packet.
[0185] Among them, the NDEF Record 0 sub - packet is used to save the Uniform Resource Locator (URL). This URL can open the website of the application currently using the NFC function, thereby obtaining the introduction of the application. For example, assume that the mobile phone touches the PC NFC sensing area to transfer data, and the mobile phone does not support the "one - touch transfer" function. This URL points to the website introducing the one - touch transfer function. When the mobile phone touches the PC NFC sensing area, the mobile phone displays the corresponding website through this URL for the user to view the relevant introduction.
[0186] The NDEF Record 1 sub - packet is used to save the NFC parameter information. As Figure 8 shown, the NDEF Record 1 sub - packet includes a bit flag field, a type length field, a payload length field, an ID length field, a payload type field, a payload ID field, and a payload data field.
[0187] Among them, the payload data field occupies a variable number of bytes and can change according to the data length of the sub - fields. The payload data field includes a version number sub - field, a Bluetooth interface MAC address sub - field, a Wi - Fi interface MAC address sub - field, a random number sub - field, a model number sub - field, and a sub - model number sub - field.
[0188] The Bluetooth interface MAC address sub - field occupies 6 bytes and is used to indicate the MAC address of the PC's Bluetooth interface. The mobile phone can establish a Bluetooth connection with the PC based on this MAC address.
[0189] The Wi - Fi interface MAC address sub - field occupies 6 bytes and is used to indicate the MAC address of the PC's Wi - Fi interface. The mobile phone can establish a Wi - Fi connection with the PC based on this MAC address. In this way, by extending the NFC tag, the MAC address of the Wi - Fi interface is directly indicated in the NFC parameter information, so that the mobile phone and the PC can directly establish a Wi - Fi connection based on the MAC address of the Wi - Fi interface, rather than having to establish a Bluetooth connection first to establish a Wi - Fi connection.
[0190] The random number sub - field occupies 32 bytes, and its value is the hash value obtained by performing a hash operation on the product serial number (SN) of the PC. Among them, the SN number is the PC identity identification code and is the unique machine code of the PC.
[0191] S702. The mobile phone determines that the device corresponding to the MAC address of the Wi-Fi interface is an adjacent device that supports Wi-Fi parameter negotiation capabilities.
[0192] In some embodiments, the router broadcasts the device information registered by the access device during the registration process based on the local security policy, and synchronizes it to each device connected within the local area network. Subsequently, after the mobile phone listens to the broadcast, it can save the device list information of the devices accessing this router, and based on this device list information, it can discover adjacent devices within the local area network. Thus, after receiving the MAC address of the Wi-Fi interface, it can discover a PC within the adjacent devices that supports Wi-Fi parameter negotiation capabilities. Optionally, the Wi-Fi parameter negotiation capabilities may include, for example, Wi-Fi hotspot parameter negotiation capabilities.
[0193] In some embodiments, after the mobile phone obtains the MAC address of the PC's Wi-Fi interface, it needs to determine whether the PC is a device that supports Wi-Fi hotspot parameter negotiation capabilities. A PC device with Wi-Fi hotspot parameter negotiation capabilities can perform wireless screen mirroring and / or cross-device file sharing between the mobile phone and the PC. Among them, the mobile phone can use the device list information cached locally to query whether the device corresponding to the MAC address of this Wi-Fi interface supports Wi-Fi hotspot parameter negotiation capabilities. If the device corresponding to the MAC address of this Wi-Fi interface is not found in the local device list, a query request can be sent to the router, and the router will perform the query and receive the query result sent by the router.
[0194] Exemplarily, the mobile phone can send a query request message to the router to query the router for a device list with a specified device identifier, a specified MAC address, or a specified capability.
[0195] For example, the query request message is, for example, "GET / cord? st=WifiCfg". Among them, the "st" field is used to indicate the filtering and screening conditions, and the "WifiCfg" field is used to indicate querying devices with Wi-Fi hotspot parameter negotiation capabilities. Specifically, if a device supports wireless screen mirroring and / or cross-device file sharing, it needs to support Wi-Fi hotspot parameter negotiation capabilities. Therefore, using this message, devices with screen mirroring capabilities can be queried.
[0196] Correspondingly, after the router receives the query request message, it will send a query response message to the mobile phone, and the query result is carried in the query response message. The following shows an example of a query response message.
[0197]
[0198]
[0199] In the above query response message, the "sn" field is used to indicate the SN number of the device with Wi-Fi hotspot parameter negotiation capability. For example, it is 00E0FC018008. The mobile phone can determine the corresponding device according to the SN number. Further, the SN number field can also be filled with the MAC address, and the MAC address can also be used to indicate the uniquely corresponding device.
[0200] It should be noted that in the above step S701, the mobile phone can also obtain the MAC address of the Bluetooth interface included in the NFC parameter information of the PC. Then, in step S702, if the processes of the mobile phone itself and the router to query neighboring devices that support Wi-Fi hotspot parameter negotiation capabilities both fail, that is, the corresponding PC cannot be queried, the mobile phone uses the MAC address of the Bluetooth interface to establish a Bluetooth connection with the PC, and then establishes a Wi-Fi P2P workgroup. Among them, the method of establishing a Wi-Fi P2P workgroup based on the Bluetooth connection can refer to Figures 3 - 5 the method shown, which will not be elaborated here.
[0201] S703. The mobile phone displays a confirmation interface, detects a confirmation operation, and confirms the connection with the PC.
[0202] In some embodiments, after the mobile phone queries the projectable PC through the above step S702, the user needs to confirm whether the PC is the target projectable device. If so, the following projection parameter negotiation process is executed. If not, the above steps S701 and S702 need to be repeated again to re-find the PC, or the projection operation is abandoned.
[0203] Exemplarily, as Figure 9 shown in interface 901, the mobile phone displays a notification bar 91 to prompt the user that a projection connection is being established currently, and the user is asked to confirm whether to allow projection on this PC. Currently, there may be multiple PCs, and the SN code of the PC, or the user-defined PC name, etc. can be used to prompt the user which PC among the multiple PCs is the target PC to be connected currently, so as to facilitate the user to distinguish. For example, in interface 901, it prompts the user that "PC(XXX)", where XXX represents the content corresponding to the prompt method. Detecting the operation that the user clicks on control 92 and confirming that the user allows projection using the target PC, a projection connection needs to be established with the target PC for transmitting projection data.
[0204] S704a. The mobile phone sends a parameter negotiation request to the router, and the parameter negotiation request carries the PC identifier and the first radio frequency parameter.
[0205] Among them, the first radio frequency parameters include the radio frequency bands supported by the mobile phone and the radio frequency bands and channels that can be currently applied in the channel. The PC identifier includes, for example, the MAC address of the PC, or a predefined PC identifier, etc. The router determines the target PC for sending the parameter negotiation request according to the PC identifier, and subsequently the mobile phone uses the target PC for wireless screen mirroring. Optionally, the mobile phone serves as the screen mirroring source device and the PC serves as the screen mirroring target device. The target device identifier and / or the source device identifier are carried in the parameter negotiation request for identifying the peer device.
[0206] In some embodiments, when the mobile phone determines to establish a connection with the PC, it is necessary to negotiate Wi-Fi P2P connection parameters to establish a Wi-Fi P2P workgroup. The mobile phone needs to send its supported and available radio frequency parameters to the PC. However, to ensure network security, the router sets up layer 2 isolation and does not allow direct communication between the mobile phone and the PC. Instead, the router forwards the signals between the mobile phone and the PC, so as to audit the permissions and traffic of the devices accessing the router network. Therefore, the mobile phone sends its supported and available radio frequency parameters to the router, and the router forwards the received radio frequency parameters to the corresponding target PC based on the target PC identifier carried in the parameter negotiation request. Then the target PC selects and determines the radio frequency parameters to be applied based on the radio frequency parameters.
[0207] Exemplarily, the request message is as follows:
[0208] METHOD PATH HTTP / 1.1
[0209] [BODY]
[0210] Among them, in the above request message, the "METHOD" field is used to represent the method for transmitting interface parameters, for example, including two methods: GET and POST. Among them, the GET method transmits the parameters through the uniform resource locator (URL). The POST method places the parameters in the message body for transmission. Optionally, the GET method and the POST method can perform transmission control protocol (TCP) packet transmission based on the hypertext transfer protocol (HTTP).
[0211] The "PATH" field is used to represent the request path of the interface.
[0212] The "BODY" field is an optional field used to represent the request body. The BODY field adopts the JSON message format and the encoding method is UTF-8. The BODY field contains sub-fields such as the available radio frequency bands in its own Wi-Fi module and the list of available channels in the corresponding frequency bands, and / or the source device identifier and the target device identifier. Among them, the device identifier is, for example, the device SN.
[0213] The "HTTP / 1.1" field is related to the specific bearer protocol. For example, when transmitting based on the HTTP protocol, this field is included in the message, and when transmitting based on CoAP, this field is not included in the message.
[0214] Several request message examples are shown below.
[0215] Example 1: Transmit the request message based on the HTTP protocol or the HTTPS protocol.
[0216] Transmit the message using the GET method:
[0217] GET / {cloud_prefix} / {devId} / PATH HTTP / 1.1
[0218] Authorization:Bearer 7dc923e1-027d-476e-ad16-380d2166c7b7
[0219] Content-Type:application / json
[0220] Transmit the message using the POST method:
[0221] POST / {cloud_prefix} / {devId} / PATH HTTP / 1.1
[0222] Authorization:Bearer 7dc923e1-027d-476e-ad16-380d2166c7b7
[0223] Content-Type:application / json
[0224] [BODY]
[0225] Example 2: Transmit the request message based on CoAP and use the transport layer security (TLS) or the datagram transport layer security (DTLS) to negotiate the shared key to ensure the confidentiality and data integrity of the transmission.
[0226] Transmit the message using the GET method:
[0227] GET / {dev_specific_prefix} / PATH
[0228] Option:session_id
[0229] 2.05content
[0230] aes_encrypted([BODY])
[0231] Transmit the message using the POST method:
[0232] POST / {dev_specific_prefix} / PATH
[0233] Option:session_id
[0234] aes_encrypted([BODY])
[0235] 2.05content
[0236] aes_encrypted([BODY])
[0237] It should be noted that when transmitting the message based on the HTTP protocol or the HTTPS protocol, the TLS or the secure sockets layer (SSL) can also be used to negotiate the shared key. Among them, the process of negotiating the shared key can refer to the prior art, and the embodiments of the present application will not elaborate specifically on this.
[0238] S704b. The router forwards the parameter negotiation request to the target PC according to the PC identifier.
[0239] In some embodiments, after receiving the parameter negotiation request, the router forwards the negotiation request to the target PC corresponding to the PC identifier based on the PC identifier.
[0240] S705. The PC selects the target radio frequency parameter from the first radio frequency parameters and creates a hotspot.
[0241] In some embodiments, after receiving the first radio frequency parameter sent by the mobile phone, the PC selects the best radio frequency band and channel as the target radio frequency parameter according to the first radio frequency parameter and the radio frequency parameters supported by itself and currently available. For example, the PC selects the radio frequency band and channel with the best expected signal quality from the radio frequency bands and channels supported and available by both itself and the mobile phone. For another example, the PC selects the radio frequency band and channel with the minimum time delay from the radio frequency bands and channels supported and available by both itself and the mobile phone.
[0242] In some embodiments, after determining the target radio frequency parameter, the PC creates a hotspot, uses itself as a soft access point (soft AP) device, and configures the radio frequency parameters of the Wi-Fi P2P working group of the radio frequency interface so that the subsequent mobile phone can access the radio frequency interface to transmit the screen mirroring data. Further, based on the target radio frequency parameter, the PC as a soft AP device sends beacon frames at a preset period, so that the mobile phone can discover the soft AP device.
[0243] In some embodiments, the PC can also configure the SSID of the hotspot, and the subsequent mobile phone uses the SSID to access the PC hotspot. Optionally, the PC can separately configure and generate the SSID of the hotspot and send the SSID to the mobile phone. Or, pre-configure the SSID of the hotspot, configure the SSID in both the PC and the mobile phone. When the PC needs to configure the SSID of the hotspot, it directly obtains the pre-configured SSID for configuration. Then, the PC does not need to send the SSID to the mobile phone, and the mobile phone can determine the corresponding SSID of the hotspot according to the pre-configured SSID.
[0244] S706a. The PC sends a parameter negotiation response to the router, and the parameter negotiation response carries the target radio frequency parameter.
[0245] In some embodiments, after determining the target radio frequency parameter, the PC sends the target radio frequency parameter to the router along the path of receiving the parameter negotiation request, and the router forwards it to the mobile phone to establish a Wi-Fi P2P working group between the PC and the mobile phone. Optionally, the parameter negotiation response can also carry the SSID and power value of the hotspot.
[0246] Exemplarily, a parameter negotiation response message is shown as follows.
[0247] HTTP / 1.1 200OK
[0248] [BODY]
[0249] Among them, the "200OK" field is used to indicate that the corresponding request has been successfully processed on the server, that is, the target radio frequency parameters have been selected. The "BODY" field is used to carry the payload of the message, such as the target radio frequency parameters. The BODY field adopts the JSON message format and is encoded in UTF-8. The BODY field contains the frequency band and corresponding channel information for the PC to select to create a hotspot, and / or the SSID, and / or the source device identifier and the target device identifier. Among them, the device identifier is, for example, the device SN.
[0250] S706b. The router forwards the parameter negotiation response to the mobile phone.
[0251] In some embodiments, after receiving the parameter negotiation response, the router forwards the parameter negotiation response to the corresponding mobile phone that sent the parameter negotiation request. Optionally, in the above step S704a, the mobile phone identifier may also be carried in the parameter negotiation request. Correspondingly, the mobile phone identifier is carried in the parameter negotiation response sent by the PC. Then, after receiving the parameter negotiation response, the router can send the parameter negotiation response to the target mobile phone according to the mobile phone identifier.
[0252] Thus, the mobile phone adds a protocol interface for transmitting Wi-Fi negotiation parameters based on the Hilink ecosystem-related protocol. For example, in the embodiments of the present application, the mobile phone uses the Hilink session channel established with the router through the method as Figure 6 shown to transmit the first radio frequency parameters and receive the target radio frequency parameters determined by the PC, so as to realize the radio frequency parameter negotiation with the PC. Compared with Figure 5 the Wi-Fi parameter negotiation between the PC and the mobile phone based on the link layer protocol as shown, the embodiments of the present application can perform the parameter negotiation process based on the application layer protocol (that is, the Hilink ecosystem-related protocol) and are not limited by the Bluetooth connection.
[0253] S707. The mobile phone and the PC create a Wi-Fi P2P socket connection and start transmitting data.
[0254] In some embodiments, after receiving the parameter negotiation response, the mobile phone determines that the parameter negotiation is successful. According to the radio frequency band and channel specified in the negotiated target radio frequency parameters, a probe request management frame is sent based on the 802.11 protocol to search for the beacon frame sent by the PC. After the PC is found, the authentication and association process is automatically triggered, a Wi-Fi P2P socket connection is created with the PC, and then the transmission of the screen mirroring data is started. Among them, the transmitted screen mirroring data includes, for example, video image information, keyboard and mouse information, etc. The Wi-Fi authentication and association process between the mobile phone and the PC can refer to the prior art and will not be elaborated here.
[0255] In some scenarios, the router does not set up layer-2 isolation within the local area network, and the mobile phone and the PC can communicate directly. Then, during the process of parameter negotiation between the mobile phone and the PC, it is not necessary to use the router to forward the parameters for negotiation.
[0256] Exemplarily, in the scenario where the mobile phone and the PC directly conduct parameter negotiation, as Figure 10 shown, the parameter negotiation process includes S704c - S706c.
[0257] S704c. The mobile phone sends a parameter negotiation request to the PC, and the first radio frequency parameter is carried in the parameter negotiation request.
[0258] In some embodiments, the mobile phone and the PC support a specific Representational State Transfer (REST) interface, and the mobile phone and the PC can communicate directly based on this REST interface. Optionally, the mobile phone receives the device list information broadcast by the router and obtains the IP address of the PC from the device list information. Or, the mobile phone looks up the Address Resolution Protocol (ARP) table according to the MAC address obtained in the above step S701, and determines the IP address of the PC according to the correspondence between the MAC address and the IP address in the ARP table. After that, the mobile phone uses this IP address to send a parameter negotiation request to the PC.
[0259] Among them, REST is used to indicate the data interaction rules between the client and the server during the data transmission process. The PC is the server of the REST interface, and the mobile phone is the client of the REST interface.
[0260] Optionally, the parameter negotiation request message is transmitted in the manner of HTTP(s) GET or HTTP(s) POST based on the UPnP protocol or CoAP. Among them, the format of the parameter negotiation request message can refer to the format of the request message described in the above step S704a, and will not be elaborated here.
[0261] S705. The PC selects the target radio frequency parameter from the first radio frequency parameters and creates a hotspot.
[0262] S706c. The PC sends a parameter negotiation response to the mobile phone, and the target radio frequency parameter is carried in the parameter negotiation response.
[0263] In some embodiments, after the PC receives the parameter negotiation request directly sent by the mobile phone, correspondingly, it directly replies with a parameter negotiation response.
[0264] Optionally, the remaining content of steps S705 - S706c can refer to the above Figure 7The relevant content in step S705-step S706b shown above will not be elaborated here.
[0265] Thus, for the connection establishment method provided in the embodiments of this application, based on the NFC function, the mobile phone can directly obtain the MAC address of its Wi-Fi interface in the NFC module of the PC, and use the MAC address of this Wi-Fi interface to establish a Wi-Fi P2P workgroup with the PC for data transmission. Compared with the connection methods in the prior art, there is no need to first establish a Bluetooth connection and then establish a Wi-Fi P2P workgroup based on the Bluetooth connection. This avoids the problem of a large connection establishment delay caused by the poor performance and stability of the Bluetooth connection, and improves the interaction performance.
[0266] In some scenarios, the mobile phone can also discover the PC without touching it via NFC. Then the mobile phone can directly receive the PC selected by the user, determine the MAC address of the corresponding Wi-Fi interface, and establish a Wi-Fi P2P workgroup.
[0267] Exemplarily, Figure 11 Another connection establishment method provided by the embodiments of this application is as follows. As Figure 11 shown, this method includes S1101-S1108.
[0268] S1101. The PC accesses the router and registers with the router.
[0269] S1102. The mobile phone accesses the router and registers with the router.
[0270] In some embodiments, in the above steps S1101 and S1102, the mobile phone and the PC access the Wi-Fi network provided by the same router. After accessing the router, based on the relevant protocols of the Hilink ecosystem, search for the Hilink gateway for registration. Assuming the router is the Hilink gateway, after the mobile phone and the PC access the router, they directly register their supported capabilities and interface information with the router, such as Bluetooth interface information, Wi-Fi interface information, etc.
[0271] Optionally, for the remaining content of steps S1101-S1102, reference can be made to the relevant content in the above steps S601-S610, which will not be elaborated here.
[0272] S1103. The mobile phone displays a screen mirroring interface, detects the operation of the user searching for a screen mirroring device, and searches for the screen mirroring device.
[0273] S1104. The mobile phone sends a screen mirroring device query request to the router.
[0274] S1105. The router sends a screen mirroring device query result to the mobile phone.
[0275] S1106. The mobile phone displays a projection device selection interface, detects a user's operation of selecting a projection device, and determines that the projection device is a PC.
[0276] In some embodiments, in step S1103-step S1106, after detecting the user's screen projection operation, the mobile phone starts to look for neighboring devices that can be used for screen projection. For example, a query request is sent to a router. After receiving the query request, the router queries the device that supports the Wi-Fi hotspot parameter negotiation capability based on the registration information of the device connected to the router, and sends the query result to the mobile phone. Optionally, the query result contains the MAC address of the device's Wi-Fi interface. After the mobile phone receives the query result, the user confirms whether to use the queried device for screen projection. If so, based on the MAC address of the Wi-Fi interface of the screen projection device selected by the user, the Wi-Fi hotspot parameters are negotiated with the screen projection device, and then a Wi-Fi P2P working group is established to start screen projection. For another example, the mobile phone monitors the neighbor device information synchronized by the router change and obtains the device list information. Then, based on the device list information, the mobile phone directly queries the screen projection device that supports the Wi-Fi hotspot parameter negotiation capability, as well as the MAC address of the corresponding Wi-Fi interface.
[0277] For example, Figure 12 In the interface 1201 shown in (a), the mobile phone detects that the user clicks the control 121 and determines that the user needs to cast the currently displayed video screen. Figure 12 In the interface 1202 shown in (b), the screen projection device that can be used for screen projection is searched, and prompt content 122 is displayed to prompt the user that the current mobile phone is searching for the device. Figure 12 The interface 1203 shown in (c) is used to receive the user's operation of selecting a projection device. For example, the mobile phone detects the user clicking the device name 123 on the interface 1203 and determines that the projection device is a PC.
[0278] S1107: The mobile phone negotiates radio frequency parameters with the PC.
[0279] S1108. The mobile phone and the PC establish a Wi-Fi P2P socket connection and start transmitting data.
[0280] Optionally, the contents of step S1107 and step S1108 can refer to Figure 7 The contents of steps S704a to S707 shown in FIG. Figure 10 The relevant contents in steps S704c to S707 are not repeated here.
[0281] Thus, without using NFC parameter information, the mobile phone can also obtain the MAC address of the Wi-Fi interface of the PC, directly establish a Wi-Fi P2P working group with the PC based on the MAC address of the Wi-Fi interface, improve the link establishment performance and stability, and enhance the user experience.
[0282] It can be understood that in order to implement the above functions, the above first electronic device, second electronic device, and AP device include the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0283] The embodiments of the present application can divide the functional modules of the above electronic device according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.
[0284] Exemplary Figure 13 is a schematic structural diagram of a connection establishment device provided by an embodiment of the present application. As Figure 13 shown, the connection establishment device 1300 includes: a transceiver module 1301 and a processing module 1302.
[0285] In a possible design, the connection establishment device 1300 can be used to implement the functions of the first electronic device involved in the above method embodiments. Among them, the connection establishment device 1300 can be the first electronic device itself, or a functional unit or chip in the first electronic device, or a device used in matching with the first electronic device.
[0286] Optionally, the transceiver module 1301 is used to support the connection establishment device 1300 to execute one or more of the steps S701, step S704a, step S706b, and step S707 shown in the embodiments of the present application; and / or, the transceiver module 1301 is further used to support the connection establishment device 1300 to execute the embodiments of the present application Figure 7 shown; and / or, the transceiver module 1301 is further used to support the connection establishment device 1300 to execute one or more of the steps shown in the embodiments of the present application Figure 10the steps S704c and S706c shown; and / or, the transceiver module 1301 is further configured to support the connection establishment device 1300 to execute the Figure 11 steps S1102, S1104, S1105, S1107, and S1108 shown; and / or, the transceiver module 1301 is further configured to support the connection establishment device 1300 to execute other sending and receiving steps performed by the first electronic device in the embodiments of the present application.
[0287] Optionally, the processing module 1302 is configured to support the connection establishment device 1300 to execute the Figure 7 or Figure 10 one or more of the steps S702 and S703 shown; and / or, the processing module 1302 is further configured to support the connection establishment device 1300 to execute the Figure 11 steps S1103 and S1106 shown; and / or, the processing module 1302 is further configured to support the connection establishment device 1300 to execute other processing steps performed by the first electronic device in the embodiments of the present application.
[0288] In another possible design, the connection establishment device 1300 can be used to implement the functions of the second electronic device involved in the above method embodiments. Among them, the connection establishment device 1300 can be the second electronic device itself, or a functional unit or chip in the second electronic device, or a device used in combination with the second electronic device.
[0289] Optionally, the transceiver module 1301 is configured to support the connection establishment device 1300 to execute the Figure 7 one or more of the steps S701, S704b, S706a, and S707 shown; and / or, the transceiver module 1301 is further configured to support the connection establishment device 1300 to execute the Figure 10 steps S704c and S706c shown; and / or, the transceiver module 1301 is further configured to support the connection establishment device 1300 to execute the Figure 11 steps S1101, S1107, and S1108 shown; and / or, the transceiver module 1301 is further configured to support the connection establishment device 1300 to execute other sending and receiving steps performed by the second electronic device in the embodiments of the present application.
[0290] Optionally, the processing module 1302 is configured to support the connection establishment device 1300 to execute the Figure 7 step S705 shown; and / or, the processing module 1302 is further configured to support the connection establishment device 1300 to execute other processing steps performed by the second electronic device in the embodiments of the present application.
[0291] Among them, the processing module 1302 can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in connection with the disclosure of the present application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
[0292] Optionally, Figure 13 the shown connection establishment device 1300 may further include a storage module ( Figure 13 not shown in the figure), and the storage module stores programs or instructions. When the transceiver module 1301 and the processing module 1302 execute the programs or instructions, it enables Figure 13 the shown connection establishment device 1300 to execute the connection establishment method provided in the embodiment of the present application.
[0293] Optionally, the transceiver module may include a receiving module and a transmitting module. Among them, the receiving module is used to receive signals sent by other devices. The transmitting module is used to send signals to other devices. The specific implementation manner of the transceiver module in the embodiment of the present application is not specifically limited.
[0294] Figure 13 The operations and / or functions of each unit in the shown connection establishment device 1300 respectively correspond to the corresponding processes of the connection establishment method provided in the above method-side embodiments. For the sake of brevity, they will not be elaborated here. Figure 13 The technical effects of the shown connection establishment device 1300 can refer to the technical effects of the connection establishment method provided in the above method-side embodiments, and will not be elaborated here.
[0295] The embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, and the memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.
[0296] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that implements by reading software codes stored in the memory.
[0297] Optionally, there may also be one or more memories in the chip system. The memory may be integrated with the processor or may be separately provided from the processor. The embodiments of the present application do not limit this. Exemplarily, the memory may be a non-transitory processor, such as a read-only memory (ROM). It may be integrated with the processor on the same chip or may be separately provided on different chips. The embodiments of the present application do not specifically limit the type of the memory and the setting manner of the memory and the processor.
[0298] Exemplarily, the chip system may be a field programmable gate array (FPGA), may be an application specific integrated circuit (ASIC), may also be a system on chip (SoC), may also be a central processing unit (CPU), may also be a network processor (NP), may also be a digital signal processing circuit (DSP), may also be a microcontroller unit (MCU), may also be a programmable logic device (PLD) or other integrated chips.
[0299] It should be understood that the steps in the above method embodiments may be completed by the integrated logic circuit in the hardware of the processor or by the instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application may be directly embodied as being executed and completed by the hardware processor, or may be executed and completed by the combination of the hardware and software modules in the processor.
[0300] The embodiments of the present application further provide a storage medium for storing instructions used for the above communication device.
[0301] The embodiments of the present application further provide a computer-readable storage medium. Computer instructions are stored in the computer-readable storage medium. When the computer instructions run on the server, the server is enabled to execute the above relevant method steps to implement the connection establishment method in the above embodiments.
[0302] The embodiments of the present application further provide a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the above relevant steps to implement the connection establishment method in the above embodiments.
[0303] In addition, an embodiment of the present application further provides a device, which may specifically be a component or a module. The device may include one or more processors and a memory connected thereto. The memory is used to store a computer program, and one or more computer programs include instructions. When the instructions are executed by one or more processors, the device is caused to execute the connection establishment method in each of the above method embodiments.
[0304] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0305] The steps of the method or algorithm described in connection with the disclosure of the present application may be implemented in a hardware manner or by a processor executing software instructions. The software instructions may be composed of corresponding software modules, and the software modules may be stored in a random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an application specific integrated circuit (ASIC).
[0306] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of description, only the above division of each functional module is used as an example. In actual applications, the above functions may be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices, and units may refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0307] In several embodiments provided by the present application, it should be understood that the disclosed method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the modules or units can be in electrical, mechanical or other forms.
[0308] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0309] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0310] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes. As described above, this is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A connection establishment method, characterized in that, Applied to a first electronic device, the method includes: Obtain the media access control (MAC) address of the Wi-Fi interface of a second electronic device in the near field communication (NFC) tag of the second electronic device; Use the MAC address of the Wi-Fi interface to query whether the second electronic device has the Wi-Fi parameter negotiation capability; If the second electronic device has the Wi-Fi parameter negotiation capability, perform Wi-Fi parameter negotiation with the second electronic device using the MAC address of the Wi-Fi interface to obtain target radio frequency parameters; establish a Wi-Fi direct connection channel with the second electronic device using the target radio frequency parameters.
2. The method according to claim 1, wherein When the first electronic device and the second electronic device are connected to a Wi-Fi network provided by the same wireless access point (AP) device, the step of using the MAC address of the Wi-Fi interface to query whether the second electronic device has the Wi-Fi parameter negotiation capability includes: Receive device list information sent by the AP device, where the device list information contains the capability information of the electronic devices connected to the AP device; In the device list information, query the first capability information of the second electronic device corresponding to the MAC address of the Wi-Fi interface, and determine whether the first capability information includes the Wi-Fi parameter negotiation capability.
3. The method according to claim 1, wherein When the first electronic device and the second electronic device are connected to a Wi-Fi network provided by the same wireless access point (AP) device, the step of using the MAC address of the Wi-Fi interface to query whether the second electronic device has the Wi-Fi parameter negotiation capability includes: Send a capability query request to the AP device, where the capability query request carries the MAC address of the Wi-Fi interface, and the capability query request is used to request to query whether the second electronic device has the Wi-Fi parameter negotiation capability; Receive a capability query response sent by the AP device, where the capability query response is used to indicate whether the second electronic device has the Wi-Fi parameter negotiation capability.
4. The method according to claim 2 or 3, characterized in that, Before obtaining the media access control (MAC) address of the Wi-Fi interface of the second electronic device in the near field communication (NFC) tag of the second electronic device, the method further includes: Send a registration request to the AP device, where the registration request is used to request to register the second capability information of the first electronic device, and the second capability information includes the Wi-Fi parameter negotiation capability.
5. The method according to claim 2 or 3, characterized in that, The step of if the second electronic device has the Wi-Fi parameter negotiation capability, then perform Wi-Fi parameter negotiation with the second electronic device to obtain target radio frequency parameters includes: Send a Wi-Fi parameter negotiation request to the AP device, where the Wi-Fi parameter negotiation request carries the identifier of the second electronic device and first radio frequency parameters; the first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device, and the idle channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response sent by the second electronic device and forwarded by the AP device. The Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
6. The method according to any one of claims 1-3, characterized in that If the second electronic device has the Wi-Fi parameter negotiation capability, then perform Wi-Fi parameter negotiation with the second electronic device to obtain the target radio frequency parameters, including: Send a Wi-Fi parameter negotiation request to the second electronic device. The Wi-Fi parameter negotiation request carries the first radio frequency parameters. The first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device and the idle channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response sent by the second electronic device. The Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
7. The method according to claim 2 or 3, characterized in that, Establish a Wi-Fi direct connection channel with the second electronic device by using the target radio frequency parameters, including: Send a connection establishment request on the target radio frequency band and target channel. The connection establishment request is used to request to establish the Wi-Fi direct connection channel with the second electronic device. Receive the connection establishment response sent by the second electronic device to complete the establishment of the Wi-Fi direct connection channel.
8. A connection establishment method, characterized in that, Applied to the first electronic device, the method includes: In response to a first operation, send a device query request to the wireless access point AP device. The device query request is used to request to query devices with Wi-Fi parameter negotiation capabilities. Receive the device query response sent by the AP device. The device query response carries the MAC address of the Wi-Fi interface of the second electronic device, and the second electronic device has the Wi-Fi parameter negotiation capability. Use the MAC address of the Wi-Fi interface to perform Wi-Fi parameter negotiation with the second electronic device to obtain the target radio frequency parameters. Establish a Wi-Fi direct connection channel with the second electronic device by using the target radio frequency parameters.
9. The method according to claim 8, wherein Before sending the device query request to the wireless access point AP device in response to the first operation, the method further includes: Send a registration request to the AP device. The registration request is used to request to register the second capability information of the first electronic device, and the second capability information includes the Wi-Fi parameter negotiation capability.
10. The method according to claim 8 or 9, characterized in that Use the MAC address of the Wi-Fi interface to perform Wi-Fi parameter negotiation with the second electronic device to obtain the target radio frequency parameters, including: Send a Wi-Fi parameter negotiation request to the AP device, where the Wi-Fi parameter negotiation request carries the identifier of the second electronic device and the first radio frequency parameters; the first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device, and the idle channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response forwarded by the AP device from the second electronic device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
11. The method according to claim 8 or 9, characterized in that, The using the MAC address of the Wi-Fi interface to negotiate Wi-Fi parameters with the second electronic device to obtain the target radio frequency parameters includes: Send a Wi-Fi parameter negotiation request to the second electronic device, where the Wi-Fi parameter negotiation request carries the first radio frequency parameters; the first radio frequency parameters include the idle radio frequency bands among the radio frequency bands supported by the first electronic device, and the idle channels among the channels supported by the first electronic device. Receive the Wi-Fi parameter negotiation response sent by the second electronic device, where the Wi-Fi parameter negotiation response carries the target radio frequency parameters, and the target radio frequency parameters include the target radio frequency band selected by the second electronic device from the idle radio frequency bands and the target channel selected from the idle channels.
12. The method according to claim 8 or 9, characterized in that The using the target radio frequency parameters to establish a Wi-Fi direct connection channel with the second electronic device includes: Send a connection establishment request on the target radio frequency band and target channel, where the connection establishment request is used to request to establish the Wi-Fi direct connection channel with the second electronic device. Receive the connection establishment response sent by the second electronic device to complete the establishment of the Wi-Fi direct connection channel.
13. An electronic device, characterized in that, Includes: A processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor reads the computer instructions from the memory, it causes the electronic device to execute the connection establishment method described in any one of claims 1-7, or causes the electronic device to execute the connection establishment method described in any one of claims 8-12.
14. A computer-readable storage medium, characterized in that, Includes a program or instruction, when the program or instruction is executed, the method described in any one of claims 1-7 is implemented, or the method described in any one of claims 8-12 is implemented.
15. A computer program product comprising instructions, characterized in that, When the computer program product runs on an electronic device, it causes the electronic device to execute the connection establishment method described in any one of claims 1-7, or causes the electronic device to execute the connection establishment method described in any one of claims 8-12.
Citation Information
Patent Citations
Establishment method of direct connected link, station device and communication system
CN101594578A
Wireless one-screen audio channel control method, transmitting device and receiving device
CN106612445A
Method, apparatus, and system for establishing WIFI direct
WO2017219657A1