Smart device pairing method and device, storage medium and electronic device

CN116133088BActive Publication Date: 2025-08-22HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211426995.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-15
Publication Date
2025-08-22
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种智能设备的配对方法和装置、存储介质及电子装置,以至少解决相关技术中的设备配对方式存在由于易出现数据包丢失、环境干扰等情况导致的设备配对的成功率低的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116133088B_ABST
    Figure CN116133088B_ABST
Patent Text Reader

Abstract

The present application discloses a pairing method and apparatus, a storage medium, and an electronic device for smart devices, which are applied to smart devices. The method comprises: in pairing mode, exchanging device information with a peer device via a wireless connection between the peer device and the peer device; verifying the device information of the peer device to obtain a first verification result, sending the first verification result to the peer device, and waiting to receive the verification result sent by the peer device; upon receiving a second verification result sent by the peer device, sending a first indication message to the peer device, wherein the first indication message is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the peer device verifying the device information of the local device; upon receiving a second indication message sent by the peer device to indicate that the first verification result has been received, determining a pairing result with the peer device based on the first verification result and the second verification result, and exiting the pairing mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home / intelligent home technology, and more specifically, to a method and apparatus for pairing smart devices, a storage medium, and an electronic device. Background Art

[0002] At present, in the home appliance Internet of Things, interaction between devices can be carried out through the network connection between devices. Since no wiring is required and almost all smart home appliances support wireless network transmission technologies such as Bluetooth and WiFi (Wireless Fidelity), wireless transmission technology is usually used in related technologies to establish pairing relationships between devices.

[0003] However, in the above-mentioned device pairing methods, wireless transmission data packet loss often occurs when the devices enter the pairing process, resulting in pairing failure. In addition, environmental interference and other reasons often cause pairing failures between devices. Therefore, the device pairing methods in the related art have the problem of low device pairing success rate due to the susceptibility to data packet loss and environmental interference. Summary of the Invention

[0004] The embodiments of the present application provide a method and apparatus for pairing smart devices, a storage medium, and an electronic device to at least solve the problem of low device pairing success rate due to the susceptibility to data packet loss, environmental interference, etc. in the device pairing method in the related art.

[0005] According to one aspect of an embodiment of the present application, a pairing method for a smart device is provided, which is applied to a smart device, comprising: in pairing mode, exchanging device information with a peer device through a wireless connection between the peer device and the peer device; verifying the device information of the peer device to obtain a first verification result, sending the first verification result to the peer device, and waiting to receive the verification result sent by the peer device; upon receiving a second verification result sent by the peer device, sending a first indication message to the peer device, wherein the first indication message is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the peer device verifying the device information of the local device; upon receiving a second indication message sent by the peer device to indicate that the first verification result has been received, determining the pairing result with the peer device based on the first verification result and the second verification result, and exiting the pairing mode.

[0006] According to another aspect of an embodiment of the present application, a pairing device for a smart device is also provided, which is applied to a smart device and includes: an exchange unit for exchanging device information with a peer device through a wireless connection between the peer device and the peer device in a pairing mode; a verification unit for verifying the device information of the peer device to obtain a first verification result, sending the first verification result to the peer device, and waiting to receive the verification result sent by the peer device; a sending unit for sending a first indication message to the peer device when a second verification result sent by the peer device is received, wherein the first indication message is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the peer device verifying the device information of the local device; a first execution unit for determining the pairing result with the peer device based on the first verification result and the second verification result when a second indication message sent by the peer device to indicate that the first verification result has been received is received, and exiting the pairing mode.

[0007] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned pairing method for smart devices when running.

[0008] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned smart device pairing method through the computer program.

[0009] In an embodiment of the present application, after determining a verification result based on the exchanged device information and sending the verification result, an indication message of the received verification result is sent. In pairing mode, device information is exchanged with the opposite device through a wireless connection between the opposite device and the opposite device; the device information of the opposite device is verified to obtain a first verification result, the first verification result is sent to the opposite device, and the verification result sent by the opposite device is received. In the case of receiving a second verification result sent by the opposite device, a first indication message is sent to the opposite device, wherein the first indication message is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the opposite device verifying the device information of the local device; after receiving the verification result sent by the opposite device, a first indication message is sent to the opposite device. In the case of the second indication information indicating that the first verification result has been received, the pairing result with the opposite device is determined based on the first verification result and the second verification result, and the pairing mode is exited. Since a mechanism for sending an indication information of the received verification result is added when exchanging the verification results, it can be ensured that the pairing process of the local device is terminated after the opposite device receives the verification result, thereby avoiding the pairing failure caused by the failure to transmit the verification result during data transmission, thereby achieving the purpose of reducing the impact of data packet loss, environmental interference and other situations on device pairing, and achieving the technical effect of improving the success rate of device pairing, thereby solving the problem of low device pairing success rate due to the easy occurrence of data packet loss, environmental interference and other situations in the device pairing method in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Figure 1 1 is a schematic diagram of a hardware environment for a pairing method of a smart device according to an embodiment of the present application;

[0013] Figure 2 This is a flowchart of an optional method for pairing smart devices according to an embodiment of the present application;

[0014] Figure 3 is a flowchart of another optional method for pairing smart devices according to an embodiment of the present application;

[0015] Figure 4This is a structural block diagram of an optional smart device pairing apparatus according to an embodiment of the present application;

[0016] Figure 5 This is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0019] According to one aspect of the embodiment of the present application, a pairing method for a smart device is provided, which can be applied to a smart device. The pairing method for a smart device is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the pairing method of the above-mentioned smart device can be applied to Figure 1 In the hardware environment shown in FIG. 1 , which is composed of a terminal device 102 and a server 104. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0020] The aforementioned network may include, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi and Bluetooth. The terminal device 102 may be, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing machine, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, smart curtains, smart audio and video, a smart socket, a smart speaker, a smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purifier, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, or other voice-activated device capable of voice interaction.

[0021] The pairing method of the smart device of the embodiment of the present application can be executed by the server 104, or by the terminal device 102, or by both the server 104 and the terminal device 102. The terminal device 102 can also execute the pairing method of the smart device of the embodiment of the present application by a client installed thereon.

[0022] Taking the terminal device 102 as an example to execute the pairing method of the smart device in this embodiment, Figure 2 FIG. 1 is a flow chart of an optional method for pairing smart devices according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:

[0023] Step S202: In pairing mode, device information is exchanged with the opposite device via a wireless connection with the opposite device.

[0024] The pairing method of the smart device in this embodiment can be applied to the scenario of device pairing between two devices. Here, device pairing can be to establish a pairing relationship between two devices, so as to realize the linkage between the two devices. The device here can be a smart device, which can be the same as the description of the aforementioned terminal device, and this embodiment will not be repeated here. The linkage between two devices can mean that the two devices do not need human control, or they can make linkage actions in time according to the device status of the paired devices. Taking the linkage between device A and device B as an example, the linkage between device A and device B means: according to the status of device A, device B makes linkage actions in time, thereby breaking human intervention (the premise requires human setting), thereby realizing the intelligence of terminal devices, such as the ignition of the stove and the start of the range hood, the linkage between the water heater and the thermostat, etc.

[0025] In the home appliance IoT model, most networking structures connect multiple devices to a router, which then connects to the cloud. Mobile applications then issue control commands to the devices via the cloud or a local area network. Throughout this process, devices are controlled by humans, and interoperability and pairing between devices is rarely achieved. To improve device intelligence and enable interoperable control, pairing between devices is necessary. The success rate of pairing directly impacts the user experience.

[0026] Because wireless network transmission technology requires no wiring, it is well-suited for pairing smart devices, particularly between home appliances within the Internet of Things (IoT). In this embodiment, device-to-device pairing is achieved based on wireless transmission technology. Bluetooth and WiFi, two of the more widely used wireless network transmission technologies, are supported by nearly all mobile phones, tablets, and laptops. Smart devices typically also have at least one of these configured. Therefore, at least one of these two technologies can be selected to establish device pairing.

[0027] However, when devices enter the pairing process, the pairing success rate may be low due to factors such as wireless transmission data packet loss or environmental interference. To address this, in this embodiment, a confirmation mechanism, namely, an ack (acknowledge character) mechanism, is added when exchanging pairing verification results. This mechanism ensures that the verification result has been received by the other end before the pairing process ends on the local end. Since both parties have received the verification result from the other end, they can determine whether the pairing relationship has been successfully established based on the verification results from the local end and the other end, thereby improving the device pairing success rate.

[0028] In this embodiment, for two devices that need to establish a pairing relationship, the two devices can first be controlled to enter pairing mode. Here, the method of controlling the devices to enter pairing mode can be achieved by operating the device buttons on the devices, or other methods of starting pairing mode, which are not limited in this embodiment.

[0029] In pairing mode, device information can be exchanged with the peer device through the wireless connection between the two devices. Here, in order to facilitate the description of the two devices that need to establish a pairing relationship, the two devices are respectively referred to as the local device and the peer device. The wireless connection here can be a WiFi connection or other wireless connection such as Bluetooth. The device information may include but is not limited to at least one of the following: baseboard information, module MAC (media access control address, local area network address), SSID (Service Set Identifier), password, etc. The baseboard information can be the device ID (Identifier), version number and other information of the device.

[0030] The above-mentioned process of exchanging device information may be a process in which the local device sends the device information of the local device to the opposite device and receives the device information of the opposite device. The exchange of device information may be completed by a module (which may include a hardware module or a software module) with a pairing function inside the local device and the opposite device. In order to avoid the situation in which device pairing fails due to a failure in sending device information, a timed sending mechanism may be set to ensure that the opposite device can receive the device information. The time interval for the timed sending may be one second. At the same time, a first number threshold may be set for the number of timed sendings. When the number of sendings reaches the first number threshold, the sending of the device information may be stopped. In addition, a first time threshold may be set for the total time of the timed sending. When the sending time reaches the first time threshold, the sending of the device information may be stopped.

[0031] In addition, in order to prevent the failure of device pairing due to the failure to send device information, a second time threshold can also be set. After sending the device information, if the verification result sent by the other device is not received within the second time threshold, the local device is controlled to resend the device information until the number of times the device information is sent reaches the first number threshold, or the time difference between the current time and the first time the device is sent reaches the first time threshold.

[0032] Step S204: verify the device information of the opposite device to obtain a first verification result, send the first verification result to the opposite device, and wait for receiving the verification result sent by the opposite device.

[0033] In this embodiment, the local device may verify the device information received from the peer device, obtain a first verification result, and send the first verification result to the peer device. Simultaneously, the peer device may also verify the device information received from the local device and send the obtained verification result (i.e., the second verification result) to the local device. The verification result here may be whether pairing with the peer device is permitted based on the received device information, and may be either permission or non-pairing.

[0034] Optionally, the first verification result and the second verification result may be consistent, that is, the verification result of the local device on the device information sent by the opposite device is that pairing with the opposite device is permitted, and the verification result of the opposite device on the device information sent by the local device is that pairing with the local device is permitted. Optionally, the first verification result and the second verification result may be inconsistent, that is, one is that pairing is permitted and the other is that pairing is not permitted.

[0035] Step S206: When the second verification result sent by the opposite device is received, a first indication message is sent to the opposite device, wherein the first indication message is used to indicate that the second verification result has been received, and the second verification result is the verification result obtained by the opposite device verifying the device information of the local device.

[0036] To avoid device pairing failure caused by data transmission failure during the verification result exchange process, in this embodiment, upon receiving the second verification result sent by the peer device, a first indication message may be sent to the peer device. Here, the first indication message may be used to indicate receipt of the second verification result, and may be a verification result (ack). Here, ack may indicate that the sent character has been confirmed to have been received correctly.

[0037] Correspondingly, when the opposite device receives the first verification result sent by the local device, it can also send indication information to the local device to indicate that the first verification result has been received, that is, the second indication information. By adding the sending of indication information, it can be ensured that the pairing process of the local end is terminated after it is determined that the opposite device has received the verification result. The local device can determine that the opposite device has successfully received the first verification result of the local device based on the received indication information, and the opposite device can also determine that the local device has successfully received the second verification result of the opposite device based on the received indication information. The two devices can terminate the pairing process of the local end after ensuring that the opposite device has received the verification result, thereby avoiding pairing anomalies caused by one device not receiving the verification result due to data transmission failure and the other device terminating the pairing process after sending the verification result.

[0038] Optionally, a retransmission mechanism may be configured for the first verification result and the second verification result. That is, if the local device does not receive the indication information sent by the opposite device indicating that the first verification result has been received within a certain period of time, the local device may be controlled to retransmit the first verification result to the opposite device and wait again for receipt of the indication information sent by the opposite device indicating that the first verification result has been received. Correspondingly, if the opposite device does not receive the indication information sent by the local device indicating that the second verification result has been received within a certain period of time, the local device may be controlled to retransmit the second verification result to the local device and wait again for receipt of the indication information sent by the local device indicating that the second verification result has been received.

[0039] Step S208: upon receiving second indication information sent by the opposite device indicating that the first verification result has been received, determining a pairing result with the opposite device according to the first verification result and the second verification result, and exiting the pairing mode.

[0040] In this embodiment, upon receiving second indication information from the peer device indicating receipt of the first verification result, the pairing result with the peer device can be determined based on the first verification result and the second verification result. Since the verification result determines whether pairing is permitted based on the received device information, pairing between the local device and the peer device is successful only if both the first verification result and the second verification result permit pairing. Otherwise, pairing fails. Regardless of whether the pairing result is successful or unsuccessful, if both the local device and the peer device receive the indication information, both devices can terminate the pairing process, i.e., exit pairing mode.

[0041] Optionally, if the local device and the remote device are successfully paired, the local device and the remote device can synchronize their device states. That is, if the device state of the local device changes, the remote device can synchronize with the corresponding device state change. Correspondingly, if the device state of the remote device changes, the local device can also synchronize with the corresponding device state change. For example, taking the remote device as a smart stove and the local device as a smart range hood, if the smart stove and the smart range hood are successfully paired, when the device state of the smart stove changes from dormant to active and ignited, the smart range hood can also synchronize from dormant to active. This synchronized linkage of the states of the two devices eliminates the need for manual control.

[0042] It should be noted that the synchronized device status can be indicated based on the configuration information. When the device status of a device at one end sends a change, if the changed device status belongs to a device status identified as having linkage, the linked device status and the smart device to which the linked device status belongs can be determined, and a device status linkage indication can be sent to the device to control the device status corresponding to the device to be linked. Although the pairing process of two devices is explained in this embodiment, the above method can be used to establish a pairing relationship for any number of linked devices. At the same time, the control for device linkage can be individual smart devices, gateway devices, or other devices, which are not limited in this embodiment.

[0043] Through the above steps S202 to S208, in pairing mode, device information is exchanged with the opposite device through the wireless connection between the opposite device and the opposite device; the device information of the opposite device is verified to obtain a first verification result, the first verification result is sent to the opposite device, and the verification result sent by the opposite device is waited for; when the second verification result sent by the opposite device is received, a first indication message is sent to the opposite device, wherein the first indication message is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the opposite device verifying the device information of the local device; when the second indication message sent by the opposite device to indicate that the first verification result has been received is received, the pairing result with the opposite device is determined according to the first verification result and the second verification result, and the pairing mode is exited, which solves the problem of low device pairing success rate due to easy data packet loss, environmental interference, etc. in the device pairing method in the related art, thereby improving the success rate of device pairing.

[0044] In an exemplary embodiment, in pairing mode, exchanging device information with a peer device via a wireless connection with the peer device includes:

[0045] S11 , in pairing mode, continuously sending device information of the local device to the opposite device through the wireless connection with the opposite device within a first preset time, and receiving device information of the opposite device sent by the opposite device.

[0046] In this embodiment, a first preset time (i.e., the aforementioned first time threshold) may be set for the exchange of device information. During the first preset time, the device information of the local device is continuously sent to the remote device via the wireless connection with the remote device, and the device information of the remote device sent by the remote device is received. The continuous transmission here can be uninterrupted continuous transmission or continuous transmission at fixed time intervals. The time interval can be the same as described above and is not further described in this embodiment. Correspondingly, the transmission of device information from the remote device to the local device can also be continuously transmitted over the wireless connection for a specified time period.

[0047] Here, it should be noted that the first preset time can be set by a pre-set first time length, that is, the first preset time can be a time period determined by the time when the device information is first sent (or other times, for example, the time when entering the pairing mode, etc.) as the starting point and the first time length as the time length.

[0048] Through this embodiment, by continuously sending device information within a preset time, a pairing failure caused by a failure to send device information once can be avoided, thereby improving the success rate of pairing.

[0049] In an exemplary embodiment, after sending the first verification result to the peer device, the method further includes:

[0050] S21: When no indication information sent by the opposite device indicating that the first verification result has been received is received within a second preset time, retransmit the first verification result at least once.

[0051] For the transmission of the verification result, a retransmission mechanism can be added, that is, a retransmission mechanism is added during the pairing process to avoid the situation where the pairing fails due to the failure to send the verification result. In this embodiment, a second preset time can be pre-set for the retransmission mechanism. If the indication information sent by the opposite device to indicate that the first verification result has been received is not received within the second preset time, the first verification result can be retransmitted at least once. The second preset time here can be the time calculated from the moment when the local device sends the first verification result to the opposite device (or other moments), that is, the second preset time can be a time period determined by the moment when the first verification result is sent (or other moments) as the starting point and the second time length as the time length.

[0052] Optionally, if the indication information sent by the peer device indicating that the first verification result has been received is not received within a certain period of time after completing a retransmission operation, the first verification result may be retransmitted. The certain period of time here may be a time period of the same length as the second preset time or a time period of a different length from the second preset time, and this embodiment is not limited thereto.

[0053] Correspondingly, if the opposite device does not receive the indication information sent by the local device indicating that the second verification result has been received within a certain period of time, it can also perform at least one retransmission operation on the second verification result. The process of performing at least one retransmission operation on the second verification result is similar to that in the above embodiment and is not further described here.

[0054] Through this embodiment, by adding a retransmission mechanism to the verification result, the occurrence of pairing failure due to failure to send the verification result can be avoided, thereby improving the success rate of pairing.

[0055] In an exemplary embodiment, after performing at least one retransmission operation on the first verification result, the method further includes:

[0056] S31, when the number of times the retransmission operation is performed reaches a preset number threshold but the indication information sent by the opposite end device indicating that the first verification result has been received is still not received, stop performing the retransmission operation; or

[0057] S32: If the indication information sent by the opposite device indicating that the first verification result has been received is not received within the third preset time, stop performing the retransmission operation.

[0058] For the retransmission mechanism of the verification result, a limiting condition can be added to prevent the unlimited execution of the retransmission operation, which would cause a waste of resources. In this embodiment, the limiting condition can be a preset number of times set for the execution number of the retransmission operation, or a third preset time set for the execution time of the retransmission operation.

[0059] Optionally, if the number of retransmissions reaches a preset threshold but no indication information is received from the peer device indicating receipt of the first verification result, the retransmission operation may be stopped. Alternatively, if no indication information is received from the peer device indicating receipt of the first verification result within a third preset time, the retransmission operation may be stopped. Correspondingly, the peer device performs a retransmission operation on the second verification result in a similar manner, and this embodiment will not be described in detail here.

[0060] Through this embodiment, by limiting the number or time of retransmission operations of the verification result, meaningless long retransmissions can be avoided, thereby reducing the waste of transmission resources and improving the efficiency of pairing.

[0061] In an exemplary embodiment, the method further includes:

[0062] S41: When the time for establishing a wireless connection with the opposite device reaches a preset time threshold, exit the pairing mode.

[0063] In the process of establishing a pairing relationship between the local device and the remote device, even if corresponding continuous sending or retransmission operations are set for the sending of device information and verification results to minimize pairing failures caused by data packet loss during wireless transmission, it is still impossible to avoid the situation where data cannot be sent or received normally due to an abnormality in one device.

[0064] To prevent the other device from not exiting pairing mode for a long time after an abnormality occurs on one device, causing the other device to waste a long time and resources in the pairing process, thereby affecting the user experience, in this embodiment, a timeout mechanism can be added after the local device and the remote device establish a wireless connection. That is, a maximum time in pairing mode, i.e., a preset time threshold, is pre-set. The timer starts after the local device and the remote device establish a wireless connection. If the time it takes to establish the wireless connection with the remote device reaches the preset time threshold, the local device can exit pairing mode regardless of whether pairing is completed. Correspondingly, the remote device can also exit pairing mode after the preset time threshold is reached to avoid resource occupation.

[0065] Through this embodiment, the pairing mode is exited when the time for establishing the wireless connection reaches a preset time threshold, which can avoid meaningless waiting and improve the efficiency of pairing.

[0066] In an exemplary embodiment, before exchanging device information with the peer device through the wireless connection between the peer device and the peer device, the method further includes:

[0067] S51, when the local device and the opposite device are connected to the same router, discover the opposite device through the local area network and establish a wireless connection with the opposite device; or

[0068] S52 , when the local device and the opposite device are not connected to the same router, discover the opposite device through a peer-to-peer network and establish a wireless connection with the opposite device.

[0069] In pairing mode, before exchanging device information with the peer device via a wireless connection, the local device and the peer device must first discover each other and establish a wireless connection. In this embodiment, since the local device and the peer device may be connected to the same router or different routers, or one or both of them may not be connected to a router, two mutual discovery and connection establishment methods can be configured to respectively address the situations where the local device and the peer device are connected to the same router and not connected to the same router.

[0070] Optionally, when the local device and the peer device are connected to the same router, the peer device is discovered via the local area network and a wireless connection is established with the peer device. Here, the local area network may be a UWT (a local area network pairing method) protocol. When the local device and the peer device are connected to the same router, the local device and the peer device can quickly discover and connect to each other via the local area network.

[0071] Optionally, when the local device and the opposite device are not connected to the same router, the opposite device is discovered through a peer-to-peer network, and a wireless connection is established with the opposite device. Here, the peer-to-peer network can be a P2P (Peer to Peer) protocol. Since there is no same router as an intermediate medium between the local device and the opposite device, and the P2P protocol can achieve direct access to the peer node (Peer) without going through an intermediate entity, when the local device and the opposite device are not connected to the same router, the local device and the opposite device can be discovered and connected through the peer-to-peer network. For each device, if it is connected to the router, the local area network device discovery method can be used to try whether the required device can be discovered. If the device discovery is unsuccessful, the peer network device discovery method can be used to try whether the required device can be discovered.

[0072] Through this embodiment, different protocols are used to complete mutual discovery and connection between devices according to whether the local device and the opposite device are connected to the same router, which can expand the scope of application of device pairing and improve the success rate of device discovery.

[0073] In an exemplary embodiment, determining a pairing result with a peer device according to the first verification result and the second verification result includes:

[0074] S61: If both the first verification result and the second verification result indicate that the verification is passed, determining to establish a pairing relationship between the local device and the peer device;

[0075] S62: If at least one of the first verification result and the second verification result indicates that the verification fails, determine not to establish a pairing relationship between the local device and the opposite device.

[0076] In this embodiment, since the verification result can be a result of allowing pairing (i.e., the verification result is used to indicate whether the verification is passed) or a result of not allowing pairing, the pairing result with the peer device can be determined based on the first verification result and the second verification result. The pairing result with the peer device can be a successful pairing or a failed pairing.

[0077] If both the first verification result and the second verification result indicate that the verification is passed, it can be determined that a pairing relationship between the local device and the remote device is established (i.e., the pairing of the two devices is successful). If at least one of the first verification result and the second verification result indicates that the verification is failed, it can be determined that a pairing relationship between the local device and the remote device is not established (i.e., the pairing of the two devices fails).

[0078] Through this embodiment, the pairing result is determined based on the verification results of the local device and the opposite device, which can avoid the situation where the pairing results displayed by the two devices at both ends are inconsistent due to the inconsistent verification results of the local device and the opposite device, thereby improving the accuracy of device pairing and avoiding abnormal device pairing.

[0079] The following is an explanation of the pairing method of the smart devices in the embodiment of the present application with reference to an optional example. In this optional example, the local device is device A and the opposite device is device B.

[0080] This optional example provides a device-to-device pairing interaction solution. It incorporates a retransmission mechanism when sending verification results and an ACK mechanism when exchanging verification results, ensuring that the pairing process ends only after the other end has received the verification result. Furthermore, a timeout mechanism is added after mutual discovery to prevent the other end from remaining in pairing mode for a long time after an anomaly on one end, thereby improving the user experience.

[0081] like Figure 3 As shown, the process of the pairing method of the smart device in this optional example may include the following steps:

[0082] Step 1: Start pairing. You can use the device buttons to put the two devices into pairing mode.

[0083] Step 2: The two devices discover each other through a peer-to-peer network protocol or a local area network pairing protocol and establish a secure connection. At the same time, a timeout mechanism is started and the timer begins.

[0084] Step 3: Exchange device information separately. Device A sends device information to device B, and device B sends device information to device A. The device information may include module MAC, SSID, password, baseboard information, etc.

[0085] Step 4: Verify whether pairing is allowed and obtain verification results. Device A verifies the device information of device B and packages it (verification result), and device B verifies the device information of device A and packages it (verification result).

[0086] Step 5: Exchange the pairing verification result and the verification result ack. When the verification result ack is received from the other end, the pairing process of the local end is ended.

[0087] Device A sends its verification result to device B, and device B sends its verification result to device A. Device A receives device B's verification result and sends a verification result ack to device B. Device B receives device A's verification result and sends a verification result ack to device A. After device A receives device B's verification result ack, the pairing process ends. After device B receives device A's verification result ack, the pairing process ends.

[0088] Step 6: Determine whether the pairing is successful based on the verification results at both ends. If the pairing is successful or the timeout mechanism indicates a timeout, the pairing ends.

[0089] Through this optional example, adding an ACK mechanism and a retransmission mechanism to the pairing process can effectively prevent the pairing process on the local end from being stopped when the other end does not receive the verification result, thereby optimizing the pairing success rate in this scenario.

[0090] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0091] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory, Read-Only Memory) / RAM (Random Access Memory, Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0092] According to another aspect of an embodiment of the present application, a pairing apparatus for a smart device is provided for implementing the above-mentioned pairing method for a smart device. The pairing apparatus for a smart device can be applied to a smart device. Figure 4 This is a structural block diagram of an optional smart device pairing device according to an embodiment of the present application, such as Figure 4 As shown, the device may include:

[0093] The exchanging unit 402 is configured to exchange device information with the peer device via a wireless connection with the peer device in pairing mode;

[0094] The verification unit 404 is connected to the exchange unit 402 and is configured to verify the device information of the peer device, obtain a first verification result, send the first verification result to the peer device, and wait for receipt of the verification result sent by the peer device;

[0095] a sending unit 406, connected to the verification unit 404, and configured to send first indication information to the peer device upon receiving the second verification result sent by the peer device, wherein the first indication information is used to indicate that the second verification result has been received, where the second verification result is a verification result obtained by the peer device verifying the device information of the local device;

[0096] The first execution unit 408 is connected to the sending unit 406, and is used to determine the pairing result with the peer device according to the first verification result and the second verification result, and exit the pairing mode when receiving the second indication information sent by the peer device to indicate that the first verification result has been received.

[0097] It should be noted that the switching unit 402 in this embodiment can be used to execute the above step S202, the verification unit 404 in this embodiment can be used to execute the above step S204, the sending unit 406 in this embodiment can be used to execute the above step S206, and the first execution unit 408 in this embodiment can be used to execute the above step S208.

[0098] Through the above-mentioned module, in pairing mode, device information is exchanged with the opposite device through the wireless connection between the opposite device and the opposite device; the device information of the opposite device is verified to obtain a first verification result, the first verification result is sent to the opposite device, and the verification result sent by the opposite device is waited for; when the second verification result sent by the opposite device is received, a first indication message is sent to the opposite device, wherein the first indication message is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the opposite device verifying the device information of the local device; when the second indication message sent by the opposite device to indicate that the first verification result has been received is received, the pairing result with the opposite device is determined according to the first verification result and the second verification result, and the pairing mode is exited, which solves the problem of low device pairing success rate due to easy data packet loss, environmental interference, etc. in the device pairing method in the related art, thereby improving the success rate of device pairing.

[0099] In an exemplary embodiment, the switching unit comprises:

[0100] The execution module is used to continuously send the device information of the local device to the opposite device through the wireless connection between the local device and the opposite device within a first preset time in the pairing mode, and receive the device information of the opposite device sent by the opposite device.

[0101] In an exemplary embodiment, the apparatus further comprises:

[0102] The second execution unit is used to perform at least one retransmission operation on the first verification result after sending the first verification result to the opposite device if no indication information sent by the opposite device to indicate that the first verification result has been received is received within a second preset time.

[0103] In an exemplary embodiment, after performing at least one retransmission operation on the first verification result, the apparatus further includes:

[0104] A first stopping unit is configured to stop the retransmission operation when the number of times the retransmission operation is performed reaches a preset number threshold but the indication information sent by the opposite end device indicating that the first verification result has been received is not received; or

[0105] The second stopping unit is configured to stop performing the retransmission operation if the indication information sent by the opposite end device and used to indicate that the first verification result has been received is not received within a third preset time.

[0106] In an exemplary embodiment, the apparatus further comprises:

[0107] The exit unit is used to exit the pairing mode when the time for establishing the wireless connection with the opposite device reaches a preset time threshold.

[0108] In an exemplary embodiment, the apparatus further comprises:

[0109] The third execution unit is configured to, before exchanging device information with the opposite device through the wireless connection between the local device and the opposite device, discover the opposite device through the local area network and establish a wireless connection with the opposite device when the local device and the opposite device are connected to the same router; or

[0110] The fourth execution unit is configured to discover the opposite device through a peer-to-peer network and establish a wireless connection with the opposite device when the local device and the opposite device are not connected to the same router.

[0111] In an exemplary embodiment, the first execution unit includes:

[0112] A first determining module is configured to determine to establish a pairing relationship between the local device and the opposite device when both the first verification result and the second verification result indicate that the verification is passed;

[0113] The second determining module is configured to determine not to establish a pairing relationship between the local device and the opposite device if at least one of the first verification result and the second verification result indicates that the verification has failed.

[0114] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. Figure 1 The hardware environment shown can be implemented through software or hardware, wherein the hardware environment includes a network environment.

[0115] According to another aspect of the embodiments of the present application, a storage medium is further provided, which can be located on a smart device. Optionally, in this embodiment, the storage medium can be used to execute the program code of any of the above-mentioned smart device pairing methods in the embodiments of the present application.

[0116] Optionally, in this embodiment, the above-mentioned storage medium may be located on at least one network device among the multiple network devices in the network shown in the above-mentioned embodiment.

[0117] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0118] S1, in pairing mode, exchanges device information with the peer device through a wireless connection between the peer device and the peer device;

[0119] S2, verifying the device information of the peer device to obtain a first verification result, sending the first verification result to the peer device, and waiting to receive the verification result sent by the peer device;

[0120] S3, upon receiving the second verification result sent by the peer device, sending first indication information to the peer device, wherein the first indication information is used to indicate that the second verification result has been received, where the second verification result is a verification result obtained by the peer device verifying the device information of the local device;

[0121] S4. Upon receiving second indication information sent by the opposite device indicating that the first verification result has been received, determine a pairing result with the opposite device according to the first verification result and the second verification result, and exit the pairing mode.

[0122] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.

[0123] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0124] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned pairing method for smart devices is also provided. The electronic device may be a smart device, a server, a terminal, or a combination thereof.

[0125] Figure 5 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 5 As shown, it includes a processor 502, a communication interface 504, a memory 506 and a communication bus 508, wherein the processor 502, the communication interface 504 and the memory 506 communicate with each other through the communication bus 508, wherein,

[0126] Memory 506, for storing computer programs;

[0127] The processor 502 is configured to execute the computer program stored in the memory 506 to implement the following steps:

[0128] S1, in pairing mode, exchanges device information with the peer device through a wireless connection between the peer device and the peer device;

[0129] S2, verifying the device information of the peer device to obtain a first verification result, sending the first verification result to the peer device, and waiting to receive the verification result sent by the peer device;

[0130] S3, upon receiving the second verification result sent by the peer device, sending first indication information to the peer device, wherein the first indication information is used to indicate that the second verification result has been received, where the second verification result is a verification result obtained by the peer device verifying the device information of the local device;

[0131] S4. Upon receiving second indication information sent by the opposite device indicating that the first verification result has been received, determine a pairing result with the opposite device according to the first verification result and the second verification result, and exit the pairing mode.

[0132] Optionally, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5The communication interface is used for communication between the electronic device and other devices.

[0133] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the aforementioned processor.

[0134] As an example, the memory 506 may include, but is not limited to, the exchange unit 402, the verification unit 404, the sending unit 406, and the first execution unit 408 in the pairing device of the smart device. In addition, it may also include, but is not limited to, other module units in the pairing device of the smart device, which will not be repeated in this example.

[0135] The above-mentioned processor can be a general-purpose processor, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0136] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0137] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only. The device for implementing the above-mentioned pairing method of smart devices may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 5 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 5 Different configurations shown.

[0138] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0139] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0140] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application.

[0141] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

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

[0143] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the purpose of the solution provided in this embodiment.

[0144] In addition, the functional units in the various embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or at least two units may be integrated into a single unit. The above-mentioned integrated units may be implemented in the form of hardware or software functional units.

[0145] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for pairing a smart device, characterized in that: include: In pairing mode, device information is exchanged with the peer device via a wireless connection with the peer device; Verifying the device information of the peer device to obtain a first verification result, sending the first verification result to the peer device, and waiting to receive a verification result sent by the peer device; Upon receiving the second verification result sent by the opposite device, sending first indication information to the opposite device, wherein the first indication information is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the opposite device verifying the device information of the local device; Upon receiving second indication information sent by the opposite device indicating that the first verification result has been received, determining a pairing result with the opposite device according to the first verification result and the second verification result, and exiting the pairing mode.

2. The method according to claim 1, characterized in that The exchanging of device information with the peer device via the wireless connection with the peer device in the pairing mode includes: In the pairing mode, the device information of the local device is continuously sent to the opposite device through the wireless connection with the opposite device within a first preset time, and the device information of the opposite device sent by the opposite device is received.

3. The method according to claim 1, characterized in that After sending the first verification result to the opposite device, the method further includes: In a case where indication information sent by the opposite device indicating that the first verification result has been received is not received within a second preset time, performing at least one retransmission operation on the first verification result.

4. The method according to claim 3, characterized in that After performing at least one retransmission operation on the first verification result, the method further includes: If the number of times the retransmission operation is performed reaches a preset number threshold but the indication information sent by the opposite device indicating that the first verification result has been received is still not received, stopping the retransmission operation; or If the indication information sent by the opposite device indicating that the first verification result has been received is not received within the third preset time, the retransmission operation is stopped.

5. The method according to claim 1, wherein The method further comprises: When the time for establishing the wireless connection with the opposite device reaches a preset time threshold, the pairing mode is exited.

6. The method according to claim 1, characterized in that Before exchanging device information with the opposite device through the wireless connection between the opposite device and the opposite device, the method further includes: In the case where the local device and the opposite device are connected to the same router, discovering the opposite device through a local area network and establishing a wireless connection with the opposite device; or In the case that the local device and the opposite device are not connected to the same router, the opposite device is discovered through a peer-to-peer network, and a wireless connection is established with the opposite device.

7. The method according to any one of claims 1 to 6, characterized in that The determining a pairing result with the opposite-end device according to the first verification result and the second verification result includes: If both the first verification result and the second verification result indicate that verification is passed, determining to establish a pairing relationship between the local device and the peer device; If at least one of the first verification result and the second verification result indicates that the verification fails, it is determined not to establish a pairing relationship between the local device and the opposite device.

8. A pairing device for a smart device, characterized in that: include: an exchange unit, configured to exchange device information with a peer device via a wireless connection with the peer device in a pairing mode; a verification unit, configured to verify the device information of the peer device, obtain a first verification result, send the first verification result to the peer device, and wait for receipt of a verification result sent by the peer device; a sending unit, configured to send first indication information to the peer device when receiving the second verification result sent by the peer device, wherein the first indication information is used to indicate that the second verification result has been received, and the second verification result is a verification result obtained by the peer device verifying the device information of the local device; The first execution unit is configured to, upon receiving second indication information sent by the opposite device indicating that the first verification result has been received, determine a pairing result with the opposite device according to the first verification result and the second verification result, and exit the pairing mode.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Pairing method, device, machine-readable storage medium, and system

    US20200015301A1

  • Identity Verification and Verifying Device

    US20200304541A1