Communication method and device

By synchronizing device information before Wi-Fi Direct connection and using Wi-Fi Fidelity operation frames for negotiation and interaction, the problem of long Bluetooth link latency is solved, enabling fast and secure device connection and efficient service transmission.

WO2026066377A1PCT designated stage Publication Date: 2026-04-02HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

During the Wi-Fi Direct connection establishment process, the Bluetooth link establishment takes a long time, resulting in a longer device connection time, which affects the user experience. In addition, the multiple interaction processes increase connection overhead and waste resources.

Method used

By synchronizing the connection establishment capability and transmission key information of the second device before establishing the first communication connection, the communication connection with the second device can be established directly using this information, avoiding multiple interaction processes. The negotiation interaction is carried out using Wi-Fi operation frames, and encrypted data transmission is carried out using virtual access points and expected channel information.

Benefits of technology

It shortens device connection time, improves user experience and business execution efficiency, reduces connection overhead and resource waste, and ensures the security and reliability of information transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025104892_02042026_PF_FP_ABST
    Figure CN2025104892_02042026_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the technical field of communications. Provided are a communication method and device. The method comprises: a first device receiving first communication information sent by a second device, the first communication information comprising a link establishment capability of the second device and a second transmission key used by the second device to establish a first communication connection, wherein the link establishment capability of the second device is used for indicating whether the second device supports establishment of the first communication connection; and the first device further establishing, in response to a trigger operation for a collaborative service, the first communication connection with the second device on the basis of the first communication information and second communication information, the second communication information comprising a link establishment capability of the first device and a first transmission key used by the first device to establish the first communication connection, wherein the link establishment capability of the first device is used for indicating whether the first device supports establishment of the first communication connection. Thus, the execution of a plurality of interaction processes during the establishment of a first communication connection is avoided, thereby reducing the time consumed for the establishment of the first communication connection.
Need to check novelty before this filing date? Find Prior Art

Description

Communication method and device

[0001] The present application claims priority to the Chinese Patent Application No. 202411345896.7, filed on September 24, 2024, and entitled "A communication method and device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the field of communication technology, and in particular to a communication method and device. BACKGROUND

[0003] With the continuous development of communication technology and terminal technology, the interconnection and intercommunication between electronic devices are increasingly attracting people's attention. Multi-devices can use Wi-Fi peer-to-peer (P2P) or Wi-Fi direct connection to work cooperatively, so that service data can be transmitted between multiple devices to support various services of multi-device cooperative work, such as multi-screen collaboration, information sharing, etc.

[0004] Generally, in the process of establishing Wi-Fi direct connection between two devices, a Bluetooth link needs to be established, and based on the Bluetooth link, device binding, authentication, and negotiation of Wi-Fi direct connection parameters are performed. After completing device binding, authentication, and negotiation of Wi-Fi direct connection parameters, the two devices can establish Wi-Fi direct connection. However, the time-consuming of establishing the above Bluetooth link is relatively long, which will lead to a long time for the two devices to establish connection, and the user needs to wait during the subsequent entire service transmission process, thereby affecting the user's experience. SUMMARY

[0005] The present application provides a communication method and device, the first device synchronizes the information used by the second device to establish the first communication connection before establishing the first communication connection with the second device. Thus, multiple interaction processes are avoided when establishing the first communication connection, and the time-consuming of establishing the first communication connection is reduced.

[0006] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:

[0007] In a first aspect, the present application provides a communication method applied to a first device, comprising:

[0008] The first device can receive first communication information sent by a second device, the first communication information including a second transmission key used by the second device to establish a first communication connection and a link establishment capability of the second device, the link establishment capability of the second device being used to indicate whether the second device supports establishing the first communication connection.

[0009] The first device can also establish the first communication connection with the second device based on the first communication information and the second communication information in response to the trigger operation for the cooperative service; the second communication information includes a link establishment capability of the first device and a first transmission key used by the first device to establish the first communication connection, and the link establishment capability of the first device is used to indicate whether the first device supports establishing the first communication connection.

[0010] In this way, in one aspect, the first device of the embodiment of the present application can synchronize the information of the second device used to establish the first communication connection before establishing the first communication connection with the second device, such as the information of whether the second device supports establishing the first communication connection and the required transmission key information. In this way, the first device can directly use the synchronized first communication information to establish the first communication connection with the second device. Thus, the multiple interaction processes when establishing the first communication connection are avoided, and the connection overhead is reduced. At the same time, the time consumption for establishing the first communication connection is further reduced, and the service execution efficiency of the entire cooperative service process is improved.

[0011] On the other hand, in the process of establishing the first communication connection, the embodiment of the present application does not need to establish a specific link (such as a Bluetooth link) and does not have time consumption fluctuation, thereby reducing the required time for the two devices to establish the first communication connection. Further, the user does not need to wait for a long time in the subsequent entire service transmission process, and the user experience is improved.

[0012] In one implementation manner, the first device can send the first broadcast information in the process of responding to the trigger operation for the cooperative service, and the first broadcast information is used to notify the second device to establish the first communication connection with the first device.

[0013] In this way, the first device of the embodiment of the present application can send the first broadcast information in the form of broadcast to activate the second device to establish the first communication connection with the first device. The multiple transmissions of the first broadcast information in the network are avoided, the information transmission and coordination are realized in real time, and thus the information response speed, real-time performance, and information processing efficiency are improved.

[0014] In one implementation manner, the first communication connection includes a communication link, and the first device can receive a link connection request sent by the second device in the process of establishing the first communication connection with the second device based on the first communication information and the second communication information, and the link connection request is used to request the first device to establish the communication link.

[0015] The first device can also send a link connection response to the second device based on the first communication information and the second communication information, and the link connection response is used to indicate that the first device and the second device have successfully established the communication link.

[0016] Thus, the first device in the embodiment of the present application receives the link connection request sent by the second device, and can send a link connection response to the second device based on the first communication information and the second communication information to inform the second device that the communication link has been successfully established. The first device and the second device only perform the above-mentioned interaction once, reducing the interaction process of the link establishment process between devices, reducing the link establishment delay of the first communication connection, and providing faster link establishment speed for collaborative services.

[0017] In an implementable manner, the link connection request and the link connection response are sent through a target communication mode, and the target communication mode includes a wireless fidelity (Wi-Fi) operation frame communication.

[0018] Thus, in the embodiment of the present application, the transmission link of the first communication connection can be established by the Bluetooth broadcast, and then a negotiation interaction process is performed through the Wi-Fi Action frame communication mode. By fully utilizing the speed and capacity of the corresponding channel of the Wi-Fi Action frame, sufficient information can be carried, and the negotiation interaction with the opposite device can be performed faster. Further, the link establishment delay of the first communication connection is reduced, and better experience and performance are provided for collaborative services.

[0019] In an implementable manner, the first broadcast information includes second device identification of the second device and information of an expected channel, and the expected channel is a channel used to establish the first communication connection.

[0020] Thus, in the embodiment of the present application, the first broadcast information includes the second device identification and the information of the expected channel, which can facilitate the second device to establish the first communication connection with the first device subsequently while activating the second device. The efficiency of establishing the first communication connection is improved.

[0021] In an implementable manner, the information of the expected channel is encrypted by using a pairwise master key, and the pairwise master key is obtained after the first device and the second device perform authentication.

[0022] Thus, in the embodiment of the present application, the information of the expected channel can be encrypted by using the pairwise master key to ensure the security of information transmission.

[0023] In an implementable manner, the first device can create a first virtual access point in the first device based on the information of the expected channel. The first device can also configure first connection information for the first virtual access point, and the first connection information is used to establish the first communication connection between the first device and the second device.

[0024] Thus, the embodiment of the present application can prepare the encrypted data required for transmission of the data link layer in advance by creating the first virtual access point and configuring the first connection information for the first virtual access point. In the subsequent interaction process, the two devices can not only complete the establishment of the communication link of the first communication connection, but also directly transmit the encrypted data required for transmission of the data link layer. The interaction process of the entire chain establishment process is reduced, the chain establishment delay of the first communication connection is reduced, and a faster chain establishment speed is provided for the collaborative service.

[0025] In an implementable manner, the first device can also establish a corresponding relationship between the first virtual access point and the second virtual access point in the second device.

[0026] Thus, the embodiment of the present application can establish the corresponding relationship between the two virtual access points to successfully establish the communication link of the first communication connection. In this way, the first device can send a link connection response to the second device to inform the establishment of the communication link of the first communication connection. Meanwhile, the first device can directly transmit the encrypted data required for transmission of the data link layer. The interaction process of the entire chain establishment process is reduced, the chain establishment delay of the first communication connection is reduced, and a faster chain establishment speed is provided for the collaborative service.

[0027] In an implementable manner, in the process in which the first device sends the link connection response to the second device based on the first communication information and the second communication information, the first device can send the link connection response to the second device by using the first transmission key in a case where it is determined that the second device supports the establishment of the first communication connection based on the chain establishment capability of the second device, and the second device is the target device for establishing the first communication connection based on the verification of the link connection request.

[0028] Thus, in the embodiment of the present application, the first device can send the link connection response to the second device by using the first transmission key, so as to improve the security of information transmission and further improve the establishment reliability of the first communication connection.

[0029] In an implementable manner, the link connection request includes second connection information, and the second connection information is configuration information of the second virtual access point in the second device. The first device can determine whether the challenge code in the second connection information is recorded in a case where it is determined that the second device identifier of the second device in the link request is recorded.

[0030] The first device can also determine that the second device is the target device for establishing the first communication connection in a case where the challenge code in the second connection information is recorded, and the challenge code is sent to the second device by the first device based on the first broadcast information.

[0031] In this way, the second connection information can include the challenge code, and the first device can verify the challenge code sent by the second device with the recorded challenge code, so as to determine whether the second device is the target device for establishing the first communication connection. The establishment reliability and security of the first communication connection are further improved.

[0032] In an implementation, the second connection information is encrypted by the second device using a second transmission key. The first device can query the corresponding second transmission key according to the second device identifier, and the first device can also decrypt the second connection information using the second transmission key to obtain the challenge code.

[0033] In this way, the second connection information can be encrypted by the second device to improve the security of information transmission. In this way, the first device can decrypt the second connection information to obtain the challenge code, so as to verify whether the second device is the target device for establishing the first communication connection. The establishment reliability of the first communication connection is further improved.

[0034] In an implementation, the second connection information further includes second verification information, and the second verification information is used to verify the integrity of the second connection information. The first device can calculate the verification information corresponding to the second connection information using a first preset rule. The first device can also determine that the second connection information has not changed when the verification information corresponding to the second connection information is consistent with the second verification information.

[0035] In this way, the embodiments of the present application can carry verification information in the connection information to verify the integrity of the connection information. It is ensured that the connection information does not change during transmission, and the security and reliability of information transmission are improved.

[0036] In an implementation, the first communication connection further includes a logical link, the first connection information includes first network segment information, the first network segment information is used to represent a network address of the logical link corresponding to the first device, and the second connection information further includes second network segment information, the second network segment information is used to represent a network address of the logical link corresponding to the second device.

[0037] The first device can update the first network segment information and the second network segment information using a second preset rule to generate a target network address, and the target network address is used to transmit service data of the collaborative service between the first device and the second device.

[0038] In this way, the embodiments of the present application can directly obtain the network segment information of the opposite end through one interaction process, and the network address of the logical link can be configured directly using the network segment information of the opposite end device and the network segment information of the local device in the subsequent process. Multiple interaction processes are not required to obtain the network segment information, the chain establishment delay of the first communication connection is reduced, and a faster chain establishment speed is provided for the collaborative service.

[0039] In an implementation, the first communication connection further comprises a logical link, and the second connection information further comprises second port information, the second port information being used to identify a port of the second device corresponding to the logical link.

[0040] The first device can establish a transmission control protocol (TCP) connection with the second device based on the second port information to complete establishment of the logical link.

[0041] In this way, the port information of the second device can be obtained through one interaction between the two devices. The TCP connection can be directly established by using the port information of the second device to complete establishment of the logical link. The time consumption for establishing the logical link is reduced, and the connection efficiency of the first communication connection is improved.

[0042] In an implementation, the first communication connection further comprises a logical link, and the first device can encrypt the first connection information by using the first transmission key and send the link connection response to the second device.

[0043] The link connection response comprises the encrypted first connection information, and the first connection information comprises a challenge code, first verification information, first network segment information and first port information. The challenge code is used to verify whether the first device is the target device for establishing the first communication connection by the second device. The first verification information is used to verify the integrity of the first connection information. The first network segment information and the first port information are used to establish the logical link by the second device.

[0044] In this way, the first device can make the second device obtain the network segment information and the port information of the first device through one interaction process. The second device can subsequently establish the logical link by using the network segment information and the port information of the second device and the network segment information and the port information of the first device. The interaction process does not need to be performed multiple times, the link establishment delay of the first communication connection is reduced, and a faster link establishment speed is provided for the collaborative service.

[0045] Meanwhile, the interaction process can also make the second device obtain the challenge code and the first verification information to perform security verification. The reliability of information transmission is improved.

[0046] In an implementation, the first broadcast information further comprises a renegotiation manner, and the renegotiation manner is used to represent a communication manner for information renegotiation between the first device and the second device. The renegotiation manner comprises a communication manner based on a wireless fidelity (Wi-Fi) data frame.

[0047] The first device can receive a change operation frame sent by the second device based on the renegotiation manner. The change operation frame comprises updated expected channel information, and the change operation frame is used to request the first device to establish the first communication connection based on the updated expected channel information.

[0048] The first device can also send a response operation frame to the second device in response to the change operation frame, the response operation frame being used to indicate that the first device establishes the first communication connection based on the updated expected channel information.

[0049] In this way, the embodiments of the present application can re-negotiate the channel information based on the wireless fidelity data frame communication mode in the case that the channel information of the two devices establishing the communication link is inconsistent. The BR link or the BLE link does not need to be established for negotiation, which greatly shortens the fast link establishment time delay in the re-negotiation scenario, and provides better experience and performance for the collaborative service.

[0050] In an implementable manner, the first device can also update the first virtual access point in the first device based on the updated expected channel information.

[0051] In this way, the embodiments of the present application can update the first virtual access point based on the updated expected channel information in the case that the channel information of the two devices establishing the communication link is inconsistent. For example, the latest first virtual access point is created and the first virtual access point is configured. In order to facilitate the subsequent fast establishment of the first communication connection, the fast link establishment time delay in the re-negotiation scenario is greatly shortened, and better experience and performance are provided for the collaborative service.

[0052] In an implementable manner, in the process that the first device receives the first communication information sent by the second device, the first device can send a first synchronization request to the second device in the case that the account information of the first device and the account information of the second device are the same account, or the account information of the first device and the account information of the second device are associated accounts in a trusted relationship, the first synchronization request being used to request to synchronize the first communication information. The first device can also receive the first communication information sent by the second device.

[0053] In this way, the embodiments of the present application can directly trigger the process of synchronizing the communication information after the two devices discover each other, that is, before the first communication connection is established. Therefore, multiple interaction processes are avoided when the first communication connection is established. The time consumption of establishing the first communication connection is further reduced, and the business execution efficiency of the entire collaborative service process is improved.

[0054] In an implementable manner, in the process that the first device sends the first synchronization request to the second device, the first device can send the first synchronization request to the second device through the established second communication connection.

[0055] The second communication connection includes at least one of a Bluetooth communication connection, a wireless local area network communication connection, and a wireless fidelity communication connection, and the second communication connection is disconnected after receiving the first communication information.

[0056] Therefore, the two devices in the embodiments of the present application can synchronize the communication information through the established second communication connection before establishing the first communication connection. The communication information does not need to be synchronized through a specific link during the process of establishing the first communication connection, thereby reducing the time consumption of establishing the first communication connection and improving the speed of establishing the link when performing the collaborative service. Meanwhile, the two devices disconnect the second communication connection after synchronizing the communication information, which can reduce the power consumption of the devices and reduce resource waste.

[0057] In an implementable manner, the first communication information further includes channel information supported by the second device for Wi-Fi direct connection, and the method further includes that the first device can determine the information of the expected channel according to the channel information supported by the second device for Wi-Fi direct connection.

[0058] Therefore, the embodiments of the present application can determine the information of the expected channel according to the channel information supported by the opposite device for the first communication connection. This can facilitate the subsequent establishment of the first communication connection based on the information of the expected channel directly. Thus, the time consumption of establishing the first communication connection is reduced, and the efficiency of establishing the first communication connection is improved.

[0059] In a second aspect, the embodiments of the present application further provide a communication method applied to a second device.

[0060] The second device can receive second communication information sent by the first device, the second communication information including the link establishment capability of the first device and a first transmission key used by the first device to establish the first communication connection, the link establishment capability of the first device being used to indicate whether the first device supports establishing the first communication connection.

[0061] The second device can further establish the first communication connection with the first device based on the first communication information and the second communication information, the first communication information including the link establishment capability of the second device and a second transmission key used by the second device to establish the first communication connection, the link establishment capability of the second device being used to indicate whether the second device supports establishing the first communication connection.

[0062] Therefore, the second device in the embodiments of the present application can synchronize the information used by the first device to establish the first communication connection before establishing the first communication connection with the first device. In this way, the second device can directly establish the first communication connection with the first device by using the synchronized second communication information. Thus, the multiple interaction processes during the establishment of the first communication connection are avoided, and the connection overhead is reduced. Meanwhile, the time consumption of establishing the first communication connection is further reduced, and the service execution efficiency of the entire collaborative service process is improved.

[0063] In an implementable manner, the second device can further receive first broadcast information, the first broadcast information being used to notify the second device to establish the first communication connection with the first device.

[0064] Thus, the second device according to the embodiments of the present application can receive the first broadcast information in the form of broadcasting to trigger the establishment of the first communication connection with the first device. The multiple transmissions of the first broadcast information in the network are avoided, and instant information transmission and coordination are achieved, thereby improving the information response speed, real-time performance and information processing efficiency.

[0065] In an implementable manner, the first communication connection comprises a communication link, and in the process of establishing the first communication connection with the first device based on the first communication information and the second communication information, the second device can send a link connection request to the first device based on the second transmission key in a case that it is determined that the first device supports the establishment of the first communication connection based on the link establishment capability of the first device, and the link connection request is used to request the establishment of the communication link with the first device.

[0066] The second device can further receive a link connection response sent by the first device, and the link connection response is used to indicate that the communication link between the first device and the second device has been successfully established.

[0067] Thus, the second device according to the embodiments of the present application can send the link connection request to the first device and receive the link connection response sent by the first device to successfully establish the communication link. The first device and the second device only perform the above-mentioned interaction once, the interaction process of the link establishment process between the devices is reduced, the link establishment delay of the first communication connection is reduced, and faster link establishment speed is provided for the collaborative service.

[0068] In an implementable manner, the first broadcast information comprises the second device identifier of the second device and the information of the expected channel. The second device can create a second virtual access point in the second device based on the information of the expected channel in a case that it is determined that the first broadcast information is the required processing information based on the second device identifier. The second device can further configure the second connection information for the second virtual access point, and the second connection information is used to establish the first communication connection between the second device and the first device.

[0069] Thus, the embodiments of the present application can prepare the encrypted data required for the transmission of the data link layer in advance by creating the second virtual access point and configuring the second connection information for the second virtual access point. In the subsequent interaction process between the two devices, not only the communication link for the establishment of the first communication connection can be completed, but also the encrypted data required for the transmission of the data link layer can be directly transmitted. The interaction process of the entire link establishment process is reduced, the link establishment delay of the first communication connection is reduced, and faster link establishment speed is provided for the collaborative service.

[0070] In an implementable manner, the first communication connection further comprises a logical link, and the first broadcast information further comprises a challenge code, the challenge code being used for the first device to verify whether the second device is a target device for establishing the first communication connection. The second device can encrypt the second connection information by using the second transmission key in a process of sending a link connection request to the first device based on the first communication information.

[0071] The link connection request comprises the encrypted second connection information, and the second connection information comprises the challenge code, second verification information, second network segment information and second port information, the second verification information being used for verifying integrity of the second connection information, and the second network segment information and the second port information being used for the first device to establish the logical link.

[0072] In this way, the second device can send the link connection request to the first device by using the second transmission key in the embodiments of the present application, so as to improve security of information transmission. The establishment reliability of the first communication connection is further improved.

[0073] In a third aspect, the embodiments of the present application further provide a communication system, the communication system comprising a first device and a second device.

[0074] The first device is configured to receive first communication information sent by the second device, the first communication information comprising a link establishment capability of the second device and a second transmission key used by the second device for establishing a first communication connection, the link establishment capability of the second device being used to indicate whether the second device supports establishing the first communication connection.

[0075] The first device is further configured to, in response to a trigger operation for a cooperative service, establish the first communication connection with the second device based on the first communication information and second communication information, the second communication information comprising a link establishment capability of the first device and a first transmission key used by the first device for establishing the first communication connection, the link establishment capability of the first device being used to indicate whether the first device supports establishing the first communication connection.

[0076] The second device is configured to receive second communication information sent by the first device.

[0077] The second device is configured to establish the first communication connection with the first device based on the first communication information and the second communication information.

[0078] In a fourth aspect, the embodiments of the present application further provide an electronic device, the electronic device comprising a memory and one or more processors; the memory is coupled to the processors; and the memory stores computer program codes, the computer program codes comprising computer instructions, when the computer instructions are executed by the processors, causing the electronic device to perform the method in the first aspect, or perform the method in the second aspect.

[0079] In a fifth aspect, the embodiments of the present application further provide a computer readable medium, and the computer readable medium stores instructions. When the instructions run on an electronic device, the electronic device executes the method in the first aspect or the method in the second aspect.

[0080] In a sixth aspect, the embodiments of the present application further provide a computer program product, and the computer program product contains instructions. When the instructions run on a computer or a processor, the computer or the processor executes the method in the first aspect or the method in the second aspect. BRIEF DESCRIPTION OF DRAWINGS

[0081] FIG. 1 is a schematic diagram of establishing Wi-Fi direct according to a related art provided by the embodiments of the present application;

[0082] FIG. 2 is a schematic diagram of the structure of a communication system provided by the embodiments of the present application;

[0083] FIG. 3 is a schematic diagram of the hardware structure of a mobile phone 100 provided by the embodiments of the present application;

[0084] FIG. 4 is a block diagram of the software structure of a mobile phone 100 provided by the embodiments of the present application;

[0085] FIG. 5 is a schematic diagram of the hardware of a communication device provided by the embodiments of the present application;

[0086] FIG. 6 is a schematic diagram of the flow of a communication method provided by the embodiments of the present application;

[0087] FIG. 7 is a schematic diagram of the interaction of a mobile phone and a tablet computer in synchronizing communication information provided by the embodiments of the present application;

[0088] FIG. 8 is a schematic diagram of the scenario of a collaborative service provided by the embodiments of the present application;

[0089] FIG. 9 is a schematic diagram of the interaction of a mobile phone and a tablet computer in establishing a first communication connection provided by the embodiments of the present application;

[0090] FIG. 10 is a schematic diagram of the interaction of a mobile phone and a tablet computer in re-negotiation provided by the embodiments of the present application;

[0091] FIG. 11 is a schematic diagram of the interaction of a mobile phone in processing a link connection request provided by the embodiments of the present application;

[0092] FIG. 12 is a schematic diagram of the interaction of a mobile phone and a tablet computer in updating a transmission key provided by the embodiments of the present application;

[0093] FIG. 13 is a schematic diagram of the hardware of a mobile phone provided by the embodiments of the present application. DETAILED DESCRIPTION

[0094] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the present application, unless otherwise specified, " / " represents an "or" relationship between the objects before and after the " / ", for example, A / B can represent A or B; in the present application, "and / or" is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent: A alone, A and B together, and B alone, where A and B can be singular or plural. In addition, in the description of the present application, unless otherwise specified, "multiple" means two or more than two. "At least one of the following" or similar expressions means any combination of the items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, "first", "second", and the like are used to distinguish the same items or similar items with basically the same function and effect.

[0095] Those skilled in the art can understand that the "first", "second", and the like do not limit the quantity and execution order, and the "first", "second", and the like do not necessarily mean different. At the same time, in some embodiments of the present application, the words "exemplary" or "for example" are used to represent an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the use of "exemplary" or "for example" is intended to present the relevant concept in a specific manner, for ease of understanding.

[0096] In addition, the device architecture and business scenarios described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that as the evolution of device architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0097] In order to better understand the technical solutions of the present application, the technical terms related to the present application will be described first.

[0098] Wireless local area network (WLAN) direct, also known as Wi-Fi direct, or WiFi peer-to-peer (P2P) connection. Wi-Fi direct is a technology that allows devices to connect and exchange data directly through wireless means. Wi-Fi direct supports peer-to-peer connection, and Wi-Fi direct allows devices to discover and connect to each other directly using WLAN direct protocol.

[0099] It should be understood that Wi-Fi direct allows devices to connect to each other directly through Wi-Fi, and the connected devices can directly communicate or transmit data, etc., without the participation of the Internet or mobile network or access point (AP) (such as network devices (such as local area network routers)) and the like. Wi-Fi direct also supports devices to share high-throughput data between trusted devices and applications even if they are disconnected from the network, even if they are not connected to the Internet or network devices.

[0100] In network communication, there are usually two roles of client and server. The client refers to a device that needs to access the services or resources provided by the server, that is, the service requester. The server refers to a device that provides services or resources, that is, the service provider. Specifically, the client (which can also be described as the discovery end) searches for available servers (which can also be described as the discovered end) nearby, and filters the appropriate server, initiates a connection request to it, and the server receiving the connection request responds to the connection request and connects with the client to provide services or resources for the client, etc.

[0101] It can be understood that the service refers to the function or resource provided by the device (such as the server). The service can be the hardware function of the device, or the service provided by the device system. The service can also be the software function of the device, that is, the service provided by the application (APP) installed on the device. The service can also be different types of resources, such as file sharing, printing service, media transmission, etc.

[0102] It can be understood that the connection between the client and the server is usually a one-to-one connection, that is, a single client is connected to a single server for communication. However, in some scenarios, there is also a one-to-many connection, and a single client needs to be connected to multiple servers for communication. Or, a single server needs to be connected to multiple clients for communication. For example, a client performs screen projection display or file sharing to multiple servers, etc.

[0103] The above Wi-Fi direct can be used between multiple devices to work cooperatively. For example, in a multi-screen interaction scenario (e.g., performing a screen projection service), a screen image on a certain electronic device (e.g., a mobile phone) can be shared to another electronic device (e.g., a tablet computer) for display, thereby realizing interconnection and intercommunication between multiple devices and meeting user usage requirements.

[0104] Generally, two devices need to implement Wi-Fi direct through Bluetooth technology. Specifically, a Bluetooth link corresponding to the Bluetooth connection needs to be established to complete the Bluetooth connection using the Bluetooth link. Then, the two devices also need to perform device binding, authentication, and negotiation of connection parameters of Wi-Fi direct based on the Bluetooth link. After completing device binding, authentication, and negotiation of connection parameters of Wi-Fi direct, the two devices can establish Wi-Fi direct.

[0105] Continuing with the example of the mobile phone performing a screen projection service. Referring to (A) in FIG. 1, the mobile phone in the related art can discover the other device by sending a Bluetooth broadcast. Generally, a user can click a screen projection control in a video display interface to trigger a screen projection process during video viewing using the mobile phone. The mobile phone can establish a Bluetooth link with the tablet computer in response to the click operation on the screen projection control. In this way, the user can discover the tablet computer through the foreground of the mobile phone (e.g., the tablet computer is included in a device list displayed after clicking the screen projection control), and the user can also click the tablet computer in the device list to trigger a data transmission process between the mobile phone and the tablet computer. Specifically, the mobile phone can perform device binding, authentication, and negotiation of connection parameters of Wi-Fi direct using the Bluetooth link in response to the click operation on the tablet computer in the device list. After completing device binding, authentication, and negotiation of connection parameters of Wi-Fi direct, the Wi-Fi direct is established and service data corresponding to the screen projection service is transmitted.

[0106] During negotiation of the connection parameters of Wi-Fi direct, key negotiation is generally performed to ensure synchronization of the keys between the two devices. The synchronized keys are used for subsequent establishment of Wi-Fi direct, such as encryption of transmitted information (negotiation of connection parameters of Wi-Fi direct).

[0107] Specifically, the two devices generally perform 4-way handshake negotiation during key negotiation.

[0108] For example, the first handshake is that the mobile phone can send a first EAPOL message to the tablet based on an Extensible Authentication Protocol (EAP). The first EAPOL message includes a first random value, which is used by the tablet to derive a corresponding pairwise transit key (PTK) for encryption and decryption of unicast data frames. In this way, the tablet can derive its own PTK based on the first EAPOL message. It should be noted that the mobile phone and the tablet can know each other's media access control (MAC) address during the authentication process, and thus can derive the PTK based on the random value.

[0109] The second handshake is that the tablet sends a second EAPOL message to the mobile phone after deriving its own PTK. The second EAPOL message includes a second random value and an authentication value, which is used by the mobile phone to verify the integrity of the second EAPOL message. The second random value is used by the mobile phone to derive a corresponding PTK.

[0110] The third handshake is that the mobile phone sends a third EAPOL message to the tablet after deriving its own PTK. The third EAPOL message includes a group temporal key (GTK), which can be encrypted based on the PTK. The third EAPOL message is used to inform the tablet to use the GTK and the PTK to encrypt transmission information.

[0111] The fourth handshake is that the tablet sends a fourth EAPOL message to the mobile phone after configuring the GTK and the PTK. The fourth EAPOL message is used to inform the mobile phone that the GTK and the PTK have been used to encrypt transmission information. In this way, the two devices can encrypt and decrypt the transmission information based on the above-mentioned synchronized keys.

[0112] Based on the above, on the one hand, the time-consuming of establishing the above Bluetooth link is relatively long (such as 2.5 seconds) and there is time-consuming fluctuation. For example, in the case that the current background has used Bluetooth resources, the time-consuming of establishing the Bluetooth link can be more than 10 seconds. As a result, the two devices need a long time to establish a communication connection, and then the user needs to wait during the subsequent entire business transmission process, which affects the user's use experience.

[0113] On the other hand, due to the limited bandwidth of Bluetooth and the service preemption scenario, the data transmission relying on the Bluetooth link will occupy too many resources. This leads to slow Bluetooth-based service discovery and a high failure rate of communication connection between the two devices. At the same time, the amount of information carried by the interaction through Bluetooth broadcast is limited and cannot support subsequent binding, authentication and negotiation processes.

[0114] Further, in the process of performing device binding, authentication and negotiation relying on the Bluetooth link established above, multiple interaction processes including the above-mentioned four handshakes need to be performed based on the link layer corresponding to the Bluetooth link. Thus, it will lead to a large connection overhead of the link layer corresponding to the Bluetooth link, reducing the usage space of the link layer corresponding to the Bluetooth link. At the same time, performing multiple interaction processes will also lead to a long time consumption of establishing a communication connection.

[0115] Referring to (B) in FIG. 1, in the related art, a pre-established manner can also be used for the Bluetooth link. For example, if the mobile phone and the tablet computer are trusted devices, such as two devices logging into the same account. In this way, after the mobile phone is close to the tablet computer, the two devices can discover each other by sending Bluetooth broadcasts. Then, the two devices will establish a Bluetooth link. In this way, after the user triggers the screen projection service, the mobile phone can respond to the triggering operation of the screen projection service and perform device binding, authentication and negotiation of Wi-Fi direct connection parameters with the tablet computer using the Bluetooth link. Similarly, after the device binding, authentication and negotiation of Wi-Fi direct connection parameters are completed, the Wi-Fi direct connection is established and the service data corresponding to the screen projection service is transmitted.

[0116] However, if the two devices do not need to work together originally, but the Bluetooth link is established in advance, it will increase the power consumption of the two devices and waste Bluetooth resources. If the device is still performing other services, the pre-established Bluetooth link will affect the execution of other services. Even the execution of other services fails or the Bluetooth link fails to be established.

[0117] Based on the above, the present application provides a communication method applied to a first device, the method comprising: the first device can receive first communication information sent by a second device. The first communication information includes the link establishment capability of the second device and a second transmission key used by the second device to establish a first communication connection, and the link establishment capability of the second device is used to indicate whether the second device supports establishing the first communication connection.

[0118] The first device can establish the first communication connection with the second device based on the first communication information and second communication information in response to a triggering operation for a collaborative service. The second communication information includes the link establishment capability of the first device and a first transmission key used by the first device to establish the first communication connection, and the link establishment capability of the first device is used to indicate whether the first device supports establishing the first communication connection.

[0119] Thus, in one aspect, the embodiments of the present application do not need to establish a specific link (such as a Bluetooth link) and do not have time-consuming fluctuations in establishing the first communication connection, thereby reducing the time required for the two devices to establish the first communication connection. Further, the user does not need to wait for a long time during the entire subsequent service transmission process, thereby improving the user experience.

[0120] In another aspect, the embodiments of the present application can synchronize the information of the second device for establishing the first communication connection (such as whether the second device supports the establishment of the first communication connection and the required transmission key information) before the first device establishes the first communication connection with the second device. In this way, the first device can directly establish the first communication connection with the second device by using the synchronized first communication information. Thus, the embodiments of the present application avoid performing multiple interaction processes when establishing the first communication connection, thereby reducing the connection overhead. Meanwhile, the embodiments of the present application further reduce the time consumption for establishing the first communication connection and improve the service execution efficiency of the entire collaborative service process.

[0121] The communication method provided by the embodiments of the present application can be applied to a communication system.

[0122] Referring to FIG. 2, the communication system provided by the embodiments of the present application includes a first device 101 (such as a mobile phone of a first user) and a second device 102 (such as a tablet computer of the first user).

[0123] In some embodiments, referring to FIG. 2, a communication connection is established between the first device 101 and the second device 102. The first device 101 and the second device 102 can perform collaborative work.

[0124] The first device 101 and the second device 102 can establish a wireless communication connection.

[0125] In one implementation manner, the wireless communication connection between the first device 101 and the second device 102 can 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), and long term evolution (LTE).

[0126] In some embodiments, the wireless communication technology for establishing the wireless communication connection includes, but is not limited to, at least one of the following: a wireless local area network (WLAN) (such as a wireless fidelity (Wi-Fi) network), Bluetooth (BT) (e.g., traditional Bluetooth or Bluetooth low energy (BLE)), near field communication (NFC), a Wi-Fi peer-to-peer (P2P) connection, also known as a Wi-Fi direct connection, Zigbee, frequency modulation (FM), infrared (IR), and the like.

[0127] In some examples, in the process of establishing the communication connection, the first device 101 can receive first communication information sent by the second device, the first communication information being information used by the second device to establish the communication connection. The second device can receive second communication information sent by the first device, the second communication information being information used by the first device to establish the first communication connection. The first device can establish the communication connection with the second device based on the first communication information and the second communication information in response to the triggering operation of the collaborative service (such as performing the screen projection service in FIG. 1). The second device can also establish the communication connection with the first device based on the first communication information and the second communication information.

[0128] That is, the first device 101 and the second device 102 can synchronize the information used for the communication connection before establishing the communication connection. In this way, the first device 101 can directly establish the communication connection with the second device 102 by using the synchronized information after responding to the triggering operation of the collaborative service. The second device 102 can also directly establish the communication connection with the first device 101 by using the synchronized information. This reduces the time required to establish the communication connection and improves the efficiency of the transmission service.

[0129] The first device 101 and the second device 102 can include a mobile phone, a tablet computer, a smart watch, a notebook computer, a netbook, a personal digital assistant (PDA), a wearable device, an artificial intelligence (AI) device, and the like, which are electronic devices with communication capabilities.

[0130] In addition, the operating system installed on the first device 101 and the second device 102 includes, but is not limited to Or other operating systems. This application does not limit the specific type of electronic device or the type of operating system installed on it.

[0131] Of course, the communication system provided in this application embodiment may also include other electronic devices besides the first device 101 and the second device 102. The communication system provided in this application embodiment includes, but is not limited to, data interaction between two devices, and may also include information interaction between one device and multiple devices. Those skilled in the art can determine the type and number of electronic devices according to actual needs, and these designs do not exceed the protection scope of this application embodiment.

[0132] The first device 101 and the second device 102 in this application embodiment can be implemented using different or the same devices. For example, the first device 101 and the second device 102 in this application embodiment can be implemented using the mobile phone 100 in FIG3.

[0133] Figure 3 shows a schematic diagram of the hardware structure of the mobile phone 100 provided in an embodiment of this application.

[0134] Mobile phone 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0135] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the mobile phone 100. In other embodiments of this application, the mobile phone 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0136] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.

[0137] The controller can be the nerve center and command center of the mobile phone 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0138] The memory in the processor 110 can also be configured to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0139] The wireless communication function of the mobile phone 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0140] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone 100 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 a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0141] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G / future communication, etc. applied to the mobile phone 100.

[0142] The mobile communication module 150 can 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, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and radiate the signals as electromagnetic waves by the antenna 1.

[0143] The wireless communication module 160 can provide wireless communication solutions applied to the mobile phone 100, including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc.

[0144] The wireless communication module 160 can be one or more devices integrated with at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, perform frequency modulation and amplification on the signals, and radiate the signals as electromagnetic waves by the antenna 2.

[0145] In the embodiments of the present application, the wireless communication module 160 includes a device with a service discovery function. Specifically, the device with the service discovery function can be a low-power device that implements the service discovery function, such as Bluetooth, Bluetooth low energy (BLE), etc. For example, a service discovery request can be broadcasted by BLE to discover the services of surrounding devices. Alternatively, the device can listen to the BLE broadcast of other devices to be discovered by surrounding devices.

[0146] It can be understood that the device with the service discovery function in the wireless communication module 160 can actively initiate a discovery request, or can listen to a discovery request initiated by a surrounding device and respond.

[0147] In the embodiments of the present application, the wireless communication module 160 further comprises a device with a communication connection function. Specifically, the device with a communication connection function can be a high-speed data communication device such as Wi-Fi. For example, a link connection between devices is established through Wi-Fi, and subsequent data transmission and communication requirements are supported.

[0148] In the embodiments of the present application, the mobile phone 100 is provided with a low-power communication device and a high-speed data communication device to meet the requirements of service discovery, communication connection and data transmission. The low-power communication device is used for service discovery and triggering in a low-power mode, and the high-speed data communication device is used for establishing a link connection and supporting high-speed data transmission.

[0149] In some embodiments, the antenna 1 of the mobile phone 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the mobile phone 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can 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 can 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).

[0150] The phone 100 implements display functions through a GPU, the display screen 194, and an 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 can include one or more GPUs that execute program instructions to generate or change display information.

[0151] The display screen 194 is used to display images, videos, etc. In some embodiments, the phone 100 can include 1 or N display screens 194, N being a positive integer greater than 1.

[0152] In some embodiments, the display screen 194 is used to display a collaborative service interface. A user can perform a triggering operation on the collaborative service interface to trigger the phone 100 to perform the collaborative service with other devices. After responding to the triggering operation of the collaborative service interface, the phone 100 can disconnect the first communication connection established with the other devices through the wireless communication module 160.

[0153] In an implementable manner, the phone 100 and the other devices can synchronize information for establishing the first communication connection before establishing the first communication connection. In this way, after responding to the triggering operation of the collaborative service, the phone 100 can directly establish the first communication connection with the other devices by using the synchronized information. The synchronized information can include a link establishment capability for indicating whether the first communication connection can be supported and a required transmission key for establishing the first communication connection.

[0154] The phone 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, and an application processor, etc. For example, music playing, recording, etc.

[0155] The software system of the phone 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example to exemplarily illustrate the software structure of the phone 100.

[0156] FIG. 4 is a software structure block diagram of the phone 100 according to an embodiment of the present application.

[0157] The layered architecture divides software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, an application layer, an application framework layer, an Android runtime (ART) and system library, a hardware abstract layer (HAL), and a kernel layer.

[0158] The application layer can include a series of application packages.

[0159] As shown in FIG. 4, the application packages can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, settings, and the like.

[0160] The application framework layer provides an application programming interface (API) and a programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions.

[0161] As shown in FIG. 4, the application framework layer can include a window manager, a content provider, a link establishment negotiation module, a networking module, a connection module, a broadcast module, and a network address management module, and the like.

[0162] The window manager is used to manage window programs. The window manager can acquire a display screen size, determine whether there is a status bar, lock a screen, and the like.

[0163] The content provider is used to store and acquire data, and make the data accessible to the applications. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, and the like.

[0164] The link establishment negotiation module is used to negotiate link information in the process of establishing a communication connection.

[0165] The networking module is used to record communication capabilities corresponding to different communication connections that can be established. For example, the networking module can negotiate a way to establish Wi-Fi direct connection between two devices that have already established a connection. Alternatively, the networking module can negotiate whether Wi-Fi direct connection can be established through BLE broadcast between two devices that have not established a connection, or a new link BR link / BLE link is used to negotiate to establish Wi-Fi direct connection.

[0166] The connection module is used to establish a transmission link and associate the transmission link in the process of establishing a first communication connection. The connection module can be a Huawei Magneto Link (HML) connection module based on a multi-link direct connection protocol.

[0167] The broadcast module is used for broadcast management such as sending broadcast and listening to broadcast. The broadcast module can be a BLE module.

[0168] The network address management module is used to be responsible for network address allocation, setting, and conflict management.

[0169] ​The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0170] The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.

[0171] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.

[0172] The system library can include multiple functional modules. For example: surface manager, media library, three-dimensional graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0173] The surface manager is used to manage the display subsystem and provides 2D and 3D layer fusion for multiple applications.

[0174] The media library supports multiple commonly used audio, video format playback and recording, and static image files. The media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0175] The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.

[0176] The 2D graphics engine is a drawing engine for 2D drawing.

[0177] The hardware abstraction layer runs in the user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer. The hardware abstraction layer can include a display module, a Wi-Fi service, a target service, and a sensor module. Among them, the target service can be an HML service, which is used to interact with peripheral devices during the process of establishing an HML communication connection.

[0178] The kernel layer is the layer between hardware and software. The kernel layer at least contains display driver, Wi-Fi driver, link driver, sensor driver.

[0179] In some examples, the system architecture of the embodiment of the present application also has a distributed soft bus capability, which refers to a software connection mode realized through a communication connection between different terminal devices. The distributed soft bus can provide a unified distributed communication capability (including but not limited to CPU / GPU capability, screen capability, storage capability, microphone capability, sensing capability, camera capability, keyboard, mouse, and stylus input capability, and speaker capability) for the interconnection and intercommunication between devices, can quickly discover and connect devices, and can efficiently distribute tasks and transmit data.

[0180] For example, the distributed soft bus can also have basic transmission capability, discovery capability, and connection capability. Meanwhile, the distributed soft bus can also cooperate with an internal networking module, an external security module, a device Profile module, and the like to provide complete distributed communication capability for an operating system and a third party, support seamless and high-speed data flow between devices based on a distributed operating system, support low-latency intelligent scheduling of services in devices, and support distributed full-scene target achievement.

[0181] The communication method of the embodiment of the present application is described in detail below through specific examples and drawings. The following examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples.

[0182] The communication method in the embodiment of the present application can be applied to any Wi-Fi direct scene. Optionally, the Wi-Fi direct scene includes but is not limited to file sharing (such as fast file sharing between Wi-Fi direct devices), multi-player game (such as a battle or cooperative game between Wi-Fi direct devices), multimedia sharing (such as sharing of multimedia content such as audio, video, and pictures between Wi-Fi direct devices), printer sharing (such as a Wi-Fi direct supported printer connecting with an electronic device through Wi-Fi direct to directly print a file without a network), device configuration and control (such as fast configuration and control between Wi-Fi direct devices, such as a mobile phone controlling a home device through Wi-Fi direct), and wireless display (such as wireless transmission of screen content from a mobile phone to a projection device for display through Wi-Fi direct), and the like. The embodiment of the present application does not specially limit the specific form of the Wi-Fi direct scene.

[0183] In some examples, the Wi-Fi direct scene in the embodiment of the present application includes a plurality of electronic devices, and the relationship between the plurality of electronic devices is one-to-many. For example, a first device, a second device, and a third device are electronic devices supporting a Wi-Fi direct function. The first device can be understood as a device initiating a service / business. The second device and the third device can be understood as peripheral devices of the first device. The second device and the third device can also be understood as devices discovered by the first device and connected with the first device.

[0184] It can be understood that the first device can perform the communication method provided in the embodiments of the present application. Alternatively, any one of the second device and the third device can perform the communication method provided in the embodiments of the present application when connecting multiple devices.

[0185] For example, as shown in FIG. 5, a hardware schematic diagram of a communication device provided in the embodiments of the present application is shown. The communication device includes a service discovery device and a communication connection device. The service discovery device and the communication connection device can establish a connection and communicate.

[0186] The service discovery device is a low-power communication device with a service discovery function. For example, Bluetooth, BLE, etc.

[0187] The communication connection device is a high-speed data communication device with a communication connection function. For example, Wi-Fi, etc.

[0188] In the embodiments of the present application, the service discovery device is used for service discovery and triggering communication connection in a low-power mode, and the communication connection device is used for establishing a communication connection, and performing communication, data transmission, etc. based on the established communication link.

[0189] It should be understood that the above description of the communication connection device is only exemplary, and the specific form and implementation of the communication device are not limited in the embodiments of the present application.

[0190] FIG. 6 is a flowchart of a communication method provided in the embodiments of the present application. It should be noted that the method is not limited to the specific order described in FIG. 6 and the following description. It should be understood that in other embodiments, the order of some steps in the method can be exchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0191] Taking a communication scenario including a first device and a second device as an example for description.

[0192] In the embodiments of the present application, the first device is an electronic device requesting a service. The second device is a peripheral device of the first device and has the service requested by the first device. For example, the first device is a mobile phone, and the second device is a tablet computer.

[0193] It should be understood that the above example takes the first device including one peripheral device as an example for description. In actual application, the first device can include a larger number of peripheral devices.

[0194] S601, the mobile phone synchronizes communication information with the tablet computer.

[0195] In some embodiments of the present application, when the account information of the mobile phone and the account information of the tablet computer are the same account, or the account information of the mobile phone and the account information of the tablet computer are associated accounts in a trusted relationship, the mobile phone can send second communication information to the tablet computer, the second communication information being information used by the mobile phone to establish the first communication connection. The tablet computer can not only receive the second communication information sent by the mobile phone, but also send first communication information to the mobile phone, the first communication information being information used by the tablet computer to establish the first communication connection. The mobile phone can receive the first communication information sent by the tablet computer.

[0196] In some examples, the mobile phone and the tablet computer can trigger active broadcasting to obtain the response of the peripheral device in response to an operation. The operation can include a switch operation of a Wi-Fi function, a switch operation of a Bluetooth function, a screen-on operation, and a screen-off operation. In this way, the mobile phone and the tablet computer can start scanning and wait for the response of the peripheral device. The mobile phone and the tablet computer can determine whether the other party is a trusted device according to the response message of the peripheral device scanned.

[0197] That is, when the account information of the mobile phone and the account information of the tablet computer are the same account, or the account information of the mobile phone and the account information of the tablet computer are associated accounts in a trusted relationship, the mobile phone and the tablet computer are trusted devices, the mobile phone can discover that the tablet computer is online, and the tablet computer can also discover that the mobile phone is online.

[0198] It should be noted that the present application does not specifically limit the process of mutual discovery of the two devices.

[0199] In an implementable manner, in the process of synchronizing the communication information between the mobile phone and the tablet computer, the mobile phone can send a first synchronization request to the tablet computer, the first synchronization request being used to request synchronization of the first communication information. The tablet computer can send the first communication information to the mobile phone. Of course, the tablet computer can also send a second synchronization request to the mobile phone, the second synchronization request being used to request synchronization of the second communication information. The mobile phone also sends the second communication information to the tablet computer.

[0200] In another implementable manner, after the mobile phone and the tablet computer discover each other, the mobile phone and the tablet computer can actively trigger the process of synchronizing the communication information, that is, the mobile phone directly sends the second communication information to the tablet computer, and the tablet computer directly sends the first communication information to the mobile phone.

[0201] It should be noted that the present application does not specifically limit the synchronization timing and synchronization manner of the mobile phone and the tablet computer in synchronizing the communication information.

[0202] Therefore, the embodiment of the present application can directly trigger the process of synchronizing the communication information after the two devices discover each other, i.e., before the first communication connection is established. Thus, the multiple interaction processes when establishing the first communication connection are avoided, the time consumption of establishing the first communication connection is further reduced, and the business execution efficiency of the whole cooperative business process is improved.

[0203] In some embodiments of the present application, the communication information can include the communication capability information corresponding to the devices and the key required in the communication connection process. For example, the first communication connection can include the communication connection between the mobile phone and the tablet computer in the cooperative business process, such as Wi-Fi direct connection.

[0204] In this way, the two devices can pre-acquire the information about whether the other device supports the establishment of the first communication connection and the key required for establishing the first communication connection, which facilitates the subsequent establishment of the communication connection.

[0205] In some embodiments of the present application, after the mobile phone and the tablet computer discover each other, a Bluetooth link can be established between the two devices for the synchronization of the communication information. The mobile phone can establish the Bluetooth link with the tablet computer in the form of Bluetooth broadcast. The mobile phone can also perform identity authentication with the tablet computer based on the Bluetooth link. After the identity authentication is passed, the communication information is synchronized with the tablet computer.

[0206] Specifically, referring to FIG. 7, the BLE broadcast module in the mobile phone can initiate a first request (S701).

[0207] It should be understood that the mobile phone can send the first request to the air interface through the BLE broadcast module, so that the peripheral devices of the mobile phone discover the first request and perform a discovery response. Of course, the mobile phone can also start to listen to the response (i.e., listen to the first channel) to obtain the discovery response returned by other devices.

[0208] The first request includes the device type of the mobile phone, the device function information of the mobile phone, the first channel, and the MAC address of the mobile phone, etc. The first channel is a channel specified by the mobile phone for receiving the response information corresponding to the first request.

[0209] It can be understood that the first request can vary according to specific application scenarios. The first request can be a service type discovery request, which is used to find a device providing a specific service. The first request can include the type of the required service, the functional description, etc. The first request can also be a function discovery request, which is used to find a device providing a specific function. The function discovery request can also include the function type, the function description, etc. The first request can also be a resource discovery request, which is used to find a device providing a specific resource. The resource discovery request can also include the resource type, etc. The embodiments of the present application do not limit this.

[0210] The tablet can discover the first request through a BLE broadcast module (S702), and send a first message to the mobile phone through a first channel in the first request (S703). The first message is used to represent response information returned by the tablet based on the first request. The first message is also used to inquire whether the mobile phone can be accessed (i.e., whether it can be connected to the mobile phone).

[0211] The first message can include the device type of the tablet, the device function information of the tablet, the MAC address of the tablet, a second channel, and an access request. The access request is used to inquire whether access is allowed. The second channel is a channel specified by the tablet for receiving an access response corresponding to the access request. Of course, the tablet can also start channel listening (i.e., listen to the second channel) to obtain the access information sent by the mobile phone.

[0212] After the mobile phone determines that the tablet can be accessed according to the first message, the mobile phone sends a second message to the tablet through the second channel in the first message to establish a Bluetooth link (S704). The second message is used to instruct the tablet to access the mobile phone. The second message can include an access response and a third channel. The access response is used to indicate that the tablet can be accessed, and the third channel is a channel for establishing a Bluetooth link. The third channel is set by the mobile phone. The tablet receives the second message and, in response to the second message, establishes a Bluetooth link with the mobile phone based on the third channel (S705). The mobile phone establishes a Bluetooth link with the tablet based on the third channel (S706).

[0213] In some embodiments of the present application, after the mobile phone establishes a Bluetooth link with the tablet, the two devices can perform identity authentication and generate a pairwise master key to facilitate the synchronization of the keys required in the communication connection process.

[0214] Specifically, the mobile phone and the tablet can perform identity authentication and generate a pairwise master key (S707). That is, the mobile phone and the tablet can perform mutual identity authentication, and after the authentication is successful, the two devices synchronize the pairwise master key obtained. The link establishment negotiation module in the mobile phone can establish a secure session with the link establishment negotiation module in the tablet, authenticate the identity of the tablet, and obtain the pairwise master key after the identity authentication is successful. Similarly, the tablet can establish a secure session with the mobile phone, authenticate the identity of the mobile phone, and obtain the pairwise master key after the identity authentication is successful.

[0215] The above-mentioned pairwise master key can include a pairwise master key (PMK) corresponding to the mobile phone and the tablet. The PMK is the source of all keys used for communication between the mobile phone and the tablet.

[0216] In some embodiments of the present application, the mobile phone can generate a first transmission key according to the pairwise master key (S708). The tablet computer can generate a second transmission key according to the pairwise master key (S709).

[0217] The first transmission key and the second transmission key can include a pairwise transmission key (PTK), and the PTK is used for encryption and decryption of a data frame.

[0218] In an implementation, the link establishment negotiation module in the mobile phone can generate a first random number and send the first random number to the tablet computer. The link establishment negotiation module in the tablet computer can generate a second random number and send the second random number to the link establishment negotiation module in the mobile phone. The link establishment negotiation module in the mobile phone can use a hash algorithm to calculate the second random number, the MAC address of the tablet computer, and the PMK to generate the first transmission key. The link establishment negotiation module in the tablet computer can use a hash algorithm to calculate the first random number, the MAC address of the mobile phone, and the PMK to generate the second transmission key.

[0219] In some embodiments of the present application, the mobile phone can send second communication information to the tablet computer based on the Bluetooth link established above (S710). The tablet computer can send first communication information to the mobile phone based on the Bluetooth link established above (S711).

[0220] The first communication information includes the second transmission key and second communication capability information of the tablet computer, and the second communication information includes the first transmission key and first communication capability information of the mobile phone.

[0221] In some examples, the decision center module in the mobile phone can obtain the first communication capability information. The first communication capability information includes link establishment capability of the mobile phone, and the link establishment capability of the mobile phone is used to indicate whether the mobile phone supports establishing the first communication connection.

[0222] Specifically, the link establishment capability of the mobile phone can be embodied by a link establishment capability identifier, and the decision center module can obtain the link establishment capability identifier from the short-range interface, and the link establishment capability identifier is used to indicate whether the first communication connection is supported.

[0223] The Wi-Fi direct can include a communication connection based on a multi-link direct connection protocol (Huawei Magneto Link, HML), that is, the first communication connection can be an HML communication connection.

[0224] For ease of description, the first communication connection is described as an HML communication connection as an example. The embodiments of the present application do not limit the implementation of the communication technology corresponding to the first communication connection.

[0225] ​The link building capability identifier is used to indicate the capability of the device for building the HML communication connection, such as the device supporting building the HML communication connection or the device not supporting building the HML communication connection.

[0226] In an implementation, when the link building capability identifier is "true", it indicates that the mobile phone supports building the HML communication connection. When the link building capability identifier is "false", it indicates that the mobile phone does not support building the HML communication connection.

[0227] In some examples, the first communication capability information can further include Wi-Fi capability information of the mobile phone, which is used to indicate the connection parameters supported by the device for the Wi-Fi direct connection. The Wi-Fi capability information can include channel information supported by the Wi-Fi direct connection.

[0228] In an implementation, the channel information supported by the Wi-Fi direct connection can include a 149 channel, a 44 channel, and the like.

[0229] It should be noted that the channel information supported by the Wi-Fi direct connection includes the channel information supported by the HML communication connection.

[0230] In some examples, the Wi-Fi capability information can further include execution information of a dual band dual concurrent (DBDC) and the like. The execution information of the DBDC can include that the device supports executing the DBDC or the device does not support the DBDC.

[0231] In an implementation, the execution information of the DBDC can be represented by an execution capability identifier.

[0232] For example, when the execution capability identifier of the DBDC is "true", it indicates that the mobile phone supports executing the DBDC. When the execution capability identifier of the DBDC is "false", it indicates that the mobile phone does not support executing the DBDC.

[0233] In some embodiments of the present application, the decision center module in the tablet computer also needs to obtain the second communication capability information of the tablet computer.

[0234] In some examples, the second communication capability information includes a link building capability of the tablet computer, which is used to indicate whether the tablet computer supports building the first communication connection. Similarly, the link building capability of the tablet computer can also be represented by a building capability identifier,

[0235] The second communication capability information can further include Wi-Fi capability information of the tablet computer.

[0236] It should be noted that the chain establishment capability identifier and the Wi-Fi capability information in the tablet computer are similar to the chain establishment capability identifier and the Wi-Fi capability information in the mobile phone, and details are not repeated here. Embodiments of the present application do not specifically limit the implementation form of the communication capability information, the generation and distribution process of the key.

[0237] The above only takes the synchronization of the communication information by using the Bluetooth broadcast as an example for illustration, and the mobile phone and the tablet computer can also synchronize the communication information by using other manners.

[0238] In some embodiments of the present application, the mobile phone can synchronize the communication information with the tablet computer through the established second communication connection. The second communication connection includes at least one of a Bluetooth communication connection, a wireless local area network communication connection, and a wireless fidelity communication connection. It should be noted that embodiments of the present application do not limit the specific implementation manner of synchronizing the communication information.

[0239] For example, if the mobile phone and the tablet computer are in the same wireless local area network, the mobile phone can synchronize the communication information with the tablet computer based on the wireless local area network. For example, the mobile phone can send a first synchronization request to the tablet computer through the established wireless local area network communication connection.

[0240] In some embodiments of the present application, the mobile phone disconnects the second communication connection after receiving the first communication information. Similarly, the tablet computer disconnects the second communication connection after receiving the second communication information.

[0241] That is, the second communication connection established between the mobile phone and the tablet computer is disconnected after the synchronization of the communication information is completed.

[0242] In this way, on the one hand, in embodiments of the present application, two devices can synchronize the communication information through the established second communication connection before establishing the first communication connection. In this way, the two devices can directly use the synchronized communication information to establish the first communication connection subsequently. There is no need to establish a specific link to synchronize the communication information in the process of establishing the first communication connection, thereby reducing the time consumption of establishing the first communication connection and improving the speed of establishing the link when performing the collaborative service.

[0243] At the same time, the two devices disconnect the second communication connection after synchronizing the communication information, which can reduce the power consumption of the devices and reduce resource waste.

[0244] On the other hand, in embodiments of the present application, the two devices have completed the synchronization of the communication information before establishing the first communication connection. Subsequently, in the process of establishing the first communication connection, there is no need to perform the interaction process of synchronizing the communication information, which can further reduce the time consumption of establishing the first communication connection. Thus, a better user experience is provided.

[0245] S602, the mobile phone establishes the HML communication connection with the tablet computer based on the first communication information and the second communication information in response to the triggering operation for the collaborative service. The tablet computer establishes the HML communication connection with the mobile phone based on the first communication information and the second communication information.

[0246] In some embodiments of the present application, the user can trigger for the collaborative service.

[0247] For example, the collaborative service can include a screen projection service. Referring to FIG. 8, the user can click a screen projection control 801 in a video display interface during the process of watching a video by using the mobile phone to trigger a screen projection process. The mobile phone can establish an HML communication connection, such as an HML communication connection, with the tablet computer in response to the clicking operation on the screen projection control.

[0248] It should be noted that the present embodiments do not specifically limit the triggering manner of the collaborative service.

[0249] In some embodiments of the present application, the mobile phone can determine whether a transmission link of the HML communication connection exists between the mobile phone and the tablet computer during the process of establishing the HML communication connection with the tablet computer.

[0250] In some examples, the transmission link of the HML communication connection includes a communication link and a logical link. The communication link refers to a communication connection at a physical level, including hardware devices, wires, optical cables, etc., which are physical channels for transmitting data between two devices. The logical link refers to a logical channel for transmitting data on the communication link, which is established at a logical level based on the communication link. In the scenario of establishing the HML communication connection, not only the communication link of the HML communication connection needs to be established, but also the logical link of the HML communication connection needs to be established.

[0251] Specifically, the networking module in the mobile phone can call a connection interface of a connection service in the mobile phone.

[0252] The connection interface can include an OpenSession interface. The networking module determines whether the communication link exists between the mobile phone and the tablet computer based on the OpenSession interface.

[0253] For example, the networking module can determine whether the communication link of the HML communication connection exists between the mobile phone and the tablet computer by using an HML connection module in the mobile phone. The HML connection module can directly establish the HML communication connection with the tablet computer based on the communication link of the HML communication connection in the case that the HML connection module determines that the communication link of the HML communication connection exists between the mobile phone and the tablet computer.

[0254] For example, the HML connection module determines whether the mobile phone supports establishing the HML communication connection according to the link establishment capability identifier in the second communication capability information.

[0255] In some embodiments of the present application, the mobile phone determines the information of the expected channel according to the channel information of the tablet computer supporting Wi-Fi direct connection in the first communication information.

[0256] That is, when the networking module determines that both the mobile phone and the tablet computer support establishing the HML communication connection, the control HML connection module acquires the channel information of the tablet computer supporting Wi-Fi direct connection in the first communication information from the short-range interface, and determines the information of the expected channel according to the channel information of the tablet computer supporting Wi-Fi direct connection in the first communication information. The information of the expected channel is used to identify the channel information of the expected HML communication connection.

[0257] For example, the mobile phone can select the channel information of the tablet computer supporting Wi-Fi direct connection as the information of the expected channel. For another example, the mobile phone selects the same channel information between the channel information of the tablet computer supporting Wi-Fi direct connection and the channel information of the mobile phone supporting Wi-Fi direct connection as the information of the expected channel. The embodiments of the present application do not specifically limit the determination process of the information of the expected channel.

[0258] In this way, the embodiments of the present application can determine the information of the expected channel according to the channel information of the opposite end device supporting the first communication connection. This can facilitate subsequent establishment of the first communication connection based on the information of the expected channel directly. Thus, the time consumption of establishing the first communication connection is reduced, and the efficiency of establishing the first communication connection is improved.

[0259] In some embodiments of the present application, the first device can send the first broadcast information in response to the trigger operation of the collaborative service, and the first broadcast information is used to notify the second device to establish the first communication connection with the first device.

[0260] For example, referring to (B) in FIG. 9, the mobile phone can send the first broadcast information (S901) in response to the trigger operation of the collaborative service, and the first broadcast information is used to notify the tablet computer to establish the HML communication connection with the mobile phone.

[0261] The first broadcast information includes a second device identifier of the tablet computer and information of an expected channel, and the expected channel is a channel for establishing an HML communication connection. The information of the expected channel is the channel information for establishing the communication link of the mobile phone. The information of the expected channel can be encrypted by using a pairwise master key, which is obtained after the authentication of the mobile phone and the tablet computer.

[0262] In an implementation, the BLE broadcast module in the mobile phone can send the first broadcast by using a short-distance interface, and the first broadcast can be a BLE directional encrypted broadcast.

[0263] The first broadcast carries the first broadcast information. The first broadcast information can include the second device identifier of the tablet computer and the information of the encrypted expected channel. The second device identifier of the tablet computer is used to identify the device identity of the tablet computer and to confirm whether the first broadcast information is the broadcast information to be processed by the tablet computer.

[0264] For example, the second device identifier can be a hash value of the device identifier corresponding to the tablet computer (such as a dstNetworkIDHash of the tablet computer).

[0265] The expected channel is used to represent a channel for establishing an HML communication connection, such as a 149 channel or a 44 channel, that is, a communication link for establishing an HML communication connection on a 49 channel or a 44 channel.

[0266] In an implementation, the first broadcast information can further include a connection identifier (such as a SeqNo of the current communication connection). The connection identifier is used to identify the current communication connection.

[0267] For example, the connection identifier can be a preset field, a preset numerical value, and a preset binary string, and the connection identifier can also be increased with the increase of the number of communication connections.

[0268] In an implementation, the first broadcast information can further include channel mode information.

[0269] The channel mode information is used to identify the link mode of the current communication connection. The link mode can include a link mode of an HML communication connection, a link mode of a Bluetooth connection, and a link mode of a P2P connection. Each link mode can correspond to respective channel mode information.

[0270] In an implementation, the first broadcast information can further include a renegotiation mode.

[0271] The renegotiation mode is used to represent a communication mode for information negotiation between the mobile phone and the tablet computer.

[0272] For example, the re-negotiation manner can include a first negotiation manner based on a wireless fidelity data frame (Wi-Fi Action frame). For another example, the re-negotiation manner can include a second negotiation manner based on a Bluetooth broadcast.

[0273] In an implementation, the first broadcast information can further include a link address.

[0274] The link address can be used to represent a MAC address of the mobile phone.

[0275] In an implementation, the first broadcast information can further include a challenge code.

[0276] The challenge code can also be encrypted by using a pairwise master key, and the challenge code can be used by the tablet to verify whether the mobile phone is a target device for establishing an HML communication connection.

[0277] For example, the challenge code can include a set of encrypted passwords generated according to a handshake verification protocol. It should be noted that the specific implementation form of the challenge code is not limited in the embodiments of the present application.

[0278] In an implementation, the first broadcast information can further carry a target Bluetooth address (RPA address).

[0279] In some embodiments of the present application, the first broadcast information can be further encrypted by using a pairwise master key, and the subsequent tablet can decrypt the first broadcast information by using the master key. Alternatively, the first broadcast information can be further encrypted by using a first transmission key, and the subsequent tablet can decrypt the first broadcast information by using the first transmission key. Thus, the security of the first broadcast information can be ensured.

[0280] In some embodiments of the present application, the first broadcast information can further include broadcast verification information, and the broadcast verification information can be used to verify the integrity of the first broadcast information.

[0281] For example, the broadcast verification information can be a hash value corresponding to the first broadcast information. The subsequent tablet can calculate a hash value corresponding to the first broadcast information, and compare the calculated hash value corresponding to the first broadcast information with the broadcast verification information. In a case where the hash value corresponding to the first broadcast information is consistent with the broadcast verification information, it indicates that the first broadcast information has not been changed.

[0282] For another example, the broadcast verification information can also be a message integrity check (MIC) value corresponding to the first broadcast information.

[0283] It should be noted that the specific information carried in the first broadcast information and the encryption key used are not limited in the embodiments of the present application.

[0284] Thus, the mobile phone in the embodiments of the present application can send the first broadcast information in the form of broadcast to activate the tablet computer to establish the HML communication connection with the mobile phone. The first broadcast information is avoided from being transmitted in the network for multiple times, and instant information transmission and coordination are realized, so as to improve the information response speed, real-time performance and information processing efficiency.

[0285] In some embodiments of the present application, referring to (A) in FIG. 9, in the process of activating the tablet computer to establish the HML communication connection with the mobile phone by sending the first broadcast information in the form of broadcast, the mobile phone needs 30 milliseconds for initiating broadcast to perform internal processing process, and needs 300 milliseconds for sending the first broadcast information to activate the tablet computer. That is to say, the time required by the above process is far less than the time required for establishing the Bluetooth link.

[0286] In some embodiments of the present application, the HML connection module can also perform timing after sending the first broadcast. If the HML connection module does not receive the response returned by the peripheral device within the time threshold after sending the first broadcast, the BLE broadcast module is controlled to stop sending broadcast, and stop listening to broadcast.

[0287] For example, the HML connection module can start a timer, and set the time threshold of the timer to 5 seconds.

[0288] It should be noted that the embodiments of the present application do not limit the specific value corresponding to the time threshold.

[0289] Thus, the embodiments of the present application can limit the time of sending broadcast and listening to broadcast, and avoid increasing the power consumption of the device.

[0290] In some embodiments of the present application, continuing to refer to (B) in FIG. 9, after sending the first broadcast, the mobile phone can prepare a communication link for establishing the HML communication connection with the tablet computer.

[0291] Specifically, in the process of preparing to establish the communication link, the mobile phone can create a first virtual access point in the mobile phone based on the information of the expected channel (S902). The mobile phone can also configure the first connection information for the first virtual access point (S903), and the first connection information is used for the mobile phone to establish the communication link with the tablet computer.

[0292] The virtual access point (VAP) can also be referred to as a virtual network card, and the VAP can be a virtual business function entity on the mobile phone.

[0293] For example, the mobile phone can prepare a communication link for establishing the HML communication connection with the tablet computer. After sending the first broadcast, the BLE broadcast module notifies the HML connection module to create the first virtual access point.

[0294] In the process of creating the first virtual access point, the HML connection module can create the first virtual access point based on the information of the expected channel. For example, the information of the expected channel can include the channel 44, and the HML connection module can set the channel of the first virtual access point to the channel 44. The HML connection module can also configure the first connection information corresponding to the driver module in the first virtual access point.

[0295] Specifically, continuing to refer to (A) in FIG. 9, the time required by the mobile phone in the process of creating the first virtual access point and configuring the first connection information is 80 milliseconds.

[0296] In some examples, in the process of configuring the first connection information, the HML connection module can call the HmlConnectNotify function to configure the first connection information of the driver module to notify the driver module that it is ready to be connected.

[0297] For example, the HML connection module needs to obtain the first initial parameter (such as the HmlConnectNotify extended parameter), which can include the link establishment capability identifier, the first device identifier of the mobile phone, the second device identifier of the tablet computer, the first transmission key, and the first connection information.

[0298] The first connection information includes the challenge code, the first air interface information, the first network segment information, and the first verification information. The first verification information is used to verify the integrity of the first connection information, i.e., to verify whether the first connection information has changed. The first connection information can be encrypted using the first transmission key.

[0299] In an implementable manner, the first verification information can be the hash value corresponding to the first connection information. The first air interface information can be the port number of the HML logical link, such as the transmission layer Port information occupied in advance by the mobile phone. The first network segment information can be the IP address of the HML logical link.

[0300] In an implementable manner, the first device identifier can be the hash value of the device identifier corresponding to the mobile phone, such as the localNetworkIDHash of the mobile phone. The second device identifier can be the hash value of the device identifier corresponding to the tablet computer, such as the peerNetworkIDHash of the tablet computer. The maximum length of the first connection information is less than 255 bytes (Byte). The first connection information can also include the format of the transmission data, the verification information of the transmission data, the operator information, and the type of network interface or specific device instance information.

[0301] It should be noted that the present application does not limit the specific data type and data form included in the first connection information.

[0302] In some embodiments of the present application, the HML connection module can encrypt the challenge code, the first air interface information, the first network segment information, and the first verification information using the first transmission key, and combine the encrypted challenge code, the first air interface information, the first network segment information, and the first verification information with the first device identifier to form the first private address.

[0303] The HML connection module can also send the first private address (e.g., the first private IE) to the driver module, such as the WiFi driver, to complete the configuration of the driver module. In this way, the Wi-Fi driver is ready to be connected.

[0304] For example, the HML connection module can call the wpa_supplicant interface to generate the first private address. The wpa_supplicant interface is a downstream interface of the short-range interface. The HML connection module can also call the wpa_supplicant interface to send the first private address to the driver module.

[0305] In this way, the embodiments of the present application can configure the first private address corresponding to the HML communication connection for the driver module in the mobile phone, which facilitates the subsequent establishment of the communication link for the HML communication connection.

[0306] In some embodiments of the present application, the HML connection module can also distribute a service set identifier (SSID), a pairwise shared key (PSK), and a MAC address of the mobile phone to the short-range interface during the process of creating the first virtual access point. The SSID is an identifier of a WLAN network and is used to distinguish different WLAN networks. The SSID and the PSK can be randomly generated based on a random number generation algorithm.

[0307] The HML connection module distributes the SSID, the PSK, and the MAC address of the mobile phone to the short-range interface, which facilitates the subsequent establishment of a communication link corresponding to a P2P connection by the mobile phone based on the SSID, the PSK, and the MAC address of the mobile phone. The process of establishing a communication link corresponding to a P2P connection based on the SSID, the PSK, and the MAC address of the mobile phone can be referred to related technologies, which will not be described here.

[0308] In this way, the embodiments of the present application can distribute the SSID, the PSK, and the MAC address of the mobile phone to the short-range interface, which facilitates the subsequent establishment of a communication link corresponding to a P2P connection by the mobile phone, and improves the compatibility of different communication connections.

[0309] In some embodiments of the present application, the driving module is configured with the first initial address due to the support of Wi-Fi direct by the mobile phone. In this way, in the case that the mobile phone supports Wi-Fi direct and has the corresponding first initial address, the HML connection module does not configure the first initial address (such as the first initial IE) to the driving module, and changes the first private address configured to the driving module to the first initial address after the HML connection module completes the establishment of the communication link of the HML communication connection.

[0310] In this way, the embodiments of the present application can configure the corresponding private address of the HML communication connection in the case of supporting multiple communication connection modes when the HML communication connection is performed. After the HML communication connection is completed, the private address can be changed to the initial address, which facilitates the subsequent support of Wi-Fi direct. Thus, the compatibility of different communication connections and the flexibility of the communication connection are improved.

[0311] In some embodiments of the present application, the HML connection module can record the link establishment capability identifier and the second device identifier. After the HML connection module completes the establishment of the communication link of the HML communication connection, or the connection times out, or the first virtual access point is deleted, the link establishment capability identifier and the second device identifier are deleted.

[0312] For example, the HML connection module can call the wpa_supplicant interface to record or delete the link establishment capability identifier, the second device identifier, and the first transmission key.

[0313] In some embodiments of the present application, the tablet computer can listen to the first broadcast. The tablet computer can also send a link connection request to the mobile phone according to the first broadcast, and the link connection request is used to request the mobile phone to establish the HML communication connection.

[0314] Continuing to refer to (B) in FIG. 9, after listening to the first broadcast, the tablet computer can verify the first broadcast information (S904). The first broadcast information is carried in the first broadcast.

[0315] For example, the BLE broadcast module in the tablet computer can listen to the first broadcast and send the first broadcast information carried in the first broadcast to the HML connection module. The HML connection module can verify the first broadcast information.

[0316] The first broadcast information includes the second device identifier. The HML connection module can match the second device identifier of the first broadcast information with the device identifier of itself. In the case that the second device identifier is consistent with the device identifier of itself, it is determined that the first broadcast information is information that needs to be received and processed.

[0317] Thus, the first broadcast information can be identified for the second device, so that the tablet determines that the first broadcast information is information that needs to be processed. The transmission directionality of the broadcast information is improved.

[0318] In some embodiments of the present application, the first broadcast information can also carry a target Bluetooth address, and the HML connection module can determine whether the device corresponding to the target Bluetooth address is a network online device according to the target Bluetooth address.

[0319] For example, the HML connection module can obtain the Bluetooth address corresponding to at least one device in the network online device list, and match the at least one Bluetooth address corresponding to the at least one device with the target Bluetooth address. In the case that the at least one Bluetooth address is consistent with the target Bluetooth address, it is determined that the mobile phone corresponding to the target Bluetooth address is a network online device, i.e., the mobile phone is the online device corresponding to the tablet.

[0320] In some embodiments of the present application, in the case that the mobile phone encrypts the first broadcast information by using the pairwise master key, the tablet can decrypt by using the master key. Alternatively, in the case that the mobile phone encrypts the first broadcast information by using the first transmission key, the tablet can decrypt by using the first transmission key. If the tablet cannot decrypt by using the master key or the first transmission key, the first broadcast information can be discarded. Thus, the security of the first broadcast information is improved.

[0321] In some embodiments of the present application, the first broadcast information can also include information of an encrypted expected channel. The HML connection module can also decrypt the information of the encrypted expected channel by using the pairwise master key. The HML connection module can also match the information of the expected channel with the channel information supporting the establishment of the HML communication connection in the second communication capability information. In the case that the information of the expected channel is consistent with the channel information supporting the establishment of the HML communication connection in the second communication capability information, the tablet can send a link connection request to the mobile phone to request the establishment of a communication link for the HML communication connection.

[0322] In some embodiments of the present application, the first broadcast information can also include a challenge code, wherein the mobile phone can also encrypt the challenge code by using the pairwise master key, and the challenge code is used by the tablet to verify whether the mobile phone is the target object for the establishment of the HML communication connection. Thus, the HML connection module can also obtain the challenge code by decrypting by using the pairwise master key. The HML connection module determines that the mobile phone is the target device for the establishment of the HML communication connection after determining that the device records the challenge code.

[0323] In some embodiments of the present application, the first broadcast information can also include broadcast verification information. The HML connection module can also perform integrity verification on the first broadcast information.

[0324] For example, the broadcast verification information can be a hash value corresponding to the first broadcast information. The HML connection module can calculate the hash value corresponding to the first broadcast information, and compare the calculated hash value corresponding to the first broadcast information with the broadcast verification information. In the case where the hash value corresponding to the first broadcast information is consistent with the broadcast verification information, it indicates that the first broadcast information has not changed.

[0325] For another example, the broadcast verification information can also be a MIC value corresponding to the first broadcast information. The HML connection module can calculate the MIC value corresponding to the first broadcast information, and compare the calculated MIC value corresponding to the first broadcast information with the broadcast verification information. In the case where the MIC value corresponding to the first broadcast information is consistent with the broadcast verification information, it indicates that the first broadcast information has not changed.

[0326] In this way, the embodiments of the present application can perform twice verification on the first broadcast information. Once is the integrity information verification of the first broadcast information, to ensure that the first broadcast information has not changed. In the case where the first broadcast information has not changed, the challenge code carried in the first broadcast information is verified again to determine that the sending end device is the target device for establishing the HML communication connection. Through the twice verification process, the security in the information transmission process is improved, and the subsequent HML communication connection is facilitated.

[0327] In some embodiments of the present application, the tablet computer creates a second virtual access point in the tablet computer based on the information of the expected channel in the case where it is determined that the first broadcast information is the required processing information based on the second device identifier. The tablet computer can also configure the second connection information for the second virtual access point.

[0328] Specifically, continuing to refer to (B) in FIG. 9, after obtaining the information of the expected channel in the first broadcast information, the tablet computer can also create a second virtual access point in the tablet computer based on the information of the expected channel (S905). The tablet computer can also configure second connection information for the second virtual access point (S906), and the second connection information is used for the mobile phone to establish a communication link with the tablet computer.

[0329] Similarly, the HML connection module in the tablet computer can call the HmlConnectNotify function to notify the driver to prepare to establish the communication link of the HML communication connection, that is, to configure the HmlConnectNotify extended parameter.

[0330] In some examples, the HML connection module can call the HmlConnectNotify function to configure the first connection information for the driver module in the process of configuring the second connection information, to notify the driver module to prepare to be connected.

[0331] For example, the HML connection module needs to obtain a second initial parameter (such as an HmlConnectNotify extended parameter), which can include a link establishment capability identifier, a first device identifier of the mobile phone, a second device identifier of the tablet computer, a second transmission key, and second connection information.

[0332] The second connection information includes a challenge code, second air interface information, second network segment information, and second verification information. The second verification information is used to verify whether the second connection information has changed. The second connection information can be encrypted by using the second transmission key.

[0333] In an implementable manner, the second verification information can be a hash value corresponding to the second connection information. The second air interface information can be a port number of the HML logical link, such as transmission layer Port information occupied by the tablet computer in advance. The second network segment information can be an IP address of the HML logical link.

[0334] In an implementable manner, the first device identifier can be a hash value of a device identifier corresponding to the mobile phone, such as a localNetworkIDHash of the mobile phone. The second device identifier can be a hash value of a device identifier corresponding to the tablet computer, such as a peerNetworkIDHash of the tablet computer. The maximum length of the second connection information is less than 255 bytes (Byte). The second connection information can further include a format of transmission data, verification information of the transmission data, operator information, and a type of network interface or specific device instance information.

[0335] It should be noted that the present application does not limit the specific data type and data form included in the second connection information.

[0336] In some embodiments of the present application, the HML connection module can encrypt the challenge code, the second air interface information, the second network segment information, and the second verification information by using the second transmission key, and combine the encrypted challenge code, the second air interface information, the second network segment information, and the second verification information with the second device identifier to form a second private address.

[0337] The HML connection module can further send the second private address (such as a second private IE) to a driver module such as a Wi-Fi driver to complete the configuration of the driver module. Thus, the Wi-Fi driver is ready to be connected.

[0338] For example, the HML connection module can call a wpa_supplicant interface to generate the second private address. The wpa_supplicant interface is a downstream interface of the short-range interface. The HML connection module can further call the wpa_supplicant interface to send the second private address to the driver module.

[0339] The HML connection module can also send a connection notification to the driver module to inform the driver module to establish a communication link of the HML communication connection.

[0340] In this way, the embodiment of the present application can configure the second private address corresponding to the HML communication connection for the driver module in the tablet computer, so as to facilitate the subsequent establishment of the communication link of the HML communication connection.

[0341] In some embodiments of the present application, the tablet computer can send a link connection request to the mobile phone according to the second connection information and the second transmission key (S907).

[0342] Specifically, in the process of sending the link connection request to the mobile phone, the driver module sends the link connection request to the driver module in the mobile phone in response to the connection notification.

[0343] For example, the link connection request can include the second connection information and a target task identifier. The target task identifier is used to identify the task currently executed as establishing the HML communication connection.

[0344] For another example, the link connection request can also include the first transmission key. The first transmission key is used for the mobile phone to perform key verification.

[0345] For another example, the link connection request can also include the MAC address of the tablet computer.

[0346] In some embodiments of the present application, the time required for the internal processing of the first broadcast message is 30 milliseconds, and the time required for creating the second virtual access point and configuring the second connection information is 80 milliseconds.

[0347] In some embodiments of the present application, when the tablet computer supports Wi-Fi direct and has a corresponding second initial address, the HML connection module does not set the second initial address (such as the second initial IE) to the driver module, and changes the second private address set to the driver module to the second initial address after the HML connection module completes the establishment of the communication link of the HML communication connection.

[0348] In some embodiments of the present application, the HML connection module can record the link establishment capability identifier, the first device identifier and the second transmission key. After the HML connection module completes the establishment of the communication link of the HML communication connection, or the connection times out, or the second virtual access point is deleted, the link establishment capability identifier, the first device identifier and the second transmission key are deleted.

[0349] In some embodiments of the present application, during the process that the tablet sends the link connection request to the mobile phone, there is a possibility that the mobile phone is not ready to establish the HML communication connection, for example, the HML connection module in the mobile phone has not configured the first connection information for the first virtual access point.

[0350] In this way, the tablet can send the link connection request at a certain time interval. For example, the time interval can include 300 ms, 250 ms, 200 ms, 150 ms, 100 ms, etc. The embodiments of the present application do not limit the specific value corresponding to the time interval.

[0351] In this way, the embodiments of the present application can periodically send the link connection request, avoiding that the mobile phone is not ready to establish the communication link. Thus, the success rate of establishing the communication connection is improved.

[0352] In some embodiments of the present application, in the case that the information of the expected channel is inconsistent with the channel information supporting the establishment of the HML communication connection in the second communication capability information, the tablet can perform a re-negotiation process with the mobile phone.

[0353] Specifically, referring to FIG. 10, in the case that the information of the expected channel is inconsistent with the channel information supporting the establishment of the HML communication connection in the second communication capability information, the HML connection module in the tablet can send a change operation frame to the mobile phone based on a re-negotiation manner, and the change operation frame is used to request the mobile phone to establish the HML communication connection based on the updated expected channel information (S1001). The change operation frame includes the updated expected channel information.

[0354] The HML connection module in the mobile phone receives the change operation frame sent by the tablet based on the re-negotiation manner, and in response to the change operation frame, sends a response operation frame to the tablet, and the response operation frame is used to indicate that the mobile phone establishes the HML communication connection based on the updated expected channel information (S1002). The re-negotiation manner includes a wireless fidelity data frame-based communication manner.

[0355] For example, the expected channel is the 149th channel, the channel supported by the second communication capability information for establishing the HML communication connection is the 44th channel, and the expected channel is inconsistent with the channel supported by the second communication capability information for establishing the HML communication connection. The HML connection module in the tablet computer can send a change operation frame to the mobile phone, and the change operation frame includes the updated expected channel information, for example, the 44th channel. The HML connection module in the mobile phone can send a response operation frame to the tablet computer based on the change operation frame, to indicate that the mobile phone can establish the HML communication connection communication link on the 44th channel. In this way, the mobile phone and the tablet computer can establish the HML communication connection communication link on the 44th channel, so as to subsequently complete the HML communication connection. Continuing to refer to (A) in FIG. 9, the time required for the mobile phone and the tablet computer to perform the re-negotiation process, such as the process of receiving the change operation frame and sending the response operation frame, is 100 milliseconds.

[0356] In some embodiments of the present application, the first broadcast information further includes a re-negotiation manner, and the tablet computer can perform the re-negotiation process with the mobile phone based on the re-negotiation manner in the first broadcast information.

[0357] In this way, the embodiments of the present application can re-negotiate the channel information based on the wireless fidelity data frame communication manner in the case that the channel information for establishing the communication link of the two devices is inconsistent. The BR link or the BLE link does not need to be established for negotiation, which greatly shortens the HML fast link establishment time delay in the re-negotiation scenario, and provides better experience and performance for the collaborative service.

[0358] In some embodiments of the present application, the mobile phone can also update the first virtual access point in the mobile phone based on the updated expected channel information.

[0359] For example, the HML connection module in the mobile phone can create the latest first virtual access point and configure the first virtual access point based on the updated expected channel information. It should be noted that the HML connection module in the mobile phone can delete the first virtual access point created based on the expected channel information before the update.

[0360] In this way, the embodiments of the present application can create the latest first virtual access point and configure the first virtual access point in the case that the channel information for establishing the communication link of the two devices is inconsistent. This facilitates subsequent fast establishment of the first communication connection, greatly shortens the fast link establishment time delay in the re-negotiation scenario, and provides better experience and performance for the collaborative service.

[0361] In some embodiments of the present application, the HML connection module can also distribute the SSID, the PSK and the MAC address of the tablet to the short-distance interface in the process of creating the second virtual access point. The SSID is the identification of the WLAN network and is used to distinguish different WLAN networks. The SSID and the PSK can be randomly generated based on a random number generation algorithm.

[0362] The HML connection module distributes the SSID, the PSK and the MAC address of the tablet to the short-distance interface, so that the tablet can subsequently establish a corresponding communication link of the P2P connection based on the SSID, the PSK and the MAC address of the tablet. The process of establishing a corresponding communication link of the P2P connection based on the SSID, the PSK and the MAC address of the tablet can be referred to related technologies, and will not be described here.

[0363] In some embodiments of the present application, the mobile phone can establish a corresponding relationship between the first virtual access point in the first electronic device and the second virtual access point in the second electronic device.

[0364] For example, the driving module in the mobile phone can receive the link connection request sent by the tablet, and associate with the driving module in the tablet according to the link connection request, that is, establish a corresponding relationship between the first virtual access point and the second virtual access point, to complete the establishment of the communication link of the HML communication connection with the tablet. The driving module in the mobile phone can report the link connection request to the HML connection module after successfully associating with the driving module in the tablet.

[0365] It can be understood that after the driving modules of the mobile phone and the tablet successfully associate, it means that the communication link of the HML communication connection has been successfully established.

[0366] In this way, the embodiments of the present application successfully establish the communication link of the HML communication connection by establishing the corresponding relationship between the two virtual access points. In this way, the mobile phone can subsequently send a link connection response to the tablet to inform the completion of the establishment of the communication link of the HML communication connection. The mobile phone can also directly transmit the encrypted data required for transmission at the data link layer. The interaction process of the entire chain establishment process is reduced, the chain establishment delay of the first communication connection is reduced, and a faster chain establishment speed is provided for collaborative services.

[0367] In some embodiments of the present application, continuing to refer to (B) in FIG. 9, the mobile phone can send a link connection response to the tablet based on the first communication information and the second communication information (S908). The link connection response is used to indicate that the communication link of the HML communication connection has been successfully established.

[0368] Thus, the mobile phone receives the link connection request sent by the tablet computer, and sends a link connection response to the tablet computer based on the first communication information and the second communication information, to inform the tablet computer that the communication link has been successfully established. Since only one interaction is performed between the mobile phone and the tablet computer, the interaction process of the link establishment between devices is reduced, the link establishment delay of the HML communication connection is reduced, and a faster link establishment speed is provided for the collaborative service.

[0369] In some examples, the mobile phone responds to the link connection request. The mobile phone can also send a link connection response to the tablet computer using the first transmission key, the link connection response being used to indicate that the communication link has been successfully established, in a case that the tablet computer is determined to support the establishment of the HML communication connection based on the first communication information, and the tablet computer is verified to be the target device for establishing the HML communication connection based on the link connection request.

[0370] Specifically, the link connection request includes second connection information, and the second connection information can include an encrypted challenge code, and the second connection information is configuration information of a second virtual access point in the tablet computer. The mobile phone queries whether the challenge code in the second connection information is recorded, in a case that the tablet computer is determined to support the establishment of the HML communication connection according to the link establishment capability identifier, and the second device identifier of the tablet computer in the link request is recorded. The mobile phone can also determine that the tablet computer is the target device for establishing the HML communication connection, in a case that the challenge code in the second connection information is recorded. The challenge code is sent to the tablet computer by the mobile phone based on the first broadcast information.

[0371] The mobile phone can query the second transmission key corresponding to the tablet computer identifier after determining that the tablet computer supports the establishment of the HML communication connection, and decrypt the second connection information using the second transmission key to obtain the challenge code.

[0372] For example, referring to FIG. 11, the driving module receives the link connection request, and determines whether the tablet computer supports the establishment of the HML connection according to the link establishment capability identifier in the first communication capability information (S1101). The driving module queries whether the second device identifier is recorded, in a case that the tablet computer is determined to support the establishment of the HML connection (S1102). The driving module queries whether the challenge code in the second connection information is recorded, in a case that the device identifier of the tablet computer is determined to be recorded (S1103). The driving module determines that the tablet computer is the target device for establishing the HML connection, i.e., the HML connection can be established with the tablet computer, in a case that the challenge code in the second connection information is determined to be recorded (S1104).

[0373] In some embodiments of the present application, the second connection information can be encrypted by the tablet using a second transmission key. The mobile phone can find the second transmission key corresponding to the second device identifier in the first communication capability information after determining that the second device identifier of the tablet is recorded, and decrypt the second connection information using the second transmission key to obtain the challenge code.

[0374] In this way, the second connection information can be encrypted by the second device to improve the security of information transmission. In this way, the mobile phone can decrypt the second connection information to obtain the challenge code, so as to verify the target device that meets the establishment of the first communication connection. Further improve the reliability of the establishment of the first communication connection.

[0375] In some embodiments of the present application, the link connection request can further include a first transmission key, and the first transmission key in the link connection request is used for key verification by the mobile phone. The mobile phone can further perform key verification after receiving the link connection request.

[0376] For example, the drive module can query whether the first transmission key in the link connection request is consistent with the transmission key of the drive module (S1104). In the case that the first transmission key in the link connection request is consistent with the transmission key of the drive module, the key verification is successful, so as to determine that the tablet is the target device for establishing the HML connection, that is, the HML connection can be established with the tablet. The drive module can send a matching success notification to the HML connection module after the key verification is successful (S1105), so as to notify the drive module that successfully associates the tablet. The HML connection module sends the second connection information and the second device identifier to the HML service in response to the matching success notification (S1106).

[0377] In this way, the tablet can further send the first transmission key again in the embodiments of the present application, which is used for key verification by the mobile phone. In this way, the mobile phone can verify again based on the sent first transmission key, and determine the communication link that can establish the HML communication connection with the tablet. Improve the reliability and security of the communication link for establishing the HML communication connection.

[0378] In some embodiments of the present application, the link connection request can further include a target task identifier, and the target task identifier is used to indicate that the current executed task is to establish the HML communication connection. In this way, the mobile phone can subsequently determine whether the tablet supports the establishment of the HML communication connection according to the target task identifier in the link connection request.

[0379] For example, the drive module receives the link connection request and parses the link connection request. The link connection request can include a target task identifier, which indicates that the task currently being performed is to establish an HML communication connection. The drive module can find the link establishment capability identifier in the first communication information based on the target task identifier to determine whether the tablet supports establishing an HML connection.

[0380] In some embodiments of the present application, the mobile phone can encrypt the first connection information using the first transmission key and send a link connection response to the tablet.

[0381] The link connection response includes the encrypted first connection information, and the first connection information includes a challenge code, first verification information, first network segment information, and first port information. The challenge code is used by the tablet to verify whether the mobile phone is the target device for establishing the first communication connection. The first verification information is used to verify the integrity of the first connection information. The first network segment information and the first port information are used by the second device to establish a logical link.

[0382] In this way, the mobile phone of the embodiments of the present application can enable the tablet to obtain the network segment information and the port information of the local device through one interaction process. Subsequently, the tablet can directly use the network segment information and the port information of the peer device and the network segment information and the port information of the local device to establish a logical link. Multiple interaction processes are not required, which reduces the link establishment delay of the first communication connection and provides a faster link establishment speed for collaborative services.

[0383] At the same time, the interaction process also enables the tablet to obtain the challenge code and the first verification information to perform security verification. This improves the reliability of information transmission.

[0384] Specifically, after the drive module sends the match success notification to the HML connection module, the drive module can send a link connection response to the tablet, and the link connection response includes first connection information. The first connection information can be encrypted using the first transmission key.

[0385] In some examples, the link connection response can also include a connection success identifier and a second transmission key.

[0386] The connection success identifier is used to indicate that the mobile phone has established an HML communication connection with the tablet. The second transmission key is used for subsequent key verification by the tablet.

[0387] Continuing to refer to (A) in FIG. 9, the time required for the mobile phone to receive the link connection request and send the link connection response is 40 milliseconds. The time required for the tablet to send the link connection request and receive the link connection response is 40 milliseconds.

[0388] Therefore, the mobile phone in the embodiment of the present application can respond to the link connection request, process the information carried in the link connection request, and establish a communication link of HML communication connection with the tablet computer. The mobile phone can also send a link connection response to the tablet computer to complete the exchange of connection information.

[0389] It should be noted that in the related art, the mobile phone needs to send physical layer transmission data to the tablet computer based on the BR link to establish a communication link of HML communication connection. It can be understood that the process of sending the physical layer transmission data to the tablet computer is the process of negotiating the information corresponding to the communication link. After the mobile phone and the tablet computer negotiate and establish a communication link of HML communication connection, the mobile phone needs to send data link layer transmission data to the tablet computer based on the BR link to establish a logical link of HML communication connection. It can be understood that the process of sending the data link layer transmission data is the process of negotiating the information corresponding to the logical link of HML communication connection.

[0390] Therefore, the embodiment of the present application can prepare the data link layer transmission data in advance. At the same time, in the process of negotiating the information corresponding to the communication link, the data link layer transmission data is directly transmitted. The mobile phone and the tablet computer only need to perform the above-mentioned interaction once to complete the establishment of the communication link of HML communication connection. At the same time, the data link layer transmission data (such as network segment information and port information) can be directly carried in the interaction process. The limitation of twice data transmission for the physical layer and the data link layer is broken, the interaction process (such as real time transfer (RTT) process) of the entire link establishment process is reduced, the link establishment delay of HML communication connection is reduced, and a faster link establishment speed is provided for collaborative services.

[0391] In some embodiments of the present application, the link connection request and the link connection response are sent through a target communication mode, and the target communication mode includes a wireless fidelity (Wi-Fi) operation frame communication. That is, the mobile phone and the tablet computer can use the Wi-Fi Action frame in the above-mentioned interaction process.

[0392] Therefore, in the embodiment of the present application, the transmission link of HML communication connection can be established through Bluetooth broadcast, and then the negotiation interaction process can be performed through the communication mode of the Wi-Fi Action frame. By fully utilizing the speed and capacity of the channel corresponding to the Wi-Fi Action frame, sufficient information can be carried, and the negotiation interaction with the opposite end device can be faster. Further, the link establishment delay of HML communication connection is reduced, and a better experience and performance are provided for collaborative services.

[0393] In some embodiments of the present application, the second connection information further comprises second verification information, and the second verification information is used to verify the integrity of the second connection information. The mobile phone can calculate the verification information corresponding to the second connection information by using the first preset rule. The mobile phone determines that the second connection information has not changed when the verification information corresponding to the second connection information is consistent with the second verification information.

[0394] For example, after the HML connection module decrypts the second connection information, the HML connection module can first perform data verification on the second connection information. The HML connection module can calculate the hash value of the second connection information, and compare the calculated hash value of the second connection information with the second verification information. When the calculated hash value of the second connection information is consistent with the second verification information, it is determined that the second connection information has not changed, so as to ensure the integrity of the second connection information.

[0395] In this way, the embodiments of the present application can carry the verification information in the connection information to verify the integrity of the connection information. The integrity of the connection information is ensured during transmission, and the security and reliability of information transmission are improved.

[0396] In some embodiments of the present application, the process of creating the first virtual access point and configuring the first connection information for the first virtual access point by the mobile phone can be processed in parallel with the interaction process.

[0397] For example, the mobile phone can start creating the first virtual access point and configuring the first connection information for the first virtual access point after sending the first broadcast information. The mobile phone can receive the link connection request sent by the tablet computer during the process of creating the first virtual access point and configuring the first connection information for the first virtual access point. Of course, the mobile phone can also process the connection information carried by the link connection request. For example, verifying the integrity of the connection information, and for another example, verifying the challenge code.

[0398] In this way, the embodiments of the present application can process the process of preparing the encrypted data required for transmission of the data link layer and the interaction process with the peer device in parallel. The fast link establishment delay of the HML communication connection is further shortened, the required time of the entire process of establishing the HML communication connection is shorter, the performance of the collaborative service is improved, and the user's use experience is improved.

[0399] In some embodiments of the present application, the mobile phone can establish a logical link of the HML communication connection with the tablet computer. The second connection information sent by the tablet computer further comprises second network segment information, and the second network segment information is used to represent the network address of the logical link corresponding to the tablet computer.

[0400] Specifically, the HML service in the mobile phone receives the second connection information sent by the HML connection module, updates the first network segment information and the second network segment information according to a second preset rule, and generates a target network address, which is used to transmit the service data of the collaborative service between the mobile phone and the tablet computer.

[0401] For example, the preset rule can include setting corresponding network segment information for the receiving end device and the sending end device respectively. The first network segment information is X, and the second network segment information is Y. The HML service can update the first network segment information and the second network segment information, such as adding a corresponding field to indicate whether the device corresponding to the network segment information is a sending device or a receiving device, to obtain the target network address. For example, the updated first network segment information X.2 and the updated second network segment information Y.1. The device corresponding to the updated first network segment information is a sending device, and the device corresponding to the updated second network segment information is a receiving device.

[0402] In this way, the HML service can configure the target network address as a routing table corresponding to a forwarding device such as a router, and the routing table includes the target network address, so that the router can transmit the service data of the collaborative service from the mobile phone to the tablet computer according to the target network address.

[0403] In some embodiments of the present application, the tablet computer receives a link connection response, and establishes a logical link of the HML communication connection with the mobile phone in response to the link connection response.

[0404] In some examples, the link connection response includes a connection success identifier.

[0405] Specifically, the driving module in the tablet computer can receive the link connection response, and determine the communication link of the HML communication connection with the mobile phone according to the connection success identifier (such as Association Rsp (OK)) in the link connection response.

[0406] In some examples, the link connection response can also include the first device identifier of the mobile phone and the encrypted first connection information.

[0407] Specifically, the driving module can query whether the first device identifier is recorded. After determining that the first device identifier is recorded, the driving module finds the first transmission key corresponding to the first identifier. Then, the driving module can decrypt the first connection information by using the first transmission key to obtain the challenge code, the first air interface information, the first network segment information, and the first verification information.

[0408] After decrypting the first connection information, the driving module can first perform data verification on the first connection information.

[0409] For example, the driving module can calculate a hash value of the first connection information, and compare the calculated hash value of the first connection information with the first verification information. In a case where the calculated hash value of the first connection information is consistent with the first verification information, it is determined that the first connection information has not changed, representing the integrity of the first connection information.

[0410] The driving module can also verify the challenge code, and query whether the challenge code in the first connection information is recorded. After the challenge code is verified successfully, the driving module can match the first transmission key in the second communication capability information with the first transmission key in the link connection response. In a case where the first transmission key is consistent with the first transmission key in the link connection response, the driving module sends a matching success notification to the HML connection module. The HML connection module sends the first connection information and the first device identifier to the HML service in response to the matching success notification.

[0411] In some examples, the first connection information can also include first network segment information, which is used to represent the network address of the logical link corresponding to the mobile phone.

[0412] Similarly, the HML service in the tablet computer receives the first connection information sent by the HML connection module, updates the first network segment information and the second network segment information according to the second preset rule, and generates a target network address, which is used to transmit service data of the collaborative service between the mobile phone and the tablet computer.

[0413] For example, the preset rule can include setting corresponding network segment information for the receiving end device and the sending end device respectively. The first network segment information is X, and the second network segment information is Y. The HML service can update the first network segment information and the second network segment information, such as adding corresponding fields, to obtain the target network address. For example, the updated first network segment information X.2 and the updated second network segment information Y.1. It should be noted that the process of generating the target network address by the tablet computer can be similar to that of the mobile phone.

[0414] In this way, the HML service can configure the target network address as a routing table corresponding to a forwarding device such as a router, and the routing table includes the target network address, so that the router can transmit the service data of the collaborative service from the mobile phone to the tablet computer according to the target network address.

[0415] In this way, the embodiment of the present application can directly obtain the network segment information of the opposite end through one interaction process, and can directly configure the network address of the logical link by using the network segment information of the opposite end device and the network segment information of the local end device. Multiple interaction processes are not required to obtain the network segment information, the link establishment delay of the HML communication connection is reduced, and a faster link establishment speed is provided for the collaborative service.

[0416] In some embodiments of the present application, the mobile phone and the tablet computer can also configure static ARP for the opposite device.

[0417] In an implementable manner, the HML service in the tablet computer can also configure static ARP of the mobile phone.

[0418] Specifically, the HML service can associate the updated first network segment information X.2 with the MAC address of the mobile phone, to establish a first mapping relationship.

[0419] In some embodiments of the present application, the HML service can also control the listening module to invoke the Socket interface to listen to the Socket event initiated by the mobile phone after configuring the static ARP of the mobile phone.

[0420] In an implementable manner, the HML service in the mobile phone can also configure static ARP of the tablet computer.

[0421] Specifically, the HML service can associate the updated second network segment information X.1 with the MAC address of the tablet computer, to establish a second mapping relationship. Continuing to refer to (A) in FIG. 9, the time required by the mobile phone in generating the target network segment address and creating static ARP of the tablet computer is 35 milliseconds.

[0422] It should be noted that the operations corresponding to the network segment information can also be performed by the IP module in the device, which is not limited in the embodiments of the present application.

[0423] In this way, the network segment information in the connection information can be directly used to configure static ARP in the embodiments of the present application, without the need to interact with the opposite device again. In this way, not only the link establishment delay of the HML communication connection is greatly shortened, but also the security of the communication is enhanced by configuring static ARP.

[0424] In some embodiments of the present application, the mobile phone and the tablet computer can also establish a transmission control protocol (TCP) connection to complete the establishment of the logical link.

[0425] In an implementable manner, on the mobile phone side, the second connection information further includes second port information, the second port information being used to identify the port of the logical link corresponding to the tablet computer. The mobile phone can establish a transmission control protocol (TCP) connection with the tablet computer based on the second port information, to complete the establishment of the logical link. Continuing to refer to (A) in FIG. 9, the time required by the mobile phone in establishing the transmission control protocol (TCP) connection with the tablet computer for handshaking is 15 milliseconds.

[0426] In an implementable manner, on the tablet side, the first connection information further comprises first port information, the first port information being used to identify a port of the mobile phone corresponding to the logical link. The tablet can establish a transmission control protocol (TCP) connection with the mobile phone based on the first port information, so as to complete establishment of the logical link.

[0427] It should be noted that the HML service in the mobile phone can control the listening module to call the Socket interface to listen to the Socket event initiated by the tablet after the static ARP of the tablet is configured. The HML service in the tablet can also control the listening module to call the Socket interface to listen to the Socket event initiated by the mobile phone after the static ARP of the mobile phone is configured, so as to trigger establishment of the TCP connection and complete establishment of the HML communication connection.

[0428] In this way, the port information of the opposite end can be obtained through one interaction between the two devices in the embodiment of the present application. The TCP connection can be directly established by using the port information of the opposite end, so as to complete establishment of the logical link. The time consumption for establishing the logical link is reduced, and the connection efficiency of the first communication connection is improved.

[0429] Based on the above, in the embodiment of the present application, the establishment process of the HML communication connection can be completed within 1 second. Even if the re-negotiation process is needed in the establishment process of the HML communication connection, the establishment process of the HML communication connection can also be completed within 1 second. Therefore, the user does not need to wait, and the use experience of the user is improved.

[0430] In some embodiments of the present application, the transmission key used by each HML communication connection is updated after the connection is successful.

[0431] For example, referring to FIG. 12, the mobile phone can generate a first transmission key and send the first transmission key to the tablet in the first HML communication connection. The tablet can generate a second transmission key and send the second transmission key to the mobile phone, so as to synchronize the transmission keys between the devices. The mobile phone can generate a new transmission key, such as a third transmission key, and send the third transmission key to the tablet in the second HML communication connection. The tablet can also generate a new transmission key, such as a fourth transmission key, and send the fourth transmission key to the mobile phone.

[0432] In this way, the embodiment of the present application can generate a new transmission key and synchronize with the opposite device in the process of establishing the communication connection each time. The security and reliability of information transmission in the process of establishing the communication connection are improved.

[0433] In some scenarios, multiple embodiments of the present application can be combined, and the combined scenario can be implemented. Optionally, some operations in the flow of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. Also, the execution order between steps of each flow is only exemplary, and does not constitute a limitation on the execution order between steps, and other execution orders between steps can also be used. It is not intended to indicate the execution order of these operations.

[0434] A person of ordinary skill in the art can think of various ways to reorder the operations described in the embodiments of the present application. In addition, it should be pointed out that the process details involved in some embodiments of the present application are also applicable to other embodiments in a similar manner, or different embodiments can be combined. In addition, some steps in the method embodiments can be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiments can be optional and can be deleted in some use scenarios. Alternatively, other possible steps can be added in the method embodiments. Also, each method embodiment can be implemented alone or in combination.

[0435] The embodiments of the present application also provide an electronic device, which can be the above-mentioned mobile phone, as shown in FIG. 13. The mobile phone can include one or more processors 1310, a memory 1320 and a communication interface 1330.

[0436] The memory 1320, the communication interface 1330 and the processor 1310 are coupled. For example, the memory 1320, the communication interface 1330 and the processor 1310 can be coupled together through a bus 1340.

[0437] The communication interface 1330 is configured to perform data transmission with other devices. The memory 1320 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 1310, causes the electronic device to perform the related method steps in the embodiments of the present application.

[0438] The processor 1310 can be a processor or controller such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device, transistor logic, hardware component, or any combination thereof. It can implement or execute various example logical blocks, modules, and circuits described in connection with the present disclosure. The processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0439] The bus 1340 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like. The bus 1340 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 13, but it does not mean that there is only one bus or only one type of bus.

[0440] The embodiments of the present application also provide an electronic device, which includes a memory and one or more processors; the memory is coupled with the processors; wherein the memory stores computer program codes, the computer program codes include computer instructions, when the computer instructions are executed by the processors, the electronic device executes the related method steps in the above method embodiments.

[0441] The embodiments of the present application also provide a communication device, which includes a memory and one or more processors; the memory is coupled with the processors; wherein the memory stores computer program codes, the computer program codes include computer instructions, when the computer instructions are executed by the processors, the communication device executes the related method steps in the above method embodiments.

[0442] The embodiments of the present application also provide a computer readable storage medium, which stores computer program codes, when the above processor executes the computer program codes, the electronic device executes the related method steps in the above method embodiments.

[0443] The embodiment of the present application further provides a computer program product, and the computer program product contains instructions. When the instructions are run on a computer or a processor, the computer or the processor executes the related method steps in the above method embodiment.

[0444] The embodiment of the present application further provides a chip system, comprising: a processor, and a memory coupled with the processor, wherein the memory is used for storing programs or instructions, and when the programs or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

[0445] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or 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, and the implementation is achieved by reading software codes stored in the memory.

[0446] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or arranged separately from the processor, and the embodiment of the present application is not limited in this regard. For example, the memory can be a non-transient processor, for example, a read-only memory (ROM), which can be integrated on the same chip as the processor or arranged on different chips respectively, and the embodiment of the present application does not make specific limitation on the type of the memory and the arrangement mode of the memory and the processor.

[0447] For example, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0448] The electronic device, the computer storage medium or the computer program product provided by the present application are used for executing the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be repeated here. The electronic device, the computer storage medium or the computer program product provided by the present application are used for executing the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be repeated here.

[0449] 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 functional modules is exemplified, and in actual application, the above functions can be completed by 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.

[0450] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0451] The units described as separate components can or can not be physically separate, and the components shown as units can be one physical unit or multiple physical units, which can be located in one place or distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit. When the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application essentially or say the part that contributes or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions to make a device (which can be a single chip, a chip, etc.) or a processor execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage program codes.

[0452] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any change or replacement within the technical scope disclosed by the present application should be covered in 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 communication method characterized by comprising: The method is applied to a first device, and comprises: receiving first communication information sent by a second device, the first communication information comprising a link establishment capability of the second device and a second transmission key used by the second device to establish a first communication connection, the link establishment capability of the second device being used to indicate whether the second device supports establishment of the first communication connection; in response to a trigger operation for a cooperative service, establishing the first communication connection with the second device based on the first communication information and second communication information, the second communication information comprising a link establishment capability of the first device and a first transmission key used by the first device to establish the first communication connection, the link establishment capability of the first device being used to indicate whether the first device supports establishment of the first communication connection.

2. The method of claim 1, wherein, In response to the trigger operation for the cooperative service, the method further comprises: sending first broadcast information, the first broadcast information being used to inform the second device to establish the first communication connection with the first device.

3. The method of claim 2, wherein, The first communication connection comprises a communication link, and the establishing of the first communication connection with the second device based on the first communication information and the second communication information comprises: receiving a link connection request sent by the second device, the link connection request being used for the second device to request the first device to establish the communication link; sending a link connection response to the second device based on the first communication information and the second communication information, the link connection response being used to indicate that the first device and the second device have successfully established the communication link.

4. The method of claim 3, wherein, The link connection request and the link connection response are sent through a target communication mode, and the target communication mode comprises a wireless fidelity (Wi-Fi) operation frame communication.

5. The method according to claim 3 or 4, characterized in that, The first broadcast information comprises second device identification of the second device and information of an expected channel, the expected channel being a channel used to establish the first communication connection.

6. The method of claim 5, wherein, The information of the expected channel is encrypted by using a pairwise master key, and the pairwise master key is obtained after authentication of the first device and the second device.

7. The method according to claim 5 or 6, characterized in that, The method further comprises: creating a first virtual access point in the first device based on the information of the expected channel; configuring first connection information for the first virtual access point, the first connection information being used for the first device and the second device to establish the first communication connection.

8. The method of claim 7, wherein, Before the sending of the link connection response to the second device, the method further comprises: establishing a correspondence between the first virtual access point and a second virtual access point in the second device.

9. The method according to claim 7 or 8, characterized in that, The sending of the link connection response to the second device based on the first communication information and the second communication information comprises: in a case where it is determined that the second device supports establishment of the first communication connection based on the link establishment capability of the second device, and it is verified that the second device is a target device for establishment of the first communication connection based on the link connection request, sending the link connection response to the second device by using the first transmission key.

10. The method of claim 9, wherein, The link connection request comprises second connection information, and the second connection information is configuration information of a second virtual access point in the second device; the method further comprises: In a case where a second device identifier of the second device in the link request is recorded, it is inquired whether a challenge code in the second connection information is recorded; In a case where the challenge code in the second connection information is recorded, it is determined that the second device is a target device for establishing the first communication connection, and the challenge code is sent to the second device by the first device based on the first broadcast information.

11. The method of claim 10, wherein, The second connection information is encrypted by the second device using the second transmission key, and the method further comprises: Inquiring the second transmission key corresponding to the second device identifier; Decrypting the second connection information using the second transmission key to obtain the challenge code.

12. The method according to claim 10 or 11, characterized in that, The second connection information further comprises second verification information, and the second verification information is used for verifying the integrity of the second connection information; the method further comprises: Using a first preset rule, calculating the verification information corresponding to the second connection information; In a case where the verification information corresponding to the second connection information is consistent with the second verification information, it is determined that the second connection information has not changed.

13. The method according to any one of claims 10-12, characterized in that, The first communication connection further comprises a logical link, the first connection information comprises first network segment information, the first network segment information is used for representing a network address of the first device corresponding to the logical link, and the second connection information further comprises second network segment information, the second network segment information is used for representing a network address of the second device corresponding to the logical link; the method further comprises: Using a second preset rule, updating the first network segment information and the second network segment information to generate a target network address, and the target network address is used for transmitting service data of the collaborative service between the first device and the second device.

14. The method according to any one of claims 10 to 13, characterized in that, The first communication connection further comprises a logical link, and the second connection information further comprises second port information, the second port information is used for identifying a port of the second device corresponding to the logical link, and the method further comprises: Based on the second port information, a transmission control protocol (TCP) connection is established with the second device to complete the establishment of the logical link.

15. The method according to any one of claims 9-14, characterized in that, The first communication connection further comprises a logical link, and the first transmission key is used to send a link connection response to the second device, comprising: The first connection information is encrypted using the first transmission key; The link connection response is sent to the second device; The link connection response comprises the encrypted first connection information, and the first connection information comprises a challenge code, first verification information, first network segment information and first port information, the challenge code is used for the second device to verify whether the first device is a target device for establishing the first communication connection, the first verification information is used for verifying the integrity of the first connection information, and the first network segment information and the first port information are used for the second device to establish the logical link.

16. The method according to any one of claims 2-15, characterized in that, The first broadcast information further comprises a re-negotiation manner, the re-negotiation manner is used for representing a communication manner of information negotiation between the first device and the second device, the re-negotiation manner comprises a wireless fidelity data frame-based communication manner, and the method further comprises: receiving a change operation frame sent by the second device based on the re-negotiation manner, the change operation frame comprising updated expected channel information, and the change operation frame being used for requesting the first device to establish the first communication connection based on the updated expected channel information; in response to the change operation frame, sending a response operation frame to the second device, the response operation frame being used for indicating that the first device establishes the first communication connection based on the updated expected channel information.

17. The method of claim 16, wherein, The method further comprises: updating a first virtual access point in the first device based on the updated expected channel information.

18. The method according to any one of claims 1 to 17, characterized in that, The receiving of the first communication information sent by the second device comprises: in a case where the account information of the first device and the account information of the second device are the same account or the account information of the first device and the account information of the second device are associated accounts in a trusted relationship, sending a first synchronization request to the second device, the first synchronization request being used for requesting to synchronize the first communication information; receiving the first communication information sent by the second device.

19. The method of claim 18, wherein, The sending of the first request to the second device comprises: sending the first synchronization request to the second device through the established second communication connection; wherein the second communication connection comprises at least one of a Bluetooth communication connection, a wireless local area network communication connection, and a wireless fidelity communication connection, and the second communication connection is disconnected after the first communication information is received.

20. The method of any one of claims 5-19, wherein, The first communication information further comprises channel information supported by the second device for wireless fidelity Wi-Fi direct connection, and the method further comprises: determining the information of the expected channel according to the channel information supported by the second device for Wi-Fi direct connection.

21. A method of communication, comprising: Applied to the second device, comprising: receiving second communication information sent by the first device, the second communication information comprising a first device link establishment capability and a first transmission key used by the first device to establish a first communication connection, the first device link establishment capability being used to indicate whether the first device supports establishment of the first communication connection; establishing the first communication connection with the first device based on first communication information and the second communication information, the first communication information comprising a second device link establishment capability and a second transmission key used by the second device to establish the first communication connection, the second device link establishment capability being used to indicate whether the second device supports establishment of the first communication connection.

22. The method of claim 21, wherein, The method further comprises: receiving first broadcast information, the first broadcast information being used to notify the second device to establish the first communication connection with the first device.

23. The method of claim 22, wherein, The first communication connection comprises a communication link, and the establishment of the first communication connection with the first device based on the first communication information and the second communication information comprises: In a case that it is determined that the first device supports to establish the first communication connection based on the link establishment capability of the first device, a link connection request is sent to the first device by using the second transmission key, and the link connection request is used to request to establish the communication link with the first device. A link connection response sent by the first device is received, and the link connection response is used to indicate that the first device and the second device have successfully established the communication link.

24. The method of claim 22 or 23, wherein, The first broadcast information includes a second device identifier of the second device and information of an expected channel; and the method further includes: In a case that it is determined that the first broadcast information is required processing information based on the second device identifier, a second virtual access point is created in the second device based on the information of the expected channel; Second connection information is configured for the second virtual access point, and the second connection information is used to establish the first communication connection between the second device and the first device.

25. The method of claim 24, wherein, The first communication connection further includes a logical link, and the first broadcast information further includes a challenge code, and the challenge code is used for the first device to verify whether the second device is a target device for establishing the first communication connection. The sending of the link connection request to the first device based on the first communication information includes: The second connection information is encrypted by using the second transmission key, and the link connection request is sent to the first device; The link connection request includes the encrypted second connection information, and the second connection information includes the challenge code, second verification information, second network segment information and second port information, the second verification information is used to verify the integrity of the second connection information, and the second network segment information and the second port information are used for the first device to establish the logical link.

26. A communication system, characterized by The communication system includes a first device and a second device; The first device is configured to receive first communication information sent by the second device, and the first communication information includes link establishment capability of the second device and a second transmission key used by the second device to establish a first communication connection, and the link establishment capability of the second device is used to indicate whether the second device supports to establish the first communication connection; The first device is further configured to, in response to a trigger operation for cooperative service, establish the first communication connection with the second device based on the first communication information and second communication information, and the second communication information includes link establishment capability of the first device and a first transmission key used by the first device to establish the first communication connection, and the link establishment capability of the first device is used to indicate whether the first device supports to establish the first communication connection; The second device is configured to receive the second communication information sent by the first device; The second device is configured to establish the first communication connection with the first device based on the first communication information and the second communication information.

27. An electronic device, comprising: The electronic device includes a memory, one or more processors; the memory is coupled with the processors; wherein the memory has computer program codes stored therein, the computer program codes include computer instructions, when the computer instructions are executed by the processors, cause the electronic device to perform the method as claimed in any one of claims 1-20, or perform the method as claimed in any one of claims 21-25.

28. A computer readable medium characterized by The computer readable storage medium has instructions stored therein, when the instructions run on an electronic device, cause the electronic device to perform the method as claimed in any one of claims 1-20, or perform the method as claimed in any one of claims 21-25.

29. A computer program product, characterised in that, The computer program product contains instructions, when the instructions run on a computer or a processor, cause the computer or the processor to perform the method as claimed in any one of claims 1-20, or perform the method as claimed in any one of claims 21-25.

Citation Information

Patent Citations

  • Method and device for establishing Wi-Fi point-to-point connection

    CN111372325A

  • Wireless network connection method and device, electronic equipment and storage medium

    CN115209510A

  • Method for establishing Wi-Fi P2P connection and electronic equipment

    CN115348563A

  • Bootstrapping wi-fi direct communication by a trusted network entity

    US20170339557A1