Device interaction method, system and electronic device

By switching the protocol interface between IoT devices and central devices, the problem of UDP transmission length limitation is solved, effective authentication and data interaction of IoT devices are achieved, and the authentication success rate is improved.

CN119255333BActive Publication Date: 2025-10-03HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410160697.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2025-10-03
Estimated Expiration
2044-02-04

AI Technical Summary

Technical Problem

During the authentication process, IoT devices are unable to effectively transmit data such as public keys and certificate chains due to the transmission length limitation of the UDP protocol, resulting in authentication failure and inability to be added to the central device's trust list, affecting data interaction.

Method used

By switching the protocol interface between the IoT device and the central device, and using the protocol interface that supports larger data capacity for information transmission, the legitimacy and integrity of the certificate chain data can be verified, thereby adding it to the trust list.

Benefits of technology

It achieves effective authentication and data interaction between IoT devices and central devices, reduces the processing burden of resource-constrained devices, and improves the authentication success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119255333B_ABST
    Figure CN119255333B_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the field of terminal technology and provide a device interaction method, system, and electronic device. The method is performed by a first electronic device and includes: receiving a first message broadcast by a second electronic device; the second electronic device is an electronic device associated with the first electronic device, and the first message includes a target device identifier of the second electronic device; in response to the target device identifier having corresponding verification information, determining a target protocol interface for interacting with the second electronic device; and establishing an interaction channel with the second electronic device based on the target protocol interface. In this way, the first electronic device can be used to verify the second electronic device and determine a protocol interface that can interact with the second electronic device, thereby achieving the switching of the protocol interface when the first electronic device interacts with the second electronic device, so that the interaction channel supports the transmission of information with a larger amount of data, which facilitates the second electronic device to transmit information with a larger amount of data for device authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a device interaction method, system, and electronic device. Background Art

[0002] When an IoT device interacts with a central device, the central device can authenticate the IoT device and add it to its trusted list. After authentication, the IoT device can then communicate with the central device and / or other trusted devices as a trusted device.

[0003] During the trust authentication process, IoT devices need to transmit data such as public keys and certificate chains to the central device so that the central device can verify and authenticate the IoT device. Since the interaction between IoT devices and the central device relies on the Constrained Application Protocol over User Datagram Protocol (CoAP over UDP), and the UDP protocol has a limited transmission length, it is not conducive to IoT devices transmitting public keys, certificate chains and other data for trust authentication. As a result, the IoT device fails to authenticate and cannot be added to the central device's trust list, affecting the data interaction between the IoT device and the central device and / or the central device's trusted devices. Summary of the Invention

[0004] The embodiments of the present application provide a device interaction method, system, and electronic device to solve the problem of authentication failure caused by the limitation of protocol transmission length during the authentication process of IoT devices.

[0005] In a first aspect, an embodiment of the present application provides a device interaction method, which is applied to a first electronic device, and the method includes: receiving a first message broadcast by a second electronic device; the second electronic device is an electronic device associated with the first electronic device, and the first message includes a target device identifier of the second electronic device; in response to the target device identifier having corresponding verification information, determining a target protocol interface for interacting with the second electronic device; and establishing an interaction channel with the second electronic device based on the target protocol interface.

[0006] In this way, the first electronic device can be used to verify the second electronic device and determine the protocol interface that can interact with the second electronic device, thereby realizing the switching of the protocol interface when the first electronic device interacts with the second electronic device, so that the interaction channel supports the transmission of information with a larger amount of data, which facilitates the authentication of the second electronic device.

[0007] In one feasible embodiment, the first message also includes information about the protocol interfaces supported by the second electronic device, where the protocol interfaces include a first protocol interface and a second protocol interface. In response to the target device identifier having corresponding verification information, determining the target protocol interface for interaction with the second electronic device includes: searching for target verification information based on the target device identifier; and, in response to finding the target verification information, determining the first protocol interface or the second protocol interface as the target protocol interface based on the protocol interfaces supported by the second electronic device. In this way, the information sent by the second electronic device can be verified to determine the target protocol interface, facilitating subsequent data transmission between the first and second electronic devices.

[0008] In one feasible embodiment, in response to finding the target verification information, based on the protocol interface supported by the second electronic device, the first protocol interface or the second protocol interface is determined as the target protocol interface, including: if the second electronic device supports the second protocol interface, then the second protocol interface is determined as the target protocol interface. In this way, the second protocol interface can be determined as the target protocol interface, so that the interaction channel established through the target protocol interface has a larger data capacity, facilitating the second electronic device to transmit messages with large amounts of data.

[0009] In one feasible embodiment, after determining the second protocol interface as the target protocol interface, the method further includes: receiving a second message sent by the second electronic device; the second message includes certificate chain data corresponding to the second electronic device; and if the certificate chain data is valid and complete, adding the second electronic device to the first list. In this way, the first electronic device can receive the authentication message sent by the second electronic device, thereby verifying it, and after successful authentication, adding the second electronic device to the first list of the first electronic device, thereby facilitating interaction between the second electronic device and the first electronic device or other electronic devices on the first list.

[0010] In one feasible embodiment, after establishing an interaction channel with the second electronic device based on the target protocol interface, the method further includes: closing the interaction channel after the interaction with the second electronic device is completed. In this way, the interaction channel can be closed after data interaction is completed, thereby avoiding loss of the interaction channel between the first electronic device and the second electronic device when no data interaction occurs.

[0011] In one feasible embodiment, after closing the interactive channel, the method further includes: establishing an interactive channel corresponding to the first protocol interface or the second protocol interface in response to a channel establishment instruction from the first electronic device or the second electronic device. In this way, after closing the interactive channel, the first electronic device and the second electronic device can re-establish the interactive channel when data exchange is required.

[0012] In one feasible embodiment, before receiving the first message from the second electronic device, the method further includes: in response to discovering the second electronic device, broadcasting a third message to the second electronic device; receiving a registration result from the second electronic device; the registration result including a failure message or a success message, the success message including registration data of the second electronic device; and in response to receiving the success message, updating the device registration information in the first electronic device based on the registration data. In this way, the second electronic device can be registered and the registration result received, thereby updating the device registration information in the first electronic device, facilitating subsequent interactive verification between the first electronic device and the second electronic device.

[0013] In one feasible embodiment, the success message also includes a target device identifier corresponding to the second electronic device. After receiving the first message from the second electronic device, the method further includes: searching for registration data corresponding to the target device identifier in the device registration information based on the target device identifier; and in response to finding the registration data corresponding to the target device identifier, obtaining verification information based on the registration data. In this way, the corresponding registration data can be found in the first electronic device to verify the second electronic device.

[0014] In a second aspect, embodiments of the present application also provide a device interaction method, applicable to a second electronic device, comprising: broadcasting a first message; the first message including a target device identifier of the second electronic device; and, in response to the first electronic device determining a target protocol interface, establishing an interaction channel with the first electronic device based on the target protocol interface. In this way, the second electronic device can send a message to the first electronic device, causing the first electronic device to verify information about the second electronic device, thereby enabling interaction between the first and second electronic devices.

[0015] In one feasible embodiment, before broadcasting the first message, the method further includes: receiving a third message including user identification information of the first electronic device; generating a fourth message based on the user identification information and device information, wherein the device information includes a target device identification and verification information of the second electronic device; and sending the fourth message to a server to register the second electronic device in association with the first electronic device. In this way, the server can be used to register the second electronic device in association with the first electronic device, enabling the first electronic device to perform subsequent authentication of the second electronic device.

[0016] In one feasible embodiment, the target protocol interface is a second protocol interface. After establishing an interactive channel with the first electronic device according to the target protocol interface, the method further includes: generating a second message, the second message including certificate chain data corresponding to the second electronic device; and sending the second message to the first electronic device via the interactive channel. In this way, data can be transmitted via the interactive channel with a larger data capacity, allowing the second electronic device to smoothly send authentication data to the first electronic device, thereby avoiding protocol transmission length limitations during the authentication process.

[0017] In a third aspect, an embodiment of the present application also provides a device interaction system, the system comprising: a first electronic device; a second electronic device associated with the first electronic device; wherein the second electronic device is configured to: broadcast a first message; the first message includes a target device identifier of the second electronic device; the first electronic device is configured to: receive the first message broadcast by the second electronic device; in response to the target device identifier having corresponding verification information, determine a target protocol interface for interacting with the second electronic device; based on the target protocol interface, establish an interaction channel with the second electronic device; the second electronic device is further configured to: in response to the first electronic device determining the target protocol interface, establish an interaction channel with the first electronic device according to the target protocol interface.

[0018] In a feasible embodiment, the system also includes a server; the first electronic device is further configured to: broadcast a third message to the second electronic device in response to discovering the second electronic device; the third message includes user identification information of the first electronic device; the second electronic device is further configured to: receive the third message; generate a fourth message based on the user identification information and device information; the device information includes the target device identification and verification information of the second electronic device; send a fourth message to the server to associate and register the second electronic device with the first electronic device; the server is configured to: receive the fourth message, and associate and register the second electronic device with the first electronic device based on the fourth message; and send the registration result to the first electronic device and the second electronic device.

[0019] In a fourth aspect, an embodiment of the present application also provides an electronic device, comprising: a processor; a memory; the memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes any one of the device interaction methods in the technical solution of the first aspect, or any one of the device interaction methods in the technical solution of the second aspect.

[0020] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes any one of the device interaction methods in the technical solution of the first aspect, or any one of the device interaction methods in the technical solution of the second aspect.

[0021] It can be understood that the beneficial effects of the third to fifth aspects mentioned above can be found in the relevant descriptions of the first and second aspects mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a schematic diagram of the connection between an IoT device and a central device;

[0023] Figure 2 This is a structural diagram of a central device in an embodiment of the present application;

[0024] Figure 3 This is a schematic diagram of the layered architecture of a central device software system in an embodiment of the present application;

[0025] Figure 4 This is a schematic diagram of a process for registering a second electronic device in an embodiment of the present application;

[0026] Figure 5 This is a schematic diagram of a display of a first electronic device scanning and discovering a second electronic device in an embodiment of the present application;

[0027] Figure 6 This is a flow chart of a device interaction method in an embodiment of the present application;

[0028] Figure 7 This is a flow chart of a device interaction method in an embodiment of the present application;

[0029] Figure 8 This is a flow chart of the execution process of step S130 in the embodiment of the present application;

[0030] Figure 9 This is a flow chart of a device authentication process in an embodiment of the present application;

[0031] Figure 10 This is a schematic diagram of a device interaction system according to an embodiment of the present application;

[0032] Figure 11 This is a schematic diagram of another device interaction system in an embodiment of the present application;

[0033] Figure 12 This is a schematic structural diagram of a chip system in an embodiment of the present application;

[0034] Figure 13 This is a structural diagram of a device interaction apparatus in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The following will clearly describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, other embodiments obtained by ordinary technicians in this field without making any creative work are all within the scope of protection of this application.

[0036] Hereinafter, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified with "first," "second," etc., may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0037] In addition, in this application, directional terms such as "upper" and "lower" are defined relative to the orientation of the components in the drawings. It should be understood that these directional terms are relative concepts. They are used for relative description and clarification, and they can change accordingly according to changes in the orientation of the components in the drawings.

[0038] To facilitate the technical solution of the application, some concepts involved in this application are first explained below.

[0039] The User Datagram Protocol (UDP) is a connectionless transport layer protocol. UDP provides applications with a way to send encapsulated IP packets without establishing a connection and without guaranteeing the reliability of transmitted packets. While it offers the advantages of low latency and high data transmission efficiency, it can only be used to transmit small amounts of data at a time.

[0040] The Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. Unlike UDP, TCP relies on connections between devices to achieve reliable end-to-end byte stream transmission. Compared to UDP, TCP offers higher data transmission reliability, can transmit more data, and performs data validation and retransmission to prevent data loss and errors.

[0041] The Constrained Application Protocol (CoAP) is an IoT protocol designed for resource-constrained electronic devices, which have limited memory and computing power. CoAP allows these devices to establish communication relationships, enabling data transfer and control.

[0042] Constrained Application Protocol over User Datagram Protocol (CoAP over UDP) is a CoAP that uses UDP at the transport layer to implement data transmission between devices, allowing data exchange between devices without requiring a connection.

[0043] CoAP over TCP (Constrained Application Protocol over Transmission Control Protocol) is a CoAP that implements data transmission between devices by applying TCP at the transport layer. Before data exchange between devices, a connection must be established to enable data transmission.

[0044] The Internet of Things (IoT) refers to the connection of any object to the network through information sensing devices and agreed protocols. Objects exchange and communicate information through information transmission media to achieve intelligent identification, positioning, tracking, supervision and other functions.

[0045] With the continuous development of IoT technology and communication technology, more and more external devices can be connected to IoT. For example, electronic devices such as TVs, speakers, routers, refrigerators, etc. in smart homes can all be connected to IoT as external devices, interacting with the user's central device, and then realizing information exchange and control of IoT devices through the central device.

[0046] The central device may be a mobile phone, tablet computer, handheld computer, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, wearable device, or other device that can be held / operated with one hand. The central device includes but is not limited to devices running iOS, Android, Microsoft, Harmony OS, or other operating systems. The IoT device may be any electronic device equipped with memory and processor, such as a smart TV, smart speaker, router, smart refrigerator, lighting equipment, sensor equipment, heating equipment, etc. The IoT device may be a smart device in any system, and this application does not limit the specific type of IoT device.

[0047] Figure 1 A schematic diagram of the connection between an IoT device and a central device.

[0048] like Figure 1 As shown, the central device can be a mobile phone 10, and IoT devices can include a smart TV 21, a smart switch 22, and a smart speaker 23. For IoT devices with screens, such as smart TV 21, mobile phone 10 can control smart TV 21 by installing the corresponding app for smart TV 21, or by installing an application that can control IoT devices, such as the Smart Space app. Before mobile phone 10 can control smart TV 21 through the application, smart TV 21 needs to exchange information with mobile phone 10, allowing a certain degree of device information exchange between mobile phone 10 and smart TV 21 to lay the foundation for the subsequent establishment of a connection channel.

[0049] For example, the app in the mobile phone 10 may have an add device function. When the user clicks the add device control, the mobile phone 10 may begin a device search. After the smart TV 21 is turned on, the mobile phone 10 may search for the device by searching for the signal broadcast by the smart TV 21, for example, by searching for the smart TV 21 through a Bluetooth (BT) signal or a wireless fidelity (Wi-Fi) signal. The user may then select the smart TV 21 on the mobile phone 10, and the mobile phone 10 will send a connection establishment request to the smart TV 21. At this time, the smart TV 21 may generate and display an identification code for authentication, such as a PIN code. After the user enters the PIN code into the mobile phone 10, the mobile phone 10 can establish a connection with the smart TV 21.

[0050] In some embodiments, since the smart TV 21 is provided with a display screen capable of displaying information, the user can also directly control the smart TV 21 to establish a wired or wireless connection with the router, so that when the mobile phone 10 accesses the network through the same router, the user can associate and control the smart TV 21 connected to the same network through the mobile phone 10.

[0051] In another embodiment, the smart TV 21 includes a display screen and has the ability to access the Internet. On this basis, an application can be installed on the smart TV 21 to control the smart TV 21 and the mobile phone 10 to log in to the same account, and the association between the two devices is achieved through the account, thereby facilitating the establishment of a connection between the mobile phone 10 and the smart TV 21.

[0052] For devices that cannot display information through the screen, such as the smart switch 22 and the smart speaker 23, during the interaction with the mobile phone 10, the user needs to control the mobile phone 10 throughout the process to achieve the interaction between the two, and the interaction method is relatively simple. For example, the mobile phone 10 can discover the device through the broadcast signal after the smart switch 22 and the smart speaker 23 are turned on, and send a control signal to the smart switch 22 and the smart speaker 23 for control.

[0053] If the user wants to change the central device that controls the IoT device, for example, replace the smartphone 10 with a tablet computer, it is necessary to re-establish the connection between the tablet computer and the IoT device through one of the above methods. It can be seen that the process of switching control between different central devices is relatively cumbersome and not flexible enough.

[0054] In some embodiments, the display screen and network access capability of the smart TV 21 can be used to associate with a central device through an account or other associated data, and added to the trust list of the central device, thereby also associating with other devices in the trust list.

[0055] Because devices on the trusted list share the same association data, for example, they are linked to the same account, they can seamlessly communicate with other devices on the trusted list using the same association data. For example, if a mobile phone 10 is the central device and a tablet computer is on its trusted list, after a smart TV 21 is added to the trusted list by associating it with an account, the tablet computer can directly establish an interaction channel with the smart TV 21 using the association data in the trusted list, reducing the number of operations required by the user to change central devices.

[0056] However, in the scenario where the IoT device is a resource-constrained electronic device, since resource-constrained electronic devices, such as smart switches 22, smart speakers 23 and other electronic devices, do not have screens or do not have screens that can display batch data, and their memory space and computing power are relatively limited, they usually do not have accounts and cannot log in, and they cannot display data through the screen. Therefore, resource-constrained electronic devices cannot be independently added to the trust list of the central device.

[0057] In addition, since IoT devices rely on the CoAP over UDP protocol to provide data transmission during interaction with central devices, and the UDP protocol can only transmit a small amount of data at a time, has a transmission length limit and cannot ensure the integrity of the transmitted data, IoT devices cannot use the CoAP over UDP protocol to transmit and verify data to the central device, and cannot be added to the central device's trust list.

[0058] Based on the above problems, the embodiments of the present application provide a device interaction method, which enables the central device to verify the information broadcast by the IoT device. When the IoT device needs to be added to the trust list, the protocol interface for interactive application between the central device and the IoT device is switched, so that the IoT device can use the switched protocol interface to transmit large amounts of data to complete the operation of adding to the central device's trust list. Most of the data processing and other work in this process is set up in the central device, thereby reducing the information that resource-constrained IoT devices need to process and enabling resource-constrained IoT devices to be added to the central device's trust list.

[0059] It should be understood that the central device used in the embodiments of the present application may be a mobile phone, tablet computer, handheld computer, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, wearable device, or other device that can be held / operated with one hand. The embodiments of the present application do not impose any particular restrictions on the specific form / type of the central device. The aforementioned central device includes but is not limited to devices running iOS, Android, Microsoft, Harmony OS, or other operating systems.

[0060] The IoT devices in the embodiments of this application refer to resource-constrained electronic devices, such as refrigerators, speakers, lighting equipment, and heating equipment. These devices have certain data processing capabilities and a small amount of data storage space, but lack screens capable of displaying batch data and are unable to independently log in to an account and retrieve data for verification. The IoT devices to which the device interaction methods in the embodiments of this application apply can also be other smart devices in any system, and this application does not limit the specific type of IoT device.

[0061] Figure 2 This is a structural diagram of a central device in an embodiment of the present application.

[0062] For example, taking the central device as a mobile phone, refer to Figure 2 As shown, the central device may include a processor 110, an external memory interface 120, an internal memory 121, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a display 193, a subscriber identification module (SIM) card interface 194, and a camera 195. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0063] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0064] The controller can be the nerve center and command center of the central equipment. The controller can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.

[0065] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

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

[0067] The external memory interface 120 can be used to store computer executable program code, which includes instructions. The external memory interface 120 may include a program storage area and a data storage area. The program storage area may store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the central device (such as audio data, a phone book, etc.). In addition, the external memory interface 120 may include one or more storage units, such as volatile memory (volatile memory), such as dynamic random access memory (DRAM), static random access memory (SRAM), etc.; and non-volatile memory (NVM), such as read-only memory (ROM), flash memory, etc. The processor 110 executes various functional applications and data processing of the central device by running instructions stored in the external memory interface 120 and / or instructions stored in the memory provided in the processor.

[0068] The internal memory 121 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The RAM can be directly read and written by the processor 110 and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. The NVM can also store executable programs and user and application data, and can be pre-loaded into the RAM for direct reading and writing by the processor 110.

[0069] The charging management module 140 is configured to receive charging input from a power supply device (e.g., a charger, laptop charger, etc.). The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input via a wireless charging coil on a central device.

[0070] While charging the battery 142, the charging management module 140 can also power the central device through the power management module 141. Specifically, the battery 142 can be composed of multiple batteries connected in series. The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110.

[0071] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the display 193, the camera 195, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery voltage, current, battery cycle count, and battery health status (leakage, impedance). In other embodiments, the power management module 141 can also be provided in the processor 110.

[0072] The wireless communication function of the central device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem and baseband processor.

[0073] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the central device can be used to cover a single or multiple communication frequency bands. In some embodiments, the antennas can be used in conjunction with tuning switches, and different antennas can be reused to improve antenna utilization.

[0074] The mobile communication module 150 can provide solutions for wireless communications, including 2G / 3G / 4G / 5G, applied to central equipment. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter, amplify, and process the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0075] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the 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. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 193. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0076] The wireless communication module 160 may include a Wi-Fi module, a Bluetooth module, a GNSS module, a near field communication (NFC) module, an infrared (IR) module, and the like. The wireless communication module 160 may be one or more devices integrating at least one of the above modules. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be transmitted from the processor 110, modulate the signals, amplify the signals, and convert them into electromagnetic waves for radiation via the antenna 2.

[0077] In an embodiment of the present application, the wireless communication module 160 can also scan, discover and receive broadcast messages after the IoT device is started through antenna 2. At the same time, the wireless communication module 160 can also broadcast messages through antenna 2, so that the electronic device 100 can interact with the IoT device through the CoAP over UDP protocol without establishing a connection.

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

[0079] A touch sensor, also known as a "touch device," can be coupled to the display screen 193, thereby forming a touch screen, also known as a "touch screen," comprised of the touch sensor and the display screen 193. The touch sensor is used to monitor touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the monitored touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 193. In other embodiments, the touch sensor can also be disposed on the surface of the central device, at a location different from that of the display screen 193.

[0080] The pressure sensor is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor can also be coupled to the display screen 193. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. When a touch operation is applied to the display screen 193, the central device monitors the intensity of the touch operation based on the pressure sensor. The central device can also calculate the location of the touch based on the monitoring signal of the pressure sensor. In some embodiments, touch operations acting on the same touch location but with different touch operation intensities can correspond to different operation instructions.

[0081] SIM card interface 194 is used to connect a SIM card. A SIM card can be inserted into or removed from SIM card interface 194 to connect to and disconnect from the central device. The central device may support one or more SIM card interfaces. SIM card interface 194 can support Nano SIM cards, Micro SIM cards, and SIM cards. Multiple cards can be inserted into the same SIM card interface 194 simultaneously. SIM card interface 194 is also compatible with external memory cards. The central device interacts with the network through the SIM card to implement functions such as call and data communications. One SIM card corresponds to one user number.

[0082] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the central device. In other embodiments of the present application, the central device may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods. Figure 2 The following is only an example of the central device being a mobile phone. If the central device is a tablet computer, handheld computer, PC, PDA, wearable device (such as smart watch, smart bracelet) or other device forms, the structure of the central device may include more than Figure 2 The structure shown in the figure is less than Figure 2 More structures are shown in the figure, which are not limited here.

[0083] It is understandable that, in general, the realization of the central device function requires not only hardware support but also software cooperation. The software system of the central device can adopt a layered architecture, event-driven architecture, micro-kernel architecture, micro-service architecture, or cloud architecture. Taking the system as an example, the software structure of the central device is illustrated.

[0084] Figure 3 This is a schematic diagram of the layered architecture of a central device software system in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and divisions of labor. The layers communicate with each other through software interfaces (such as APIs).

[0085] In some examples, such as Figure 3 As shown, in the embodiment of the present application, the software of the central device is divided into five layers, from top to bottom: the application layer, the framework layer, the system library and Android runtime (Android runtime), the HAL layer (hardware abstraction layer), and the driver layer (or kernel layer). Among them, the system library and Android runtime can also be called the local framework layer or native layer, and the framework layer can also be called the application framework layer.

[0086] The application layer can include a series of applications. Figure 3 As shown, the application layer may include applications (APPs) such as camera, gallery, calendar, map, WLAN, Bluetooth, music, video, short message, call, navigation, and instant messaging.

[0087] The framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions or services. For example, the application framework layer may include an activity manager, a window manager, a content provider, an audio service, a view system, a telephony manager, a resource manager, a notification manager, a package manager, etc., but the embodiments of the present application do not impose any restrictions on this.

[0088] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0089] Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0090] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0091] The phone manager is used to provide communication functions for the central device. For example, the phone manager can manage the call status of the call application (including initiation, connection, and hang up).

[0092] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0093] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the Notification Manager can be used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting beeps, causing the device to vibrate, or flashing indicator lights.

[0094] Package Manager in The system is used to manage application packages. It allows applications to obtain detailed information about installed applications and their services, permissions, etc. The package manager is also used to manage events such as application installation, uninstallation, and upgrades.

[0095] The system library can include multiple functional modules. For example: surface manager, media library, OpenGL ES, SGL, etc. The surface manager is used to manage the display subsystem and provides 2D and 3D layer fusion for multiple applications. The media library supports playback and recording of various common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. SGL is the drawing engine for 2D drawing.

[0096] The Android runtime consists of core libraries and the ART virtual machine. The Android runtime is responsible for scheduling and management of the Android system. The core libraries consist of two parts: one for Java-based functions and the other for the Android core library. The application layer and application framework layer run in the ART virtual machine. The ART virtual machine executes Java files from the application layer and application framework layer as binary files. The ART virtual machine is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0097] The HAL layer is an interface layer located between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable across multiple platforms. The HAL layer provides a standard interface to display device hardware capabilities to the higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as: audio HAL audio module, bluetooth HAL Bluetooth module, camera HAL camera module (also known as camera HAL or camera hardware abstraction module), sensors HAL sensor module (or Isensor service, sensor service), wireless fidelity HAL Wi-Fi module, etc.

[0098] The kernel layer is the layer between hardware and software. It includes at least display drivers, camera drivers, audio drivers, sensor drivers, battery drivers, Wi-Fi drivers, and more, though this application does not limit these. Specifically, sensor drivers may include drivers for each sensor included in the central device, such as a pressure sensor driver.

[0099] For example, when interacting with IoT devices, the central device can use a Wi-Fi module and a Wi-Fi driver to implement data exchange with the IoT device. In the embodiments of this application, receiving and sending signals through the Wi-Fi module and Wi-Fi driver is only one feasible implementation method. This application does not limit the modules and drivers used when the central device interacts with IoT devices.

[0100] In the embodiments of the present application, the application layer includes applications that can be divided into external-device apps and internal-device apps. External-device apps are apps installed in the application layer on the central device through an installation package or other means, such as instant messaging and navigation apps. Internal-device apps are apps built into the application layer on the central device and used to implement different functions, such as camera, gallery, calendar, WLAN, Bluetooth, notification, and other apps.

[0101] It should be understood that to implement multiple functions, an off-device app can call multiple on-device apps to implement its functions. For example, music software within an off-device app can call on on-device apps such as Music and Notification to implement music playback and message notification functions. For another example, a camera app within an off-device app can call on on-device apps such as Camera, Gallery, and Notification to implement image capture, editing, and message notification functions.

[0102] like Figure 3 As shown, in order to implement the function of interacting with IoT devices, the application layer in the embodiment of the present application also includes an external device manager Nearby and a device management platform. Nearby is an on-device app that provides the central device with the function of interacting with external devices, while the device management platform is an off-device app that provides the central device with functions such as displaying, managing, and controlling external devices. It should be noted that the device management platform can be an application for providing external device management, such as the Smart Space app.

[0103] Furthermore, when using Nearby for interaction, the central device may not display the corresponding information on the main interface. Instead, the central device may implement the interaction process between the central device and the external device by running in the background, and the user interface (UI) may be the same as the default UI of the central device. When using the device management platform to interact with and manage external devices, the central device needs to display the operation controls and processes in the main interface corresponding to the device management platform. At the same time, its UI may be the same as the default UI of the central device, or it may be different from the default UI of the central device. This application does not impose any restrictions on this.

[0104] It should be noted that since the device management platform is an off-end APP, IoT devices can only interact with central devices through the device management platform, but cannot use the device management platform to join the central device's trust list. Nearby relies on the CoAP over UDP protocol to interact with IoT devices. At this time, due to the transmission length limit of the UDP protocol, IoT devices cannot be successfully added to the central device's trust list. Therefore, in the embodiment of the present application, the IoT device is verified by Nearby and when the IoT device needs to be added to the trust list, the protocol port for interacting with the IoT device is switched to achieve smooth interaction with the IoT device, avoiding authentication failure due to transmission length limitations during the authentication process.

[0105] Based on the above Figure 2 The structure of the central device shown in Figure 3 The software architecture shown in the figure is further described below in conjunction with the accompanying drawings and application scenarios to specifically illustrate the device interaction method provided in the embodiment of the present application. In the device interaction method in the embodiment of the present application, the first electronic device is the central device in the aforementioned embodiment, such as a mobile phone, tablet computer and other electronic devices, and the second electronic device is an external device of the central device. In some embodiments, the external device is a resource-constrained IoT device, such as a refrigerator, a speaker, a lighting device, a heating device and other electronic devices. Taking the first electronic device as a smart phone as an example, the specific structure of the first electronic device in this application is the same as that of the aforementioned electronic device 100, and this application will not elaborate on it here.

[0106] When a first electronic device and a second electronic device interact, to improve the security and stability of the interaction, the first and second electronic devices may exchange data through a server. Specifically, before the second electronic device controls and interacts with the first electronic device, the first and second electronic devices may register with the server. The registration process is described below based on the capabilities of the first and second electronic devices.

[0107] In an embodiment of the present application, the first electronic device is an electronic device with an account login capability, and can register the device with the server by relying on the account login function of the first electronic device itself. Taking the first electronic device as a mobile phone as an example, the process can be: when the user account is logged in for the first time on the mobile phone, the logged-in user account can be sent to the server. The server assigns a registration ID to the mobile phone and returns the registration ID to the mobile phone. The mobile phone can then apply for registration with the server based on the registration ID. After the registration is completed, the server can assign a device ID to the electronic device, which is used to identify the mobile phone together with the user account.

[0108] Exemplarily, when a user registers the first electronic device, he or she may log in using a user account (which may be a user's mobile phone number, email address, or other user name) and password, or may log in using a user's mobile phone number and verification code. That is, after registering an account, the user may log in using a variety of information under the account. Assuming that the user's mobile phone number is a unique identifier, and the mobile phone number is the credential for subsequent registration with the server, when the user logs in using a login method other than a mobile phone number and password, the first electronic device can find the corresponding mobile phone number through information other than the mobile phone number, and send the mobile phone number to the server for registration; when the user logs in using a login method other than the mobile phone number and verification code, the first electronic device can directly send the mobile phone number to the server for registration.

[0109] However, the second electronic device cannot register directly due to its limited storage space and computing power, and lacks the function of account login. Therefore, the second electronic device needs to register with the server with the help of the first electronic device. Figure 4 FIG. 1 is a flow chart of a second electronic device registration process in an embodiment of the present application. Figure 4 As shown, the registration process of the second electronic device may include:

[0110] S100: Generate verification information.

[0111] After the second electronic device is started or reset, it can generate verification information based on the state of the device after startup. In some embodiments, the verification information may include an AuthCode generated by the second electronic device. Based on the verification information, the first electronic device can determine the protocol interface of the second electronic device during subsequent interaction, thereby facilitating data exchange between the two.

[0112] S101: In response to discovering a second electronic device, broadcast a third message to the second electronic device.

[0113] The first electronic device can detect the second electronic device that has been started through signal scanning or other methods. If the second electronic device needs to be registered, the first electronic device can broadcast a third message to the second electronic device to help it register. In an embodiment of the present application, the third message includes user identification information of the first electronic device, where the user identification information can be an identification code of a login account of a device management platform in the first electronic device, or a unique device identification code of the first electronic device or other identification information that can represent the first electronic device, or a combination of the identification code of the login account and the unique device identification code of the first electronic device. This application does not limit the specific type of information in the user identification information.

[0114] In an embodiment of the present application, in order to facilitate the first electronic device to discover the second electronic device, the second electronic device can periodically broadcast to the outside world after being started, so that the first electronic device can quickly discover the started second electronic device.

[0115] Figure 5 This is a display diagram of a first electronic device scanning and discovering a second electronic device in an embodiment of the present application.

[0116] It should be noted that, since the second electronic device allows the first electronic device to discover it by broadcasting to the outside world, there may be a scenario where the first electronic device scans and discovers the second electronic device of another user or the discovered second electronic device does not need to be registered. In this case, sending the third message to the second electronic device carries the risk of information leakage. Therefore, in some embodiments, such as Figure 5 As shown, the user can operate the first electronic device to scan the second electronic device.

[0117] like Figure 5 As shown in (a), the first electronic device can first display the first interface 510 of the device management platform, and the first interface 510 can display the electronic devices that can be connected to the first electronic device. When the user needs to add a device, he can click the add control 511 in the first interface 510 to display the multi-select interface 512 on the first interface 510. By clicking the add device control on the multi-select interface 512, the user can enter the Figure 5 The scanning interface 520 shown in (b) is shown in FIG.

[0118] like Figure 5 As shown in (b), the scanning page 520 may include a start scanning control 521, a manual add control 522 and a return control 523. When the user clicks the start scanning control 521, the scanning page 520 may display "Scanning", thereby prompting the user that the first electronic device is in a scanning state.

[0119] After the first electronic device scans and finds the second electronic device, or the user clicks the return control 523, the user can return to the first interface 510. Figure 5 As shown in (c), if a second electronic device is found during scanning, the message of finding the second electronic device can be displayed on the first interface 510 through the display control 513, and then the user confirms whether a third message needs to be broadcast to the found second electronic device.

[0120] Furthermore, since the first electronic device will not scan and receive the broadcast signal of the second electronic device before the scanning function is turned on, the first electronic device cannot discover the second electronic device that has been started before the scanning function of the first electronic device is turned on. Therefore, in order to discover the second electronic device that has been started, the user can also manually start the scanning function of the first electronic device, thereby discovering the second electronic device by signal scanning. Optionally, the protocol used for transmitting information during the registration process between the first electronic device and the second electronic device can be the CoAP protocol or other types of protocols, and this embodiment does not limit this.

[0121] It should be understood that Figure 5 The process of the first electronic device scanning to obtain the second electronic device shown in the figure is only a feasible implementation method in this application, and this application does not limit the specific process of scanning to the second electronic device.

[0122] S102: Receive a third message.

[0123] After sending the third message, the first electronic device can parse the third message to obtain the user identification information therein. In some embodiments, to reduce the number of broadcasts by the first electronic device, after receiving the third message, the second electronic device can broadcast a reply message to the first electronic device. After receiving the reply message, the first electronic device can stop broadcasting the third message, thereby avoiding the increased energy consumption caused by the first electronic device continuously broadcasting the third message.

[0124] In order to enable the second electronic device to process the received messages and send data, the second electronic device may be provided with a connection tool MagicLink SDK (MagicLink Software Development Kit). Through the connection tool, the second electronic device can obtain, generate and perform other operations on its own information. At the same time, it can also parse the information sent by the first electronic device, so that the second electronic device can send, receive and process messages, thereby providing a basis for subsequent device interaction.

[0125] S103: Generate a fourth message based on the user identification information and the device information.

[0126] After parsing and obtaining the user identification information, the second electronic device may generate a fourth message for registration based on the user identification information and the device information of the second electronic device.

[0127] Among them, the device information may include the target device identification and verification information of the second electronic device. For example, the target device identification includes but is not limited to the device name, unique device identifier (UDID), internet protocol address (IP address), media access control address (MAC address), etc. The specific type of target device identification is not limited in this application.

[0128] The verification information is information generated by the second electronic device based on the status after the device is started. The verification information may include a verification code (AuthCode) generated by the second electronic device. Through the verification information, the first electronic device can determine the protocol interface of the second electronic device in the subsequent interaction process, thereby facilitating data interaction between the two.

[0129] S104: Send a fourth message to the server to associate and register the second electronic device with the first electronic device.

[0130] After generating the fourth message, the second electronic device can send the fourth message to the server, thereby registering with the server. Because the fourth message includes the user identification information of the first electronic device, when the second electronic device registers with the server, the user identification information can be used to associate the second electronic device with the first electronic device, thereby facilitating subsequent interaction between the second electronic device and the first electronic device.

[0131] S105: Register the second electronic device and send the registration result of the second electronic device to the first electronic device and the second electronic device respectively.

[0132] After receiving the fourth message, the server can parse the fourth message to obtain the user identification information and device information therein, and then register the device information of the second electronic device to the account corresponding to the user identification information or the device registration information of the first electronic device through the user identification information to complete the process of associating and registering the second electronic device with the first electronic device.

[0133] After registering the second electronic device, the server will generate a registration result for the second electronic device. It should be understood that the registration result is one of two results, namely, a success message and a failure message. Among them, the success message represents that the second electronic device corresponding to the device information in the fourth message is successfully associated and registered with the first electronic device corresponding to the user identification information, while the failure message has multiple possibilities, such as the registration information of the first electronic device corresponding to the user identification information does not exist in the server, the second electronic device has been associated and registered with the first electronic device corresponding to other user identification information, the second electronic device has been associated and registered with the first electronic device corresponding to the user identification information, etc. This application does not limit the specific reason for the registration failure in the failure information.

[0134] After completing the registration and generating the registration result, the server may send the registration result to the first electronic device and the second electronic device respectively, so as to notify the first electronic device and the second electronic device of the registration result of the second electronic device.

[0135] S106: Receive the registration result of the second electronic device.

[0136] In some embodiments of the present application, if the registration result is a failure message, and the failure message may include the reason for the registration failure, the first electronic device may display the reason for the registration failure on the screen of the first electronic device after receiving the registration result. The user may operate the first electronic device and the second electronic device based on the reason for the registration failure, and re-register or stop the device registration process.

[0137] In another embodiment of the present application, the success information may include the registration data of the second electronic device. When the registration result received by the first electronic device is a success message, the first electronic device can synchronously receive the registration data of the second electronic device in the server. The registration data may include the device information of the second electronic device and its association with the first electronic device. At the same time, the registration result includes the registration data, and the device registration information in the first electronic device can be updated.

[0138] It should be understood that in some embodiments, the registration result can also be sent separately from the registration data of the second electronic device. After the server sends the registration result of the second electronic device to the first electronic device and the second electronic device, if the registration result sent is a success message, the server will send the registration data of the second electronic device to the first electronic device to send the registration result and registration data separately.

[0139] S107: In response to receiving the success information, update the device registration information in the first electronic device according to the registration data.

[0140] After receiving the success message, the first electronic device can parse the success message to obtain the registration data of the second electronic device, and then update the device registration information cached in the first electronic device. For example, the device registration information in the first electronic device may include the registration data of all second electronic devices that are associated with the first electronic device. Therefore, after a second electronic device is associated with the first electronic device and registered, the first electronic device can update the device registration information using the registration data sent by the server.

[0141] Furthermore, due to the limitations of the transmission protocol applied by the second electronic device, the data it can transmit has a transmission length limit, so the success information sent to the second electronic device does not include the registration data of the second electronic device, thereby improving the efficiency of the server in sending information to the second electronic device.

[0142] In some embodiments, the success information sent by the server to the first electronic device may not include the registration data of the second electronic device. After receiving the registration success information, the first electronic device sends a registration data request instruction to the server through its own user identification information, thereby calling all registration data corresponding to the user identification information in the server, and then synchronously updating the device registration information in the first electronic device through these registration data.

[0143] It should be noted that in some embodiments, due to the limited information processing capability of the second electronic device, the process of the second electronic device generating the fourth message and sending it directly to the server will be affected by the information processing capability, and the response speed will be slow.

[0144] Therefore, in some embodiments of the present application, in step S102, after receiving the third message, the second electronic device can generate a corresponding reply message based on the device information and send it to the first electronic device via broadcast. The device information of the second electronic device is the same as the device information in step S103, and this application will not repeat it here.

[0145] After receiving the reply message, the first electronic device can parse the reply message to obtain the device information of the second electronic device. After obtaining the device information, it can execute step S103 in combination with the user identification information of the first electronic device to generate a fourth message for registering the second electronic device. The first electronic device then executes step S104 through a connection with the server to send the fourth message to the server, thereby realizing the association registration of the second electronic device with the first electronic device. The implementation method of the above embodiment is only a feasible implementation method in the embodiment of this application. The present application does not limit the device that sends a message to the server for registration.

[0146] Figure 6This is a flow chart of a device interaction method in an embodiment of the present application. Figure 7 This is a flowchart of a device interaction method in an embodiment of the present application.

[0147] After the second electronic device is registered, there is a certain correlation between the first electronic device and the second electronic device, and then in the process of interaction, the interaction between the devices can be controlled through the correlation information. Figure 6 and Figure 7 As shown, the device interaction method in the embodiment of the present application includes:

[0148] S110: Broadcasting a first message.

[0149] The first message includes the target device identifier of the second electronic device. The second electronic device can broadcast the first message via the CoAP protocol. It should be understood that the purpose of the second electronic device broadcasting the first message is to provide the first electronic device with its own target device identifier before interaction, so that the first electronic device can use the target device identifier to search for registration data corresponding to the target device identifier in the device registration information cached within it.

[0150] S120: Receive a first message broadcast by a second electronic device.

[0151] After receiving the first message, the first electronic device can parse the first message to obtain the target device identifier included therein, so that the first electronic device can perform subsequent operations based on the target device identifier. It should be understood that the second electronic device cannot interact with the first electronic device by logging into an account or other means. In the embodiment of the present application, the second electronic device needs to send the first message in the form of broadcasting the first message to the outside world through the CoAP protocol so that it can be scanned and discovered by the first electronic device, and at the same time send the first message to the first electronic device.

[0152] In order to accurately search the registration data of the second electronic device, it is necessary to identify the second electronic device through a unique identifier. As can be seen from the content of the above embodiments, when the second electronic device is registered, a unique device identification code or information such as the IP address or MAC address of the second electronic device can be used as the target device identifier, so that the corresponding information can be found in the device registration information of the first electronic device through the target device identifier.

[0153] Exemplarily, the target device identifier may be a unique device identification code of the second electronic device. The target device identifier may be used to enable the first electronic device to find the corresponding registration data and other information of the second electronic device in the registered device information of the first electronic device by searching for the target device identifier after the second electronic device is associated and registered with the first electronic device, thereby facilitating device identification by the first electronic device.

[0154] The aforementioned implementation method of using a unique device identification code as an identifier for identifying the second electronic device is only a feasible implementation method in this application, and this application does not limit the specific content of the target device identifier.

[0155] In some embodiments of the present application, if the first electronic device updates the device registration information cached in the first electronic device through the registration data of the second electronic device after the first electronic device completes registration with the second electronic device, then after receiving the first message, the target device identifier obtained by parsing can be used to search for the registration data corresponding to the target device identifier in the device registration information, and after finding the registration data corresponding to the target device identifier, verification information can be obtained based on the registration data.

[0156] S130: In response to the target device identifier having corresponding verification information, determining a target protocol interface for interacting with the second electronic device.

[0157] After receiving the first message, the first electronic device can parse the first message to obtain the data content contained therein. In the embodiment of the present application, the first message includes a target device identifier, so after parsing, the first electronic device can obtain the target device identifier corresponding to the second electronic device that sent the first message.

[0158] Taking the information in the target device identifier as a unique device identification code as an example, after obtaining the unique device identification code, the first electronic device can find the verification information corresponding to the unique device identification code by searching for the unique device identification code corresponding to each second electronic device in the device registration information, and then determine the target protocol interface for interaction between the first electronic device and the second electronic device through the verification information found.

[0159] Since data interaction through different protocols requires the establishment of interaction channels through different protocol interfaces, the first electronic device can control the switching of the protocol interface of the interaction channel with the second electronic device only when the second electronic device has a corresponding protocol interface.

[0160] Therefore, in some embodiments of the present application, the first message may also include information about the protocol interface supported by the second electronic device, and the protocol interface includes a first protocol interface and a second protocol interface. It should be understood that the second electronic device often applies the CoAP protocol during the interaction with the first electronic device. The protocol interface that the first electronic device controls to switch is the protocol interface of the CoAP protocol at the transport layer. For example, in a common application scenario, the transport layer protocol of the CoAP protocol is the UDP protocol, that is, the CoAP over UDP protocol. When the first electronic device switches, the transport layer protocol of the CoAP protocol is switched from the UDP protocol to the TCP protocol, so as to replace the CoAP over UDP protocol with the CoAP over TCP protocol. Since the TCP protocol does not limit the length of the transmitted data, the second electronic device can transmit batch data through the protocol, thereby facilitating the second electronic device to be added to the trust list of the first electronic device, so as to achieve seamless data interaction between the second electronic device and the devices in the trust list.

[0161] For example, the information about the protocol interface supported by the second electronic device may be a protocol interface with which the second electronic device can interact, and information is generated in the form of "UDP interface + interface number" or "TCP interface + interface number" and sent through the first message to indicate the second electronic device's support for the protocol interface. It should be understood that the format of the aforementioned generated information is only one feasible implementation method in the embodiments of this application, and this application does not limit the format of the information about the protocol interface supported by the second electronic device in the first message.

[0162] Figure 8 Schematic diagram of the process of executing step S130 in the embodiment of the present application.

[0163] In some examples of this application, Figure 8 As shown, after the first electronic device receives the first message, the process of determining the target protocol interface may include the following steps:

[0164] S131: Parse the data in the first message.

[0165] Specifically, in an embodiment of the present application, the first message includes a target device identifier and information about a protocol interface supported by the second electronic device, wherein the target device identifier is a unique device identification code of the second electronic device, and the supported protocol interface information is the protocol interface used by the second electronic device to perform the subsequent data interaction process.

[0166] Since the unique device identification code is required to identify the second electronic device during the protocol interface determination process, if the unique device identification code is not included in the first message sent by the second electronic device, the first electronic device cannot search for the registration data corresponding to the second electronic device and cannot verify it. Therefore, if the unique device identification code is not included in the first message sent by the second electronic device after parsing, the process is terminated directly and the second electronic device needs to resend the first message for verification.

[0167] Similarly, since the subsequent interaction process requires the application of a protocol interface to establish an interaction channel, if the data parsed by the first electronic device does not include the interface information of the second electronic device, the first electronic device cannot establish an interaction channel corresponding to the second electronic device. Therefore, if the first electronic device does not obtain a unique device identification code or protocol interface when parsing the first message, it will terminate the process and re-acquire the first message to parse and obtain the data in the first message again.

[0168] It should be understood that in this embodiment, the unique device identification code parsed by the first electronic device is data used to verify the correspondence between the second electronic device and the device registration information in the first electronic device, so that the first electronic device can verify the second electronic device when formally establishing an interaction channel with the second electronic device.

[0169] The protocol interface is used to indicate the protocol interface enabled by the second electronic device. In the embodiment of the present application, the first protocol interface in the protocol interface is a UDP interface, and the second protocol interface is a TCP interface. When the information of the protocol interface supported by the second electronic device indicates that it supports the first protocol interface, the interactive channel established this time is established through the first protocol interface, that is, the UDP interface; if the information of the protocol interface supported by the second electronic device indicates that it supports the second protocol interface, the interactive channel established this time is established through the second protocol interface, that is, the TCP interface. It should be understood that the corresponding relationship of the aforementioned protocol interfaces is only an example in this application, and this application does not limit the specific meaning of the protocol interface.

[0170] In an embodiment of the present application, when the second electronic device supports both the first protocol interface and the second protocol interface, the protocol interface information included in the first message sent may include only one of the first protocol interface and the second protocol interface. This can reduce the length of the first message and improve the transmission efficiency of the first message. In this way, the interface for establishing an interactive channel between the first electronic device and the second electronic device can be selected.

[0171] S132: Searching for target verification information based on the target device identifier.

[0172] After confirming that the target device identifier is included in the first message, the first electronic device can search the registered device information using the target device identifier to obtain the target verification information corresponding to the second electronic device for which an interactive channel needs to be established. In an embodiment of the present application, the verification information of the second electronic device is information generated by the second electronic device itself before the second electronic device is associated and registered with the first electronic device, which may include a verification code indicating support for the UDP interface and may further include a device public key that supports the TCP interface.

[0173] It should be noted that the verification code of the second electronic device is the verification information that needs to be generated by default when the second electronic device is started, so that the second electronic device can perform basic data interaction through the UDP protocol, thereby satisfying the functional basis for the second electronic device to register and interactively determine the protocol interface. The device public key is controlled by a switch to control whether it is generated. When the device public key is generated, the device public key can be sent to the server together with the verification code as the verification information of the second electronic device to complete the registration process of the second electronic device. The TCP interface in the second electronic device can be controlled through the device public key. When the device public key can be generated in the second electronic device, it means that the second electronic device can establish an interactive channel with the first electronic device that relies on the TCP interface.

[0174] Exemplarily, a switch for controlling the generation of a device public key may be provided in the connection tool, so that when the second electronic device generates verification information through the connection tool, the state of the switch is directly read to determine whether a device public key is generated. It should be understood that if the second electronic device generates a verification code and a device public key, then during the device registration process, the server will send the verification code and the device public key together as registration data to the first electronic device as data in the device registration information. Therefore, in an embodiment of the present application, the target device identification is used to search for the target verification information in the device registration information in order to verify the interface and determine whether the second electronic device can establish an interactive channel using the target protocol interface.

[0175] In an embodiment of the present application, the process of searching for target verification information can also be based on the target device identifier and the protocol interface supported by the second electronic device. With the verification code corresponding to the switch of the UDP interface and the device public key corresponding to the switch of the TCP interface, when the protocol interface supported by the second electronic device is the second protocol interface, i.e., the TCP interface, the target device identifier is used to search for the device public key in the information associated with the target device identifier; and when the protocol interface supported by the second electronic device is the first protocol interface, i.e., the UDP interface, the target device identifier is used to search for the verification code in the information associated with the target device identifier, thereby enabling the first electronic device to accurately search for the target verification information through the target device identifier.

[0176] S133: In response to finding the target verification information, based on the protocol interfaces supported by the second electronic device, determine the first protocol interface or the second protocol interface as the target protocol interface.

[0177] In some embodiments of the present application, since different target verification information corresponds to different protocol interfaces supported by the second electronic device, in a scenario where the second electronic device can support a first protocol interface and a second protocol interface, i.e., a UDP interface and a TCP interface, the following search results based on the target device identifier exist:

[0178] One is that the protocol interface obtained by parsing the first message is a UDP interface, that is, the second electronic device supports the first protocol interface. The verification code is found according to the target device identifier, which means that the first electronic device has found the target verification information corresponding to the first protocol interface. At this time, based on the support of the second electronic device for the first protocol interface, the first protocol interface can be determined as the target protocol interface.

[0179] The second is that the protocol interface obtained by parsing the first message is a TCP interface, that is, the second electronic device supports the second protocol interface, and the first electronic device can find the device public key according to the target device identifier, which means that the first electronic device has found the target verification information corresponding to the second protocol interface. At this time, based on the support of the second electronic device for the second protocol interface, the second protocol interface can be determined as the target protocol interface.

[0180] The third is that the protocol interface obtained by parsing the first message is a TCP interface, that is, the second electronic device supports the second protocol interface, but the first electronic device fails to find the device public key according to the target device identifier, which means that the first electronic device has not found the target verification information corresponding to the second protocol interface, and at this time the second protocol interface cannot be determined as the target protocol interface.

[0181] It should be noted that, since the interaction of the first message, the third message and other messages of the second electronic device can be implemented based on the CoAP over UDP protocol, the second electronic device supports the UDP interface by default, that is, the second electronic device supports the first protocol interface by default, so the protocol interface obtained by parsing the first message is a UDP interface, but the scenario in which the first electronic device fails to find the verification code according to the target device identifier rarely occurs, and the occurrence of this problem may be due to incomplete device registration information of the first electronic device. Therefore, when this situation occurs, the first electronic device can resend the message to the server to synchronize the device registration information to avoid the situation where the first electronic device and the second electronic device cannot interact through the UDP interface.

[0182] In the above manner, the first electronic device can determine the first protocol interface or the second protocol interface as the target protocol interface, so as to perform further operations of establishing an interactive channel.

[0183] S140: Establishing an interaction channel with the second electronic device based on the target protocol interface.

[0184] After the first electronic device determines one of the first protocol interface and the second protocol interface as the target protocol interface, the first electronic device can use the target protocol interface to establish an interaction channel with the second electronic device. For example, in response to the first electronic device determining the target protocol interface, the second electronic device can establish an interaction channel with the first electronic device based on the target protocol interface.

[0185] In the embodiment of the present application, the steps in the above steps S110 to S140 performed by the first electronic device can be implemented by Nearby in the first electronic device.

[0186] Figure 9 This is a flow chart of a device authentication process in an embodiment of the present application.

[0187] After the first electronic device and the second electronic device establish an interactive channel between them, data can be transmitted through the interactive channel. In some embodiments, if, during the process of determining the target protocol interface, the protocol interface in the first message is the second protocol interface, and the target verification information device public key corresponding to the unique device identification code can be found, then the second protocol interface is determined as the target protocol interface. At the same time, the first electronic device can learn through the above process that the second electronic device will perform device authentication to be added to the trust list of the first electronic device. Therefore, after establishing the interactive channel with the second electronic device, the first electronic device can perform device authentication on the second electronic device.

[0188] like Figure 9 As shown, the process of device authentication may include:

[0189] S151: Generate a second message.

[0190] After establishing an interactive channel corresponding to the second protocol interface with the first electronic device, the second electronic device can interact with the first electronic device through the established interactive channel. Since the second protocol interface is a TCP interface in the embodiment of the present application, the interactive channel established through the second protocol interface can support the second electronic device to transmit large amounts of data, thereby enabling the first electronic device to authenticate the second electronic device.

[0191] Exemplarily, in order to perform device authentication, the second electronic device generates a second message for device authentication. The second message may include certificate chain data corresponding to the second electronic device. The certificate chain data is a data chain consisting of multiple digital certificates, including at least a root certificate and a device certificate corresponding to the second electronic device. By verifying the certificate chain data, the connected second electronic device can be authenticated to protect the transmission security of interactions between electronic devices in the trust list after the first electronic device adds the second electronic device to the trust list.

[0192] The certificate chain data enables electronic devices that have established an interactive relationship to use encryption to ensure data security during data transmission, and to achieve data integrity through encrypted signatures and hashing.

[0193] It should be understood that the method of performing device authentication of the second electronic device through certificate chain data in this application is only a feasible implementation method in this application, and this application does not limit the data used for device authentication.

[0194] S152: Send the second message to the first electronic device through the interactive channel.

[0195] Because an interactive channel has been established between the first electronic device and the second electronic device, the second electronic device can send the second message to the first electronic device through the interactive channel.

[0196] S153: Receive a second message sent by a second electronic device.

[0197] Correspondingly, after the second electronic device sends the second message, the first electronic device can obtain the second message transmitted by the second electronic device through the interactive channel.

[0198] S154: If the certificate chain data is legal and complete, the second electronic device is added to the first list.

[0199] Based on the second message including the certificate chain data, the certificate chain data can be verified to confirm its legitimacy and integrity. Legitimacy is achieved by the first electronic device verifying whether the issuing authority of the root certificate is legitimate and whether the certificates in the certificate chain are within their validity periods. Integrity is achieved by verifying whether the certificate chain between the device certificate and the root certificate is complete.

[0200] For example, in the case of a certificate chain containing a root certificate, an intermediate certificate, and a device certificate, the integrity verification process involves verifying whether the device certificate was issued by the intermediate certificate, and whether the intermediate certificate was issued by the root certificate. Only when the device certificate is issued by the intermediate certificate, and the intermediate certificate is issued by the root certificate, can the certificate chain data be proven complete. Similarly, in scenarios where multiple intermediate certificates exist, the first electronic device only needs to confirm whether the device certificate can be traced back to a single root certificate.

[0201] It should be understood that the method for verifying the certificate chain is only one feasible implementation method in this application. In the actual verification process, the certificate chain can also be verified by other methods. This application does not limit the specific verification method of the certificate chain.

[0202] After the certificate chain data is verified and confirmed to be legal and complete, the first electronic device can add the second electronic device to the first list, which becomes the trust list of the first electronic device. It should be noted that the first list may include multiple other first electronic devices and multiple second electronic devices. After the second electronic device is added to the first list, the other first and second electronic devices in the first list can directly establish an interactive channel and interact with the second electronic device through the first list, avoiding the problem of repeated authentication when switching interactions between multiple electronic devices.

[0203] S155: After the interaction with the second electronic device is completed, the interaction channel is closed.

[0204] After the second electronic device completes transmitting the second message and the first electronic device adds the second electronic device to the first list, if there is no data transmission between the first electronic device and the second electronic device, the interaction channel can be closed to avoid the consumption generated by the first electronic device and the second electronic device maintaining the interaction channel when there is no data interaction.

[0205] S156: In response to the channel establishment instruction of the first electronic device or the second electronic device, establish an interactive channel corresponding to the first protocol interface or the second protocol interface.

[0206] If the second electronic device is added to the first list and the interaction channel is closed, when the first electronic device or the second electronic device needs to send data to the other party for interaction, a channel establishment instruction can be generated to establish interface data corresponding to the first protocol interface or the second protocol interface to realize information interaction.

[0207] In an embodiment of the present application, the process of establishing an interactive channel may also include establishing a channel when other electronic devices in the first list interact with the second electronic device, so as to avoid repeated authentication of electronic devices.

[0208] The above-described device interaction method enables a first electronic device to change the protocol interface used to interact with a second electronic device, allowing the second electronic device to interact with data via an interactive channel with a higher data throughput, thereby avoiding issues with data length limitations during the authentication process. Furthermore, after increasing the data throughput between the first and second electronic devices, the second electronic device can be added to the first electronic device's trusted list, enabling user-unnoticed data interaction between the second electronic device and other electronic devices on the trusted list.

[0209] The above describes in detail an example of a device interaction method provided by an embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.

[0210] In an embodiment of the present application, the functional modules of the first electronic device and the second electronic device can be divided according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0211] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0212] Figure 10 This is a schematic diagram of a device interaction system in an embodiment of the present application. Figure 11 This is a schematic diagram of another device interaction system in an embodiment of the present application.

[0213] Based on the aforementioned implementation of the device interaction method, the embodiment of the present application further provides a device interaction system 200, in which the aforementioned device interaction method can be executed. Figure 10 As shown, the device interaction system 200 may include:

[0214] A first electronic device 210 and a second electronic device 220 associated with the first electronic device 210 .

[0215] The second electronic device 220 is configured to: broadcast a first message; the first message includes a target device identifier of the second electronic device 220.

[0216] The first electronic device 210 is configured to: receive a first message broadcast by the second electronic device 220; determine a target protocol interface for interacting with the second electronic device 220 in response to the target device identifier having corresponding verification information; and establish an interaction channel with the second electronic device 220 based on the target protocol interface.

[0217] The second electronic device 220 is further configured to: in response to the first electronic device 210 determining the target protocol interface, establish an interaction channel with the first electronic device according to the target protocol interface.

[0218] In some embodiments of the present application, the device interaction system 200 may further include a server 230 .

[0219] The first electronic device 210 is further configured to: in response to discovering the second electronic device 220 , broadcast a third message to the second electronic device 220 ; the third message includes user identification information of the first electronic device 210 .

[0220] The second electronic device 220 is also configured to: receive a third message; generate a fourth message based on user identification information and device information; the device information includes the target device identification and verification information of the second electronic device 220; and send the fourth message to the server 230 to associate and register the second electronic device with the first electronic device 210.

[0221] The server 230 is configured to: receive the fourth message, and register the second electronic device 220 in association with the first electronic device 210 based on the fourth message; and send a registration result to the first electronic device 210 and the second electronic device 220 .

[0222] Exemplarily, the first electronic device 210 may include an external device manager 211 and a device management platform 212. The external device manager 211 can be used to implement the interaction and verification process with the second electronic device 220, while the device management platform 212 can be used to implement the device registration process with the second electronic device 220 and the server 230.

[0223] The electronic device provided in this embodiment is used to execute the above-mentioned device interaction method, and thus can achieve the same effect as the above-mentioned implementation method.

[0224] When integrated, the electronic device may also include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the operation of the electronic device. The storage module may be used to support the execution of program code and data stored in the electronic device. The communication module may be used to support communication between the electronic device and other devices.

[0225] The processing module may be a processor or a controller. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, or a Wi-Fi chip.

[0226] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 2 Device with the structure shown.

[0227] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the device interaction method of any of the above embodiments.

[0228] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the device interaction method in the above-mentioned embodiment.

[0229] Figure 12 This is a structural diagram of a chip system in an embodiment of the present application.

[0230] The present application also provides a chip system. Figure 12 As shown, the chip system 1200 includes at least one processor 1201 and at least one interface circuit 1202. The processor 1201 and the interface circuit 1202 can be interconnected via lines. For example, the interface circuit 1202 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1202 can be used to send signals to other devices (such as the processor 1201). Exemplarily, the interface circuit 1202 can read instructions stored in the memory and send the instructions to the processor 1201. When the instructions are executed by the processor 1201, the electronic device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0231] Figure 13 This is a structural diagram of a device interaction apparatus in an embodiment of the present application.

[0232] In addition, an embodiment of the present application also provides a device, which can be a chip, component or module. The device may include a processor 1301, a memory 1302 and a communication module 1303 connected via a communication bus 1304. The processor 1301 may include one or more processing units. For example, the processor 1301 may include 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. The different processing units may be independent devices or integrated into one or more processors. The memory 1302 is coupled to the processor 1301 and is used to store various software programs and / or multiple sets of instructions. The memory 1302 may include volatile memory and / or non-volatile memory. When the software programs and / or multiple sets of instructions in the memory 1302 are executed by the processor 1301, the device is able to implement the method steps in the above-mentioned embodiments and their implementation methods.

[0233] Among them, the electronic device, computer-readable storage medium, computer program product, system, device or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0234] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0235] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the system embodiments and device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0236] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0237] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0238] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0239] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A device interaction method, characterized in that: Applied to a first electronic device, the method includes: receiving a first message broadcast by a second electronic device, where the second electronic device is an electronic device associated with the first electronic device, the first message including a target device identifier of the second electronic device and information about a protocol interface supported by the second electronic device, the protocol interface including a first protocol interface and a second protocol interface, the first protocol interface and the second protocol interface corresponding to different protocols, and a transmission data length of a protocol corresponding to the second protocol interface being greater than a transmission data length of a protocol corresponding to the first protocol interface; In response to the target device identifier having corresponding verification information, determining a target protocol interface for interacting with the second electronic device, wherein the verification information is information generated by the second electronic device according to a state after the device is started; establishing an interaction channel with the second electronic device based on the target protocol interface; Among them, in response to the target device identifier having corresponding verification information, determining the target protocol interface for interacting with the second electronic device includes: searching for target verification information based on the target device identifier; in response to finding the target verification information, determining the first protocol interface or the second protocol interface as the target protocol interface based on the protocol interface supported by the second electronic device.

2. The device interaction method according to claim 1, characterized in that: In response to finding the target verification information, determining the first protocol interface or the second protocol interface as the target protocol interface based on the protocol interface supported by the second electronic device includes: If the second electronic device supports the second protocol interface, the second protocol interface is determined as the target protocol interface.

3. The device interaction method according to claim 2, characterized in that: After determining the second protocol interface as the target protocol interface, the method further includes: receiving a second message sent by the second electronic device; the second message including certificate chain data corresponding to the second electronic device; If the certificate chain data is legal and complete, the second electronic device is added to the first list.

4. The device interaction method according to any one of claims 1 to 3, characterized in that: After establishing the interaction channel with the second electronic device based on the target protocol interface, the method further includes: After the interaction with the second electronic device is completed, the interaction channel is closed.

5. The device interaction method according to claim 4, characterized in that: After closing the interactive channel, the method further includes: In response to the channel establishment instruction of the first electronic device or the second electronic device, the interactive channel corresponding to the first protocol interface or the second protocol interface is established.

6. The device interaction method according to claim 1, characterized in that: Before receiving the first message from the second electronic device, the method further includes: In response to discovering the second electronic device, broadcasting a third message to the second electronic device; receiving a registration result of the second electronic device; the registration result including failure information or success information, and the success information including registration data of the second electronic device; In response to receiving the success information, the device registration information in the first electronic device is updated according to the registration data.

7. The device interaction method according to claim 6, characterized in that: The success information further includes the target device identifier corresponding to the second electronic device. After receiving the first message from the second electronic device, the method further includes: According to the target device identifier, searching the device registration information for the registration data corresponding to the target device identifier; In response to finding the registration data corresponding to the target device identifier, the verification information is obtained according to the registration data.

8. A device interaction method, characterized in that: Applied to a second electronic device, the method includes: Broadcasting a first message; the first message includes a target device identifier of the second electronic device and information about a protocol interface supported by the second electronic device, the protocol interface including a first protocol interface and a second protocol interface, the first protocol interface and the second protocol interface corresponding to different protocols, the transmission data length of the protocol corresponding to the second protocol interface being greater than the transmission data length of the protocol corresponding to the first protocol interface, the target device identifier having corresponding verification information, the verification information being information generated by the second electronic device based on a state after the device is started; In response to the first electronic device determining a target protocol interface, an interaction channel with the first electronic device is established according to the target protocol interface.

9. The device interaction method according to claim 8, characterized in that: Before broadcasting the first message, the method further includes: receiving a third message, wherein the third message includes user identification information of the first electronic device; generating a fourth message based on the user identification information and the device information, wherein the device information includes a target device identification and verification information of the second electronic device; The fourth message is sent to the server to associate and register the second electronic device with the first electronic device.

10. The device interaction method according to claim 8, characterized in that: The target protocol interface is a second protocol interface. After establishing an interaction channel with the first electronic device according to the target protocol interface, the method further includes: generating a second message, wherein the second message includes certificate chain data corresponding to the second electronic device; The second message is sent to the first electronic device through the interaction channel.

11. A device interaction system, characterized in that: The system comprises: First electronic device; a second electronic device associated with the first electronic device; in, The second electronic device is configured to: broadcast a first message; the first message includes a target device identifier of the second electronic device and information about a protocol interface supported by the second electronic device, the protocol interface includes a first protocol interface and a second protocol interface, the first protocol interface and the second protocol interface correspond to different protocols, and the transmission data length of the protocol corresponding to the second protocol interface is greater than the transmission data length of the protocol corresponding to the first protocol interface; The first electronic device is configured to: receive a first message broadcast by a second electronic device; determine a target protocol interface for interaction with the second electronic device in response to the target device identifier having corresponding verification information; and establish an interaction channel with the second electronic device based on the target protocol interface; The second electronic device is further configured to: in response to the first electronic device determining the target protocol interface, establish an interaction channel with the first electronic device according to the target protocol interface; The first electronic device is further configured to: search for target verification information based on the target device identifier; and in response to finding the target verification information, determine the first protocol interface or the second protocol interface as the target protocol interface based on the protocol interface supported by the second electronic device.

12. The device interaction system according to claim 11, characterized in that: The system further includes a server; The first electronic device is further configured to: in response to discovering the second electronic device, broadcast a third message to the second electronic device; the third message includes user identification information of the first electronic device; The second electronic device is further configured to: receive the third message; generate a fourth message based on the user identification information and the device information; the device information includes a target device identification and verification information of the second electronic device; Sending the fourth message to the server to associate and register the second electronic device with the first electronic device; The server is configured to: receive the fourth message, and register the second electronic device in association with the first electronic device based on the fourth message; and send a registration result to the first electronic device and the second electronic device.

13. An electronic device, characterized in that: include: processor; Memory; The memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes the device interaction method according to any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to execute the device interaction method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Equipment connection method and electronic equipment

    CN115550415A

  • Management method and device of Internet of Things equipment, computer equipment and storage medium

    CN116248721A

  • Communication method and electronic equipment

    CN117119077A