Device cooperation method and electronic device

By displaying a first window and automatically initiating device authentication upon discovering the peer device, and utilizing Bluetooth address recognition and device status judgment, the problem of low device collaboration efficiency is solved, enabling the rapid establishment of a data transmission channel and improving the user experience.

CN119227030BActive Publication Date: 2025-11-21HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310790210.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-11-21
Estimated Expiration
2043-06-28

AI Technical Summary

Technical Problem

The low efficiency of device collaboration between electronic devices and peer devices results in excessively long waiting times and a poor user experience.

Method used

After discovering the peer device, a first window is displayed and the device authentication process is automatically started. A data transmission channel is quickly established based on the device status, including Bluetooth address identification and device authentication, thus optimizing the device authentication process to improve efficiency.

Benefits of technology

It shortens the setup time for device collaboration, improves the efficiency of device collaboration, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227030B_ABST
    Figure CN119227030B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a device cooperation method and an electronic device. The method comprises: a first electronic device, in response to a first operation of a user, displaying a first window after discovering a second electronic device, and performing a first device authentication process with the second electronic device. The first electronic device, in response to a second operation of the user, identifies a device state of the second electronic device. If the device state is a first state, the first electronic device establishes a data transmission channel with the second electronic device. If the device state is a second state, the first electronic device performs a second device authentication process with the second electronic device, and establishes the data transmission channel with the second electronic device after the second electronic device passes the authentication. In this way, the first electronic device can quickly discover the second electronic device and automatically perform device authentication on the second electronic device, without waiting for the second operation of the user, thereby shortening the time for the first electronic device to establish the data transmission channel with the second electronic device in response to the second operation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of terminal, and in particular, to a device cooperation method and an electronic device. BACKGROUND

[0002] Multi-device cooperation is a kind of distributed technology applied to multiple electronic devices. With the multi-device cooperation technology, two or more electronic devices can be cooperated across systems and devices, and resource sharing and cooperative operation can be realized.

[0003] After discovering a peer device, the electronic device establishes a data transmission channel with the peer device in response to a user operation, and interacts with the peer device through the data transmission channel to realize device cooperation between the electronic device and the peer device. After discovering the peer device, if the electronic device does not receive the user operation, the electronic device will not establish the data transmission channel with the peer device until the user operation is received.

[0004] Since the process of discovering the peer device by the electronic device and the process of establishing the data transmission channel by the electronic device after discovering the peer device require a certain amount of time, the user needs to wait for a long time before being able to use the electronic device to cooperate with the peer device. It can be seen that the efficiency of device cooperation between the electronic device and the peer device is low, resulting in poor user experience. SUMMARY

[0005] Embodiments of the present application provide a device cooperation method and an electronic device to solve the problem of low efficiency of device cooperation between the electronic device and the peer device.

[0006] In a first aspect, the embodiments of the present application provide a device cooperation method, comprising: a first electronic device, in response to a first operation of a user, displaying a first window after discovering a second electronic device, the first window comprising a first button, and performing a first device authentication process with the second electronic device based on a first connection. The first electronic device, in response to a second operation of the user on the first button, identifies a device state of the second electronic device, the device state of the second electronic device comprising a first state and a second state. If the second electronic device is in the first state, the first electronic device establishes a data transmission channel with the second electronic device based on a second connection. If the second electronic device is in the second state, the first electronic device performs a second device authentication process with the second electronic device based on the first connection, and establishes the data transmission channel with the second electronic device based on the second connection after the second electronic device is authenticated. The first state comprises that the second electronic device is authenticated and the second electronic device maintains the first connection with the first electronic device or can receive a broadcast response message from the other party. The second state comprises that the second electronic device is not authenticated, or the second electronic device is authenticated and the second electronic device disconnects the first connection with the first electronic device and cannot receive the broadcast response message from the other party.

[0007] The method provided by the embodiments of the present application can be used to trigger the first electronic device to discover the second electronic device quickly when the user needs to use the first electronic device to cooperate with the second electronic device. After discovering the second electronic device, the first electronic device displays the first window and automatically starts the first device authentication process with the second electronic device. When the user performs the second operation on the first button of the first window, if the second electronic device is in the first state, the first electronic device can directly establish the data transmission channel with the second electronic device based on the authentication result of the authentication of the second electronic device, thereby shortening the time for establishing the data transmission channel between the first electronic device and the second electronic device and improving the efficiency of the device cooperation between the first electronic device and the second electronic device.

[0008] In an implementation, the first electronic device, in response to the second operation of the first button by the user, identifies the device status of the second electronic device, including: the first electronic device identifies the device status of the second electronic device according to the Bluetooth address of the second electronic device and the stored first information, the Bluetooth address of the second electronic device being obtained when the first electronic device discovers the second electronic device, and the first information including the Bluetooth address and the device status of the authenticated device. When the first information includes the Bluetooth address of the second electronic device, and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the first state, the second electronic device is in the first state. When the first information includes the Bluetooth address of the second electronic device, and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the second state, or when the first information does not include the Bluetooth address of the second electronic device, the second electronic device is in the second state. In this way, the first electronic device can store the Bluetooth address and the device status of the authenticated device, and when the Bluetooth address of the authenticated device is obtained, the device status of the authenticated device can be quickly obtained based on the Bluetooth address, and then the process of establishing a data transmission channel can be quickly and accurately determined according to the device status.

[0009] In an implementation, if the second electronic device is in the first state, the first electronic device establishes a data transmission channel with the second electronic device based on the second connection, including: the first electronic device interacts with the second electronic device to obtain connection information of a wireless network based on the first connection, the first connection being the first connection established between the first electronic device and the second electronic device, or the first connection being the first connection re-established between the first electronic device and the second electronic device after the first electronic device determines to disconnect the first connection with the second electronic device. The first electronic device establishes the second connection with the second electronic device according to the connection information of the wireless network. The first electronic device establishes the data transmission channel with the second electronic device based on the second connection. In this way, if the second electronic device is in the first state, the first electronic device can establish a data transmission channel with the second electronic device across the device authentication process in response to the second operation of the user, thereby improving the efficiency of establishing a data transmission channel. Moreover, the data transmission channel established based on the second connection can meet a larger data transmission amount, thereby meeting the device cooperation between the first electronic device and the second electronic device.

[0010] In an implementation, the first information further includes a device identity identifier ID of the authenticated device, the device ID including a universally unique identifier UUID, and the first electronic device further stores second information including the device ID of the authenticated device, the device ID including a unique device identifier UDID. The first electronic device interacts with the second electronic device based on the connection information of the wireless network of the first connection, including: the first electronic device acquires the UUID of the second electronic device according to the Bluetooth address of the second electronic device and the first information. The first electronic device acquires the UDID of the second electronic device according to the UUID of the second electronic device and the second information. The first electronic device identifies the device state of the second electronic device according to the UDID of the second electronic device and the first information. The first electronic device interacts with the second electronic device based on the connection information of the wireless network of the first connection when the second electronic device is determined to be in the first state. In this way, the first electronic device can accurately determine the second electronic device to be established for the data transmission channel through the specified device ID, thereby ensuring the security and effectiveness of the data transmission channel.

[0011] In an implementation, the data transmission channel is an encryption channel. If the second electronic device is in the first state, the key of the data transmission channel is obtained by the first electronic device according to the Bluetooth address of the second electronic device and the first information. The first information includes a device identity identifier ID of the second electronic device, and the key of the data transmission channel corresponds to the device ID of the second electronic device. In this way, if the second electronic device is in the first state, the first electronic device can directly obtain the key of the data transmission channel from the first information, and then interact with the second electronic device through the data transmission channel to ensure the security of data transmission.

[0012] In an implementation, the first electronic device and the second electronic device perform a first device authentication process based on the first connection, including: the first electronic device acquires a user account logged in by the second electronic device. The first electronic device determines whether the user account logged in by the first electronic device and the user account logged in by the second electronic device are the same. If they are the same, the first electronic device and the second electronic device perform the first device authentication process based on the first connection. In this way, the first electronic device can preliminarily determine whether it can be networked with the second electronic device through the user account logged in by the second electronic device, so as to ensure the security of the device and avoid invalid networking operations of the first electronic device.

[0013] In an implementation, the discovering, by the first electronic device, of the second electronic device in response to the first operation of the user includes: the first electronic device establishing, in response to the user bringing the first electronic device close to or touching a near field communication (NFC) region of the second electronic device, an NFC communication with the second electronic device. The first electronic device obtains, based on the NFC communication, a Bluetooth address of the second electronic device from the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by bringing the first electronic device close to or touching the second electronic device.

[0014] In an implementation, the discovering, by the first electronic device, of the second electronic device in response to the first operation of the user includes: the first electronic device obtaining, in response to the user scanning, by using the first electronic device, a two-dimensional code provided by the second electronic device, a Bluetooth address associated with the two-dimensional code. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by scanning the two-dimensional code by using the first electronic device.

[0015] In an implementation, the discovering, by the first electronic device, of the second electronic device in response to the first operation of the user includes: the first electronic device broadcasting a device discovery request. The first electronic device receives, in response to the user bringing the first electronic device close to the second electronic device, a response message broadcasted by the second electronic device in response to the device discovery request when a Bluetooth signal strength of the device discovery request is greater than or equal to a strength threshold, the response message including a Bluetooth address of the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by bringing the first electronic device close to the second electronic device.

[0016] In an implementation, the discovering, by the first electronic device, of the second electronic device in response to the first operation of the user includes: the first electronic device receiving, in response to the user performing a third operation on the second button on the first page, a device discovery request broadcasted by the second electronic device, the device discovery request including a Bluetooth address of the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by performing the second operation on the second button on the second page.

[0017] In an implementation, if the second electronic device is in the second state, the first electronic device performs a second device authentication process with the second electronic device based on the first connection, and establishes a data transmission channel with the second electronic device based on a second connection after the second electronic device is authenticated. The first electronic device establishes the first connection with the second electronic device according to a Bluetooth address of the second electronic device. The first electronic device performs the second device authentication process with the second electronic device based on the first connection. The first electronic device interacts with the second electronic device for connection information of a wireless network based on the first connection after the second electronic device is authenticated. The first electronic device establishes the second connection with the second electronic device according to the connection information of the wireless network. The first electronic device establishes the data transmission channel with the second electronic device based on the second connection. In this way, the first electronic device quickly performs the second device authentication process with the second electronic device in response to a second operation of the user, and no longer waits for an authentication result of the first device authentication process with the second electronic device, thereby avoiding wasting time in waiting for the authentication result of the first device authentication process, shortening the time for establishing the data transmission channel between the first electronic device and the second electronic device, and improving the cooperation efficiency of the first electronic device and the second electronic device.

[0018] In an implementation, the data transmission channel is an encrypted channel. If the second electronic device is in the second state, the key of the data transmission channel is exchanged between the first electronic device and the second electronic device in the second authentication process. In this way, the first electronic device and the second electronic device can accurately obtain the key suitable for the data transmission channel established this time.

[0019] In an implementation, if the second electronic device is in the second state, the first electronic device performs the first process and the second process in parallel. The first process is a first device authentication process performed by the first electronic device with the second electronic device based on the first connection, and the second process is a second device authentication process performed by the first electronic device with the second electronic device based on the first connection, and a data transmission channel established by the first electronic device with the second electronic device based on a second connection after the second electronic device is authenticated. In this way, the first electronic device can establish the data transmission channel with the second electronic device based on the result of being authenticated in the second device authentication process with the second electronic device. Meanwhile, the first electronic device can store the full information and the Bluetooth address of the second electronic device based on the result of being authenticated in the first device authentication process with the second electronic device, so that in subsequent device cooperation with the second electronic device, the full information of the second electronic device can be directly obtained according to the Bluetooth address of the second electronic device, and the data transmission channel can be established with the second electronic device based on the full information of the second electronic device, without the need to perform device authentication with the second electronic device again, thereby improving the efficiency of device cooperation with the second electronic device.

[0020] In an implementation, the first electronic device identifies the device status of the second electronic device in response to the second operation of the first button by the user, including: the first electronic device identifies whether the service package to be executed is a collaborative service package in response to the second operation of the first button by the user. When the service package is a collaborative service package, the device status of the second electronic device is identified. In this way, the first electronic device can establish a data transmission channel with the second electronic device for the collaborative service in a targeted manner.

[0021] In an implementation, the first electronic device displays the first window in response to a third operation of the second button on the first page by the user, including: the first window is a first area on the second page for displaying device search results, the device search results including the second electronic device, wherein each device search result corresponds to one of the first buttons. In this way, the first electronic device can show all discovered devices to the user through the first window, and provide an entry for each device to establish a data transmission channel.

[0022] In an implementation, the device discovery request includes a user account logged in by the second electronic device, and the first electronic device displays the first window in response to the third operation of the second button on the first page by the user, including: the first electronic device determines whether the user account information logged in by the first electronic device and the user account information logged in by the second electronic device are the same. If they are the same, the first electronic device displays the first identification on the second electronic device when displaying the first window. In this way, the user can quickly and accurately locate the discovered device logged in with the same user account as the first electronic device through the first identification, and then can perform corresponding operations based on the same account device.

[0023] In an implementation, the first electronic device adds the device information of the second electronic device to the second information after the second electronic device passes the first device authentication process, the second information including the device information of the authenticated devices, and the device information of the authenticated devices including the device status of the authenticated devices. The first electronic device displays the third page according to the second information in response to a fourth operation by the user, the second page including the first electronic device and the interactive control of the authenticated device in the first state. In this way, the user can interact with the authenticated device and the first electronic device based on the interactive control on the second page, which can effectively simplify the user operation and improve the interactivity between the user and the first electronic device.

[0024] In an implementation manner, the first electronic device displays the third page according to the second information in response to the fourth operation of the user, including: the first electronic device acquires the user account logged in by the authenticated device in response to the fourth operation of the user; and the first electronic device displays the third page according to the user account logged in by the first electronic device and the user account logged in by the authenticated device. The third page further includes a second identifier located on the interactive control of the authenticated device logged in by the same user account as the first electronic device. In this way, the user can quickly and accurately locate the authenticated device logged in by the same user account as the first electronic device through the second identifier, and then can perform corresponding operations based on the same account device.

[0025] In a second aspect, the embodiments of the present application further provide a device cooperation apparatus, including: a display module configured to display a first window including a first button in response to a first operation of a user after discovering a second electronic device; a first authentication module configured to perform a first device authentication process with the second electronic device based on a first connection after discovering the second electronic device; an identification module configured to identify a device state of the second electronic device in response to a second operation of the user on the first button; and a connection module configured to establish a data transmission channel with the second electronic device based on a second connection if the second electronic device is in a first state; and a second authentication module configured to perform a second device authentication process with the second electronic device based on the first connection if the second electronic device is in a second state. The connection module is further configured to establish the data transmission channel with the second electronic device based on the second connection after the second electronic device is authenticated. The first state includes that the second electronic device is authenticated and the second electronic device maintains the first connection with the first electronic device or can receive a broadcast response message from the other party. The second state includes that the second electronic device is not authenticated or the second electronic device is authenticated and the second electronic device disconnects the first connection with the first electronic device and cannot receive the broadcast response message from the other party.

[0026] The apparatus provided by the embodiments of the present application can quickly trigger the first electronic device to discover the second electronic device through the first operation when the user needs to use the first electronic device to perform device cooperation with the second electronic device. The first electronic device displays the first window and directly and automatically starts the first device authentication process with the second electronic device after discovering the second electronic device. In this way, when the user performs the second operation on the first button of the first window, if the second electronic device is in the first state, the first electronic device can directly establish the data transmission channel with the second electronic device based on the authentication result of the authentication of the second electronic device, thereby shortening the time for establishing the data transmission channel between the first electronic device and the second electronic device and improving the efficiency of the device cooperation between the first electronic device and the second electronic device.

[0027] In a third aspect, the embodiments of the present application further provide a computer readable storage medium, which stores instructions, and when the instructions are run on a computer, the computer is caused to execute the method of the above aspects and the implementation manners thereof.

[0028] In a fourth aspect, the embodiments of the present application further provide a computer program product containing instructions, and when the instructions are run on a computer, the computer is caused to execute the method of the above aspects and the implementation manners thereof.

[0029] In a fifth aspect, the embodiments of the present application further provide a chip system, which includes a processor for supporting the terminal device to implement the functions involved in the above aspects, for example, generating or processing the information involved in the above method. BRIEF DESCRIPTION OF DRAWINGS

[0030] Figure 1 is a software architecture block diagram of an electronic device provided by the embodiments of the present application to implement multi-device collaboration;

[0031] Figure 2 is a hardware structure schematic diagram of an electronic device provided by the embodiments of the present application;

[0032] Figure 3 is a software structure block diagram of an electronic device of the embodiments of the present application;

[0033] Figure 4 is a flowchart of a device collaboration method provided by the embodiments of the present application;

[0034] Figure 5A and Figure 5B is a first set of interaction example diagrams of a first electronic device discovering a second electronic device and displaying a first window, as shown by the embodiments of the present application;

[0035] Figure 6A , Figure 6B , Figure 6C and Figure 6D is a second set of interaction example diagrams of a first electronic device discovering a second electronic device and displaying a first window, as shown by the embodiments of the present application;

[0036] Figure 7A , Figure 7B and Figure 7C is a third set of interaction example diagrams of a first electronic device discovering a second electronic device and displaying a first window, as shown by the embodiments of the present application;

[0037] Figure 8A and Figure 8B is a fourth set of interaction example diagrams of a first electronic device discovering a second electronic device and displaying a first window, as shown by the embodiments of the present application;

[0038] Figure 9 is a flowchart of a first device authentication process between a first electronic device and a second electronic device provided by an embodiment of the present application;

[0039] Figure 10 is a flowchart of a first electronic device and a second electronic device establishing a data transmission channel provided by a first embodiment of the present application;

[0040] Figure 11 is a flowchart of a first electronic device and a second electronic device exchanging connection information of a wireless network provided by a first embodiment of the present application;

[0041] Figure 12 is a flowchart of a second electronic device and a second electronic device establishing a data transmission channel provided by a first embodiment of the present application;

[0042] Figure 13 is a first interaction example diagram of a first electronic device and a second electronic device performing device authentication in response to a user performing any of the first to third implementation manners provided by an embodiment of the present application;

[0043] Figure 14 is a first interaction example diagram of a first electronic device and a second electronic device performing device collaboration based on the device authentication method shown in Figure 13 provided by an embodiment of the present application;

[0044] Figure 15 is an interaction example diagram of a first electronic device and a second electronic device establishing a data transmission channel when the second electronic device is in a second state in Figure 14 provided by an embodiment of the present application;

[0045] Figure 16 is a second interaction example diagram of a first electronic device and a second electronic device performing device collaboration in response to a user performing any of the first to third implementation manners provided by an embodiment of the present application;

[0046] Figure 17 is a third interaction example diagram of a first electronic device and a second electronic device performing device authentication in response to a user performing a first operation in the fourth implementation manner provided by an embodiment of the present application;

[0047] Figure 18 is a third interaction example diagram of a first electronic device and a second electronic device performing device collaboration based on the device authentication method shown in Figure 17 provided by an embodiment of the present application;

[0048] Figure 19is an example diagram of a second page when a first electronic device and a second electronic device log in a same user account according to an embodiment of the present application;

[0049] Figure 20A 、 Figure 20B 、 Figure 20C and Figure 20D is an example diagram of interaction between a first electronic device and a second electronic device for device collaboration after the second electronic device is authenticated according to an embodiment of the present application;

[0050] Figure 21 is a structural schematic diagram of a device authentication apparatus according to an embodiment of the present application;

[0051] Figure 22 is a structural schematic diagram of another device collaboration apparatus according to an embodiment of the present application. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0053] The terms “first”, “second”, and “third” and the like in the specification and claims of the present application are used to distinguish different objects, rather than to limit a specific order. In the description of the present application, unless otherwise specified, “at least one” means one, two, and two or more.

[0054] In the embodiments of the present application, the words “exemplary” or “for example” are used to mean serving as an example, instance, or illustration. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of the words “exemplary” or “for example” is intended to present related concepts in a specific way.

[0055] The terms used in the implementation part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0056] Multi-device collaboration is a distributed technology applied to multiple electronic devices. With the multi-device collaboration technology, two or more electronic devices can be cross-system and cross-device collaboration, realizing information synchronization, resource sharing, and collaborative operation.

[0057] The multi-device cooperation can be applied between electronic devices of the same type or different types. The types of the electronic devices include, but are not limited to, a mobile phone, a tablet computer, a notebook computer, a large-screen device (for example, a smart television or a smart screen), a personal computer (PC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a vehicle-mounted device, a virtual reality device, and the like.

[0058] The multi-device cooperation needs to be implemented based on a trusted relationship between devices. After discovering a peer device, the electronic device can establish a data transmission channel with the peer device only after device authentication by both parties, and perform data interaction based on the data transmission channel to realize the multi-device cooperation.

[0059] The electronic device discovers a peer device by broadcasting. In order to reduce the power consumption of the electronic device, the electronic device can broadcast according to a preset triggering mechanism. The preset triggering mechanism can include that the electronic device periodically broadcasts according to different periods in different screen states. For example, the electronic device broadcasts continuously for 5 seconds within 30 seconds in a bright screen state. The electronic device broadcasts continuously for 2 seconds or 5 seconds every 5 minutes in a sleep state (screen off and not plugged in). The broadcasting for 2 seconds and the broadcasting for 5 seconds can be alternately performed, and the scanning for 2 seconds and the stopping for 3 seconds of the peer device are coordinated. The preset triggering mechanism can also include that the electronic device triggers broadcasting when a specified device state of the electronic device changes, or triggers broadcasting when a network group in which the electronic device is located changes. The specified device state of the electronic device includes a bright screen unlocked state, a screen off state, a charging state, a plugged state, and an on-network function state. On the basis of periodic broadcasting, the electronic device additionally triggers broadcasting for a certain time duration when the specified device state changes or the network group changes, for example, additional broadcasting for 5 seconds.

[0060] After discovering the peer device, the electronic device displays a window. The window further includes a connection button. When a user performs an operation based on the connection button, the electronic device performs device authentication with the peer device in response to the operation. If the electronic device does not receive the operation of the user on the connection button, the electronic device does not perform device authentication with the peer device.

[0061] Figure 1 FIG. 1 is a software architecture block diagram of an electronic device for implementing multi-device cooperation according to an embodiment of the present application.

[0062] As shown in FIG. 1, the electronic device includes a processor 101, a memory 102, a communication interface 103, a display 104, and a sensor 105. Figure 1As shown, the software architecture can include an application service framework, a multi-device collaborative decision engine, and a connection base capability subsystem. The electronic device runs a multi-device collaborative application based on the application service framework, such as PC and mobile phone collaboration, PC and tablet computer collaboration. After the electronic device starts the multi-device collaborative application, the relevant data is transmitted to the connection base capability subsystem, and the device management, service registration, synchronization device, service online and offline, and other functions are realized through the multi-device collaborative decision engine. The connection base capability subsystem includes: device management service, peripheral control service, device discovery and connection service, and data transmission service. Among them, the device management service can obtain an account through an account service, such as obtaining a user account logged in by the local device and a user account logged in by the opposite device. The device discovery and connection service can realize periodic wake-up through the system timing service to broadcast to discover nearby devices after wake-up. The period of the system timing service wake-up can meet the preset trigger condition, such as the broadcast period of the electronic device in different screen states, the change of the specified device state of the electronic device, and the change of the network group where the electronic device is located. After discovering the nearby devices, the device discovery and connection service can perform device authentication with the opposite device through the security service, such as obtaining the device certificate of the opposite device, performing same-account authentication with the opposite device, distributing secret keys to the opposite device, and performing data encryption and decryption during data transmission with the opposite device. The data transmission service can perform near-field physical connection with the opposite device through the communication service, and perform data transmission and reception through the physical channel. Among them, the communication service can be realized through low-power hardware.

[0063] Since the process of discovering the opposite electronic device by the electronic device, and the process of performing device authentication with the opposite device in response to the user's operation on the connection button, both of which will consume a long time. Therefore, the electronic device needs to consume a long time to establish a data transmission channel with the opposite electronic device, and the user needs to wait for a long time to use the electronic device to perform device collaboration with the opposite device. It can be seen that the efficiency of the electronic device and the opposite device to perform device collaboration is low, which leads to poor user experience.

[0064] To solve the above technical problems, the device collaboration method provided by the embodiments of the present application is provided.

[0065] Figure 2 is a hardware structure schematic diagram of the electronic device provided by the embodiments of the present application. If the device for multi-device collaboration includes a first electronic device and a second electronic device, the electronic device can act as the first electronic device and the second electronic device. For example, Figure 2As shown, the electronic device 100 can include a processor 110, a memory 120, a universal serial bus (USB) interface 130, a radio frequency circuit 140, a mobile communication module 150, a wireless communication module 160, a camera 170, a display screen 180, a touch sensor 190, an air pressure sensor 210, and a button 220, etc.

[0066] 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 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, such as integrated in a system on a chip (SoC). The processor 110 can also be provided with a memory for storing 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.

[0067] In some embodiments, the processor 110 can include one or more interfaces. The interface can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0068] The memory 120 can be configured to store computer-executable program codes including instructions. The memory 120 can include a program storage area and a data storage area. The program storage area can store operating systems, application programs (such as a sound play function, an image play function, etc.) required by at least one function, and the like. The data storage area can store data (such as audio data, a phone book, etc.) created during use of the electronic device 100, and the like. In addition, the memory 120 can include one or more memory units, for example, can include volatile memory such as dynamic random access memory (DRAM), static random access memory (SRAM), etc., and can also include non-volatile memory such as read-only memory (ROM), flash memory, etc. The processor 110 executes various function applications and data processing of the electronic device 100 by running instructions stored in the memory 120 and / or instructions stored in a memory disposed in the processor.

[0069] It should be noted here that the operating system referred to in the embodiments of the present application includes but is not limited to the Android operating system, the IOS operating system, the iPad OS, the Harmony operating system (HarmonyOS), the Windows operating system, the Linux operating system, the MAC OS operating system, the embedded system, etc.

[0070] The wireless communication function of the electronic device 100 can be implemented by the radio frequency circuit 140, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0071] The radio frequency circuit 140 can include at least one antenna 141 for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. In some embodiments, the antenna can be used in combination with a tuning switch.

[0072] The mobile communication module 150 can provide a solution for an application on the electronic device 100 including wireless communication of 2G / 3G / 4G / 5G, etc. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive an electromagnetic wave by the antenna 141, and perform filtering, amplification, etc. on the received electromagnetic wave, and transfer the processed signal to the modem processor for demodulation. The mobile communication module 150 can also amplify a signal modulated by the modem processor, and radiate the amplified signal as an electromagnetic wave through the antenna 141. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.

[0073] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (including but not limited to a speaker, a receiver, etc.), or displays an image or a video through the display screen 180. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and disposed in the same device as the mobile communication module 150 or other function modules.

[0074] The wireless communication module 160 can include a wireless fidelity (Wi-Fi) module, a Bluetooth (BT) module, a GNSS module, a near field communication (NFC) module, an infrared (IR) module, etc. The wireless communication module 160 can be one or more devices that integrate at least one of the above modules. The wireless communication module 160 receives an electromagnetic wave via the antenna 141, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification, and radiate the processed signal as an electromagnetic wave through the antenna 141.

[0075] In the embodiments of the present application, the wireless communication function of the electronic device 100 can include, for example, 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), 5th generation mobile networks new radio (5G NR), BT, GNSS, WLAN, NFC, FM, and / or IR, 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).

[0076] The camera 170 is configured to capture still images or videos. The camera 170 includes a lens and a photosensitive element. An object projects an optical image onto the photosensitive element through the lens. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to an ISP to be converted into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into an image signal in a standard format, such as RGB, YUV, RYYB, etc. In some embodiments, the electronic device 100 can include one or N cameras 170, where N is a positive integer greater than 1.

[0077] The NPU is a neural-network (NN) computing processor that quickly processes input information by drawing on the structure of a biological neural network, such as the transmission mode between human brain neurons, and can also continuously self-learn. Through the NPU, the electronic device 100 can implement intelligent cognitive applications such as image recognition, face recognition, speech recognition, text understanding, and the like.

[0078] The display screen 180 is configured to display images, videos, and the like. The display screen 180 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light emitting diode (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 180, where N is a positive integer greater than 1.

[0079] The touch sensor 190, also referred to as a “touch device.” The touch sensor 190 can be disposed on the display screen 180, and the touch sensor 190 and the display screen 180 together form a touch screen, also referred to as a “touch panel.” The touch sensor 190 is configured to detect a touch operation applied to or near the touch sensor 190. The touch sensor 190 can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 180. In other embodiments, the touch sensor 190 can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 180.

[0080] The barometric pressure sensor 210 is configured to measure barometric pressure. In some embodiments, the electronic device 100 calculates altitude, assists positioning and navigation based on the barometric pressure value measured by the barometric pressure sensor 210.

[0081] The keys 220 include a power key, a volume key, and the like. The keys 220 can be mechanical keys. Alternatively, the keys 220 can be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0082] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software or a combination of software and hardware.

[0083] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.

[0084] Figure 3 is a software structure block diagram of the electronic device 100 of the embodiments of the present application.

[0085] The layered architecture divides the 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 four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

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

[0087] As shown in Figure 3 , the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0088] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.

[0089] As shown in Figure 3 , the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0090] The window manager is used to manage the window program. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and intercept the screen, etc.

[0091] The content provider is used to store and obtain data, and make the data accessible to the application. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.

[0092] The view system includes visual controls, such as controls that display text, controls that display pictures, and the like. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays a picture.

[0093] The telephony manager is used to provide the communication function of the electronic device 100. For example, the management of the call state (including the connection, hang-up, and the like).

[0094] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.

[0095] The notification manager enables the application to display notification information in the status bar, which can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of the download, the message reminder, and the like. The notification manager can also be a notification that appears in the top status bar of the system in the form of a chart or a scrolling text, such as a notification of an application running in the background, and can also be a notification that appears on the screen in the form of a dialogue window. For example, the text information is prompted in the status bar, a prompt sound is emitted, the electronic device is vibrated, the indicator light flashes, and the like.

[0096] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0097] The core library includes 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.

[0098] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the stack management, the thread management, the security and exception management, and the garbage collection, and the like.

[0099] The system library can include a plurality of functional modules. For example: the surface manager, the media library, the three-dimensional graphics processing library (for example: OpenGL ES), the two-dimensional graphics engine (for example: SGL), and the like.

[0100] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for a plurality of applications.

[0101] The media library supports playback and recording of various commonly used audio, video formats, and static image files. The media library can support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, and the like.

[0102] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, composition, and layer processing.

[0103] The two-dimensional graphics engine is a drawing engine for two-dimensional drawing.

[0104] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0105] The device cooperation method provided in the embodiments of the present application can be implemented in a first electronic device.

[0106] Figure 4 is a flowchart of a device cooperation method provided in the embodiments of the present application.

[0107] As shown in Figure 4 When the first electronic device and the second electronic device start the multi-device cooperation function, the method can include the following steps S401-S404:

[0108] In step S401, the first electronic device displays a first window and performs a first device authentication process with the second electronic device based on a first connection in response to a first operation of a user after discovering the second electronic device.

[0109] The first operation of the user is used to quickly trigger the first electronic device to discover the second electronic device. The first operation of the user can include: the user brings the first electronic device close to or touches the near field communication (NFC) area of the second electronic device, the user scans the two-dimensional code provided by the second electronic device using the first electronic device, the user brings the first electronic device close to the second electronic device, and the user performs a third operation on the second button on the first page. The first page can be a multi-device cooperation page, and the second button can be an entry for searching for nearby devices, such as a cooperation option of a specified type of device in the multi-device cooperation page. The third operation can be a single-click operation, a double-click operation, a long-press operation, and the like.

[0110] If the first electronic device discovers the second electronic device, the Bluetooth address of the second electronic device can be obtained. The Bluetooth address of the second electronic device can include a basic rate (BR) media access control address (MAC) and a Bluetooth low energy (BLE) MAC.

[0111] The first window can be used to prompt the user that the second electronic device has been discovered. The first window includes a first button based on which the user can perform a second operation to cause the first electronic device to establish a data transmission channel with the second electronic device. The second operation can be a single-click operation, a double-click operation, a long-press operation, etc. The first window can also include a cancel button based on which the user can perform an operation to cause the first electronic device to refrain from establishing a data transmission channel with the second electronic device and to close the first window.

[0112] In an implementation, the first window can be a toast. In this way, the first electronic device can display a small toast to quickly prompt the user that the second electronic device has been discovered while minimizing the obstruction to the interface displayed by the first electronic device. The toast includes a first button, such as a connect button. When the user performs a second operation based on the first button, the electronic device will establish a data transmission channel with the second electronic device in response to the second operation.

[0113] In an implementation, the first window is a first region in a second page used to display device search results. The second page can be a collaboration page for a specified type of device, where an entry to the second page can be provided on the first page, such as a second button on the first page. If the first electronic device discovers the second electronic device, the device search results include a device search result for the second electronic device. In this way, the first electronic device can display the first window to show the user all the electronic devices discovered. The first window includes a first button, where each device search result corresponds to a first button, such as a connect button. When the user performs a second operation based on the first button corresponding to the device search result for the second electronic device, the electronic device will establish a data transmission channel with the second electronic device in response to the second operation.

[0114] The first electronic device will display in different forms based on different first operations by the user. The different interactions of the first electronic device displaying the first window in response to the first operation are described in connection with the following implementations.

[0115] In a first implementation, the first operation by the user is to bring or tap the NFC region of the second electronic device against the first electronic device.

[0116] The first electronic device and the second electronic device both have NFC functions, for example, the first electronic device and the second electronic device are both configured with NFC chips. The NFC area of the second electronic device can be identified by an NFC mark, so as to facilitate the user to accurately locate the NFC area of the second electronic device. The first electronic device discovers the second electronic device and establishes NFC communication with the second electronic device in response to the operation of the user bringing the first electronic device close to or touching the NFC area of the second electronic device. Thus, the first electronic device can obtain the Bluetooth address of the second electronic device from the second electronic device based on the NFC communication. Based on the NFC communication between the first electronic device and the second electronic device, the Bluetooth address of the second electronic device obtained by the first electronic device is BR MAC, the data amount of BR MAC is smaller, more suitable for transmission through NFC communication, and the transmission speed is faster.

[0117] In this way, the user can simply and quickly trigger the first electronic device to discover the second electronic device by bringing the first electronic device close to or touching the second electronic device, such as "touching".

[0118] Figure 5A And Figure 5B is a first group of interaction example diagrams of the first electronic device discovering the second electronic device and displaying the first window, which are illustrated by the embodiments of the present application.

[0119] Take the first electronic device as a mobile phone and the second electronic device as a PC as an example. The mobile phone and the PC are both in a bright screen state, and the mobile phone and the PC both have Bluetooth functions turned on. As shown in Figure 5A , an NFC mark 501 can be pasted in the lower right corner of the PC. When the user wants to establish networking for the mobile phone and the PC, the first operation 11 of bringing the mobile phone close to or touching the NFC mark 501 can be performed. As shown in Figure 5B , when the mobile phone touches the NFC mark 501, the mobile phone discovers the PC and establishes NFC communication with the PC. Take the Bluetooth address of the PC as BR MAC_1 as an example, the PC sends BR MAC_1 to the mobile phone through NFC communication. After obtaining the BR MAC_1 of the PC, the mobile phone can leave the NFC area of the PC. However, the mobile phone needs to remain within the range for Bluetooth communication with the PC. After obtaining the BR MAC_1 of the PC, the mobile phone displays a first window. Take the first window as a pop-up window as an example, as shown in Figure 5B , the mobile phone displays a pop-up window 502, and the pop-up window 502 can include a first button 503. The pop-up window 502 can also include a cancel button 504.

[0120] In the second implementation manner, the first operation of the user is that the user uses the first electronic device to scan a two-dimensional code provided by the second electronic device.

[0121] The first electronic device has a function of scanning a two-dimensional code. The fourth page can be a desktop, a smart vision page, a browser page, etc. The scanning entrance of the two-dimensional code can be an icon of a scanning application on the desktop, an icon of scanning in the smart vision page, an icon of scanning on the browser page, etc. When the fourth page is displayed on the first electronic device, the user can perform a click operation on the scanning entrance on the fourth page to make the first electronic device display a scanning page.

[0122] The second electronic device has a function of providing a two-dimensional code. The fifth page can be a multi-device collaboration page. The display entrance of the two-dimensional code can be a collaboration option of a specified type of device in the multi-device collaboration page. When the fifth page is displayed on the second electronic device, the user can perform a click operation on the display entrance of the two-dimensional code on the fifth page to make the second electronic device display the two-dimensional code. Alternatively, the second electronic device can paste the two-dimensional code on the device shell. The two-dimensional code is associated with the Bluetooth address of the second electronic device.

[0123] When the first electronic device displays the scanning page and the second electronic device displays the two-dimensional code, the user uses the scanning page of the first electronic device to scan the two-dimensional code provided by the second electronic device. The first electronic device discovers the second electronic device when the two-dimensional code is recognized in response to the first operation, and obtains the Bluetooth address associated with the two-dimensional code in the scanning frame.

[0124] In this way, the user can trigger the first electronic device to discover the second electronic device in a simple and fast manner through scanning.

[0125] Figure 6A 、 Figure 6B 、 Figure 6C and Figure 6D are a second set of interaction example diagrams of the first electronic device discovering the second electronic device and displaying the first window according to the embodiments of the present application.

[0126] Taking the first electronic device as a mobile phone and the second electronic device as a PC as an example, as shown in Figure 6A , the mobile phone displays a fourth page, such as a desktop, which includes a scanning entrance of a two-dimensional code, such as an icon 601 of scanning. The user can perform a click operation 13 on the icon 601. The PC displays a fifth page, such as a multi-device collaboration page, which includes a display entrance of a two-dimensional code, such as an option 602 of mobile phone collaboration. The user can perform a click operation 14 on the option 602. As shown in Figure 6BAs shown, the mobile phone responds to click operation 13 by displaying a scanning page 603, and the PC responds to click operation 14 by displaying a QR code 604. When a user wants to establish a network between the mobile phone and the PC, they can scan the PC's QR code 604 through the scanning page 603 on the mobile phone. Figure 6C As shown, when QR code 604 is within the scanning range of scanning page 603, the mobile phone recognizes QR code 604 and obtains the associated Bluetooth address, such as BR MAC_2, through QR code 604. After obtaining the PC's BR MAC_2, the mobile phone can move away from the PC. However, the mobile phone needs to remain within the Bluetooth communication range with the PC. After obtaining the PC's BR MAC_2, the mobile phone displays the first window. Taking a pop-up window as an example, as shown... Figure 6D As shown, the phone displays pop-up window 605. Pop-up window 605 includes a first button 606, and may also include a cancel button 607.

[0127] In the third implementation, the user's first action is to bring the first electronic device close to the second electronic device.

[0128] The first electronic device has the function of broadcasting device discovery requests. Specifically, after the first electronic device enables Bluetooth, it begins broadcasting device discovery requests to other devices.

[0129] The second electronic device has the function of scanning nearby devices. An entry point for scanning nearby devices can be set on the sixth page. In some embodiments, the sixth page can be a multi-device collaboration page, and the entry point for scanning nearby devices can be a collaboration option specifying a type of device within the multi-device collaboration page. When the sixth page is displayed on the second electronic device, the user can click on the entry point for scanning nearby devices on the sixth page to instruct the second electronic device to scan nearby devices.

[0130] After the second electronic device starts scanning nearby devices, the user brings the first electronic device close to the second electronic device. The second electronic device can receive the device discovery request broadcast by the first electronic device, and determine the distance between the first electronic device according to the Bluetooth signal strength of the device discovery request. Wherein, the stronger the Bluetooth signal strength, the closer the second electronic device can determine the distance between the first electronic device. The weaker the Bluetooth signal strength, the farther the second electronic device can determine the distance between the first electronic device. When the second electronic device determines that the Bluetooth signal strength of the received device discovery request is greater than or equal to the strength threshold value, it can be determined that the distance between the first electronic device and the second electronic device is less than or equal to the distance threshold value, that is, the first electronic device is close enough to the second electronic device. When the second electronic device determines that the Bluetooth signal strength of the received device discovery request is greater than or equal to the strength threshold value, it broadcasts a response message in response to the device discovery request of the first electronic device, and carries the Bluetooth address in the response message. When the first electronic device receives the response message, it discovers the second electronic device and obtains the Bluetooth address of the second electronic device from the response message. Based on the way the second electronic device transmits the Bluetooth address by broadcasting the response message, the Bluetooth address of the second electronic device obtained by the first electronic device is BR MAC, which has a smaller data amount and is more suitable for broadcasting.

[0131] In this way, when the function of scanning nearby devices of the second electronic device is turned on, the user can simply and quickly trigger the first electronic device to discover the second electronic device by bringing the first electronic device close to the second electronic device.

[0132] Figure 7A , Figure 7B and Figure 7C are a third group of interaction example diagrams in which the first electronic device discovers the second electronic device and displays the first window, as illustrated by an embodiment of the present application.

[0133] Taking the first electronic device as a mobile phone and the second electronic device as a PC as an example. As shown in Figure 7A , the mobile phone broadcasts a device discovery request. The PC displays a sixth page, such as a multi-device collaboration page, which includes an entry for scanning nearby devices, such as the option 701 for mobile phone collaboration. The user can perform a click operation 15 on the option 701. As shown in Figure 7B , the PC scans nearby devices in response to the click operation 15. When the user wants to establish a network for the mobile phone and the PC, the operation 16 of bringing the mobile phone close to the PC is performed. The PC determines the distance to the mobile phone according to the Bluetooth signal strength of the received device discovery request. As shown in Figure 7C ​​​​​​As shown, when the PC determines that the Bluetooth signal strength of the device discovery request is greater than or equal to the strength threshold, it broadcasts a response message to the mobile phone. This response message carries the PC's Bluetooth address, such as BR MAC_3. The mobile phone receives the response message, discovers the PC, and obtains the PC's BR MAC_3 from the response message. After obtaining the PC's BR MAC_3, the mobile phone displays the first window. Taking a pop-up window as an example, as... Figure 7C As shown, the phone displays pop-up window 702. Pop-up window 702 includes a first button 703, and pop-up window 702 may also include a cancel button 704.

[0134] In the fourth implementation, the user's first action is the third action performed by the user on the second button on the first page.

[0135] The second electronic device has the function of broadcasting a device discovery request. Specifically, after enabling Bluetooth, the second electronic device begins broadcasting a device discovery request. This request may include the Bluetooth address of the second electronic device, such as a BLE MAC or BR MAC, and may also include device information such as the logged-in user account.

[0136] When a user wants to network the first electronic device with the second electronic device, the user can perform a third operation by clicking the second button on the first page displayed on the first electronic device, instructing the first electronic device to search for nearby devices. After the second electronic device enables the device discovery service, it broadcasts a device discovery request. In response to the third operation, the first electronic device receives the device discovery request broadcast by the second electronic device. After receiving the device discovery request from the second electronic device, the first electronic device discovers the second electronic device and can obtain the Bluetooth address of the second electronic device from the received device discovery request.

[0137] In this way, users can easily and quickly trigger the first electronic device to discover the second electronic device by triggering the first electronic device to receive a device discovery request from nearby devices.

[0138] Figure 8A- Figure 8B This is a fourth set of interactive example diagrams illustrating a first electronic device discovering a second electronic device and displaying a first window, as shown in an embodiment of this application.

[0139] Taking a PC as the first electronic device and a tablet computer as the second electronic device as an example. Figure 8A As shown, the tablet broadcasts a device discovery request. The PC displays a first page, such as a multi-device collaboration page, which includes an entry point for searching nearby devices, such as option 801 for tablet collaboration. When the user wants to establish a network between the PC and the tablet, they can perform a third action on option 801, such as clicking action 17. Figure 8BAs shown, the PC searches for the nearby device in response to the click operation 17. When the PC receives the device discovery request broadcasted by the tablet, the tablet is discovered. The PC obtains the Bluetooth address of the tablet from the received device discovery request, such as BLE MAC_4. After obtaining the BR MAC_4 of the tablet, the PC displays the first window. The first window can be the first area on the second page, and the first window includes the device search result. As shown in the figure, the device search result in the first window 802 includes the tablet and the mobile phone. It can be seen that when the PC discovers the tablet, the PC can display the device search result of the tablet in the first window 802. The first window 802 includes the first button 803, and each first button 803 corresponds to a device search result. Figure 8B As shown, the PC displays the first window 802 on the second page. The first window 802 includes the device search result. Taking the tablet and the mobile phone as examples, the device search result in the first window 802 includes the tablet and the mobile phone. It can be seen that when the PC discovers the tablet, the PC can display the device search result of the tablet in the first window 802. The first window 802 includes the first button 803, and each first button 803 corresponds to a device search result.

[0140] After the first electronic device discovers the second electronic device, if device collaboration with the second electronic device is needed, device authentication with the second electronic device is needed. The device authentication between the first electronic device and the second electronic device includes a first device authentication process and a second device authentication process. The first device authentication process is used for network online authentication of the second electronic device. When the second electronic device passes the authentication in the first device authentication process, the second electronic device successfully establishes a network relationship with the first electronic device. Based on the network relationship, the first electronic device can obtain the connection and transmission information of the second electronic device from the data transmitted by the second electronic device when the second electronic device is discovered, and can directly perform device connection and data transmission with the second electronic device based on the connection and transmission information. The second device authentication process is used for connection authentication of the second electronic device. When the second electronic device passes the authentication in the second device authentication process, the second electronic device has the permission to establish a connection with the first electronic device, and the permission is applicable to the first electronic device and the second electronic device to establish a data transmission channel and device collaboration this time.

[0141] It can be seen that, based on the networking relationship between the first electronic device and the second electronic device, not only can the first electronic device and the second electronic device establish the data transmission channel and device cooperation this time, but also can the first electronic device and the second electronic device establish the data transmission channel and device cooperation subsequently. That is, when the first electronic device and the second electronic device establish the data transmission channel and device cooperation subsequently, it is not necessary to perform device authentication again, and the time for the first electronic device and the second electronic device to establish the data transmission channel and device cooperation subsequently can be reduced by omitting the device authentication process, and the efficiency of the first electronic device and the second electronic device to establish the data transmission channel and device cooperation subsequently can be improved. Based on this, the first electronic device performs the first device authentication process with the second electronic device in parallel before displaying the first window or when the first window is displayed and the second operation of the user is not received.

[0142] Figure 9 is a flowchart of a first device authentication process between a first electronic device and a second electronic device provided by an embodiment of the present application. As shown in Figure 9 the flowchart can include the following steps S901-S903:

[0143] Step S901, the first electronic device identifies the device state of the second electronic device according to the Bluetooth address of the second electronic device and the first information stored by the first electronic device.

[0144] In some embodiments, the first electronic device can store / manage the second information through the device management module. Since the device management module is used to manage the information of the device itself, the second information only includes the device information in the full information of the authenticated device, such as device ID, device state, etc., but does not include the Bluetooth address of the authenticated device and the link information in the full information. The authenticated device is an electronic device discovered by the first electronic device and authenticated in the first device authentication process with the first electronic device, and the first electronic device has a networking relationship with the authenticated device. Therefore, the first electronic device cannot directly query the full information of the authenticated device through the device management module according to the Bluetooth address of the authenticated device.

[0145] In order to facilitate the first electronic device to quickly query the full information of the authenticated device according to the Bluetooth address of the authenticated device. The first electronic device can store / manage the first information through a networking module, which can be used to provide online authentication service of the first electronic device and the second electronic device, and the networking module can be a smart interconnection module. The first information includes the Bluetooth address and the full information of the authenticated device. The first electronic device can store the first information in the form of a device list, such as the device list including the Bluetooth address of the authenticated device and the full information of the authenticated device corresponding to the Bluetooth address. Therefore, when the first electronic device obtains the Bluetooth address of the authenticated device, the smart interconnection module can directly query the full information of the authenticated device according to the Bluetooth address of the authenticated device and the first information.

[0146] The Bluetooth address of the authenticated device can include BR MAC and BLE MAC.

[0147] The full information of the authenticated device can include device information of the authenticated device. The device information of the authenticated device can include device status, and the device status includes a first state and a second state. The first state can also be referred to as an online state, and the first state includes that the authenticated device passes the authentication, and the first electronic device and the authenticated device have established Bluetooth connection or can receive the broadcast response message of the other party. The networking relationship between the first electronic device and the authenticated device in the first state can be maintained and used, for example, the first electronic device and the authenticated device establish a long connection, or the first electronic device sends a broadcast to the authenticated device through heartbeat broadcast, unicast confirmation, etc., and can receive the broadcast response message of the authenticated device.

[0148] The second state can also be referred to as an offline state. The second state includes that the authenticated device passes the authentication, and the first electronic device and the authenticated device disconnect the Bluetooth connection, and cannot receive the broadcast response message of the other party. The networking relationship between the first electronic device and the authenticated device in the second state cannot be maintained and used. For example, the first electronic device and the authenticated device disconnect the long connection, or the first electronic device cannot receive the broadcast response message of the authenticated device through heartbeat broadcast, unicast confirmation, etc., or the authenticated device cannot pass the device authentication of the first electronic device again.

[0149] The device information of the authenticated device can further include a device ID, a running state, a device type, a device model, supported collaborative functions, whether to support smart interconnection, a version of supported smart interconnection, and the like. The device ID can include a node ID, a universally unique identifier (UUID), and the like. The running state can include a screen-on, a screen-off, a hibernation, and the like. The collaborative functions can include screen extension, screen projection, super call, screen mirroring, multi-screen collaboration, super notification, keyboard and mouse sharing, super keyboard and mouse, and the like. The device type can include a mobile phone, a foldable-screen mobile phone, a PC, a tablet computer, and the like.

[0150] The full amount of information of the authenticated device can further include link information, such as a link state, a network state, and the like.

[0151] The device state of the second electronic device includes a first state and a second state. The first state includes that the second electronic device is authenticated, and the second electronic device maintains a first connection with the first electronic device or can receive a broadcast response message of the other party. The second state includes that the second electronic device is not authenticated, or the second electronic device is authenticated, and the second electronic device disconnects the first connection with the first electronic device, and cannot receive the broadcast response message of the other party.

[0152] The first electronic device can identify the device state of the second electronic device according to the Bluetooth address of the second electronic device and the first information, specifically as follows:

[0153] The first electronic device can determine whether the second electronic device is an authenticated device according to the Bluetooth address of the second electronic device and the first information. For example, the first electronic device determines whether the first information exists the Bluetooth address of the second electronic device, if yes, the second electronic device is an authenticated device, if not, the second electronic device is not an authenticated device.

[0154] If the second electronic device is an authenticated device, the first electronic device determines the device state of the second electronic device according to the stored first information. For example, if the device state in the first information with the same Bluetooth address is the first state, the device state of the second electronic device is the first state, if the device state in the first information with the same Bluetooth address is the second state, the device state of the second electronic device is the second state.

[0155] If the second electronic device is not an authenticated device, the first electronic device also determines the second electronic device as the second state.

[0156] In some embodiments, based on the first to third implementations of the first operation in step S401, before performing step S901, the first electronic device can further determine the service type. The service is a service to be run by the first electronic device and the second electronic device after the second electronic device is authenticated in the first device authentication process. The service type can include a first type and a second type. The first type is an open type, i.e., the first electronic device and the second electronic device are allowed / supported to run the service based on the networking relationship. The second type is a non-open type, i.e., the first electronic device and the second electronic device are not allowed / supported to run the service based on the networking relationship. When the service type is the first type, the first electronic device performs step S901. When the service type is the second type, the first electronic device does not perform step S901.

[0157] In some embodiments, based on the fourth implementation of the first operation in step S401, before identifying the device state of the second electronic device, the first electronic device obtains a user account logged in by the second electronic device. The device discovery request broadcast by the second electronic device can include the logged-in user account. After receiving the device discovery request of the second electronic device, the first electronic device can obtain the logged-in user account of the second electronic device from the device discovery request. The first electronic device determines whether the local logged-in user account is the same as the logged-in user account of the second electronic device. If the first electronic device and the second electronic device log in the same user account, the first electronic device identifies the device state of the second electronic device. If the first electronic device and the second electronic device log in different user accounts, the first electronic device no longer performs the first device authentication process on the second electronic device. In this way, the second electronic device can be first authenticated by the logged-in user account of the first electronic device and the second electronic device, to further ensure the identity security of the user of the second electronic device. When the second electronic device and the first electronic device log in different user accounts, the subsequent device state identification and device authentication process can be avoided to save resources.

[0158] If the device state of the second electronic device is the first state, the first electronic device does not need to perform the device authentication with the second electronic device again, and the first electronic device can directly connect with the second electronic device and perform data transmission.

[0159] In step S902, if the device state of the second electronic device is the second state, the first electronic device establishes the first connection with the second electronic device according to the Bluetooth address of the second electronic device.

[0160] If the device status of the second electronic device is the second status, the first electronic device establishes a first connection with the second electronic device according to the Bluetooth address of the second electronic device. For example, if the Bluetooth address of the second electronic device is BR MAC, the first electronic device establishes a first connection with the second electronic device according to the BR MAC, and the first connection is a BR connection. If the Bluetooth address of the second electronic device is BLE MAC, the first electronic device establishes a first connection with the second electronic device according to the BLE MAC, and the first connection is a BLE connection.

[0161] In step S903, the first electronic device performs a first device authentication process with the second electronic device based on the first connection.

[0162] After the first electronic device establishes the first connection with the second electronic device, the first electronic device interacts with the second electronic device to obtain security module information, and performs the first device authentication process based on the security module information.

[0163] In some embodiments, during the device authentication process in which the first electronic device and the second electronic device interact with the security module message, if the first electronic device and the second electronic device pass the authentication, the first electronic device and the second electronic device obtain a key based on the security module information. For example, the first electronic device obtains a first key based on the security module information transmitted by the second electronic device, and the second electronic device obtains a second key based on the security module information transmitted by the first electronic device. The first electronic device and the second electronic device interact with encrypted information using the keys they hold respectively, and complete the device authentication process. The first electronic device encrypts the first encrypted information using the first key, and transmits the first encrypted information to the second electronic device. The second electronic device encrypts the second encrypted information using the second key, and transmits the second encrypted information to the first electronic device.

[0164] In some embodiments, the first encrypted information can include full information of the first electronic device, and the second encrypted information can include full information of the second electronic device. Therefore, the first electronic device and the second electronic device can obtain more comprehensive information of the other party during the first device authentication process.

[0165] In some embodiments, after obtaining the second encryption information, the first electronic device stores the full information and the Bluetooth address of the second electronic device, and the first electronic device can add the full information and the Bluetooth address of the second electronic device to the first information. In this way, in the subsequent process of connecting and cooperating with the second electronic device, after obtaining the Bluetooth address of the second electronic device, the first electronic device can directly obtain the full information of the second electronic device, such as the device ID, according to the simple Bluetooth address and the first information through the smart interconnection module, so as to quickly connect and cooperate with the second electronic device based on the obtained full information, and realize different upper-layer businesses. For example, the second electronic device is accurately located according to the device ID; the key corresponding to the device ID is determined, and the key is used to interact data in the device cooperation process.

[0166] In step S402, the first electronic device identifies the device state of the second electronic device in response to the second operation of the user on the first button.

[0167] The process is similar to step S901, which will not be described here.

[0168] The first electronic device executes different processes of establishing a data transmission channel according to different device states of the second electronic device. If the second electronic device is in the first state, the first electronic device executes a first process of establishing a data transmission channel, which is a device authentication process of the first electronic device across the second electronic device, and establishes a data channel with the second electronic device; if the second electronic device is in the second state, the first electronic device executes a second process of establishing a data transmission channel, which is a device authentication process of the first electronic device with the second electronic device again, and establishes a data channel with the second electronic device after passing the authentication.

[0169] In step S403, if the second electronic device is in the first state, the first electronic device establishes a data transmission channel with the second electronic device based on the second connection.

[0170] If the second electronic device is in the first state, it means that the networking relationship between the second electronic device and the first electronic device is available, so the first electronic device and the second electronic device do not need to perform device authentication again. The first electronic device can cross the device authentication process and establish a data transmission channel with the second electronic device in response to the second operation of the user. In this way, the first electronic device can save the time of device authentication in the process of establishing a data transmission channel with the second electronic device in response to the second operation of the user, thereby shortening the process of establishing a data transmission channel with the second electronic device. Correspondingly, after the user performs the second operation, the user only needs to wait for a short time to use the first electronic device to cooperate with the second electronic device, thereby effectively improving the user experience.

[0171] Figure 10is a first flowchart of a method for establishing a data transmission channel by a first electronic device and a second electronic device according to an embodiment of the present application. As shown in Figure 10 The method can include the following steps S1001-S1003.

[0172] In step S1001, the first electronic device interacts with the second electronic device for connection information of a wireless network based on a first connection.

[0173] The first connection is a first connection established by the first electronic device and the second electronic device, or a first connection re-established by the first electronic device and the second electronic device after the first electronic device determines to disconnect the first connection with the second electronic device.

[0174] The connection information of the wireless network is used for the first electronic device and the second electronic device to establish a second connection, which can be a Wi-Fi Peer-to-Peer (P2P) connection. When the second connection is a Wi-Fi P2P connection, the connection information of the wireless network can be network configuration information, address information, etc. related to the Wi-Fi P2P connection.

[0175] Before the first electronic device and the second electronic device interact with the connection information of the wireless network, the accuracy and effectiveness of the interaction object need to be ensured, so as to ensure the accuracy and security of the subsequent establishment of the data transmission channel.

[0176] Figure 11 is a first flowchart of a method for establishing a data transmission channel by a first electronic device and a second electronic device according to an embodiment of the present application. As shown in Figure 11 The method can include the following steps S1101-S1104.

[0177] In step S1101, the first electronic device obtains the UUID of the second electronic device according to the Bluetooth address of the second electronic device and the first information.

[0178] The first information can include various device IDs of the authenticated device, such as Node ID, UUID, etc. When the second electronic device is authenticated in the first authentication process, the first information includes various device IDs of the second electronic device. The second information stored by the first electronic device includes device information of the authenticated device, such as Unique Device Identifier (UDID). When the second electronic device is authenticated in the first authentication process, the second information includes the UDID of the second electronic device.

[0179] The first electronic device can determine the UUID of the second electronic device according to the Bluetooth address of the second electronic device and the first information. The UUID of the second electronic device changes dynamically with the Over the Air upgrade of the second electronic device, and therefore, the first electronic device adds the UUID of the second electronic device in the first information. The first electronic device can determine the latest version of the second electronic device according to the Bluetooth address of the second electronic device.

[0180] In step S1102, the first electronic device obtains the UDID of the second electronic device according to the UUID of the second electronic device and the second information.

[0181] The first electronic device can determine the UDID of the second electronic device according to the UUID of the second electronic device and the second information. The UDID of the second electronic device is a device ID generated based on the device unique information of the second electronic device, and is fixed. Since part of the information in the full information corresponds to the UDID of the device, such as the device state, the key, etc. Therefore, in order to accurately find the part of the state of the second electronic device, the first electronic device needs to determine the UDID of the second electronic device.

[0182] In step S1103, the first electronic device identifies the device state of the second electronic device according to the UDID of the second electronic device and the first information.

[0183] The first electronic device identifies the device state of the second electronic device again. Once the device state of the second electronic device changes from the first state to the second state in the above process, such as the authentication of the second electronic device is invalid, the first electronic device is disconnected from the first connection, the second electronic device cannot receive the message of the response of the other party through the broadcast, etc., it is determined that the data transmission channel cannot be established with the second electronic device based on the previous authentication result, and the device authentication with the second electronic device needs to be performed again to ensure the security and effectiveness of the data transmission.

[0184] In some embodiments, if the first electronic device identifies that the second electronic device is in the second state, the first electronic device performs a second device authentication process with the second electronic device, and then establishes a data transmission channel with the second electronic device after the second electronic device is authenticated.

[0185] In step S1104, the first electronic device interacts with the second electronic device to obtain the connection information of the wireless network based on the first connection when it is determined that the second electronic device is in the first state.

[0186] If the first electronic device determines that the second electronic device is still in the first state, it means that the first electronic device can establish a data transmission channel with the second electronic device based on the networking relationship with the second electronic device without re-performing device authentication. At this time, the first electronic device can interact with the second electronic device based on the first connection to obtain the connection information of the wireless network.

[0187] In step S1002, the first electronic device establishes a second connection with the second electronic device according to the connection information of the wireless network.

[0188] Taking the connection information of the wireless network as an example, the connection information of the wireless network is network configuration information, address information, etc. related to Wi-Fi P2P connection. The first electronic device establishes a Wi-Fi P2P connection with the second electronic device.

[0189] In step S1003, the first electronic device establishes a data transmission channel with the second electronic device based on the second connection.

[0190] The data transmission channel is an encrypted channel, and the key of the data transmission channel can be obtained according to the Bluetooth address of the second electronic device and the first information. The full information of the second electronic device includes the device ID, and the key of the data transmission channel has a corresponding relationship with the device ID. Therefore, when the second electronic device is in the first state, the first information includes the Bluetooth address of the second electronic device and the full information. The first electronic device can obtain the device ID in the full information of the second electronic device according to the Bluetooth address of the second electronic device and the first information, and obtain the key of the data transmission channel according to the device ID. Correspondingly, the second electronic device can obtain the corresponding key based on the stored Bluetooth address and full information of the first electronic device.

[0191] After the first electronic device and the second electronic device establish the data transmission channel, the key is used to encrypt and decrypt the data exchanged.

[0192] In step S404, if the second electronic device is in the second state, the first electronic device performs a second device authentication process with the second electronic device based on the first connection, and establishes a data transmission channel with the second electronic device based on the second connection after the second electronic device passes the authentication.

[0193] If the second electronic device is in the second state, it means that the second electronic device fails to pass the authentication in the first device authentication process, or the networking relationship with the first electronic device is unavailable, and the first electronic device needs to perform the device authentication with the second electronic device again. At this time, the first electronic device performs the second device authentication process with the second electronic device in response to the second operation of the user, and establishes the data transmission channel with the second electronic device after the second electronic device passes the device authentication. In this way, the first electronic device quickly starts the second device authentication process with the second electronic device in response to the second operation of the user, and no longer waits for the authentication result of the first device authentication process with the second electronic device, thereby avoiding the additional waste of time waiting for the authentication result of the first device authentication process, and shortening the time for the first electronic device to establish the data transmission channel with the second electronic device, and improving the collaborative efficiency of the first electronic device and the second electronic device.

[0194] Figure 12 is a flowchart of a second method for the first electronic device and the second electronic device to establish a data transmission channel provided by the embodiment of the present application. As shown in Figure 12 the method can include the following steps S1201-S1205:

[0195] Step S1201, the first electronic device establishes a first connection with the second electronic device according to the Bluetooth address of the second electronic device.

[0196] The first electronic device and the second electronic device re-perform the process of establishing the first connection to ensure that there is an effective path for the connection information of the interactive wireless network.

[0197] Step S1202, the first electronic device and the second electronic device perform a second device authentication process based on the first connection.

[0198] The first electronic device and the second electronic device perform the second device authentication process to ensure the security and reliability of the second electronic device. Step S1202 is similar to step S903, which will not be described here.

[0199] In some embodiments, in the second device authentication process between the first electronic device and the second electronic device, if the first electronic device and the second electronic device are authenticated, the first electronic device and the second electronic device obtain a key according to the security module information and use the key to encrypt and decrypt the information of the interaction. For example, the first electronic device obtains a first key according to the security module information transmitted by the second electronic device, and the second electronic device obtains a second key according to the security module information transmitted by the first electronic device. The first electronic device and the second electronic device use the keys held by each other to interact with the encrypted information, and complete the process of device authentication. Among them, the first electronic device uses the first key to obtain first encrypted information, and transmits the first encrypted information to the second electronic device. The second electronic device uses the second key to obtain second encrypted information, and transmits the second encrypted information to the first electronic device.

[0200] In some embodiments, the first encrypted information can include device information of the first electronic device. The second encrypted information can include device information of the second electronic device. Among them, the device information of the first electronic device and the second electronic device can include: device ID, running state, device type, device model, supported collaboration function, etc. Among them, the device ID can include NodeID, UDID, etc. The running state can include screen on, screen off, hibernate, etc. The collaboration function can include screen extension, screen projection, super call, screen mirroring, multi-screen collaboration, super notification, keyboard and mouse sharing, super keyboard and mouse, etc. The device type can include mobile phone, folding screen mobile phone, PC, tablet computer, etc. Therefore, the first electronic device and the second electronic device can obtain the device information of the other party in the process of device authentication.

[0201] In some embodiments, after obtaining the second encrypted information, the first electronic device stores the device information of the second electronic device and manages the device information of the second electronic device. The first electronic device can add the device information of the second electronic device to the second information to store / manage the device information of the second electronic device through the device management module.

[0202] Step S1203, after the second electronic device is authenticated, the first electronic device interacts with the second electronic device based on the first connection to obtain the connection information of the wireless network.

[0203] The second electronic device is authenticated, which means that the second electronic device is safe and reliable, and the first electronic device can establish a data transmission channel with the second electronic device.

[0204] The connection information of the wireless network is used for the first electronic device to establish a second connection with the second electronic device, which can be a Wi-Fi P2P connection. When the second connection is a Wi-Fi P2P connection, the connection information of the wireless network can be network configuration information, address information, etc. related to the Wi-Fi P2P connection.

[0205] In step S1204, the first electronic device establishes a second connection with the second electronic device according to the connection information of the wireless network.

[0206] Taking the connection information of the wireless network as an example of network configuration information, address information, etc. related to the Wi-Fi P2P connection, the first electronic device establishes a Wi-Fi P2P connection with the second electronic device.

[0207] In step S1205, the first electronic device establishes a data transmission channel with the second electronic device based on the second connection.

[0208] The data transmission channel is an encrypted channel, and the key exchanged between the first electronic device and the second electronic device in the second device authentication process is the key of the data transmission channel.

[0209] After the first electronic device and the second electronic device establish the data transmission channel, the key is used to encrypt and decrypt the data exchanged.

[0210] In some embodiments, if the second electronic device is in the second state, the first electronic device performs the first process and the second process in parallel. The first process is a first device authentication process between the first electronic device and the second electronic device based on the first connection, and the second process is a second device authentication process between the first electronic device and the second electronic device based on the first connection, and after the second electronic device is authenticated, the data transmission channel is established between the first electronic device and the second electronic device based on the second connection. In this way, the first electronic device can establish a data transmission channel with the second electronic device based on the result of the second device authentication process with the second electronic device. At the same time, the first electronic device can store the full information and the Bluetooth address of the second electronic device based on the result of the first device authentication process with the second electronic device, so that in subsequent device collaboration with the second electronic device, the full information of the second electronic device can be obtained directly according to the Bluetooth address of the second electronic device, and the data transmission channel can be established based on the full information of the second electronic device, without the need for device authentication with the second electronic device again, thereby improving the efficiency of device collaboration with the second electronic device.

[0211] The device authentication method steps S401-S404 of the embodiments of the present application are illustratively described in conjunction with the following examples.

[0212] Example 1

[0213] This example illustrates a first interactive process in which a first electronic device, in response to any of the first operations performed by a user in the first to third implementation methods, engages in device collaboration with a second electronic device.

[0214] Figure 13 This is a first interaction example diagram illustrating a first electronic device performing device authentication with a second electronic device in response to any first operation in the first to third implementation methods performed by a user, as shown in an embodiment of this application. Figure 14 The first electronic device and the second electronic device shown in the embodiments of this application are based on Figure 13 The diagram shows a first interaction example of the device authentication method used for device collaboration. Figure 15 The first electronic device and the second electronic device shown in the embodiments of this application are in Figure 14 An example diagram illustrating the interaction between the first and second electronic devices when the second electronic device is in its second state, showing how they establish a data transmission channel.

[0215] like Figure 13 As shown, taking the first operation performed by a user in the first implementation method as an example, the first electronic device can be a mobile phone, and the second electronic device can be a PC. The modules involved in the first interaction process on the mobile phone include a pop-up application, a smart interconnection module, a device management module, a collaborative service module, and a communication module. The modules involved in the first interaction process on the PC include a communication module, a collaborative service module, a device management module, and a smart interconnection module.

[0216] The mobile phone's communication module provides NFC communication functionality, as does the PC's communication module. When a user brings their phone close to or touches the PC's NFC area, the phone's and PC's communication modules sense each other, and the phone discovers the PC. The PC, through its collaborative service module, instructs the smart interconnection module to create a session service. The phone establishes an NFC connection with the PC via its communication module, and the PC transmits its Bluetooth address (e.g., BR MAC) to the phone based on this NFC connection. The phone can also transmit its Bluetooth address (e.g., BR MAC) to the PC via its communication module based on this NFC connection. The phone's communication module sends a device discovery message to the collaborative service module, which includes the PC's BR MAC. The PC's communication module sends a device discovery message to the collaborative service module, which includes the phone's BR MAC. The phone, through its collaborative service module, sends a notification to the pop-up application to initiate a pop-up window, which includes the PC's BR MAC. The phone's pop-up application responds to this notification by displaying a first window, such as a pop-up window. This first window includes a first button.

[0217] When the mobile phone displays the pop-up window, the pop-up window application calls the forced online interface of the smart interconnection module to trigger the smart interconnection module to perform forced online on the PC. The smart interconnection module of the mobile phone judges the service type of the pop-up window application corresponding service. When the service type is the first type, the mobile phone identifies the device state of the PC according to the BR MAC of the PC and the stored first information through the smart interconnection module. If the device state of the PC is the first state, that is, the PC is in the online state, the smart interconnection module sends an online notification to the pop-up window application, which can include the device ID of the PC, such as the Node ID of the PC. If the first information includes the device ID, the smart interconnection module can obtain the corresponding device ID from the first information according to the BR MAC of the PC.

[0218] If the device state of the PC is the second state, that is, the PC is in the offline state, the smart interconnection module sends an offline notification to the pop-up window application, and the smart interconnection module sends a connection instruction to the communication module, which can include the BR MAC of the PC. The mobile phone establishes a BR connection with the PC according to the BR MAC of the PC through the communication module. After the mobile phone and the PC establish a BR connection successfully, the communication module of the mobile phone feeds back a BR connection success notification to the smart interconnection module, and the communication module of the PC feeds back a BR connection success notification to the smart interconnection module.

[0219] The mobile phone performs a first authentication process of device authentication with the smart interconnection module of the PC through the smart interconnection module. Wherein, the mobile phone sends a notification of device authentication to the security service module through the smart interconnection module, and the security service module of the mobile phone interacts with the security service module of the PC based on the BR connection and uses the security module message for device authentication. Before the security service module of the mobile phone interacts with the security service module of the PC based on the BR connection, the security service module of the mobile phone can judge whether the local and the PC are logged in the same user account, and when the same user account is logged in, the security module message is interacted with the PC.

[0220] If the PC fails to pass the authentication, the security service module of the mobile phone returns an authentication failure notification to the smart interconnection module, and the smart interconnection module feeds back the authentication failure notification to the pop-up application. The authentication failure notification can include the reason for the authentication failure. If the mobile phone and the PC pass the device authentication, the security service module of the mobile phone returns a first key to the smart interconnection module, and the security service module of the PC returns a second key to the smart interconnection module. The smart interconnection module of the mobile phone and the smart interconnection module of the PC respectively use the first key and the second key to interact first encrypted information and second encrypted information. The first encrypted information and the second encrypted information can include full information of the corresponding electronic device. After the smart interconnection module of the mobile phone and the smart interconnection module of the PC obtain the encrypted information of the other party, it is confirmed that the authentication is successful. The mobile phone feeds back an authentication success notification to the pop-up application through the smart interconnection module, and the authentication success notification can include the device ID of the PC. The device ID of the PC can be obtained by the mobile phone from the second encrypted information, such as the Node ID of the PC. After the PC passes the authentication, the smart interconnection module of the mobile phone adds the PC to the authenticated devices, such as adding the full information and the Bluetooth address of the PC to the first information. After the PC passes the authentication, the smart interconnection module of the mobile phone also sends a device BR online message to the device management module, and the device BR online message includes the device information of the PC, such as the device ID, the device state, the device type, etc. The mobile phone adds the device information of the PC to the second information. The mobile phone can update the display related page according to the updated second information through the device management module. After the mobile phone passes the authentication, the smart interconnection module of the PC adds the mobile phone to the authenticated devices, such as adding the full information and the Bluetooth address of the mobile phone. After the mobile phone passes the authentication, the smart interconnection module of the PC also sends a device BR online message to the device management module, and the device BR online message includes the device information of the mobile phone, such as the device ID, the device state, the device type, etc. The PC adds the device information of the mobile phone to the second information. The PC can update the display related page according to the updated second information through the device management module.

[0221] As Figure 14As shown, when the user wants to use the mobile phone to perform device cooperation with the PC, the user can perform a second operation on the first button, such as clicking the first button. The popup application identifies whether the service package to be executed is a service package of the cooperation service, and when the service package is the service package of the cooperation service, the second operation is continuously responded to, and the device cooperation with the PC is performed. The popup application sends a message of the second operation to the cooperation service module, and the cooperation service module responds to the second operation and sends a notification of forced online to the device management module, which can include the BR MAC of the PC. The device management module sends the notification of forced online to the smart interconnection module, calls the query interface of the smart interconnection module, and the notification can include the BR MAC of the PC. The smart interconnection module of the mobile phone identifies the device state of the PC according to the BR MAC of the PC and the stored first information.

[0222] If the PC is in the first state, it is determined to execute the first procedure of establishing a data transmission channel. The smart interconnection module of the mobile phone sends an online notification to the device management module, which can include the UUID of the PC. The device management module returns the UDID of the PC to the smart interconnection module in response to the online notification, and sends a message of successful online and the UDID of the PC to the collaborative service module. The collaborative service module identifies the device state of the PC again according to the UDID of the PC in response to the message of successful online. If it is determined that the PC is in the first state, it is determined to continue to execute the first procedure of establishing a data transmission channel; if it is determined that the PC is in the second state, it is determined to execute the second procedure of establishing a data transmission channel. When it is determined to continue to execute the first procedure of establishing a data transmission channel, the collaborative service module of the mobile phone returns a message of obtaining a device object (getDevice) to the device management module, and returns a notification of opening a session to the smart interconnection module. The smart interconnection module of the mobile phone establishes a data transmission channel with the smart interconnection module of the PC. Among them, the smart interconnection module of the mobile phone identifies whether the first connection with the PC has been established, if not, the smart interconnection module of the mobile phone notifies the communication module to establish the first connection with the PC. After the smart interconnection module of the mobile phone identifies that the first connection with the PC has been established, it interacts with the smart interconnection module of the PC based on the first connection to obtain the connection information of the wireless network, such as the network configuration information related to the Wi-Fi P2P connection, the address information, etc. The communication module of the mobile phone establishes a second connection based on the connection information of the wireless network, such as the Wi-Fi P2P connection, and then the smart interconnection module of the mobile phone establishes a data transmission channel (open session) with the smart interconnection module of the PC based on the second connection. After the mobile phone and the PC establish the data transmission channel, the smart interconnection module of the mobile phone sends a message of session open (on session Open de) to the collaborative service module, and the smart interconnection module of the PC sends a message of session open to the collaborative service module. In this way, the collaborative service module of the mobile phone can interact with the collaborative service module of the PC based on the data transmission channel (sendMessage).

[0223] If the PC is in the second state, it is determined to execute the second procedure of establishing a data transmission channel. As Figure 15As shown, the collaborative service module of the mobile phone sends a notification of Bluetooth connection to the communication module, which can include the BR MAC of the PC. The communication module of the mobile phone establishes a first connection with the PC according to the BR MAC of the PC, and returns a notification of successful Bluetooth connection to the collaborative service module after the first connection is successfully established. In response to the notification of successful Bluetooth connection, the collaborative service module of the mobile phone can perform a second authentication process of device authentication with the secure service module of the PC. The secure service module of the mobile phone can interact with the secure service module of the PC based on the first connection, and perform device authentication using the secure module message.

[0224] If the PC fails to pass the authentication, the secure service module of the mobile phone returns a notification of authentication failure to the collaborative service module, which can include the reason for the authentication failure. If the mobile phone and the PC pass the device authentication, the secure service module of the mobile phone returns a first key to the collaborative service module, and the secure service module of the PC returns a second key to the collaborative service module. The collaborative service module of the mobile phone and the collaborative service module of the PC respectively use the first key and the second key to interact with first encrypted information and second encrypted information. The first encrypted information and the second encrypted information can include device information of the corresponding electronic device. After the collaborative service module of the mobile phone and the collaborative service module of the PC obtain the encrypted information of the other party, it is confirmed that the authentication is successful. Wherein, after the PC passes the authentication, the collaborative service module of the mobile phone can store / manage the device information of the PC, or send the device information of the PC to the device management module, and the mobile phone adds the device information of the PC to the second information. After the mobile phone passes the authentication, the collaborative service module of the PC can store / manage the device information of the mobile phone, or send the device information of the mobile phone to the device management module, and the PC adds the device information of the mobile phone.

[0225] If the mobile phone and the PC pass the second authentication process, the mobile phone determines to continue to perform a second flow of establishing a data transmission channel. Wherein, the collaborative service module of the mobile phone identifies whether a first connection has been established with the PC, and if not, the collaborative service module of the mobile phone notifies the communication module to establish a first connection with the PC. After the collaborative service module of the mobile phone identifies that the first connection has been established with the PC, it interacts with the collaborative service module of the PC based on the first connection to exchange connection information of a wireless network, such as network configuration information and address information related to Wi-Fi P2P connection. The communication modules of the mobile phone and the PC establish a second connection according to the exchanged connection information of the wireless network, such as Wi-Fi P2P connection, and the collaborative service module of the mobile phone and the collaborative service module of the PC establish a data transmission channel based on the second connection. After the mobile phone and the PC start a session, the collaborative service module of the mobile phone can interact with the collaborative service module of the PC based on the data transmission channel.

[0226] In the process of executing the second flow, the mobile phone can perform the first authentication process with the PC in parallel through the smart interconnection module. If the PC passes the authentication in the first authentication process, the smart interconnection module of the mobile phone sends an online success notification to the device management module, and the device management module sends an online success notification to the collaborative service module, which can include the UDID of the PC. The smart interconnection module of the mobile phone also reports the device online notification to the device management module, which can include the device information of the PC. The device management module can update the relevant page according to the device information of the PC. If the PC fails to pass the authentication in the first authentication process, the smart interconnection module of the mobile phone sends an online failure notification to the device management module. In this way, the mobile phone can establish a data transmission channel with the PC based on the stored device information when it performs device collaboration with the PC next time.

[0227] Example 2

[0228] This example illustrates the second interaction process of the first electronic device performing device collaboration with the second electronic device after displaying the first window in response to the user performing any of the first to third implementation manners.

[0229] Figure 16 is a second interaction example diagram of a first electronic device performing device collaboration with a second electronic device in response to a user performing any of the first to third implementation manners, which is illustrated by an embodiment of the present application.

[0230] As shown in Figure 16 , taking the user performing the first operation in the first implementation manner as an example, the first electronic device can be a mobile phone, and the second electronic device can be a PC. The modules of the mobile phone participating in the second interaction process include the business module, the device management module and the smart interconnection module. The business module corresponds to the pop-up application. The modules of the PC participating in the second interaction process include the smart interconnection module.

[0231] The first window, such as a pop-up window, is displayed after the user brings the mobile phone close to or touches the NFC area of the PC. The process can refer to Example 1, which is not repeated here. The mobile phone calls the forceOnlineByMac interface of the device management through the business module to force the PC to be online. The device management module constructs a DeviceInfo object and calls the verifyDevice() interface of the smart interconnection module to perform a first authentication process of the PC through the smart interconnection module to force the PC to be online. The smart interconnection module of the mobile phone identifies the device state of the PC according to the BR MAC of the PC and the stored first information. If the device state of the PC is the first state, i.e., the PC is in the online state, the smart interconnection module calls the VerifyCallback.onDeviceVerifyPass interface of the business module and carries the device ID of the PC, such as the Node ID of the PC. If the device state of the PC is the second state, i.e., the PC is in the offline state, the smart interconnection module calls the VerifyCallback.onDeviceVerifyFail interface of the business module and notifies the business module that the authentication is in progress. If the device state of the PC is the second state, the mobile phone performs device authentication with the smart interconnection module of the PC through the smart interconnection module. The device authentication process can refer to Example 1, which is not repeated here. After the authentication is completed, the smart interconnection module of the mobile phone calls the corresponding authentication callback (VerifyCallback) interface of the business module according to the authentication result and forces the PC to be online. If the PC passes the device authentication, the smart interconnection module of the mobile phone calls the Pass interface of VerifyCallback. If the PC fails the device authentication, the smart interconnection module of the mobile phone calls the Fail interface of VerifyCallback.

[0232] The user performs a second operation on the first button in the first window, such as clicking the first button. The service module, in response to the second operation, calls the getDevice(Nodeid) interface of the device management module to obtain the device object of the PC from the device management module. After obtaining the device object of the PC, the service module determines the flow of establishing the data transmission channel to be performed according to the device state of the PC. The determination process can refer to Example 1, which is not described herein. When the service module identifies that the PC is in the first state, the service module further calls the getProperty interface to obtain the servicesupportVersion field of the PC to determine whether the PC supports the smart interconnection function, that is, whether the first flow is executed. If the PC supports the smart interconnection function, the service module determines to continue to execute the first flow. If the PC does not support the smart interconnection function, the service module executes the second flow. The service module listens to whether the PC is online, that is, whether the PC is in the first state. If the service module listens to that the PC is in the first state, the service module can quickly establish the data transmission channel with the PC by executing the first flow, and implements the device collaboration service based on the data transmission channel.

[0233] Example 3

[0234] This example illustrates a third interaction process in which the first electronic device responds to the first operation performed by the user in the fourth implementation manner and performs device collaboration with the second electronic device.

[0235] Figure 17 is a third interaction example diagram in which a first electronic device responds to a first operation performed by a user in a fourth implementation manner and performs device authentication with a second electronic device, as illustrated in an embodiment of the present application. Figure 18 is a third interaction example diagram in which a first electronic device and a second electronic device perform device collaboration based on Figure 17 the device authentication method illustrated in FIG. 8.

[0236] As illustrated in Figure 17 , taking the first operation performed by the user in the fourth implementation manner as an example, the first electronic device can be a PC, and the second electronic device can be a tablet computer. The modules of the PC participating in the third interaction process include a communication module, a collaboration service module, a device management module, and a smart interconnection module. The modules of the tablet computer participating in the third interaction process include a smart interconnection module, a device management module, a collaboration service module, and a communication module.

[0237] The communication module of the PC provides BLE / BR communication function, and the communication module of the tablet computer provides BLE / BR communication function. The tablet computer informs the smart interconnection module to create a session service (addSessionService) through the cooperation service module, and informs the smart interconnection module to start a device discovery service (publishDiscoveryService). The smart interconnection module of the tablet computer informs the communication module to start the device discovery service, and the tablet computer broadcasts a device discovery request. The user performs a first operation based on the second button on the first page displayed by the PC, for example, clicks the option of tablet cooperation on the multi-device cooperation page. The process can refer to the related description of the fourth implementation manner of the first operation, which will not be described here. The PC responds to the first operation and informs the smart interconnection module to start searching for nearby devices (startDiscovery) through the cooperation service module. The smart interconnection module of the PC informs the communication module to start searching for nearby devices. Taking the PC discovering the tablet computer based on the BLE discovery protocol as an example, the communication module of the PC sends a device discovery message (onDeviceFound) to the smart interconnection module, which can include the BLE / BR MAC of the tablet computer. The device discovery message can also include the user account logged in by the tablet computer. The communication module of the tablet computer sends a device discovery message to the smart interconnection module, which can include the BLE / BR MAC of the PC. The smart interconnection module of the PC passes the BLE / BR MAC of the tablet computer and the logged-in user account to the cooperation service module.

[0238] The PC displays a first window according to the device search result, which can be a region on the first page for displaying the device search result. If the PC discovers the tablet computer, the first window includes the device search result of the tablet computer. The first window also includes a first button corresponding to the device search result.

[0239] The cooperation service module of the PC determines whether the tablet computer and the local device are logged in the same user account according to the user account logged in by the tablet computer and the user account logged in locally. If the tablet computer and the local device are logged in different user accounts, the PC ignores this task. If the tablet computer and the local device are logged in the same user account, the cooperation service module of the PC calls the forced online interface of the device management module to force the tablet computer to be online. The device management module of the PC calls the forced online interface of the smart interconnection module to trigger the smart interconnection module to force the tablet computer to be online. The PC identifies the device state of the PC according to the BLE / BR MAC of the tablet computer and the stored first information through the smart interconnection module. The PC can obtain the device information of the tablet computer when discovering the tablet computer, and identify the device state of the PC according to the device information of the tablet computer and the first information.

[0240] If the device state of the tablet is the first state, i.e., the tablet is in the online state, the smart interconnection module sends an online notification to the device management module, which can include the device ID of the tablet, such as the UUID of the tablet. The device management module responds to the notification and requests the UDID of the tablet from the smart interconnection module. After obtaining the UDID of the tablet, the device management module sends an online success message to the collaborative service module, which includes the UDID of the tablet.

[0241] If the device state of the tablet is the second state, i.e., the tablet is in the offline state, the smart interconnection module sends an offline notification to the device management module, and the device management module sends an offline notification to the collaborative service module. The smart interconnection module also sends a connection instruction to the communication module, which can include the BLE / BR MAC of the tablet. The PC establishes a BLE / BR connection with the tablet through the communication module according to the BLE / BR MAC of the tablet.

[0242] After the PC establishes a BLE / BR connection with the tablet successfully, the PC performs a first authentication process of device authentication with the smart interconnection module of the tablet through the smart interconnection module. Wherein, the PC sends a device authentication notification to the security service module through the smart interconnection module, and the security service module of the PC interacts with the security service module of the tablet based on the BLE / BR connection and uses the security module message for device authentication. Before the security service module of the PC interacts with the security service module of the tablet based on the BLE / BR connection, the security service module of the PC can determine whether the local and the tablet are logged in the same user account, and when logged in the same user account, interact with the tablet security module message.

[0243] If the tablet computer is not authenticated, the security service module of the PC returns an authentication failure notification to the smart interconnection module, and the smart interconnection module feeds back the authentication failure notification to the device management module. The authentication failure notification can include the reason for the authentication failure. The device management module feeds back the authentication failure notification to the collaborative service module. If the tablet computer is authenticated, the security service module of the PC returns a first key to the smart interconnection module, and the security service module of the tablet computer returns a second key to the smart interconnection module. The smart interconnection module of the PC and the smart interconnection module of the tablet computer respectively use the first key and the second key to interact first encrypted information and second encrypted information. The first encrypted information and the second encrypted information can include full information of the corresponding electronic device. After the smart interconnection module of the PC and the smart interconnection module of the tablet computer obtain the encrypted information of the other party, it is confirmed that the authentication is successful. The PC feeds back an authentication success notification to the device management module through the smart interconnection module. The authentication success notification can include the device ID of the tablet computer. The device ID of the tablet computer can be obtained by the PC from the second encrypted information or can be obtained by the PC when the tablet computer is discovered. The device management module feeds back the authentication success notification to the collaborative service module, and the tablet computer is added to the authenticated devices. The PC can manage / store the full information and the Bluetooth address of the tablet computer through the smart interconnection module. After the tablet computer is authenticated, the smart interconnection module of the PC also sends a device BR online message to the device management module. The device BR online message can include device information of the tablet computer, such as device ID, device status, device type, etc. The PC adds the device information of the tablet computer to the second information. The PC can update the display related page according to the updated second information through the device management module. The tablet computer can manage / store the full information and the Bluetooth address of the PC through the smart interconnection module. After the PC is authenticated, the smart interconnection module of the tablet computer also sends a device BR online message to the device management module. The device BR online message can include device information of the PC, such as device ID, device status, device type, etc. The tablet computer adds the device information of the PC to the second information. The tablet computer can update the display related page according to the updated second information through the device management module.

[0244] As Figure 18As shown, when the user wants to use the PC to perform device cooperation with the tablet computer, the user can perform a second operation on the first button corresponding to the device search result of the tablet computer, such as clicking the first button. The cooperation service module of the PC identifies whether the service package to be executed is a service package of the cooperation service, and when the service package is the service package of the cooperation service, the second operation is continuously responded to, and the device cooperation with the tablet computer is performed. The cooperation service module responds to the second operation, and sends a notification of forced online to the device management module, which can include the BLE / BR MAC of the tablet computer. The device management module sends the notification of forced online to the smart interconnection module, calls the query interface of the smart interconnection module, and the notification can include the BLE / BR MAC of the tablet computer. The smart interconnection module of the mobile phone identifies the device state of the tablet computer according to the BLE / BR MAC of the PC and the stored first information.

[0245] If the tablet is in the first state, it is determined to execute the first procedure of establishing the data transmission channel. The smart interconnection module of the PC sends an online notification to the device management module, which can include the UUID of the tablet. The device management module returns the UDID of the tablet to the smart interconnection module in response to the online notification, and sends a message of successful online and the UDID of the tablet to the collaborative service module. The collaborative service module identifies the device state of the tablet again according to the UDID of the tablet in response to the message of successful online. If it is determined that the tablet is in the first state, it is determined to continue to execute the first procedure of establishing the data transmission channel; if it is determined that the tablet is in the second state, it is determined to execute the second procedure of establishing the data transmission channel. When it is determined to continue to execute the first procedure of establishing the data transmission channel, the collaborative service module of the PC returns a message of obtaining device object (getDevice) to the device management module, and returns a notification of starting session to the smart interconnection module. The smart interconnection module of the PC establishes the data transmission channel with the smart interconnection module of the tablet. Wherein, the smart interconnection module of the PC identifies whether the first connection with the tablet has been established, if not, the smart interconnection module of the PC notifies the communication module to establish the first connection with the tablet. After the smart interconnection module of the PC identifies that the first connection with the tablet has been established, it interacts with the smart interconnection module of the tablet based on the first connection to obtain the connection information of the wireless network, such as the network configuration information and address information related to the Wi-Fi P2P connection. The communication module of the PC establishes the second connection, such as the Wi-Fi P2P connection, with the communication module of the tablet according to the connection information of the wireless network. The smart interconnection module of the PC establishes the data transmission channel with the smart interconnection module of the tablet based on the second connection. After the PC and the tablet establish the data transmission channel, the smart interconnection module of the PC sends a message of session started to the collaborative service module, and the smart interconnection module of the tablet sends a message of session started to the collaborative service module. In this way, the collaborative service module of the PC can interact with the collaborative service module of the tablet based on the data transmission channel.

[0246] If the tablet is in the second state, it is determined to execute the second procedure of establishing the data transmission channel. The PC and the tablet execute the second procedure of establishing the data transmission channel can refer to Figure 15 , the collaborative service module and the communication module of the PC execute the procedure similar to the procedure executed by the collaborative service module and the communication module of the mobile phone in Figure 15 , and the collaborative service module and the communication module of the tablet execute the procedure similar to the procedure executed by the collaborative service module and the communication module of the mobile phone in Figure 15The process executed by the cooperation service module and the communication module of the PC is similar. The cooperation service module of the PC sends a Bluetooth connection notification to the communication module, which can include the BR MAC of the tablet computer. The communication module of the PC establishes a first connection with the tablet computer according to the BR MAC of the tablet computer, and after the first connection is successfully established, the communication module returns a Bluetooth connection success notification to the cooperation service module. In response to the Bluetooth connection success notification, the cooperation service module of the PC can perform a second authentication process of device authentication with the security service module of the tablet computer through the security service module. The security service module of the PC interacts with the security service module of the tablet computer based on the first connection to exchange security module messages, and uses the security module messages to perform device authentication.

[0247] If the tablet computer fails to pass the authentication, the security service module of the PC returns an authentication failure notification to the cooperation service module, which can include the reason for the authentication failure. If the PC and the tablet computer pass the device authentication, the security service module of the PC returns a first key to the cooperation service module, and the security service module of the tablet computer returns a second key to the cooperation service module. The cooperation service module of the PC and the cooperation service module of the tablet computer respectively use the first key and the second key to exchange first encrypted information and second encrypted information. The first encrypted information and the second encrypted information can include device information of the corresponding electronic device. After the cooperation service module of the PC and the cooperation service module of the tablet computer obtain the encrypted information of the other party, it is confirmed that the authentication is successful. The cooperation service module of the PC can store / manage the device information of the tablet computer after the tablet computer passes the authentication, or send the device information of the tablet computer to the device management module, and the PC adds the device information of the tablet computer to the second information. The cooperation service module of the tablet computer can store / manage the device information of the PC after the PC passes the authentication, or send the device information of the PC to the device management module, and the tablet computer adds the device information of the PC.

[0248] If the PC and the tablet pass the second authentication process, the PC determines to continue to execute the second flow of establishing the data transmission channel. In this case, the collaboration service module of the PC identifies whether the first connection has been established with the tablet, and if not, the collaboration service module of the PC instructs the communication module to establish the first connection with the tablet. After the collaboration service module of the PC identifies that the first connection has been established with the tablet, the collaboration service module of the PC interacts with the collaboration service module of the tablet to obtain the connection information of the wireless network, such as the network configuration information and address information related to the Wi-Fi P2P connection. The communication module of the PC and the tablet establishes the second connection, such as the Wi-Fi P2P connection, based on the connection information of the wireless network. The collaboration service module of the PC and the collaboration service module of the tablet establish the data transmission channel based on the second connection. After the PC and the tablet establish the data transmission channel, the collaboration service module of the PC can interact with the collaboration service module of the tablet based on the data transmission channel.

[0249] In the process of executing the second flow, the PC can execute the first authentication process with the tablet in parallel through the smart interconnection module. In this case, if the tablet passes the first authentication process, the smart interconnection module of the PC sends an online success notification to the device management module, and the device management module sends an online success notification to the collaboration service module, which can include the UDID of the tablet. The smart interconnection module of the PC also reports the device online notification to the device management module, which can include the device information of the tablet. The device management module can update the relevant page based on the device information of the tablet. If the tablet fails the first authentication process, the smart interconnection module of the PC sends an online failure notification to the device management module. In this way, the PC can establish the data transmission channel with the tablet based on the stored device information when the device collaboration is performed next time.

[0250] In some embodiments, based on the first operation of the fourth implementation in step S401, if the second electronic device and the discovered device log in the same user account, the first electronic device displays the first identifier on the device search result of the discovered device logged in the same user account in the first window.

[0251] In this way, the user can quickly and accurately locate the discovered device logged in the same user account as the first electronic device through the first identifier, and then can perform corresponding operations based on the same account device.

[0252] Figure 19 is an example diagram of a second page when the first electronic device and the second electronic device log in the same user account according to an embodiment of the present application.

[0253] The first electronic device can be a PC, and the second electronic device can be a tablet. If the device search result includes a tablet and a mobile phone, the device information of the tablet includes a device type such as a tablet, a device model such as V7 Pro, and a logged-in user account such as user account b. The device information of the mobile phone includes a device type such as a folding screen mobile phone, a device model such as Magic V, and a logged-in user account such as user account c. As shown in FIG. 6A, the first window 1901 of the second page includes the device search result of the tablet and the mobile phone. If the user account logged in by the PC is user account b, the device search result of the tablet further includes a first identifier such as "My Device". Figure 19

[0254] In some embodiments, the first electronic device is configured with a page for displaying the authenticated device in the first state, which can include a third page. The third page includes the first electronic device and the interactive control of the authenticated device in the first state.

[0255] The first electronic device can display the third page according to the second information. If the second electronic device passes the device authentication and is in the first state, the second page includes the identifier of the second electronic device. If the second electronic device does not pass the device authentication or is in the second state, the second page does not include the identifier of the second electronic device.

[0256] The first electronic device displays the third page according to the second information in response to the fourth operation of the user.

[0257] In some embodiments, the first electronic device can set an entry of the third page on a seventh page such as a control center page. The user can perform a fourth operation on the entry of the third page, which can be a single-click operation, a double-click operation, a long-press operation, etc. The first electronic device displays the third page including the first electronic device and the interactive control of the authenticated device in the first state in response to the fourth operation.

[0258] In this way, when the user needs to use the first electronic device to perform device collaboration with the authenticated device, the user can establish a data transmission channel between the authenticated device and the first electronic device based on the interactive control on the second page, which can effectively simplify the user operation and improve the interactivity between the user and the first electronic device. When the first electronic device establishes the data transmission channel with the second electronic device, the first electronic device can obtain the full information of the second electronic device according to the first information and the device ID, Bluetooth address, etc. of the second electronic device, and perform device collaboration with the second electronic device according to the full information of the second electronic device.

[0259] ​In some embodiments, the second information can include a user account logged in by the authenticated device, and if the second electronic device is authenticated by the device authentication, the device information of the second electronic device stored by the first electronic device includes the user account logged in by the second electronic device.

[0260] The first electronic device acquires the user account logged in by the authenticated device in the first state in response to a third operation of the user.

[0261] The first electronic device displays a third page according to the user account information logged in by the local device and the user account logged in by the authenticated device in the first state. The third page further includes a second identifier located on the interactive control of the authenticated device logged in by the same user account as the first electronic device.

[0262] In this way, the user can quickly and accurately locate the authenticated device logged in by the same user account as the first electronic device through the second identifier, and then can perform corresponding operations based on the same account device.

[0263] Figure 20A 、 20B , 20C and 20D are an interaction example diagram of the first electronic device and the second electronic device for device collaboration after the second electronic device is authenticated by the device authentication according to an embodiment of the present application.

[0264] The first electronic device can be a mobile phone, and the second electronic device can be a PC. Both the mobile phone and the PC are in a bright screen state, and both the mobile phone and the PC have Bluetooth function turned on. As shown in Figure 20A , the mobile phone displays a seventh page, such as a control center page, which includes an entrance of the third page, such as an icon 2001. After the PC is authenticated by the device authentication of the mobile phone, if the user performs a fourth operation, such as a click operation 18, on the icon 2001, the mobile phone displays the third page according to the first information in response to the click operation 18. Taking the second information including the device information of the PC and the tablet computer as an example, the device information of the PC includes the device state, such as the first state, the device type, such as the PC, the device model, such as MagicBook X14, and the user account logged in, such as user account a. The device information of the tablet computer includes the device state, such as the first state, the device type, such as the tablet computer, the device model, such as V7 Pro, and the user account logged in, such as user account b. Figure 20BAs shown, the third page includes the interactive control 2002 of the mobile phone, the interactive control 2003 of the PC, and the interactive control 2004 of the tablet computer. The icon of the interactive control 2003 corresponds to the device type of the PC, which is an icon of a PC. The icon of the interactive control 2004 corresponds to the device type of the tablet computer, which is an icon of a tablet computer. If the user account logged in by the mobile phone is the user account a, the interactive control 2003 further includes a second identifier, such as "My Device". When the user needs to perform the cooperation between the mobile phone and the PC, the user can perform an operation on the interactive control 2003, such as a drag operation 19. As shown, the mobile phone moves the interactive control 2003 to contact the interactive control 2002 in response to the drag operation 19, and performs the cooperation task between the mobile phone and the PC after the interactive control 2003 contacts the interactive control 2002. Figure 20C As shown, the mobile phone moves the interactive control 2003 to contact the interactive control 2002 in response to the drag operation 19, and performs the cooperation task between the mobile phone and the PC after the interactive control 2003 contacts the interactive control 2002. Figure 20D As shown, the mobile phone moves the interactive control 2003 to contact the interactive control 2002 in response to the drag operation 19, and performs the cooperation task between the mobile phone and the PC after the interactive control 2003 contacts the interactive control 2002.

[0265] The above embodiments of the present application introduce the various schemes of the device cooperation method provided by the present application. It can be understood that, in order to implement the above functions, the electronic device includes the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed in the present application, the present application can be implemented in the form of hardware or the combination of hardware and computer software. Whether a certain function is implemented in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical scheme. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0266] Figure 21 FIG. 1 is a structural schematic diagram of a device authentication apparatus provided by an embodiment of the present application. In an embodiment, an electronic device, for example, a first electronic device, can implement the corresponding functions through the hardware apparatus shown in FIG. 1. As shown, the device authentication apparatus can include a display screen 1001, a memory 1002, a processor 1003, and a communication module 1004. The above devices can be connected through one or more communication buses 1005. Figure 21 Figure 21 As shown, the device authentication apparatus can include a display screen 1001, a memory 1002, a processor 1003, and a communication module 1004. The above devices can be connected through one or more communication buses 1005.

[0267] ​In an embodiment, the display screen 1001 can include a display panel 10011 for displaying images and a touch sensor 10012 that can pass a detected touch operation to an application processor to determine a touch event type and provide visual output related to the touch operation through the display panel 10011. The processor 1003 can include one or more processing units, such as: an application processor, a modem processor, a graphics processor, an image signal processor, a controller, a video codec, a digital signal processor, a baseband processor, and / or a neural network processor, etc. Different processing units can be independent devices or integrated into one or more processors. The memory 1002 is coupled to the processor 1003 and is used to store various software programs and / or sets of instructions. The memory 1002 can include volatile memory and / or non-volatile memory.

[0268] When the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device implements the following method steps: in response to a first operation of a user, after discovering a second electronic device, displaying a first window including a first button, and performing a first device authentication process with the second electronic device based on a first connection. In response to a second operation of the user on the first button, identifying a device state of the second electronic device, the device state of the second electronic device including a first state and a second state. If the second electronic device is in the first state, establishing the data transmission channel with the second electronic device based on a second connection. If the second electronic device is in the second state, performing a second device authentication process with the second electronic device based on the first connection, and after the second electronic device is authenticated, establishing the data transmission channel with the second electronic device based on the second connection. Wherein the first state includes that the second electronic device is authenticated, and the second electronic device maintains the first connection with the first electronic device or is able to receive a broadcast response message from the other party; the second state includes that the second electronic device is not authenticated, or the second electronic device is authenticated, and the second electronic device disconnects the first connection with the first electronic device, and is unable to receive a broadcast response message from the other party.

[0269] The device provided by the embodiments of the present application can be used by a user to trigger the first electronic device to discover the second electronic device quickly through the first operation when the user needs to use the first electronic device and the second electronic device to perform device cooperation. After discovering the second electronic device, the first electronic device displays the first window and directly and automatically starts the first device authentication process with the second electronic device. In this way, when the user performs the second operation on the first button of the first window, if the second electronic device is in the first state, the first electronic device can directly establish the data transmission channel with the second electronic device based on the authentication result of the second electronic device passing the authentication, thereby shortening the time for the first electronic device and the second electronic device to establish the data transmission channel and improving the efficiency of the first electronic device and the second electronic device to perform device cooperation.

[0270] In an implementation manner, when the software programs and / or groups of instructions in the memory 1002 are executed by the processor 1003, the first electronic device specifically implements the following method steps to identify the device state of the second electronic device in response to the second operation of the user on the first button: identifying the device state of the second electronic device according to the Bluetooth address of the second electronic device and the stored first information, the Bluetooth address of the second electronic device being obtained when the first electronic device discovers the second electronic device, and the first information including the Bluetooth address and the device state of the authenticated device. When the first information includes the Bluetooth address of the second electronic device and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the first state, the second electronic device is in the first state. When the first information includes the Bluetooth address of the second electronic device and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the second state, or when the first information does not include the Bluetooth address of the second electronic device, the second electronic device is in the second state. In this way, the first electronic device stores the Bluetooth address and the device state of the authenticated device, can quickly obtain the device state of the authenticated device based on the Bluetooth address when the Bluetooth address of the authenticated device is obtained, and then quickly and accurately determine the process of establishing the data transmission channel according to the device state.

[0271] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device implements the following method steps to establish a data transmission channel with the second electronic device based on the second connection if the second electronic device is in the first state: interacting with the second electronic device based on the connection information of the wireless network based on the first connection, the first connection being the first connection established between the first electronic device and the second electronic device, or the first connection being the first connection re-established between the first electronic device and the second electronic device after the first electronic device determines to disconnect the first connection with the second electronic device. The second connection is established between the first electronic device and the second electronic device based on the connection information of the wireless network. The data transmission channel is established between the first electronic device and the second electronic device based on the second connection. In this way, if the second electronic device is in the first state, the first electronic device can establish the data transmission channel with the second electronic device across the device authentication process in response to the second operation of the user, thereby improving the efficiency of establishing the data transmission channel. Moreover, the data transmission channel established based on the second connection can meet a larger data transmission amount, thereby meeting the device cooperation between the first electronic device and the second electronic device.

[0272] In an implementation, the first information further includes a device identity identification number ID of the authenticated device, the device ID including a universally unique identifier UUID, and the first electronic device further stores second information including the device ID of the authenticated device, the device ID including a unique device identifier UDID. When the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device implements the following method steps to interact with the second electronic device based on the connection information of the wireless network based on the first connection: obtaining the UUID of the second electronic device according to the Bluetooth address of the second electronic device and the first information. Obtaining the UDID of the second electronic device according to the UUID of the second electronic device and the second information. Identifying the device state of the second electronic device according to the UDID of the second electronic device and the first information. When it is determined that the second electronic device is in the first state, interacting with the second electronic device based on the connection information of the wireless network based on the first connection. In this way, the first electronic device can accurately determine the second electronic device to which the data transmission channel is to be established through the specified device ID, thereby ensuring the security and effectiveness of the data transmission channel.

[0273] In an implementation, the data transmission channel is an encrypted channel. If the second electronic device is in the first state, the key of the data transmission channel is obtained by the first electronic device according to the Bluetooth address of the second electronic device and the first information. The first information includes the device ID of the second electronic device, and the key of the data transmission channel corresponds to the device ID of the second electronic device. In this way, if the second electronic device is in the first state, the first electronic device can directly obtain the key of the data transmission channel from the first information, and then interact with the second electronic device through the data transmission channel to encrypt information, thereby ensuring the security of data transmission.

[0274] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device specifically implements the following method steps to implement the first device authentication process based on the first connection with the second electronic device: obtaining a user account logged in by the second electronic device. Determine whether the user account logged in by the first electronic device and the user account logged in by the second electronic device are the same. If they are the same, perform the first device authentication process based on the first connection with the second electronic device. In this way, the first electronic device can preliminarily judge whether it can be networked with the second electronic device through the user account logged in by the second electronic device, so as to ensure the security of the device and avoid invalid networking operations of the first electronic device.

[0275] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device specifically implements the following method steps to implement the discovery of the second electronic device in response to the first operation of the user: in response to the user bringing the first electronic device close to or touching the NFC area of the second electronic device, establishing NFC communication with the second electronic device. Obtain the Bluetooth address of the second electronic device from the second electronic device based on the NFC communication. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by bringing the first electronic device close to or touching the second electronic device.

[0276] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device specifically implements the following method steps to implement the discovery of the second electronic device in response to the first operation of the user: in response to the user using the first electronic device to scan the two-dimensional code provided by the second electronic device, obtaining the Bluetooth address associated with the two-dimensional code. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by scanning the code with the first electronic device.

[0277] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device implements the following method steps to discover the second electronic device in response to the first operation of the user, including: broadcasting a device discovery request. In response to the user bringing the first electronic device close to the second electronic device, receiving a response message broadcasted by the second electronic device in response to the device discovery request when the Bluetooth signal strength of the second electronic device is greater than or equal to the strength threshold in the device discovery request, the response message including the Bluetooth address of the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by bringing the first electronic device close to the second electronic device.

[0278] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device implements the following method steps to discover the second electronic device in response to the first operation of the user, including: in response to the third operation of the user on the second button on the first page, receiving the device discovery request broadcasted by the second electronic device, the device discovery request including the Bluetooth address of the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by performing the second operation on the second button on the second page.

[0279] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device implements the following method steps to discover the second electronic device in response to the first operation of the user, including: in response to the third operation of the user on the second button on the first page, receiving the device discovery request broadcasted by the second electronic device, the device discovery request including the Bluetooth address of the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by performing the second operation on the second button on the second page.

[0280] In an implementation, the data transmission channel is an encrypted channel. If the second electronic device is in the second state, the key of the data transmission channel is the key exchanged between the first electronic device and the second electronic device in the second authentication process. In this way, the first electronic device and the second electronic device can accurately obtain the key suitable for the data transmission channel established this time.

[0281] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device specifically implements the following method steps to implement the parallel execution of the first process and the second process if the second electronic device is in the second state. The first process is a first device authentication process between the first electronic device and the second electronic device based on the first connection, the second process is a second device authentication process between the first electronic device and the second electronic device based on the first connection, and a data transmission channel is established between the first electronic device and the second electronic device based on a second connection after the second electronic device is authenticated. In this way, the first electronic device can establish a data transmission channel with the second electronic device based on the result of being authenticated in the second device authentication process with the second electronic device. At the same time, the first electronic device can store the full information and the Bluetooth address of the second electronic device based on the result of being authenticated in the first device authentication process with the second electronic device, so that when the first electronic device performs device collaboration with the second electronic device in the future, the full information of the second electronic device can be directly obtained according to the Bluetooth address of the second electronic device, and a data transmission channel can be established with the second electronic device based on the full information of the second electronic device, without the need to perform device authentication with the second electronic device again, thereby improving the efficiency of device collaboration with the second electronic device.

[0282] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device specifically implements the following method steps to implement the identification of the device state of the second electronic device in response to the second operation of the first button by the user: in response to the second operation of the first button by the user, identifying whether the service package to be executed is a service package of a collaboration service. When the service package is a service package of a collaboration service, the device state of the second electronic device is identified. In this way, the first electronic device can establish a data transmission channel with the second electronic device for the collaboration service in a targeted manner.

[0283] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device is also caused to implement the following method steps: in response to a third operation performed by the user on the second button on the first page, the first electronic device displays a first window. The first window is a first area on the second page for displaying device search results, and the device search results include the second electronic device, wherein each device search result corresponds to one of the first buttons. In this way, the first electronic device can show the user all discovered devices through the first window, and provide an entry for each device to establish a data transmission channel.

[0284] In an implementation, the device discovery request includes a user account logged in by the second electronic device, and when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device is caused to implement the following method steps to display the first window in response to the third operation performed by the user on the second button on the first page: determine whether the user account information logged in by the first electronic device and the user account information logged in by the second electronic device are the same. If they are the same, display the first identification on the second electronic device when displaying the first window. In this way, the user can quickly and accurately locate the discovered device logged in with the same user account as the first electronic device through the first identification, and then can perform corresponding operations based on the same account device.

[0285] In an implementation, when the software programs and / or sets of instructions in the memory 1002 are executed by the processor 1003, the first electronic device is also caused to implement the following method steps: after the second electronic device passes the first device authentication process, add the device information of the second electronic device to the second information, and the second information includes the device information of the authenticated devices, and the device information of the authenticated devices includes the device state of the authenticated devices. In response to a fourth operation of the user, display a third page according to the second information, and the second page includes the interactive controls of the first electronic device and the authenticated devices in the first state. In this way, the user can interact with the authenticated devices based on the interactive controls on the second page, which can effectively simplify the user operation and improve the interactivity between the user and the first electronic device.

[0286] In an implementation manner, when the software programs and / or groups of instructions in the memory 1002 are executed by the processor 1003, the first electronic device specifically implements the following method steps to display the third page according to the second information in response to the fourth operation of the user: in response to the fourth operation of the user, the user account logged in by the authenticated device is obtained; and the third page is displayed according to the user account information logged in by the local and the user account logged in by the authenticated device. The third page further includes a second identifier located on the interactive control of the authenticated device logged in by the same user account as the first electronic device. In this way, the user can quickly and accurately locate the authenticated device logged in by the same user account as the first electronic device through the second identifier, and then can perform corresponding operations based on the same account device.

[0287] Figure 22 is another device coordination apparatus provided by the embodiment of the present application. In an embodiment, an electronic device, for example, a first electronic device, can implement corresponding functions through the software apparatus shown in Figure 22 . As shown in Figure 22 , the device coordination apparatus can include a display module 2201, a first authentication module 2202, an identification module 2203, a connection module 2204, and a second authentication module 2205. Wherein:

[0288] The display module 2201 is configured to display a first window including a first button in response to a first operation of a user after discovering a second electronic device. The first authentication module 2202 is configured to perform a first device authentication process with the second electronic device based on a first connection after discovering the second electronic device. The identification module 2203 is configured to identify a device state of the second electronic device in response to a second operation of the user on the first button, the device state of the second electronic device including a first state and a second state. The connection module 2204 is configured to establish the data transmission channel with the second electronic device based on a second connection if the second electronic device is in the first state. The second authentication module 2205 is configured to perform a second device authentication process with the second electronic device based on the first connection if the second electronic device is in the second state. The connection module 2204 is further configured to establish the data transmission channel with the second electronic device based on the second connection after the second electronic device is authenticated. Wherein, the first state includes that the second electronic device is authenticated, and the second electronic device maintains the first connection with the first electronic device or can receive a broadcast response message from the other party; and the second state includes that the second electronic device is not authenticated, or the second electronic device is authenticated, and the second electronic device disconnects the first connection with the first electronic device, and cannot receive the broadcast response message from the other party.

[0289] The device provided by the embodiments of the present application can be used by a user to quickly trigger the first electronic device to discover the second electronic device when the first electronic device and the second electronic device need to be cooperated. After discovering the second electronic device, the first electronic device displays the first window and directly and automatically starts the first device authentication process with the second electronic device. In this way, when the user performs the second operation on the first button of the first window, if the second electronic device is in the first state, the first electronic device can directly establish the data transmission channel with the second electronic device based on the authentication result of the second electronic device passing the authentication, thereby shortening the time for the first electronic device and the second electronic device to establish the data transmission channel and improving the efficiency of the device cooperation of the first electronic device and the second electronic device.

[0290] In an implementation manner, the device further includes a storage module 2206 configured to store the first information. The identification module 2203 is specifically configured to identify the device state of the second electronic device according to the Bluetooth address of the second electronic device and the stored first information, the Bluetooth address of the second electronic device being obtained when the first electronic device discovers the second electronic device, and the first information including the Bluetooth address and the device state of the authenticated device. When the first information includes the Bluetooth address of the second electronic device and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the first state, the second electronic device is in the first state. When the first information includes the Bluetooth address of the second electronic device and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the second state, or when the first information does not include the Bluetooth address of the second electronic device, the second electronic device is in the second state. In this way, the first electronic device can store the Bluetooth address and the device state of the authenticated device, and when the Bluetooth address of the authenticated device is obtained, the device state of the authenticated device can be quickly obtained based on the Bluetooth address, and then the process of establishing the data transmission channel can be quickly and accurately determined according to the device state.

[0291] In an implementation manner, the connection module 2204 is specifically configured to: based on the connection information of the first connection with the second electronic device in the wireless network, the first connection being the first connection established by the first electronic device with the second electronic device or the first connection re-established by the first electronic device with the second electronic device after the first electronic device determines to disconnect the first connection with the second electronic device; establish the second connection with the second electronic device according to the connection information of the wireless network; and establish the data transmission channel with the second electronic device based on the second connection. In this way, if the second electronic device is in the first state, the first electronic device can establish the data transmission channel with the second electronic device across the device authentication process in response to the second operation of the user, thereby improving the efficiency of establishing the data transmission channel. Moreover, the data transmission channel established based on the second connection can meet a larger data transmission amount, thereby meeting the device cooperation between the first electronic device and the second electronic device.

[0292] In an implementation manner, the first information further includes a device identity identifier ID of the authenticated device, the device ID includes a universally unique identifier UUID, the first electronic device further stores second information, the second information includes the device ID of the authenticated device, the device ID includes a unique device identifier UDID, and the connection module 2204 is specifically configured to: obtain the UUID of the second electronic device according to the Bluetooth address of the second electronic device and the first information; obtain the UDID of the second electronic device according to the UUID of the second electronic device and the second information; and identify the device state of the second electronic device according to the UDID of the second electronic device and the first information. When it is determined that the second electronic device is in the first state, the first connection is used to interact with the second electronic device based on the connection information of the wireless network. In this way, the first electronic device can accurately determine the second electronic device to which the data transmission channel is to be established through the specified device ID, thereby ensuring the security and effectiveness of the data transmission channel.

[0293] In an implementation manner, the data transmission channel is an encryption channel. If the second electronic device is in the first state, the key of the data transmission channel is obtained by the first electronic device according to the Bluetooth address of the second electronic device and the first information. The first information includes a device identity identifier ID of the second electronic device, and the key of the data transmission channel corresponds to the device ID of the second electronic device. In this way, if the second electronic device is in the first state, the first electronic device can directly obtain the key of the data transmission channel from the first information, and then interact with the second electronic device through the data transmission channel to ensure the security of data transmission.

[0294] In an implementation manner, the first authentication module 2202 is specifically configured to: obtain a user account logged in by the second electronic device; and determine whether the user account logged in by the first electronic device and the user account logged in by the second electronic device are the same. If they are the same, the first device authentication process is performed based on the first connection with the second electronic device. In this way, the first electronic device can preliminarily determine whether the first electronic device can be networked with the second electronic device through the user account logged in by the second electronic device, so as to ensure the security of the device and avoid invalid networking operations of the first electronic device.

[0295] In an implementation manner, the first authentication module 2202 is specifically configured to: obtain a user account logged in by the second electronic device; and determine whether the user account logged in by the first electronic device and the user account logged in by the second electronic device are the same. If they are the same, the first device authentication process is performed based on the first connection with the second electronic device. In this way, the first electronic device can preliminarily determine whether the first electronic device can be networked with the second electronic device through the user account logged in by the second electronic device, so as to ensure the security of the device and avoid invalid networking operations of the first electronic device.

[0296] In an implementation manner, the response module 2207 is further configured to: in response to the user scanning a two-dimensional code provided by the second electronic device by using the first electronic device, acquire a Bluetooth address associated with the two-dimensional code. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by using the first electronic device to scan the two-dimensional code.

[0297] In an implementation manner, the response module 2207 is further configured to: broadcast a device discovery request. In response to the user bringing the first electronic device close to the second electronic device, receive a response message broadcasted by the second electronic device in response to the device discovery request when a Bluetooth signal strength of the device discovery request is greater than or equal to a strength threshold, the response message including a Bluetooth address of the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by bringing the first electronic device close to the second electronic device.

[0298] In an implementation manner, the response module 2207 is further configured to: in response to the user performing a third operation on the second button on the first page, receive a device discovery request broadcasted by the second electronic device, the device discovery request including a Bluetooth address of the second electronic device. In this way, the user can quickly and simply trigger the first electronic device to discover the second electronic device by performing the second operation on the second button on the second page.

[0299] In an implementation manner, the second authentication module 2205 is specifically configured to: establish a first connection with the second electronic device according to the Bluetooth address of the second electronic device. Perform a second device authentication process with the second electronic device based on the first connection. The connection module 2204 is specifically configured to: after the second electronic device is authenticated, interact with the second electronic device based on the first connection to obtain connection information of a wireless network. Establish a second connection with the second electronic device according to the connection information of the wireless network. Establish a data transmission channel with the second electronic device based on the second connection. In this way, the first electronic device quickly performs the second device authentication process with the second electronic device in response to the second operation of the user, and no longer waits for an authentication result of the first device authentication process with the second electronic device, thereby avoiding additional waste of time waiting for the authentication result of the first device authentication process, shortening the time for the first electronic device to establish the data transmission channel with the second electronic device, and improving the collaboration efficiency of the first electronic device and the second electronic device.

[0300] In an implementation manner, the data transmission channel is an encrypted channel. If the second electronic device is in the second state, a key of the data transmission channel is a key exchanged between the first electronic device and the second electronic device in the second authentication process. In this way, the first electronic device and the second electronic device can accurately obtain a key suitable for the data transmission channel established this time.

[0301] In an implementation manner, the first authentication module 2202, the connection module 2204 and the second authentication module 2205 are specifically configured to: if the second electronic device is in the second state, the first process and the second process are executed in parallel. The first process is that the first electronic device and the second electronic device perform a first device authentication process based on the first connection, the second process is that the first electronic device and the second electronic device perform a second device authentication process based on the first connection, and a data transmission channel is established with the second electronic device based on a second connection after the second electronic device is authenticated. In this way, the first electronic device can establish a data transmission channel with the second electronic device based on the result of being authenticated in the second device authentication process with the second electronic device. At the same time, the first electronic device can store the full information and the Bluetooth address of the second electronic device based on the result of being authenticated in the first device authentication process with the second electronic device, so as to directly obtain the full information of the second electronic device according to the Bluetooth address of the second electronic device when performing device collaboration with the second electronic device in the future, and establish a data transmission channel with the second electronic device based on the full information of the second electronic device, without the need to perform device authentication with the second electronic device again, thereby improving the efficiency of device collaboration with the second electronic device.

[0302] In an implementation manner, the identification module 2203 is specifically configured to: in response to a second operation of the first button by the user, identify whether the service package to be executed is a service package of the collaboration service. When the service package is the service package of the collaboration service, the device state of the second electronic device is identified. In this way, the first electronic device can be targeted to establish a data transmission channel with the second electronic device for the collaboration service.

[0303] In an implementation manner, the display module 2201 is specifically configured to: in response to a third operation of the second button on the first page performed by the user, display a first window. The first window is a first area on the second page for displaying device search results, and the device search results include the second electronic device, wherein each device search result corresponds to a first button. In this way, the first electronic device can show all discovered devices to the user through the first window, and provide an entry for establishing a data transmission channel for each device.

[0304] In an implementation manner, the device discovery request includes a user account logged in by the second electronic device, and the display module 2201 is specifically configured to: determine whether the user account information logged in by the local device and the user account information logged in by the second electronic device are the same. If they are the same, the first identifier is displayed on the second electronic device when the first window is displayed. In this way, the user can quickly and accurately locate the discovered device logged in with the same user account as the first electronic device through the first identifier, and then can perform corresponding operations based on the same account device.

[0305] In an implementation manner, the storage module 2206 is specifically configured to: after the second electronic device passes the first device authentication process, add device information of the second electronic device to second information, the second information including device information of authenticated devices, and the device information of the authenticated devices including device states of the authenticated devices. The display module 2201 is specifically configured to: in response to a fourth operation of the user, display a third page according to the second information, the second page including interactive controls of the first electronic device and the authenticated devices in the first state. In this way, the user can interact with the authenticated devices and the first electronic device based on the interactive controls on the second page, which can effectively simplify the user operation and improve the interactivity of the user and the first electronic device.

[0306] In an implementation manner, the display module 2201 is specifically configured to: in response to a fourth operation of the user, obtain a user account logged in by the authenticated device; and display a third page according to the local logged-in user account information and the user account logged in by the authenticated device. The third page further includes a second identifier on the interactive control of the authenticated device logged in to the same user account as the first electronic device. In this way, the user can quickly and accurately locate the authenticated device logged in to the same user account as the first electronic device through the second identifier, and then can perform corresponding operations based on the same account device.

[0307] The above detailed description of the embodiments of the present application further describes the purposes, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above is only a specific implementation manner of the embodiments of the present application, and is not used to limit the protection scope of the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.

Claims

1. A device collaboration method, characterized by, The method comprises: The first electronic device displays a first window in response to a first operation of a user after discovering a second electronic device, the first window comprising a first button, and performs a first device authentication process with the second electronic device based on a first connection; The first electronic device identifies a device state of the second electronic device in response to a second operation of the user on the first button, the device state of the second electronic device comprising a first state and a second state; If the second electronic device is in the first state, the first electronic device establishes a data transmission channel with the second electronic device based on a second connection; If the second electronic device is in the second state, the first electronic device performs a second device authentication process with the second electronic device based on the first connection, and establishes the data transmission channel with the second electronic device based on the second connection after the second electronic device is authenticated; The first state comprises that the second electronic device is authenticated, and the second electronic device maintains the first connection with the first electronic device or can receive a broadcast response message from the other party; the second state comprises that the second electronic device is not authenticated, or the second electronic device is authenticated, and the second electronic device disconnects the first connection with the first electronic device and cannot receive a broadcast response message from the other party.

2. The device collaboration method of claim 1, wherein, The first electronic device identifies the device state of the second electronic device in response to the second operation of the user on the first button, comprising: The first electronic device identifies the device state of the second electronic device according to a Bluetooth address of the second electronic device and stored first information, the Bluetooth address of the second electronic device being obtained when the first electronic device discovers the second electronic device, and the first information comprising a Bluetooth address and a device state of an authenticated device; When the first information comprises the Bluetooth address of the second electronic device, and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the first state, the second electronic device is in the first state; When the first information comprises the Bluetooth address of the second electronic device, and the authenticated device corresponding to the Bluetooth address of the second electronic device is in the second state, or when the first information does not comprise the Bluetooth address of the second electronic device, the second electronic device is in the second state.

3. The device collaboration method of claim 2, wherein, If the second electronic device is in the first state, the first electronic device establishes the data transmission channel with the second electronic device based on a second connection, comprising: The first electronic device interacts with the second electronic device based on the connection information of the wireless network, the first connection being a first connection established by the first electronic device with the second electronic device, or a first connection re-established by the first electronic device with the second electronic device after the first electronic device determines that the first connection is disconnected with the second electronic device; The first electronic device establishes a second connection with the second electronic device according to the connection information of the wireless network; The first electronic device establishes the data transmission channel with the second electronic device based on the second connection.

4. The device collaboration method of claim 3, wherein, The first information further includes a device identity identifier ID of the authenticated device, the device ID including a universally unique identifier UUID, and the first electronic device further stores second information including a device ID of the authenticated device, the device ID including a unique device identifier UDID. The first electronic device obtains the UUID of the second electronic device according to the Bluetooth address of the second electronic device and the first information; The first electronic device obtains the UDID of the second electronic device according to the UUID of the second electronic device and the second information; The first electronic device identifies the device state of the second electronic device according to the UDID of the second electronic device and the first information; The first electronic device interacts with the second electronic device to obtain the connection information of the wireless network based on the first connection when it is determined that the second electronic device is in the first state.

5. The device collaboration method of claim 2, wherein, The data transmission channel is an encrypted channel, and if the second electronic device is in the first state, the key of the data transmission channel is obtained by the first electronic device according to the Bluetooth address of the second electronic device and the first information, the first information including the device identity identifier ID of the second electronic device, and the key of the data transmission channel corresponding to the device ID of the second electronic device.

6. The device collaboration method of claim 1, wherein, The first electronic device and the second electronic device perform a first device authentication process based on the first connection, including: The first electronic device obtains a user account logged in by the second electronic device; The first electronic device determines whether the user account logged in by the first electronic device is the same as the user account logged in by the second electronic device; If they are the same, the first electronic device and the second electronic device perform the first device authentication process based on the first connection.

7. The device collaboration method according to any one of claims 1 to 6, characterized by, The first electronic device discovers the second electronic device in response to a first operation of a user, including: The first electronic device establishes NFC communication with the second electronic device in response to the user bringing the first electronic device close to or touching the near field communication NFC area of the second electronic device; The first electronic device obtains the Bluetooth address of the second electronic device from the second electronic device based on the NFC communication.

8. The device collaboration method according to any one of claims 1-6, wherein, The first electronic device discovers the second electronic device in response to a first operation of a user, including: The first electronic device obtains the Bluetooth address associated with the two-dimensional code in response to the user using the first electronic device to scan the two-dimensional code provided by the second electronic device.

9. The device collaboration method according to any one of claims 1-6, wherein, The first electronic device discovers the second electronic device in response to a first operation of a user, including: The first electronic device broadcasts a device discovery request; The first electronic device receives, in response to the user bringing the first electronic device close to the second electronic device, a response message broadcast by the second electronic device in response to the device discovery request when the Bluetooth signal strength of the second electronic device in the device discovery request is greater than or equal to a strength threshold, the response message including a Bluetooth address of the second electronic device.

10. The device collaboration method according to any one of claims 1-6, wherein, The first electronic device discovers, in response to a first operation of the user, that the second electronic device includes: The first electronic device receives, in response to a third operation of the user on the second button on the first page, a device discovery request broadcast by the second electronic device, the device discovery request including a Bluetooth address of the second electronic device.

11. The device collaboration method of claim 2, wherein, If the second electronic device is in the second state, the first electronic device performs a second device authentication process with the second electronic device based on a first connection, and after the second electronic device is authenticated, establishes the data transmission channel with the second electronic device based on a second connection, including: The first electronic device establishes a first connection with the second electronic device according to the Bluetooth address of the second electronic device; The first electronic device performs a second device authentication process with the second electronic device based on the first connection; The first electronic device interacts with the second electronic device based on the first connection to obtain connection information of a wireless network after the second electronic device is authenticated; The first electronic device establishes a second connection with the second electronic device according to the connection information of the wireless network; The first electronic device establishes the data transmission channel with the second electronic device based on the second connection.

12. The device collaboration method of claim 2, wherein, The data transmission channel is an encrypted channel, and if the second electronic device is in the second state, a key of the data transmission channel is interacted with the second electronic device in the second device authentication process.

13. The device collaboration method of any one of claims 1, 11-12, wherein, If the second electronic device is in the second state, the first electronic device performs a first process and a second process in parallel; The first process is that the first electronic device performs the first device authentication process with the second electronic device based on the first connection, and the second process is that the first electronic device performs the second device authentication process with the second electronic device based on the first connection, and after the second electronic device is authenticated, establishes the data transmission channel with the second electronic device based on the second connection.

14. The device collaboration method of claim 1, wherein, The first electronic device identifies a device state of the second electronic device in response to a second operation of the user on the first button, including: The first electronic device identifies whether the service package to be executed is a collaborative service package in response to the second operation of the user on the first button; When the service package is the collaborative service package, the first electronic device identifies the device state of the second electronic device.

15. The device collaboration method of claim 10, wherein, Also includes: The first electronic device displays the first window in response to a third operation performed by the user on the second button on the first page, the first window being a first area on a second page for displaying device search results, the device search results including the second electronic device, wherein each device search result corresponds to one of the first buttons.

16. The device collaboration method of claim 15, wherein, The device discovery request includes a user account logged in by the second electronic device, and the first electronic device displays the first window in response to a third operation performed by the user on the second button on the first page, including: The first electronic device determines whether the user account information logged in by the first electronic device and the user account information logged in by the second electronic device are the same; If they are the same, the first electronic device displays a first identifier on the second electronic device when displaying the first window.

17. The device collaboration method of claim 13, wherein, Also includes: After the second electronic device passes the first device authentication process, the first electronic device adds device information of the second electronic device to second information, the second information including device information of authenticated devices, and the device information of the authenticated devices including device states of the authenticated devices; The first electronic device displays a third page according to the second information in response to a fourth operation of the user, the third page including an interactive control of the first electronic device and the authenticated device in the first state.

18. The device collaboration method of claim 17, wherein, The first electronic device displays a third page according to the second information in response to a fourth operation of the user, including: The first electronic device acquires a user account logged in by the authenticated device in response to a fourth operation of the user; The first electronic device displays the third page according to the user account information logged in by the first electronic device and the user account logged in by the authenticated device, wherein the third page further includes a second identifier, and the second identifier is located on the interactive control of the authenticated device logged in by the same user account as the first electronic device.

19. An electronic device, comprising: Includes: A processor and a memory; the memory stores program instructions, when the program instructions are executed by the processor, the electronic device executes the device cooperation method of any one of claims 1-18.

Citation Information

Patent Citations

  • Equipment interconnection security authentication system, method and device, server and medium

    CN114866251A

  • Method and apparatus for providing communication service

    US20200404501A1