Device pairing methods, apparatus, electronic devices and storage media
By using distance authentication and information authentication between devices, the distance between devices is calculated, the most suitable target device is determined, and automatic pairing is performed. This solves the problem of low device pairing efficiency in existing technologies and achieves fast, manual-free device pairing.
Patent Information
- Application Number
- CN202510621725.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2026-11-17
AI Technical Summary
Existing device pairing methods are inefficient, especially in scenarios where pairing between multiple devices is required. The efficiency of device pairing is significantly reduced, particularly when pairing home appliances cannot be done via NFC or other methods.
By using distance authentication and information authentication, the distance between devices is calculated, the most suitable target device is determined, and pairing information is sent for automatic pairing, avoiding manual intervention.
It enables rapid pairing between devices, improving device pairing efficiency, especially in scenarios where no manual intervention is required during the installation of home appliances, simplifying the process of pairing multiple devices.
Smart Images

Figure CN123123873A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of device pairing technology, and in particular to a device pairing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Pairing two devices establishes a connection, enabling control between them. In related technologies, pairing typically requires on-screen confirmation, connection to the same Wi-Fi network, or unique verification via NFC and verification codes.
[0003] However, the device pairing methods in related technologies are inefficient, especially in scenarios where pairing between multiple devices is required, where the efficiency of device pairing is significantly reduced.
[0004] Therefore, how to quickly achieve automatic pairing between devices is an urgent problem to be solved. Summary of the Invention
[0005] This application provides a device pairing method, apparatus, electronic device, and storage medium that can quickly achieve automatic pairing between devices.
[0006] In a first aspect, embodiments of this application provide a device pairing method, applied to a target first device among M first devices, wherein the target first device is any one of the M first devices, and M is a positive integer greater than or equal to 1; the method includes:
[0007] Send first information to the target second device among N second devices. The first information is the relevant configuration information for pairing the target first device with the target second device. The target second device is determined based on the distance between the target first device and the target second device. N is a positive integer greater than or equal to 1.
[0008] Receive pairing request information sent by the target second device;
[0009] Based on the pairing request information, pair with the target second device.
[0010] Secondly, embodiments of this application provide a device pairing method applied to a target second device among N second devices. The target second device is determined based on the distance between a target first device and a target second device among M first devices. The target first device is any one of the M first devices, where M and N are positive integers greater than or equal to 1. The method includes:
[0011] Receive first information sent by the first target device, the first information being the relevant configuration information for pairing the first target device with the second target device;
[0012] Based on the first information, a pairing request is sent to the target first device. The pairing request is used to pair with the target first device.
[0013] Thirdly, embodiments of this application also provide a first device pairing device, applied to a target first device among M first devices, wherein the target first device is any one of the M first devices, and M is a positive integer greater than or equal to 1; the first device pairing device includes:
[0014] The first sending module is used to send first information to a target second device among N second devices. The first information is the relevant configuration information for pairing the target first device with the target second device. The target second device is determined based on the distance between the target first device and the target second device. N is a positive integer greater than or equal to 1.
[0015] The first receiving module is used to receive pairing request information sent by the target second device;
[0016] The pairing module is used to pair with a target second device based on pairing request information.
[0017] Fourthly, embodiments of this application also provide a second device pairing device, applied to a target second device among N second devices. The target second device is determined based on the distance between a target first device and a target second device among M first devices. The target first device is any one of the M first devices, where M and N are positive integers greater than or equal to 1. The second device pairing device includes:
[0018] The second receiving module is used to receive first information sent by the target first device, the first information being relevant configuration information for pairing the target first device and the target second device;
[0019] The second sending module is used to send pairing request information to the target first device based on the first information. The pairing request information is used to pair with the target first device.
[0020] Fifthly, embodiments of this application provide an electronic device, including:
[0021] One or more processors;
[0022] Memory, used to store one or more programs.
[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the device pairing method described in any embodiment of this application.
[0024] Sixthly, embodiments of this application provide a storage medium storing a computer program thereon, which, when executed by a processor, implements the device pairing method described in any embodiment of this application.
[0025] This application proposes a device pairing method, apparatus, electronic device, and storage medium, applied to a target first device among M first devices, where the target first device is any one of the M first devices, and M is a positive integer greater than or equal to 1. The method includes: sending first information to the target second device among N second devices, the first information being configuration information related to pairing between the target first device and the target second device; the target second device is determined based on the distance between the target first device and the target second device; N is a positive integer greater than or equal to 1; receiving pairing request information sent by the target second device; and pairing with the target second device based on the pairing request information. In other words, in the technical solution of this application, the most suitable target second device is determined from the N second devices based on the distance to the target first device. The target first device sends first information to the target second device, and then pairs with the target second device based on the pairing request information sent by the target second device, achieving rapid pairing between the target first device and the target second device and improving device pairing efficiency. Attached Figure Description
[0026] Figure 1 This is one of the schematic flowcharts of a device pairing method provided in an embodiment of this application;
[0027] Figure 2 A schematic flowchart illustrating the process of determining the distance between devices according to an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of a pairing strategy provided in an embodiment of this application;
[0029] Figure 4 This is a second schematic flowchart illustrating a device pairing method provided in an embodiment of this application.
[0030] Figure 5 The third schematic flowchart of a device pairing method provided in an embodiment of this application;
[0031] Figure 6 This is a schematic diagram of the structure of a first device pairing device provided in an embodiment of this application;
[0032] Figure 7 This is a schematic diagram of the structure of a second device pairing device provided in an embodiment of this application;
[0033] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0036] To facilitate understanding of the device pairing method provided by this invention, relevant knowledge of the embodiments of this invention will first be introduced.
[0037] In related technologies, pairing schemes between two devices typically involve pairing them using a key by selecting corresponding signal names. Several device pairing methods are illustrated below:
[0038] 1. Bluetooth pairing: For example, the mobile phone scans for the corresponding Bluetooth headset signal via Bluetooth and selects to pair.
[0039] 2. NFC pairing: For example, computers and mobile phones can quickly establish a connection via NFC and WiFi to transfer files.
[0040] 3. Screen casting pairing: For example, the mobile phone and the TV are connected to the same WiFi network, and the screen casting code is used for unique verification.
[0041] 4. Factory binding pairing: For example, two devices are uniquely bound at the factory.
[0042] In the home appliance industry, pairing home appliances is usually done by simultaneously activating the pairing button on both appliances and performing password verification.
[0043] The above solution has the following problems: When pairing two devices, one party must confirm and lock the key, which is inefficient in practical home appliance installation scenarios. When pairing multiple home appliances, each device needs to be confirmed individually. This significantly reduces efficiency in home appliance installation scenarios.
[0044] In related technologies, device pairing methods mostly require information confirmation via the screen, pairing by connecting to the same Wi-Fi network, or unique verification via NFC modules and verification codes. These methods usually require some configuration or assistance from other hardware devices.
[0045] The methods described above are generally not applicable in home appliance installation scenarios. Some devices are installed in environments without power or network access, making it impossible for two larger appliances to pair via NFC or similar methods. For example, a water heater and its remote control cannot be paired by simply touching the device together using NFC. Especially when multiple appliances need to be paired in the installation environment, the pairing efficiency is extremely low.
[0046] To address the aforementioned technical problems, this application's embodiments utilize distance authentication and information authentication to quickly achieve pairing between two devices. For example, this application's embodiments calculate the distance between the water heater and the wired controller to comprehensively determine their pairing, enabling automatic pairing without human intervention and avoiding the hassle of pairing by after-sales staff and users.
[0047] Figure 1 This is a schematic flowchart of a device pairing method provided in one embodiment of the present application. The method can be executed by a first device pairing device or an electronic device, which can be implemented by software and / or hardware, and can be integrated into any smart device with network communication function.
[0048] like Figure 1 As shown, the device pairing method is applied to a target first device among M first devices, where the target first device is any one of the M first devices, and M is a positive integer greater than or equal to 1.
[0049] The method may include the following steps:
[0050] S110. Send first information to the target second device among N second devices. The first information is the relevant configuration information for pairing the target first device and the target second device. The target second device is determined based on the distance between the target first device and the target second device. N is a positive integer greater than or equal to 1.
[0051] In some embodiments, the first device and the second device are paired to enable mutual control between the devices.
[0052] The first and second devices can be household appliances, industrial equipment, etc. Taking household appliances as an example, the first device can be a water heater, and the second device can be the water heater's wired controller. As another example, the first device can be an air conditioner, and the second device can be the corresponding controller for the air conditioner.
[0053] In some embodiments, pairing and binding between two devices are achieved through WiFi-based information authentication and distance authentication schemes, facilitating device debugging and use by users and after-sales personnel.
[0054] In some embodiments, after the WiFi module of the first device is powered on, it will transmit an encoded signal containing local information. Assuming that a connection is to be established between the first device and the second device, device A is 001 and device B is 002. Device A only receives information from device 002 and device B only receives information from device 001.
[0055] In practical applications, there can be one or more first devices; correspondingly, there can also be one or more second devices.
[0056] In some embodiments, when there is one first device and one second device, the first device is the target first device and the second device is the target second device.
[0057] In some embodiments, when there are multiple first devices and second devices, for any one of the first devices, it is necessary to select the target second device that is most compatible with the target first device from among the multiple second devices for device pairing.
[0058] For example, there are multiple first devices, including: device A1, device A2, and device A3; and multiple second devices, including: device B1, device B2, and device B3. For device A1, it is necessary to select the most suitable device (e.g., device B1) from device B1, device B2, and device B3, and then pair device A1 with device B1.
[0059] In some embodiments, the first information includes identification information of the target first device, pairing information, etc.; wherein, the pairing information is used to indicate whether the target first device is paired, and the pairing parameters when the target first device is paired, etc.
[0060] In some embodiments, after determining that a target second device needs to be paired, the target first device sends first information to the target second device.
[0061] S120: Receive pairing request information sent by the target second device.
[0062] S130. Based on the pairing request information, pair with the target second device.
[0063] This application proposes a device pairing method applied to a target first device among M first devices. In this embodiment, based on the distance to the target first device, a target second device most compatible with the target first device is determined from N second devices. The target first device sends first information to the target second device, and then pairs with the target second device based on the pairing request information sent by the target second device. This achieves rapid pairing between the target first device and the target second device, improving device pairing efficiency.
[0064] Optionally, before sending the first information to the target second device among the N second devices, the target first device also needs to perform the following steps:
[0065] The target second device is determined based on the distance between the target first device and N second devices.
[0066] In some embodiments, the target first device determines the most suitable second device as the target second device based on the distance between it and N second devices.
[0067] Optionally, the distance between the first target device and the second target device is determined in the following way:
[0068] Step 1) Send ranging information to the target second device, the ranging information carrying the first timestamp;
[0069] Step 2) Receive feedback information sent by the target second device, the feedback information carrying the second timestamp of when the target second device received the ranging information;
[0070] Step 3) Determine the distance based on the first timestamp, the second timestamp, and the third timestamp when the feedback information is received.
[0071] In some embodiments, the distance between any first device and any second device can also be obtained through the methods described in steps 1)-3) above.
[0072] Figure 2 A flowchart illustrating the process of determining the distance between devices according to an embodiment of this application is provided. See also: Figure 2As shown, taking device A as the first device and device B as the second device as an example, the steps include:
[0073] Step 1: Begin.
[0074] Step 2: Device A sends ranging information (including timestamp T1).
[0075] Specifically, the timestamp T1 included in the ranging information is the first timestamp mentioned above.
[0076] Step 3: Device B receives the information from Device A, records the processing time T2, and sends the feedback information again.
[0077] Specifically, the processing time T2 is the second timestamp mentioned above.
[0078] Step 4: Device A receives feedback information from Device B and records the timestamp T3.
[0079] Specifically, the timestamp T3 in step 4 is the third timestamp mentioned above.
[0080] Step 5: Based on the first timestamp, the second timestamp, and the third timestamp, device A determines the distance between device A and device B.
[0081] In some embodiments, device A determines the distance between device A and device B based on a first timestamp, a second timestamp, and a third timestamp, which can be calculated using the following formula (1):
[0082] d=c*(T3-T1-T2) / 2 (1)
[0083] Where d represents the distance between device A and device B, c represents a constant, T1 represents the first timestamp, T2 represents the second timestamp, and T3 represents the third timestamp.
[0084] Step 6, End.
[0085] Optionally, the target second device is determined based on the distance between the target first device and N second devices, including at least one of the following:
[0086] Scenario 1: In the case of multiple second devices, calculate the distance between the target first device and each second device; determine the second device with the smallest distance from the target first device as the target second device.
[0087] In some embodiments, if there is one first device (which can be understood as the target first device) and multiple second devices in the current environment, the target first device will calculate the distance between itself and each second device, and determine the second device with the smallest distance as the target second device, thereby achieving pairing between the target first device and the target second device.
[0088] Scenario 2: In the case of multiple first devices and multiple second devices, calculate the variance corresponding to each pairing strategy, where each pairing strategy is used to indicate a scheme of pairing multiple first devices and multiple second devices one by one, and the variance is determined based on the distance between multiple first devices and multiple second devices; the second device corresponding to the target first device in the pairing strategy with the smallest variance is determined as the target second device.
[0089] It should be noted that in the above scenarios one and two, the method for calculating the distance between the target first device and each of the second devices can refer to the specific method described in the previous embodiments, and will not be repeated here.
[0090] In some embodiments, where there are multiple first devices and multiple second devices in the current environment, there are multiple pairing strategies for the multiple first devices and multiple second devices.
[0091] Figure 3 This is a schematic diagram illustrating a pairing strategy provided in one embodiment of this application. See also... Figure 3 As shown, for example, there are two first devices in the current environment: device A1 and device A2; and two second devices: device B1 and device B2. Then, there are multiple pairing strategies for the two first devices and the two second devices:
[0092] Pairing Strategy 1: Device A1 is paired with Device B1; Device A2 is paired with Device B2.
[0093] Pairing Strategy 2: Device A1 is paired with Device B2; Device A2 is paired with Device B1.
[0094] The distance between equipment A1 and equipment B1 is 1 meter, the distance between equipment A1 and equipment B2 is 2.5 meters, the distance between equipment A2 and equipment B2 is 1.5 meters, and the distance between equipment A2 and equipment B1 is 2 meters.
[0095] The variance for pairing strategy 1 can be calculated as follows:
[0096] Step 1) Calculate the average distance between the first distance and the second distance; where the first distance is the distance between device A1 and device B1 (e.g., 1 meter); the second distance is the distance between device A2 and device B2 (e.g., 1.5 meters); then the average distance between the first distance and the second distance can be expressed as: (1+1.5) / 2=1.25.
[0097] Step 2) Calculate the variance based on the average distance, for example, it can be expressed as: [(1-1.25)] 2 +(1.5-1.25) 2 ] / 2 = 0.0625.
[0098] The variance for pairing strategy 2 can be calculated as follows:
[0099] Step 1) Calculate the average distance between the third distance and the fourth distance; where the third distance is the distance between device A2 and device B1 (e.g., 2 meters); the fourth distance is the distance between device A1 and device B2 (e.g., 2.5 meters); then the average distance between the third distance and the fourth distance can be expressed as: (2+2.5) / 2=2.25.
[0100] Step 2) Calculate the variance based on the average distance, for example, it can be expressed as: [(2-2.25) 2 +(2.5-2.25) 2 ] / 2 = 0.0625.
[0101] In some embodiments, for any one of the plurality of first devices (which can be understood as the target first device, such as device A1), device A1 needs to calculate the variance corresponding to each pairing strategy, and determine the second device corresponding to device A1 in the pairing strategy with the smallest variance as the target second device.
[0102] Optionally, if pairing between the first target device and the second target device fails, the second target device is updated based on a preset pairing strategy; the updated second target device is then used to pair with the first target device.
[0103] For example, when a pairing error occurs between the water heater and the remote controller, the pairing scheme can be changed using the "Change Pairing Scheme" button on both the remote controller and the water heater. For instance, if the initial pairing scheme is device A1 paired with device B1 and device A2 paired with device B2, clicking the "Change Pairing Scheme" button will automatically change the pairing scheme to device A1 paired with device B2 and device A2 paired with device B1.
[0104] Figure 4This is a second schematic flowchart of a device pairing method provided in an embodiment of this application. The method can be executed by a second device pairing device or electronic device, which can be implemented by software and / or hardware, and can be integrated into any smart device with network communication function.
[0105] like Figure 4 As shown, the device pairing method is applied to a target second device among N second devices. The target second device is determined based on the distance between the target first device and the target second device among M first devices. The target first device is any one of the M first devices, where M and N are positive integers greater than or equal to 1.
[0106] The method may include the following steps:
[0107] S210. Receive first information sent by the first target device, wherein the first information is relevant configuration information for pairing the first target device with the second target device;
[0108] S220. Based on the first information, send pairing request information to the target first device. The pairing request information is used to pair with the target first device.
[0109] Optionally, based on the first information, a pairing request is sent to the target first device, which can be achieved through the following steps:
[0110] Step 1) Based on the first information, determine whether the target first device meets the pairing conditions.
[0111] Step 2) If the target first device meets the pairing conditions, send a pairing request message to the target first device; wherein the pairing conditions include at least one of the following:
[0112] a) The device identifier of the first target device is a preset identifier;
[0113] b) The target device is in an unpaired state;
[0114] c) The target first device has pairing information;
[0115] d) In the case of multiple first devices, the distance between the target first device and the target second device is minimized.
[0116] The device pairing method provided in this application will be described in detail below with reference to specific embodiments. Figure 5 The third schematic flowchart of a device pairing method provided in an embodiment of this application is shown below. Figure 5 As shown, taking target device A as the first target device and target device B as the second target device as an example, the following steps are included:
[0117] Step 1: Begin.
[0118] Step 2: Device A sends a 001 identifier and a pairing identifier 0 / 1.
[0119] Specifically, 001 represents the local information of device A; the pairing identifier 0 / 1 indicates that device A is currently not paired.
[0120] Step 3: Device B receives the information sent by Device A.
[0121] Step 4: Does Device B determine if the information is 001? Is it unpaired? Is there any pairing information currently available?
[0122] If so, proceed to step 5.
[0123] Step 5: Does device B determine if there are multiple devices A? Is the current device A the closest?
[0124] If so, proceed to step 6.
[0125] Step 6: Device B sends a pairing request.
[0126] Step 7: Device A receives pairing information from Device B and completes pairing.
[0127] Step 8: End.
[0128] Figure 6 This is a schematic diagram of the structure of a first device pairing device provided in an embodiment of this application. Figure 6 As shown, the first device pairing device is applied to a target first device among M first devices, where the target first device is any one of the M first devices, and M is a positive integer greater than or equal to 1; the first device pairing device includes:
[0129] The first sending module 601 is used to send first information to a target second device among N second devices. The first information is the relevant configuration information for pairing the target first device with the target second device. The target second device is determined based on the distance between the target first device and the target second device. N is a positive integer greater than or equal to 1.
[0130] The first receiving module 602 is used to receive pairing request information sent by the target second device;
[0131] The pairing module 603 is used to pair with the target second device based on the pairing request information.
[0132] This application provides a first device pairing device, which determines the most suitable target second device from N second devices based on the distance between the target first device and the target second device. The target first device sends first information to the target second device, and then pairs with the target second device based on the pairing request information sent by the target second device, thereby realizing fast pairing between the target first device and the target second device and improving device pairing efficiency.
[0133] Optionally, the device further includes:
[0134] The determination module is used to determine the target second device based on the distance between the target first device and N second devices.
[0135] Optionally, the module is further used for at least one of the following:
[0136] In the presence of multiple second devices, calculate the distance between the target first device and each second device; determine the second device with the smallest distance to the target first device as the target second device;
[0137] In the presence of multiple first devices and multiple second devices, the variance corresponding to each pairing strategy is calculated, wherein each pairing strategy is used to indicate a scheme of pairing multiple first devices and multiple second devices one by one, and the variance is determined based on the distance between the multiple first devices and multiple second devices; the second device corresponding to the target first device in the pairing strategy with the smallest variance is determined as the target second device.
[0138] Optionally, the distance between the first target device and the second target device is determined in the following way:
[0139] Send ranging information to the target second device, the ranging information carrying the first timestamp;
[0140] Receive feedback information sent by the target second device, the feedback information carrying a second timestamp when the target second device received the ranging information;
[0141] The distance is determined based on the first timestamp, the second timestamp, and the third timestamp when the feedback information is received.
[0142] Optionally, the device further includes:
[0143] The update module is used to update the target second device based on a preset pairing strategy when the pairing of the target first device and the target second device fails; the updated target second device is used to pair with the target first device.
[0144] The aforementioned first device pairing device can execute this application. Figure 1The method provided in the illustrated embodiments has the corresponding functional modules for performing the method and beneficial effects. Technical details not described in detail in this embodiment can be found in this application. Figure 1 The device pairing method provided in the embodiment.
[0145] Figure 7 This is a schematic diagram of the structure of a second device pairing device provided in an embodiment of this application. Figure 7 As shown, the second device pairing device is applied to a target second device among N second devices. The target second device is determined based on the distance between the target first device and the target second device among M first devices. The target first device is any one of the M first devices, where M and N are positive integers greater than or equal to 1. The second device pairing device includes:
[0146] The second receiving module 701 is used to receive first information sent by the target first device, the first information being relevant configuration information for pairing the target first device and the target second device;
[0147] The second sending module 702 is used to send pairing request information to the target first device based on the first information. The pairing request information is used to pair with the target first device.
[0148] This application provides a second device pairing device, which determines the most suitable target second device from N second devices based on the distance between the target first device and the target first device. The target first device sends first information to the target second device, and then pairs with the target second device based on the pairing request information sent by the target second device, thereby realizing fast pairing between the target first device and the target second device and improving device pairing efficiency.
[0149] Optionally, the second transmitting module 702 is further configured to:
[0150] Based on the first information, determine whether the target first device meets the pairing conditions;
[0151] If the target first device meets the pairing conditions, a pairing request message is sent to the target first device; wherein the pairing conditions include at least one of the following:
[0152] The device identifier of the first target device is the preset identifier;
[0153] The target device is in an unpaired state;
[0154] The target device has pairing information;
[0155] In the presence of multiple first devices, the distance between the target first device and the target second device is minimized.
[0156] The aforementioned second device pairing device can perform the functions described in this application. Figure 4 The method provided in the illustrated embodiments has the corresponding functional modules for performing the method and beneficial effects. Technical details not described in detail in this embodiment can be found in this application. Figure 4 The device pairing method provided in the embodiment.
[0157] Figure 8 A schematic diagram of the structure of an electronic device 10 that can be used to implement embodiments of the present invention is shown. For example... Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0158] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0159] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as Figure 1 The device pairing method shown, or Figure 4 The device pairing method is shown.
[0160] In some embodiments, the device pairing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, the above-described method can be executed. Figure 1 or Figure 4 One or more steps of the described device pairing method. Alternatively, in other embodiments, the processor 11 may be configured to perform these steps by any other suitable means (e.g., by means of firmware). Figure 1 or Figure 4 The device pairing method is shown.
[0161] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0162] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0163] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 10, which includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device 10. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0165] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0166] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0167] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0168] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A device pairing method, characterized in that, The method is applied to a target first device among M first devices, wherein the target first device is any one of the M first devices, and M is a positive integer greater than or equal to 1; the method includes: Send first information to a target second device among N second devices. The first information is the relevant configuration information for pairing the target first device with the target second device. The target second device is determined based on the distance between the target first device and the target second device. N is a positive integer greater than or equal to 1. Receive pairing request information sent by the target second device; Based on the pairing request information, pair with the target second device.
2. The method according to claim 1, characterized in that, Before sending the first information to the target second device among the N second devices, the method further includes: The target second device is determined based on the distance between the target first device and the N second devices.
3. The method according to claim 2, characterized in that, Determining the target second device based on the distance between the target first device and the N second devices includes at least one of the following: In the presence of multiple second devices, the distance between the target first device and each of the second devices is calculated; the second device with the smallest distance to the target first device is determined as the target second device. In the presence of multiple first devices and multiple second devices, the variance corresponding to each pairing strategy is calculated, wherein each pairing strategy is used to indicate a scheme for one-to-one pairing of the multiple first devices and the multiple second devices, and the variance is determined based on the distance between the multiple first devices and the multiple second devices; the second device corresponding to the target first device in the pairing strategy with the smallest variance is determined as the target second device.
4. The method according to any one of claims 1-3, characterized in that, The distance between the first target device and the second target device is determined in the following way: Send ranging information to the target second device, wherein the ranging information carries a first timestamp; Receive feedback information sent by the target second device, wherein the feedback information carries a second timestamp when the target second device receives the ranging information; The distance is determined based on the first timestamp, the second timestamp, and the third timestamp when the feedback information is received.
5. The method according to any one of claims 1-3, characterized in that, The method further includes: If pairing between the first target device and the second target device fails, the second target device is updated based on a preset pairing strategy; the updated second target device is then used to pair with the first target device.
6. A device pairing method, characterized in that, The method applies to a target second device among N second devices, wherein the target second device is determined based on the distance between the target first device and the target second device among M first devices, where the target first device is any one of the M first devices, and M and N are positive integers greater than or equal to 1; the method includes: Receive first information sent by the target first device, wherein the first information is relevant configuration information for pairing the target first device and the target second device; Based on the first information, a pairing request is sent to the target first device, the pairing request being used to pair with the target first device.
7. The method according to claim 6, characterized in that, The step of sending pairing request information to the target first device based on the first information includes: Based on the first information, determine whether the target first device meets the pairing conditions; If the target first device meets the pairing conditions, a pairing request message is sent to the target first device; wherein the pairing conditions include at least one of the following: The device identifier of the first target device is a preset identifier; The target first device is in an unpaired state; The target first device has pairing information; In the presence of multiple first devices, the distance between the target first device and the target second device is minimized.
8. A first device pairing device, characterized in that, The target first device is any one of the M first devices, where M is a positive integer greater than or equal to 1. The first device pairing device includes: A first sending module is used to send first information to a target second device among N second devices. The first information is configuration information related to pairing the target first device with the target second device. The target second device is determined based on the distance between the target first device and the target second device. N is a positive integer greater than or equal to 1. The first receiving module is used to receive pairing request information sent by the target second device; The pairing module is used to pair with the target second device based on the pairing request information.
9. A second device pairing device, characterized in that, The target second device is applied to N second devices, and the target second device is determined based on the distance between the target first device and the target second device among M first devices. The target first device is any one of the M first devices, and M and N are positive integers greater than or equal to 1. The second device pairing device includes: The second receiving module is used to receive first information sent by the target first device, wherein the first information is relevant configuration information for pairing the target first device and the target second device. The second sending module is used to send pairing request information to the target first device based on the first information, the pairing request information being used to pair with the target first device.
10. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the device pairing method as described in any one of claims 1 to 5, or implement the device pairing method as described in any one of claims 6 to 7.
11. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the device pairing method as described in any one of claims 1 to 5, or implements the device pairing method as described in any one of claims 6 to 7.
