Equipment interaction method and system and electronic equipment
By switching the protocol interface between IoT devices and central devices, the TCP protocol is used to solve the problem of UDP protocol transmission length limitation, the trust authentication and data interaction of IoT devices are realized, the problem that IoT devices cannot be added to the trust list, and the improvement of the problem that IoT devices cannot be added to the trust list Reliability and efficiency of data transmission.
Patent Information
- Application Number
- CN202410160697.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-02-04
AI Technical Summary
During the trust authentication process, IoT devices cannot successfully join the trust list of the central device due to the transmission length limitation of the UDP protocol, affecting data interaction.
By switching the protocol interface when interacting between IoT devices and central devices, the TCP protocol that supports larger data capacity can be used to effectively transmit and authenticate data such as certificate chains.
The problem of IoT device authentication failure was successfully solved, allowing IoT devices to be added to the trust list of the central device, and improving the reliability and efficiency of data transmission.
Smart Images

Figure CN119255333A_ABST
Abstract
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] In the process of interaction between the Internet of Things (IoT) device and the central device, the central device can add the IoT device to the trust list of the central device by performing trust authentication on the IoT device. After the authentication is completed, the IoT device can be used as a trusted device to transmit data with the central device and / or other trusted devices.
[0003] During the trust authentication process, the IoT device needs 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 the IoT device and the central device relies on the Constrained Application Protocol over User Datagram Protocol (CoAP over UDP), and the UDP protocol has a transmission length limit, it is not conducive to the IoT device to transmit public keys, certificate chains and other data for trust authentication, resulting in IoT device authentication failure and inability to 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; based on the target protocol interface, establishing an interaction channel with the second electronic device.
[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 a feasible implementation, the first message also includes information about the protocol interface supported by the second electronic device, the protocol interface includes a first protocol interface and a second protocol interface, and in response to the target device identifier having corresponding verification information, determining the target protocol interface to interact with the second electronic device includes: searching for the 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. In this way, the information sent by the second electronic device can be verified, thereby determining the target protocol interface, which facilitates subsequent data transmission between the first electronic device and the second electronic device.
[0008] In a feasible implementation, 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, 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 interactive channel established through the target protocol interface has a larger data capacity, which is convenient for the second electronic device to transmit messages with a large amount of data.
[0009] In a feasible implementation, 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 the certificate chain data corresponding to the second electronic device; if the certificate chain data is legal 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 the authentication is passed, adding the second electronic device to the first list of the first electronic device, so as to facilitate the interaction between the second electronic device and the first electronic device or other electronic devices in the first list.
[0010] In a feasible implementation, after establishing the interactive channel with the second electronic device based on the target protocol interface, the method further includes: closing the interactive channel after the interaction with the second electronic device is completed. In this way, the interactive channel can be closed after the data interaction is completed to avoid the loss of the interactive channel maintained by the first electronic device and the second electronic device when there is no data interaction.
[0011] In a feasible implementation, after closing the interactive channel, the method further includes: in response to a channel establishment instruction of the first electronic device or the second electronic device, establishing an interactive channel corresponding to the first protocol interface or the second protocol interface. 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 interaction is required.
[0012] In a feasible implementation, before receiving the first message of 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 the registration result of the second electronic device; the registration result includes failure information or success information, and the success information includes the registration data of the second electronic device; in response to receiving the success information, updating the device registration information in the first electronic device according to the registration data. In this way, the second electronic device can be registered and the registration result can be received, thereby updating the device registration information in the first electronic device, which is convenient for the subsequent interactive verification of the second electronic device by the first electronic device.
[0013] In a feasible implementation, the success information 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 according to the target device identifier; in response to finding the registration data corresponding to the target device identifier, obtaining verification information according to the registration data. In this way, the corresponding registration data can be found in the first electronic device to implement verification of the second electronic device.
[0014] In a second aspect, the embodiment of the present application also provides a device interaction method, which is applied to a second electronic device, and the method includes: broadcasting a first message; the first message includes a target device identifier of the second electronic device; in response to the first electronic device determining a target protocol interface, establishing an interaction channel with the first electronic device according to the target protocol interface. In this way, the second electronic device can send a message to the first electronic device, so that the first electronic device verifies the information of the second electronic device, so that the first electronic device and the second electronic device can interact with each other.
[0015] In a feasible implementation, before broadcasting the first message, the method further includes: receiving a third message, the third message including user identification information of the first electronic device; generating a fourth message based on the user identification information and device information; the device information including the target device identification and verification information of the second electronic device; and sending the fourth message to the server to associate and register the second electronic device with the first electronic device. In this way, the second electronic device can be associated and registered with the first electronic device using the server, so that the first electronic device can perform the subsequent second electronic device authentication process.
[0016] In a feasible implementation, the target protocol interface is a second protocol interface, and 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 the certificate chain data corresponding to the second electronic device; and sending the second message to the first electronic device through the interactive channel. In this way, data can be transmitted through an interactive channel with a large data capacity, so that the second electronic device can smoothly send the data used for authentication to the first electronic device, thereby avoiding the limitation of the protocol transmission length 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 comprises 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 implementation, the system also includes a server; the first electronic device is also 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 also 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 further 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 It is a schematic diagram of the connection between an IoT device and a central device;
[0023] Figure 2 This is a schematic diagram of the structure of a central device in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of a layered architecture of a central device software system in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of a process of registering a second electronic device in an embodiment of the present application;
[0026] Figure 5 This is a display schematic diagram of a first electronic device scanning and discovering a second electronic device in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of 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 flowchart of the execution process of step S130 in the embodiment of the present application;
[0030] Fig. 9 A schematic diagram of a device authentication process in an embodiment of the present application;
[0031] Fig.10 A schematic diagram of a device interaction system in an embodiment of the present application;
[0032] Fig.11 A schematic diagram of another device interaction system in an embodiment of the present application;
[0033] Fig.12 This is a schematic diagram of the structure of a chip system in an embodiment of the present application;
[0034] Fig.13 It is a structural schematic diagram of a device interaction apparatus in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application will be described clearly below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, other embodiments obtained by ordinary technicians in this field without making creative work all belong to the protection scope of the present application.
[0036] In the following, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "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 the present 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 the changes in the orientation of the components in the drawings.
[0038] To facilitate the technical solution of the application, some concepts involved in the application are first explained below.
[0039] User Datagram Protocol (UDP) is a connectionless transport layer protocol. UDP can provide a method for applications to send encapsulated IP data packets without establishing a connection, and does not guarantee the reliability of the transmitted data packets. It has the advantages of small delays and high data transmission efficiency during data transmission, but it can only be used to transmit a small amount of data at a time.
[0040] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. Unlike UDP, TCP requires a connection between devices to achieve reliable end-to-end byte stream transmission. Compared with UDP, TCP has higher data transmission reliability and can transmit more data. It also verifies and retransmits data to avoid loss and errors in transmitted data.
[0041] Constrained Application Protocol (CoAP) is an IoT protocol for resource-constrained electronic devices, where resource-constrained electronic devices are electronic devices with a small amount of memory space and limited computing power. Resource-constrained electronic devices can establish communication relationships through CoAP to transmit data and control electronic devices.
[0042] Constrained Application Protocol over User Datagram Protocol (CoAP over UDP) is a CoAP that implements data transmission between devices by applying UDP at the transport layer, so that data exchange can be achieved without the need for a connection between devices.
[0043] Constrained Application Protocol over Transmission Control Protocol (CoAP over TCP) is a CoAP that implements data transmission between devices by applying TCP at the transport layer. It is necessary to establish a connection before data interaction between devices so that data can be transmitted.
[0044] The Internet of Things (IoT) refers to connecting any object to the network through information sensing devices according to agreed protocols. Objects exchange and communicate information through information dissemination 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 interaction 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, and the central device may include but is not limited to devices equipped with iOS, Android, Microsoft, Harmony OS, or other operating systems. The IoT device may be any electronic device equipped with memory and processor, such as 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 may be a mobile phone 10, and the IoT devices may include a smart TV 21, a smart switch 22, and a smart speaker 23. For an IoT device such as a smart TV 21 with a screen, the mobile phone 10 can control the smart TV 21 by installing the APP corresponding to the smart TV 21, or installing an application such as the Smart Space APP that can control the IoT device. Before the mobile phone 10 controls the smart TV 21 through the application, the smart TV 21 needs to interact with the mobile phone 10 through information, so that the device information of the mobile phone 10 and the smart TV 21 interacts to a certain extent, so as to provide a basis for the subsequent establishment of a connection channel.
[0049] For example, the APP in the mobile phone 10 may have a function of adding a device. When the user clicks the add device control, the mobile phone 10 may start searching for the device. After the smart TV 21 is started, the device is found 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. Then the user may select the smart TV 21 on the mobile phone 10, and the mobile phone 10 will send a request to establish a connection 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, because 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 mobile phone 10 to establish a connection with 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 started, 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 reconnect the tablet computer with the IoT device through one of the above methods. It can be seen that the process of switching control between different central devices is cumbersome and inflexible.
[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 being associated with other devices in the trust list.
[0055] Since the devices in the trusted list have the same data for association, such as being associated with the same account, the same associated data can be used to perform data transmission with other devices in the trusted list without the user noticing. For example, if the central device is a mobile phone 10 and a tablet computer is included in its trusted list, after the smart TV 21 is added to the trusted list by associating an account, the tablet computer can directly establish an interactive channel with the smart TV 21 through the associated data in the trusted list, thereby reducing the number of operations for the user to change the central device.
[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 a screen or do not have a screen that can display batch data, and their memory space and computing power are relatively limited, they usually do not have an account 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, because IoT devices rely on 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 perform data transmission and verification and other interactions with central devices through CoAP over UDP protocol, and cannot be added to the trust list of the central device.
[0058] Based on the above problems, the embodiment of the present application provides a device interaction method, which enables the central device to verify the information broadcast by the IoT device, so that 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 data with a large amount of data to complete the operation of adding to the trust list of the central device. Most of the data processing and other work in this process is set in the central device, thereby reducing the information that the resource-constrained IoT device needs to process, so that the resource-constrained IoT device can also be added to the trust list of the central device.
[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, etc. that can be held / operated with one hand, and the embodiments of the present application do not impose any special restrictions on the specific form / type of the central device. The above-mentioned central device includes but is not limited to devices equipped with iOS, Android, Microsoft, Harmony OS or other operating systems.
[0060] The IoT devices in the embodiments of the present application refer to resource-constrained electronic devices, such as refrigerators, speakers, lighting equipment, heating equipment, etc., which have certain data processing capabilities and a small amount of data storage space, but do not have a screen that can display batch data and cannot independently log in to an account to obtain data for verification. The IoT devices used in the device interaction method in the embodiments of the present application can also be other smart devices in any system, and the present application does not limit the specific type of IoT devices.
[0061] Figure 2 This is a schematic diagram of the structure 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 screen 193, a subscriber identification module (SIM) card interface 194, and a camera 195, etc. Among them, 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, etc.
[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 processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. 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 device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0065] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0066] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0067] The external memory interface 120 can be used to store computer executable program codes, and the executable program codes include instructions. The external memory interface 120 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application program 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.), etc. In addition, the external memory interface 120 may include one or more storage units, for example, it may include a volatile memory (volatile memory), such as: dynamic random access memory (dynamic random access memory, DRAM), static random access memory (static random access memory, SRAM), etc.; it may also include a non-volatile memory (non-volatile memory, NVM), such as: read-only memory (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 a memory provided in the processor.
[0068] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.
[0069] The charging management module 140 is used to receive charging input from a power supply device (e.g., a charger, a laptop power supply, 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 through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of 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. 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 supplies power to the processor 110, the internal memory 121, the display screen 193, the camera 195, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as the battery voltage, current, battery cycle number, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set 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 antenna can be used in combination with a tuning switch, and different antennas can be reused to improve the utilization of the antenna.
[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, and filter, amplify and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves 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. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a 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, etc. 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 the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through 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 the antenna 2. At the same time, the wireless communication module 160 can also broadcast messages through the 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] The display screen 193 is used to display images, videos, etc. The 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 or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the central device may include 1 or N display screens 193, where N is a positive integer greater than 1.
[0079] Touch sensor, also known as "touch control device". The touch sensor can be coupled to the display screen 193, so that the touch sensor and the display screen 193 form a touch screen, also known as a "touch control screen". The touch sensor is used to monitor touch operations acting on or near it. The touch sensor can pass the monitored touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 193. In other embodiments, the touch sensor can also be set on the surface of the central device, which is different from the position of the display screen 193.
[0080] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. 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 touch operation intensity according to the pressure sensor. The central device can also calculate the touch position based on the monitoring signal of the pressure sensor. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions.
[0081] The SIM card interface 194 is used to connect a SIM card. The SIM card can be connected to or disconnected from the central device by inserting it into or removing it from the SIM card interface 194. The central device can support one or more SIM card interfaces. The SIM card interface 194 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 194 at the same time. The 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 calls and data communications. One SIM card corresponds to one user number.
[0082] It is understandable 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 in the above embodiments, or a combination of multiple interface connection methods. Figure 2 The following is only an example of a central device in the form of a mobile phone. If the central device is a tablet computer, a handheld computer, a PC, a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the central device may include 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 functions of the central device requires not only hardware support but also software cooperation. The software system of the central device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the central device is illustrated.
[0084] Figure 3 The following is a schematic diagram of a 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 division 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, namely, the application layer, the framework layer, the system library and the Android runtime (Android runtime), the HAL layer (hardware abstraction layer) and the driver layer (or kernel layer). Among them, the system library and the Android runtime can also be called the local framework layer or the 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 (APP) such as camera, gallery, calendar, map, WLAN, Bluetooth, music, video, short message, call, navigation, instant messaging, etc.
[0087] The framework layer provides an application programming interface (API) and a programming framework for the 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 phone manager, a resource manager, a notification manager, a package manager, etc., and 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 screen size, determine whether there is a status bar, lock the screen, capture the screen, 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 controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0091] The phone manager is used to provide the communication function of the central device. For example, the phone manager can manage the call status of the call application (including initiation, connection, hang up, etc.).
[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 enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the central device vibrates, and the indicator light flashes.
[0094] The package manager is 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 provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of 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, etc. SGL is a drawing engine for 2D drawing.
[0096] The Android runtime includes the core library and the ART virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the ART virtual machine. The ART virtual machine executes the Java files of the application layer and the application framework layer as binary files. The ART virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0097] The HAL layer is an interface layer between the operating system kernel and the hardware circuit, and 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 on multiple platforms. The HAL layer provides a standard interface to display device hardware functions 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 called 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. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, battery driver, Wi-Fi driver, etc., which are not limited in this application. Among them, the sensor driver can specifically include the driver of each sensor included in the central device, such as pressure sensor driver, etc.
[0099] Exemplarily, when the central device interacts with the IoT device, it can use a Wi-Fi module and a Wi-Fi driver to implement data interaction with the IoT device. In the embodiment of the present application, receiving and sending signals through a Wi-Fi module and a Wi-Fi driver is only a feasible implementation method. In the present application, there is no restriction on the modules and drivers used when the central device interacts with the IoT device for data.
[0100] In the embodiment of the present application, the application programs included in the application layer can be divided into external APPs and internal APPs. Among them, external APPs are APPs installed in the application layer by the central device through installation packages or other forms, such as instant messaging, navigation and other APPs, while internal APPs are APPs built into the application layer of 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 in order to implement the calling of multiple functions, the external terminal APP can call multiple internal terminal APPs to implement its functions. For example, the music software in the external terminal APP can implement the functions of music playing and message notification by calling the music and notification APPs of the internal terminal APP. For another example, the camera software in the external terminal APP can implement the functions of image shooting, modification and message notification by calling the camera, gallery and notification APPs of the internal terminal APP.
[0102] like Figure 3 As shown, in order to realize 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, wherein Nearby is an in-terminal APP, which is used to provide the central device with the function of interacting with external devices, and the device management platform is an out-terminal APP, which is used to provide the central device with the functions of 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 in the main interface, but 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 for interaction and management of external devices, the central device needs to display the operation controls and processes in the main interface corresponding to the device management platform, and its UI may be the same as the default UI of the central device, or different from the default UI, and this application does not limit 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, the IoT device 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 the transmission length limit 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 describe 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, a 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 the present application is the same as the aforementioned electronic device 100, and this application will not be repeated here.
[0106] When the first electronic device and the second electronic device interact, in order to improve the security and stability of the interaction, the first electronic device and the second electronic device can perform data exchange through the server. Specifically, before the second electronic device controls and interacts with the first electronic device, the first electronic device and the second electronic device can be registered on the server. The registration process is described below based on the capabilities of the first electronic device and the second electronic device.
[0107] In an embodiment of the present application, the first electronic device is an electronic device with an account login capability, and the device can be registered 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 to the server for registration 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 registering the first electronic device, the user can log in using a user account (which can be a user's mobile phone number, email address, or other user name) and a password, or a user mobile phone number and a verification code. That is, after registering an account, the user can 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 a 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 a mobile phone number and a 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 by itself due to its limited storage space and computing power and lack of account login function. 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 according to the state of the device after startup. In some embodiments, 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.
[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 find the second electronic device that has been started by 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 the embodiment of the present application, the third message includes user identification information of the first electronic device, wherein 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. The present application does not limit the specific information types in the user identification information.
[0114] In the 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 schematic 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 other users or the discovered second electronic device does not need to be registered. In this case, sending the third message to the second electronic device has the risk of information leakage. Therefore, in some embodiments, such as Figure 5 As shown, the second electronic device can be scanned by the user operating the first electronic device.
[0117] like Figure 5 As shown in (a), the first electronic device may first display a first interface 510 of the device management platform, and the first interface 510 may display electronic devices that can be connected to the first electronic device. When the user needs to add a device, the user may click an add control 511 in the first interface 510 to display a multiple selection interface 512 on the first interface 510, and click an add device control on the multiple selection interface 512 to enter the Figure 5 The scanning interface 520 shown in (b) .
[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 first interface 510 can be returned. Figure 5 As shown in (c), if a second electronic device is found by scanning, the message of finding the second electronic device can be displayed on the first interface 510 by means of a 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 find the second electronic device that has been started before the scanning function of the first electronic device is turned on. Therefore, in order to realize the discovery of the second electronic device that has been started, the user can also manually start the scanning function of the first electronic device, so as to discover 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, which is not limited in this embodiment.
[0121] It should be understood that Figure 5 The process of scanning the first electronic device to obtain the second electronic device shown in the figure is only a feasible implementation method in the present application, and the present application does not limit the specific process of scanning 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, in order to reduce the number of broadcasts of the first electronic device, after receiving the third message, the second electronic device can broadcast a reply message to the first electronic device, and after receiving the reply message, the first electronic device can stop broadcasting the third message, thereby avoiding the increase in energy consumption caused by the first electronic device continuously broadcasting the third message.
[0124] In order to enable the second electronic device to process 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, and 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 according to 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 according to 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. Exemplarily, 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 the 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 of the device after startup. 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 in the server. Since the fourth message includes the user identification information of the first electronic device, when the second electronic device registers through the server, the second electronic device can be associated with the first electronic device through the user identification information, so as to facilitate the subsequent interaction process 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, and 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, and 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 reasons 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, and the user may operate the first electronic device and the second electronic device according to 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 registration data of the second electronic device. When the registration result received by the first electronic device is success information, the first electronic device can synchronously receive the registration data of the second electronic device in the server. The registration data may include 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, so as to send the registration result and the registration data separately.
[0139] S107: In response to receiving the success information, updating the device registration information in the first electronic device according to the registration data.
[0140] After receiving the success information, the first electronic device can parse the success information to obtain the registration data of the second electronic device, and then update the device registration information cached in the first electronic device. Exemplarily, the device registration information in the first electronic device may include the registration data of all second electronic devices associated with the first electronic device. Therefore, after a second electronic device is associated with the first electronic device, the first electronic device can update the device registration information through the registration data sent by the server.
[0141] Furthermore, due to the limitations of the transmission protocol used 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 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 successful registration 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 in which the second electronic device generates the fourth message and directly sends it to the server will be affected by the information processing capability, and the response speed is 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 according to the device information and send it to the first electronic device in the form of 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, combined with the user identification information of the first electronic device, step S103 can be executed to generate a fourth message for registering the second electronic device. Then the first electronic device executes step S104 through the connection with the server to send the fourth message to the server, thereby realizing the association registration of the second electronic device and the first electronic device. The implementation method of the above embodiment is only a feasible implementation method in the embodiment of the present application. The present application does not limit the device that sends a message to the server for registration.
[0146] Figure 6: is a flow chart of a device interaction method in an embodiment of the present application, Figure 7 This is a flow chart of a device interaction method in an embodiment of the present application.
[0147] After the second electronic device is registered, there is a certain association 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 association 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 through 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 therein.
[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 according to 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, etc. 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. It can be seen from the above embodiments that when the second electronic device is registered, the unique device identification code or the IP address, MAC address and other information 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 of using a unique device identification code as an identifier for identifying the second electronic device is only a feasible implementation in this application, and the specific content of the target device identifier is not limited in this application.
[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 is registered with the second electronic device, then after receiving the first message, the registration data corresponding to the target device identifier can be searched in the device registration information through the target device identifier obtained by parsing, 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 identification 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 the unique device identification code corresponding to each second electronic device in the device registration information, and then determine the target protocol interface for the first electronic device to interact with 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, and the protocol interface controlled by the first electronic device for switching is the protocol interface of the CoAP protocol located in the transport layer. For example, in a common application scenario, the protocol applied at the transport layer of the CoAP protocol is the UDP protocol, that is, the CoAP over UDP protocol, and 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 CoAPover 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 join the trust list of the first electronic device, so as to realize the senseless interaction of data between the second electronic device and the devices in the trust list.
[0161] Exemplarily, the information of the protocol interface supported by the second electronic device may be the protocol interface with which the second electronic device can interact, and the 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 support of the protocol interface by the second electronic device. It should be understood that the format of the aforementioned generated information is only a feasible implementation method in the embodiments of the present application, and the present application does not limit the form of the protocol interface information 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 embodiments 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 for the subsequent data interaction process.
[0166] Since the second electronic device needs to be identified by a unique device identification code during the process of determining the protocol interface, if the first message sent by the second electronic device does not contain the unique device identification code, the first electronic device cannot search for the registration data corresponding to the second electronic device, and thus cannot verify it. Therefore, if the first message sent by the second electronic device does not contain the unique device identification code after parsing, the process ends directly, and the second electronic device needs to resend the first message for verification.
[0167] Similarly, since the application protocol interface is required to establish an interactive channel in the subsequent interaction process, 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 interactive channel corresponding to the second electronic device. Therefore, if the first electronic device does not obtain the unique device identification code or protocol interface when parsing the first message, the process will be terminated, and the first message will be re-obtained 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, i.e., 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, i.e., the TCP interface. It should be understood that the corresponding relationship of the aforementioned protocol interfaces is only an example in the present application, and the present 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 identification.
[0172] After confirming that the target device identifier is included in the first message, the first electronic device can search the registered device information through the target device identifier to obtain the target verification information corresponding to the second electronic device that needs to establish an interactive channel. 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 with the first electronic device for registration, which may include a verification code for 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 interact to 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 perform 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 depends 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 to generate a device public key. 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, searching for the target verification information in the device registration information through the target device identifier is for the purpose of verifying the interface and determining whether the second electronic device can establish an interactive channel with the target protocol interface.
[0175] In the embodiment of the present application, the process of searching for target verification information can also be based on the target device identification 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 identification is used to search whether the device public key exists in the information associated with the target device identification; and when the protocol interface supported by the second electronic device is the first protocol interface, i.e., the UDP interface, the target device identification is used to search whether the verification code exists in the information associated with the target device identification, so that the first electronic device can accurately search for the target verification information through the target device identification.
[0176] S133: In response to finding the target verification information, based on the protocol interface 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 protocol interfaces supported by the second electronic device correspond to different target verification information, in the scenario where the second electronic device can support the first protocol interface and the second protocol interface, that is, the UDP interface and the TCP interface, there are the following search results according to the target device identifier:
[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] Secondly, 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. Therefore, 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 identification 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 may resend the message to the server to synchronize the device registration information to avoid the situation in which 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 a 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 interactive channel with the second electronic device. Exemplarily, the second electronic device can establish an interactive channel with the first electronic device according to the target protocol interface in response to the first electronic device determining 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] Fig. 9 The present invention is a flowchart 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 in 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, and the first electronic device can know through the above process that the second electronic device will perform device authentication to join the trust list of the first electronic device, so 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 Fig. 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 data with a large amount of data, thereby enabling the first electronic device to perform device authentication on 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, and the certificate chain data is a data chain composed 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 the interaction between the electronic devices in the trust list after the first electronic device adds the second electronic device to the trust list.
[0192] Certificate chain data enables electronic devices that have established interactive relationships 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 the present application is only a feasible implementation method in the present application, and the present 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] On the basis that the second message includes the certificate chain data, the certificate chain data can be verified to confirm its legitimacy and integrity. The legitimacy is achieved by the first electronic device by verifying whether the issuing authority of the root certificate is legitimate and whether the certificates in the certificate chain are within the validity period, while the integrity is achieved by verifying whether there is a complete certificate chain between the device certificate and the root certificate.
[0200] Exemplarily, taking the certificate chain data including the root certificate, an intermediate certificate and the device certificate as an example, the process of verifying the integrity is to verify whether the device certificate is issued by the intermediate certificate, and whether the intermediate certificate is 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 to be complete. Similarly, in the scenario where there are multiple intermediate certificates, the first electronic device only needs to confirm whether it can be traced back to a root certificate through the device certificate.
[0201] It should be understood that the method for verifying the certificate chain is only a 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, and the first list is 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 electronic devices 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 transmission of 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 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 each other 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 achieve information interaction.
[0207] In the embodiment of the present application, the process of establishing an interactive channel may also exist in the establishment of a channel when other electronic devices in the first list interact with the second electronic device, which can avoid repeated authentication of electronic devices.
[0208] Through the above-mentioned device interaction method, the protocol interface for interaction between the first electronic device and the second electronic device can be changed, so that the second electronic device can interact with data through an interactive channel with a higher data transmission volume, so as to avoid the problem of receiving a transmission data length limit during the authentication process. At the same time, after increasing the data transmission volume between the first electronic device and the second electronic device, the second electronic device can also be added to the trust list of the first electronic device, so as to realize the data interaction between the second electronic device and other electronic devices in the trust list without the user's feeling.
[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 realize 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 the form of hardware or computer software driving hardware 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 exceed the scope of the present application.
[0210] The embodiment of the present application can divide the functional modules of the first electronic device and the second electronic device 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 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] Fig.10 is a schematic diagram of a device interaction system in an embodiment of the present application, Fig.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 present application embodiment further provides a device interaction system 200, and the aforementioned device interaction method can be executed in the device interaction system 200, such as Fig.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 a 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 a target device identification and verification information of the second electronic device 220; and send a 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 the 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] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.
[0225] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can 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, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.
[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 of the structure shown.
[0227] An embodiment of the present application also 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] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the device interaction method in the above-mentioned embodiment.
[0229] Fig.12 This is a schematic diagram of the structure of a chip system in an embodiment of the present application.
[0230] The present application also provides a chip system, such as Fig.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 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 perform the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0231] Fig.13 It is a structural schematic 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 may be a chip, a component or a module, and the device may include a processor 1301, a memory 1302 and a communication module 1303 connected via a communication bus 1304. Among them, 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, etc. Among them, different processing units may be independent devices or integrated in one or more processors. The memory 1302 is coupled to the processor 1301 for storing various software programs and / or multiple sets of instructions, and the memory 1302 may include a volatile memory and / or a 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 is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method 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 assigned to 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 the present 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. There may be other division methods in actual implementation, 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] The units described as separate components may or may not be physically separated, and the 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 different 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, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0239] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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; 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 identification having corresponding verification information, determining a target protocol interface for interacting with the second electronic device; Based on the target protocol interface, an interaction channel with the second electronic device is established.
2. The device interaction method according to claim 1, characterized in that: The first message further includes information of a protocol interface supported by the second electronic device, the protocol interface including a first protocol interface and a second protocol interface, and the step of determining a target protocol interface for interacting with the second electronic device in response to the target device identifier having corresponding verification information includes: Searching for target verification information based on the target device identifier; In response to finding the target authentication information, the first protocol interface or the second protocol interface is determined as the target protocol interface based on the protocol interface supported by the second electronic device.
3. The device interaction method according to claim 2, 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.
4. The device interaction method according to claim 3, 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.
5. The device interaction method according to any one of claims 1 to 4, 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.
6. The device interaction method according to claim 5, 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.
7. 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 includes failure information or success information, and the success information includes 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.
8. The device interaction method according to claim 7, characterized in that: The success information also 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 acquired according to the registration data.
9. 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; 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.
10. The device interaction method according to claim 9, 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 according to the user identification information and the device information; the device information including the 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.
11. The device interaction method according to claim 9, characterized in that: The target protocol interface is a second protocol interface, and after establishing an interaction channel with the first electronic device according to the target protocol interface, the method further includes: Generate 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.
12. 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 identification of the second electronic device; The first electronic device is configured to: receive a first message broadcast by a second electronic device; determine a target protocol interface for interacting 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 a target protocol interface, establish an interaction channel with the first electronic device according to the target protocol interface.
13. The device interaction system according to claim 12, characterized in that: The system also 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 according to the user identification information and the device information; the device information includes the 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.
14. 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 as described in any one of claims 1 to 11.
15. 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 executes the device interaction method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Information processing method and electronic equipment
CN104426858A
Method and equipment for controlling display terminal by multi-protocol handheld terminal
CN112218279A
Equipment connection method and electronic equipment
CN115550415A
Data transmission method and device, storage medium and electronic equipment
CN115914430A
Techniques for device-to-device authentication
CN116158103A
