Device connection method, device communication system, and electronic device
By receiving special broadcast messages to identify the target device, the problem of users having difficulty pairing and connecting in a multi-device environment is solved, improving connection efficiency and user experience, and reducing hardware compatibility requirements.
Patent Information
- Application Number
- PCT/CN2025/104182
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-12
- Filing Date
- 2025-06-27
- Publication Date
- 2026-01-15
AI Technical Summary
When multiple electronic devices of the same type are present around a user, the user may have difficulty distinguishing the displayed device names, resulting in low pairing and connection efficiency and a poor user experience.
Electronic devices can quickly pair and connect by sensing the presence of nearby devices and receiving special broadcast messages, and then determining the target device based on the information carried in the broadcast messages.
It improves the efficiency of pairing and connecting electronic devices, enhances the user experience, reduces the requirements for hardware compatibility, and avoids limitations on product design.
Smart Images

Figure CN2025104182_15012026_PF_FP_ABST
Abstract
Description
A device connection method, a device communication system, and an electronic device.
[0001] This application claims priority to Chinese Patent Application No. 202410944010.4, filed on July 12, 2024, with the invention entitled "A Device Connection Method, Device Communication System and Electronic Device", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technology, and in particular to a device connection method, a device communication system, and an electronic device. Background Technology
[0003] With the development of short-range communication technology, more and more electronic devices can achieve various functions by establishing short-range communication connections. Before establishing a short-range communication connection, electronic devices must first establish a pairing relationship.
[0004] In practical applications, when there are multiple compatible electronic devices of the same type or even the same model around a user's electronic device, the user often cannot distinguish which electronic device the device name displayed on their electronic device actually corresponds to. Consequently, the user needs to try pairing devices to test which device name the target device corresponds to, resulting in low pairing efficiency between electronic devices and a poor user experience. Summary of the Invention
[0005] This application provides a device connection method, a device communication system, and an electronic device. A first device enters a first state based on a search for nearby devices. This first state indicates that the first device perceives the presence of multiple nearby devices but cannot determine which of these devices to connect to. Nearby devices can send a special broadcast message upon detecting a specific operation; this first broadcast message is sent when the first operation is detected. The first device can receive the first broadcast message from at least one of the nearby devices and, based on the received message, determine that the at least one device includes only the second device (i.e., the target device). This improves the efficiency of pairing and connection between electronic devices, thereby enhancing the user experience.
[0006] In a first aspect, this application provides a device connection method applied to a first device, the method comprising: the first device entering a first state based on a search for nearby devices, the first state being that the first device perceives the existence of multiple nearby devices and cannot determine which of the multiple devices to connect to; in the first state, the first device receiving a first broadcast message from at least one of the multiple devices, the first broadcast message including first information, the first information being used to instruct a user to perform a first operation on at least one device; the first device determining, based on the first broadcast message, that the at least one device includes only a second device; and the first device establishing a connection with the second device.
[0007] Implementing the method provided in the first aspect, a first device (i.e., electronic device 100) can enter a first state based on a search for nearby devices. This first state indicates that the first device perceives the presence of multiple nearby devices but cannot determine which of these devices to connect to. Electronic device 100 can receive a first broadcast message from at least one of the nearby electronic devices 200. This first broadcast message instructs the user to perform a first operation on this at least one electronic device 200. Subsequently, the first device can determine, based on the received first broadcast message, that this at least one electronic device 200 includes only the target device, thereby improving the efficiency of pairing and connection between electronic devices and thus enhancing the user experience.
[0008] Compared to a trial-and-error pairing method, the method provided in the first aspect allows electronic device 100 to quickly identify the target device from among multiple nearby electronic devices 200 based on a received first broadcast message, thereby improving the efficiency of pairing between electronic devices and enhancing the user experience. Furthermore, compared to contact methods (such as magnetic or interface methods) or pairing via a pairing switch, the method provided in the first aspect has lower requirements for hardware compatibility and does not impose limitations on the industrial design of the product.
[0009] In conjunction with the first aspect, in some embodiments, the first device determines that at least one device includes only the second device based on the first broadcast message, specifically including: the first device determining the number of devices of at least one device based on the device identity information carried in the first broadcast message; and the first device determining that at least one device includes only the second device based on the number of devices.
[0010] By implementing the method provided in the above embodiments, the first device (i.e., electronic device 100) can determine whether the number of devices that sent the first broadcast message matches the number of target devices based on the device identity information carried in the first broadcast message. If they match, the electronic device 100 can determine that the electronic devices 200 that sent the first broadcast message include only the target devices, thereby enabling the electronic device 100 to accurately locate which electronic device 200 is the target device from among multiple nearby electronic devices 200.
[0011] In conjunction with the first aspect, in some embodiments, the second device includes one device, or the second device includes more than one device.
[0012] When implementing the method provided in the above embodiments, the second device (i.e., the target device) can be one or more. When there are multiple target devices, the electronic device 100 can pair and connect with multiple electronic devices 200 by executing the above device connection method once, thereby greatly improving the efficiency of pairing and connection between electronic devices.
[0013] In conjunction with the first aspect, in some embodiments, before the first device receives a first broadcast message from at least one of the plurality of devices, the method further includes: in a first state, the first device receives a second broadcast message from N of the plurality of devices, the second broadcast message including second information for instructing a user to perform a second operation on the N devices; the first device determines, based on the second broadcast message, that the N devices include not only the second device.
[0014] Implementing the method provided in the above embodiments, before the electronic device 100 finds the target device according to the first broadcast message, there may be one or more rounds of process to determine which electronic device 200 to connect to from multiple nearby electronic devices 200. For example, the electronic device 100 may receive the second broadcast message from N electronic devices 200 from multiple nearby electronic devices 200, but according to the received second broadcast message, the mobile phone may determine that these N electronic devices 200 include not only the target device.
[0015] In conjunction with the first aspect, in some embodiments, the first operation differs from the second operation.
[0016] By implementing the method provided in the above embodiments, in the process of determining which electronic device 200 to connect from multiple nearby electronic devices 200 in multiple rounds, the special operations used for pairing and connection between electronic devices can be different, so that electronic device 100 can quickly distinguish the target device from other nearby electronic devices 200, thereby improving the efficiency of pairing and connection between electronic devices.
[0017] In conjunction with the first aspect, in some embodiments, the first device determines that at least one device includes only the second device based on the first broadcast message, specifically including: the first device determining at least one device that sent the first broadcast message as the second device from N devices.
[0018] By implementing the method provided in the above embodiments, in the process of determining which electronic device 200 to connect from multiple nearby electronic devices 200 in multiple rounds, the electronic device 100 does not need to re-filter based on all nearby electronic devices 200 each time. Instead, it filters from the N electronic devices 200 that have sent the second broadcast message in the previous round that have also sent the first broadcast message in this round, and then determines that the filtered at least one electronic device 200 includes only the target device. Compared to re-filtering based on all nearby electronic devices 200 each time, this scheme of further filtering based on the results of the previous round can determine the target device more quickly, thereby improving the efficiency of pairing and connection, and thus improving the user experience.
[0019] In conjunction with the first aspect, in some embodiments, the first device senses the presence of multiple nearby devices, specifically including: the first device receiving multiple broadcast messages, the broadcast messages including one or more of the following: a first broadcast message, a second broadcast message and a third broadcast message, the third broadcast message not carrying the first information and not carrying the second information; the first device determining that there are multiple nearby devices based on the device identity information carried in the multiple broadcast messages.
[0020] By implementing the method provided in the above embodiments, the first device (i.e., electronic device 100) can determine the presence of multiple electronic devices 200 in the vicinity of the electronic device 100 by the number of device identity information carried in the received broadcast message. The broadcast message here may include one or more of a first broadcast message, a second broadcast message, and a third broadcast message (i.e., a conventional Bluetooth broadcast message). This application embodiment does not limit the specific type of broadcast message used by the electronic device 100 to sense the presence of multiple electronic devices 200 in the vicinity.
[0021] In conjunction with the first aspect, in some embodiments, it is impossible to determine which of the multiple devices is connected, specifically including: the first device displays identification information of the multiple devices, and the first device does not receive a first user operation from the user within a preset time, the first user operation being used to select the connected device.
[0022] By implementing the method provided in the above embodiments, the electronic device 100 can display identification information of multiple electronic devices 200, that is, display a device list to the user. If no operation is received from the user to select a device to connect to in the device list within a preset time, the electronic device 100 can enter a new round of process to determine which electronic device 200 to connect to from the multiple nearby electronic devices 200.
[0023] In conjunction with the first aspect, in some embodiments, it is impossible to determine which of the multiple devices to connect. Specifically, this includes: a first device displaying identification information of the multiple devices and detecting a second user operation, the second user operation being used to trigger the first device to determine which device to connect from the multiple devices.
[0024] By implementing the method provided in the above embodiments, the electronic device can display identification information of multiple electronic devices 200, that is, show a device list to the user. If the electronic device 100 detects a second user operation within a preset time, the second user operation can directly trigger the electronic device 100 to enter a new round of process to determine which electronic device 200 to connect to from among the multiple nearby electronic devices 200. For example, the second user operation can be the user clicking the "Cannot distinguish target device" control on the mobile phone screen.
[0025] In conjunction with the first aspect, in some embodiments, it is impossible to determine which of the multiple devices is connected, specifically including: the first device does not display identification information of the multiple devices.
[0026] When implementing the method provided in the above embodiments, if the electronic device 100 does not display the identification information of multiple electronic devices 200, that is, does not show the device list to the user, then after detecting that multiple electronic devices 200 exist nearby, the electronic device 100 immediately enters a new round of process to determine which electronic device 200 to connect to from the multiple nearby electronic devices 200.
[0027] In conjunction with the first aspect, in some embodiments, before the first device receives the first broadcast message from multiple devices, the method further includes: the first device prompting a user to perform a first operation on the second device, the first operation being selected by the first device from a preset set of operations.
[0028] By implementing the method provided in the above embodiments, the electronic device 100 can prompt the user to perform a first operation on the target device before receiving the first broadcast message, thereby making it convenient for the user to know what the special operation for pairing and connection is in this round.
[0029] In conjunction with the first aspect, in some embodiments, before the first device receives the first broadcast message from multiple devices, the method further includes: the first device prompting a user to perform a first operation on the second device, wherein the first operation is selected by the user from multiple special operations provided by the first device, and the multiple special operations are selected by the first device from a preset set of operations.
[0030] By implementing the method provided in the above embodiments, before receiving the first broadcast message, the electronic device 100 can prompt the user to perform a first operation on the target device. This first operation can be selected by the user from a number of special operations provided by the electronic device 100. Thus, the user can determine what the special operation for pairing and connection is in each round according to their own preferences, and it is also convenient to perform different first operations so as to distinguish the target device from the multiple nearby electronic devices 200.
[0031] In conjunction with the first aspect, in some embodiments, before the first device establishes a connection with the second device, the method further includes: the first device displaying the identification information of the second device in a first manner.
[0032] Implementing the method provided in the above embodiments, if the electronic device 100 can display a device list (i.e., display device identification information), then after the electronic device 100 finds the target device but before establishing a connection with it, the electronic device 100 can also distinguish and display the target device in the device list, thereby prompting the user which device in the device list the target device is. The identification information of the target device includes, but is not limited to, the device name and device type of the target device. The first method includes, but is not limited to, highlighting, flashing, color, and additional icons.
[0033] In conjunction with the first aspect, in some embodiments, the first device displays the identification information of the second device in a first manner, specifically including: along with the identification information of the second device, the first device displays description information of a first operation received by the second device.
[0034] By implementing the method provided in the above embodiments, the electronic device 100 can display a description of the first operation next to the target device in the device list, thereby enabling the user to more intuitively understand the operation performed by the user on the electronic device 200, and helping the user to quickly select the electronic device 200 to be connected when there are multiple target devices.
[0035] In conjunction with the first aspect, in some embodiments, the first device distinguishes the second device by displaying the identification information of the second device, specifically including: the first device playing a first animation according to a first operation received by the second device, with different first operations corresponding to different first animations.
[0036] By implementing the method provided in the above embodiments, the electronic device 100 can display a first animation corresponding to the first operation next to the target device in the device list. Optionally, the first animation can be a dynamic display of the first operation, so that users can more intuitively understand what kind of first operation each electronic device 200 has detected; at the same time, it also maintains a certain degree of interest, thereby attracting users to use this method to pair electronic devices.
[0037] Secondly, this application provides a device communication system, which includes a first device and nearby devices of the first device. The first device is used to search for nearby devices; the first device is used to enter a first state based on the search for nearby devices, the first state being that the first device senses the existence of multiple nearby devices but cannot determine which of the multiple devices to connect to; in the first state, the first device is used to receive a first broadcast message from at least one of the multiple devices, the first broadcast message including first information indicating that a user has performed a first operation on at least one device; the first device is used to determine, based on the first broadcast message, that the at least one device includes only a second device; and the first device is used to establish a connection with the second device. In conjunction with the embodiments provided in the second aspect, in some embodiments, if the first device receives first broadcast messages from only N or fewer devices from the multiple devices, then the first device is used to determine that the second device includes N or fewer devices.
[0038] In conjunction with the embodiments provided in the second aspect, in some embodiments, the first device is used to determine the number of devices of at least one device based on the device identity information carried in the first broadcast message; the first device is also used to determine, based on the number of devices, that at least one device includes only the second device.
[0039] In conjunction with the embodiments provided in the second aspect, in some embodiments, the second device includes one device, or the second device includes more than one device.
[0040] In conjunction with the embodiments provided in the second aspect, in some embodiments, in the first state, the first device is further configured to receive a second broadcast message from N devices among a plurality of devices, the second broadcast message including second information, the second information being used to instruct the user to perform a second operation on the N devices; the first device is configured to determine, based on the second broadcast message, that the N devices include not only the second device.
[0041] In conjunction with the embodiments provided in the second aspect, in some embodiments, the first operation is different from the second operation.
[0042] In conjunction with the embodiments provided in the second aspect, in some embodiments, the first device determines at least one device from N devices that sent the first broadcast message as the second device.
[0043] In conjunction with the embodiments provided in the second aspect, in some embodiments, the first device is used to receive multiple broadcast messages, the broadcast messages including one or more of the following: a first broadcast message, a second broadcast message and a third broadcast message, wherein the third broadcast message does not carry the first information or the second information; the first device is used to determine that there are multiple devices nearby based on the device identity information carried in the multiple broadcast messages.
[0044] In conjunction with the embodiments provided in the second aspect, in some embodiments, the first device is used to display identification information of multiple devices, and the first device does not receive a first user operation from the user within a preset time, the first user operation being used to select a connected device.
[0045] In conjunction with the embodiments provided in the second aspect, in some embodiments, the first device is used to display identification information of multiple devices and detect a second user operation, the second user operation being used to trigger the first device to determine which device to connect from among the multiple devices.
[0046] In conjunction with the embodiments provided in the second aspect, in some embodiments, the first device is not used to display identification information of multiple devices.
[0047] In conjunction with the embodiments provided in the second aspect, in some embodiments, before the first device receives a first broadcast message from multiple devices, the first device prompts the user to perform a first operation on the second device, the first operation being selected by the first device from a preset set of operations.
[0048] In conjunction with the embodiments provided in the second aspect, in some embodiments, before the first device receives the first broadcast message from multiple devices, the first device prompts the user to perform a first operation on the second device. The first operation is selected by the user from multiple special operations provided by the first device, and the multiple special operations are selected by the first device from a preset set of operations.
[0049] In conjunction with the embodiments provided in the second aspect, in some embodiments, before the first device establishes a connection with the second device, the first device is used to display the identification information of the second device in a first manner.
[0050] In conjunction with the embodiments provided in the second aspect, in some embodiments, along with the identification information of the second device, the first device is used to display description information of the first operation received by the second device.
[0051] In conjunction with the embodiments provided in the second aspect, in some embodiments, along with the identification information of the second device, the first device is used to play a first animation according to a first operation received by the second device, and different first operations correspond to different first animations.
[0052] It is understood that when the device communication system provided in the second aspect above executes the method provided in this application, the first device in the device communication system mainly executes the device connection method provided in the first aspect. Therefore, the beneficial effects it can achieve can be referred to the beneficial effects of the first aspect, and will not be repeated here.
[0053] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the method described in the first aspect and any possible implementation thereof.
[0054] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect and any possible implementation thereof.
[0055] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect and any possible implementation thereof.
[0056] It is understood that the electronic device provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here. Attached Figure Description
[0057] Figure 1 is a schematic diagram of electronic device pairing connection based on a short-range communication protocol provided in an embodiment of this application;
[0058] Figure 2 is a schematic diagram of a stylus being paired and connected by magnetic adsorption according to an embodiment of this application;
[0059] Figure 3A is a schematic diagram of a stylus structure that is paired and connected via an interface according to an embodiment of this application;
[0060] Figure 3B is a schematic diagram of a hardware device used for switching when pairing and connecting via an interface, according to an embodiment of this application.
[0061] Figure 4 is a schematic diagram of another electronic device pairing connection based on a short-range communication protocol provided in an embodiment of this application;
[0062] Figure 5 is a flowchart illustrating a device connection method provided in an embodiment of this application;
[0063] Figure 6 is a system architecture of a device communication system provided in an embodiment of this application;
[0064] Figure 7 is a schematic flowchart of a method for pairing and connecting a mobile phone and a stylus according to an embodiment of this application.
[0065] Figure 8 is a schematic diagram of a stylus being paired and connected to a mobile phone via a shaking operation according to an embodiment of this application.
[0066] Figure 9 illustrates the module distribution in the electronic device shown in Figure 8;
[0067] Figure 10 is a schematic diagram of the module interaction of a stylus pen paired with a mobile phone through a shaking operation, according to the present application.
[0068] Figure 11 is a schematic diagram of a stylus being paired with a mobile phone via a pressing operation according to an embodiment of this application;
[0069] Figure 12 illustrates the module distribution in the electronic device shown in Figure 11;
[0070] Figure 13 is a schematic diagram of the module interaction of a stylus pen paired with a mobile phone through a pressing operation, as provided in this application;
[0071] Figure 14 is a schematic diagram of a mobile phone interface that prompts the user to continue performing special operations on the target stylus, according to an embodiment of this application.
[0072] Figure 15 is a schematic diagram of a mouse being paired with a laptop computer via a click operation, according to an embodiment of this application.
[0073] Figure 16 illustrates the module distribution in the electronic device shown in Figure 15;
[0074] Figure 17 is a schematic diagram of the module interaction of a mouse and a laptop computer through a click operation provided in this application;
[0075] Figure 18 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application;
[0076] Figure 19 is a schematic diagram of the structure of an electronic device 200 provided in an embodiment of this application. Detailed Implementation
[0077] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be a limitation of this application.
[0078] With the development of short-range communication technology, an increasing number of electronic devices can establish short-range communication connections to achieve various functions. Specifically, electronic devices within a certain range can establish short-range communication connections through short-range communication protocols to transmit data. These short-range communication protocols include, but are not limited to, Wireless Fidelity (Wi-Fi), Bluetooth (BT), NearLink, ZigBee, Near Field Communication (NFC), Infrared (IR), and Ultra-Wideband (UWB). Before establishing such short-range communication connections, the electronic devices must first establish a pairing relationship, that is, establish a trust relationship between them. Only then can the electronic devices establish the corresponding short-range communication connection based on this pairing relationship to transmit data.
[0079] Figure 1 is a schematic diagram of electronic device pairing and connection based on a short-range communication protocol provided in an embodiment of this application.
[0080] As shown in Figure 1, the device distance between electronic device 100 and one or more electronic devices 200 is within the range defined by the short-range communication protocol. For example, electronic device 100 can be a mobile phone 1, and electronic device 200 can include stylus 1 and stylus 2. Electronic device 100 is also referred to as the first device, and electronic device 200 is also referred to as the nearby device. Electronic device 100 and one or more electronic devices 200 all support at least one of the same short-range communication protocols, such as Bluetooth, and / or, StarFlash.
[0081] Taking Bluetooth as an example, the aforementioned devices within the range defined by the Bluetooth protocol include electronic device 100 and one or more electronic devices 200 in a pairable state. The pairable state refers to the state in which an electronic device can establish a pairing relationship with other electronic devices through the Bluetooth protocol. After establishing a Bluetooth pairing relationship, either of the two paired electronic devices can send a session request to the other device to establish a data channel. Either electronic device that has successfully established a data channel can use this data channel to send data, such as audio data or image data, to the other device.
[0082] In practical applications, users need to select the electronic device 200 to be paired from the device list of electronic device 100 to achieve pairing and connection between Bluetooth devices. When multiple electronic devices 200 of the same type or even the same model are around the user's electronic device 100, the user often cannot distinguish which electronic device 200 the name displayed on the electronic device 100 actually corresponds to. For example, in the scenario shown in Figure 1, when there are two styluses of the same model A around electronic device 100, the user cannot distinguish which "Model A stylus" in the "Available Devices" column the stylus 1 on the left belongs to. Therefore, the user needs to try pairing to test whether the name of the stylus 1 on the left is the "Model A stylus" at the top or bottom of the device list, resulting in low device pairing and connection efficiency and a poor user experience.
[0083] To address this issue, one solution is for electronic devices 100 and 200 to pair via contact. This contact method refers to pairing between electronic devices 100 and 200 through direct or indirect physical contact. Figure 2 is a schematic diagram illustrating a stylus pairing connection via magnetic adsorption, as provided in an embodiment of this application. As shown in Figure 2, the stylus can magnetically attach to the top of the tablet computer, thus completing Bluetooth pairing and simultaneously performing wireless charging. Even if multiple styluses are present in the environment, the tablet computer will only pair with the stylus magnetically attached to it. Another similar contact-based solution is shown in Figure 3A. Some styluses can have an interface (such as a Lightning connector) inside the cap, allowing them to be inserted into the corresponding Lightning connector on the tablet computer for pairing. In some solutions, the interface in the cap does not match the interface on the tablet computer; for example, the pen cap has a Lightning connector while the tablet computer has a Type-C connector. In such cases, the user can use an adapter and cable as shown in Figure 3B to achieve a wired connection between the pen cap and the tablet computer, thus completing pairing. However, whether pairing is done magnetically or via an interface, contact-based methods require corresponding hardware modules on both the stylus and the tablet, or the stylus cap must have an interface built into it. This makes the method unusable for electronic devices without the necessary hardware modules or interfaces, resulting in poor compatibility. Furthermore, for interface-based pairing methods, the physical interfaces and other physical components can negatively impact the aesthetics and simplicity of the product's design, thus limiting its industrial design.
[0084] Specifically, the stylus does not have a pairing switch. The pairing switch is a hardware structure or software module on the electronic device 200. When the pairing switch is on, the electronic device 200 can enter a pairable state; when the pairing switch is off, the electronic device 200 can exit the pairable state and enter a sleep state or a powered-off state. Since the stylus does not have a pairing switch, it can be equipped with sensors such as motion sensors or gravity sensors. Based on the data detected by these sensors, the stylus can determine whether it has been picked up or is in motion. When the stylus is picked up or in motion, it can directly enter the pairable mode based on this state. If the sensors in the stylus detect that the stylus has not moved for a long time, it can also exit the pairable mode and enter a sleep state or a powered-off state. Therefore, when the electronic device 100 detects multiple styluses, the user cannot quickly exit the pairable state by performing a specific operation. In other words, for electronic devices with a pairing connection switch, the opening and closing operation of the pairing connection switch can help the user identify the name of the electronic device 200 to be paired displayed on the electronic device 100.
[0085] Figure 4 is another schematic diagram of electronic device pairing and connection based on a short-range communication protocol provided in this application embodiment. Specifically, as shown in Figure 4, electronic device 100 is a laptop computer, and electronic device 200 is a mouse. Since the mouse can have a pairing connection switch, when multiple mice are around the laptop, the user can toggle the pairing connection switch on the mouse they want to pair with to put that mouse into pairing mode, while keeping the pairing connection switches of other mice off. This allows the laptop to search for a unique mouse and then select and pair it.
[0086] However, this method only applies to electronic devices 200 with a pairing connection switch, and is not applicable to electronic devices 200 such as styluses that do not have a pairing connection switch. Furthermore, when multiple electronic devices 200 belonging to multiple users simultaneously enter pairing mode, electronic device 100 still cannot identify the electronic device 100 that the user wants to pair with.
[0087] Therefore, this application provides a device connection method that can be applied to the device communication system shown in FIG1. Not limited to Bluetooth, this method can also be applied to device communication systems based on other short-range communication protocols. This application does not impose any special limitations on the short-range communication protocols involved in the device communication system.
[0088] Implementing this method, as shown in Figure 5, the electronic device 100 can enter a first state based on the search for nearby devices. In this first state, the electronic device 100 senses the presence of multiple electronic devices 200 nearby, but cannot determine which of these devices is the one it wants to connect to. In this first state, the electronic device 100 can receive a first broadcast message from at least one of the nearby electronic devices 200. Subsequently, the electronic device 100 can determine, based on the first broadcast message, that only the target device is among the at least one electronic device 200, and thus, the electronic device 100 can establish a connection with the target device. The electronic device 100 is also referred to as the first device, and the target device is also referred to as the second device. It is understood that the electronic device 200 can send a special broadcast message when it detects a special user operation. The first broadcast message is the special broadcast message sent by the electronic device 200 when it receives a special operation for pairing and connection. For example, if the special operation for pairing and connection is operation A, the electronic device 200 can send broadcast message A when it detects user operation A; in this case, broadcast message A is the first broadcast message.
[0089] This method can perform special operations on the target device to make the target device send special broadcast messages, thereby quickly distinguishing the target device from multiple nearby devices found by the electronic device 100, thus improving the efficiency of pairing and connection between electronic devices and enhancing the user experience.
[0090] Figure 6 is a system architecture of a device communication system provided in an embodiment of this application.
[0091] As shown in Figure 6, the communication system of this device may include an electronic device 100 (such as a mobile phone) and an electronic device 200 (such as a stylus) near the electronic device 100. The electronic device 100 and electronic device 200 shown in Figure 6 can be paired and connected wirelessly.
[0092] The electronic device 100 may include a wireless communication module 01. The electronic device 200 may include a sensor 12 and a wireless communication module 11. It is understood that since the electronic devices 100 and 200 can be connected wirelessly, the wireless communication module 01 and the wireless communication module 11 are compatible, and both can support at least one of the same short-range communication methods.
[0093] The aforementioned sensor 12 can be used to detect the state of the electronic device 200, thereby enabling the electronic device 200 to recognize the actions performed by the user, that is, to recognize the user input to the electronic device 200. Depending on the type of electronic device 200, the aforementioned sensor 12 includes, but is not limited to, accelerometers, pressure sensors, photosensitive devices, and gyroscopes. The aforementioned wireless communication module 01 and wireless communication module 11 can be used to transmit and receive various types of data, including but not limited to messages and commands. The electronic device 200 may also include an action recognition module (not shown in Figure 6). The aforementioned action recognition module is used to acquire the data detected by the sensors and determine whether the user has performed a preset pairing action on the electronic device 200. If the action recognition module determines that the user has performed a preset pairing action on the electronic device 200, the action recognition module sends a notification message to the wireless communication module 11, which causes the wireless communication module 11 to send a special broadcast message. After receiving this special broadcast message, the wireless communication module 01 uses this special broadcast message to distinguish the target device in the device communication system from other electronic devices 200. The specific special features of this broadcast message will be explained in detail in the subsequent method flow, and will not be elaborated here.
[0094] It is understood that Figure 6 only exemplarily illustrates the above-mentioned hardware components in the above-mentioned electronic device and does not limit the specific location of the above-mentioned hardware components in the electronic device.
[0095] Not limited to mobile phones, electronic device 100 can also be a tablet computer, desktop computer, laptop computer, etc. Not limited to a stylus, electronic device 200 can also be a wearable device (e.g., watch, bracelet), input device (e.g., keyboard, mouse), output device (e.g., speaker). Not limited to the above-mentioned wearable devices, input devices, output devices, etc., electronic device 200 can also be a mobile terminal such as a mobile phone, tablet computer, laptop computer, etc. The embodiments of this application do not specifically limit the device types of electronic device 100 and electronic device 200. In the following embodiments, this application will use a device communication system composed of a mobile phone (electronic device 100) and a stylus (electronic device 200) as an example for description.
[0096] Understandably, the target device that ultimately pairs and connects with electronic device 100 can be one or more. The following description of the solution will focus on a stylus as the target device.
[0097] Figure 7 is a schematic flowchart of a method for pairing and connecting a mobile phone and a stylus provided in an embodiment of this application.
[0098] S101, the mobile phone can enter the first state based on the search for nearby devices.
[0099] The aforementioned first state refers to a state in which the mobile phone detects the presence of multiple electronic devices 200 in the vicinity by searching for nearby devices, and the mobile phone cannot determine which of these multiple electronic devices 200 to pair and connect with.
[0100] Before pairing and connecting with other devices, the phone can search for nearby devices. Specifically, the phone can scan the Bluetooth channel at regular intervals to receive broadcast messages sent by nearby devices. The phone can detect the presence of multiple electronic devices 200 in its vicinity by receiving multiple broadcast messages from multiple electronic devices 200.
[0101] In some embodiments, the mobile phone can determine that the multiple broadcast messages originate from multiple electronic devices 200 based on device identification information in the received multiple broadcast messages. Optionally, the aforementioned identification information includes, but is not limited to, device name or device address, and the aforementioned device address includes, but is not limited to, the device's media access control (MAC) address. Optionally, the aforementioned identification information includes, but is not limited to, a device unique identifier (DID).
[0102] S102, The mobile phone receives a first broadcast message from a stylus pen among multiple electronic devices 200.
[0103] During a Bluetooth channel scanning time interval, the stylus senses and identifies a special operation performed by the user and sends a special broadcast message. If the stylus senses and identifies the special operation performed by the user as a preset special operation for pairing and connection, the special broadcast message sent by the stylus is a first broadcast message, and the mobile phone can receive the first broadcast message from the stylus in the multiple electronic devices 200. The aforementioned preset special operation for pairing and connection is also called the first operation.
[0104] Figure 8 is a schematic diagram illustrating the pairing and connection of a stylus with a mobile phone via a shaking operation according to an embodiment of this application. As shown in Figure 8, the specific operation for user pairing and connection between the mobile phone and the stylus can be shaking the stylus (i.e., operation A). Figure 9 exemplarily illustrates the module distribution in the electronic device shown in Figure 8. As shown in Figure 10, corresponding to shaking the stylus, the sensor 12 of the stylus 1 in Figure 9 can be an accelerometer. When the user shakes the stylus 1, the aforementioned accelerometer can detect the acceleration changes of the stylus 1 on three axes (x, y, z). Subsequently, the motion recognition module in the stylus 1 can obtain the acceleration of the stylus on the three axes from the accelerometer and compare it with a first threshold. When the acceleration on any axis is greater than the first threshold, the motion recognition module can determine that the user is shaking the stylus 1, that is, the stylus senses and recognizes that the user has performed a shaking operation on the stylus. The aforementioned first threshold can be determined by the developers based on experience.
[0105] Subsequently, the action recognition module can send a notification message A to the wireless communication module 11. Upon receiving notification message A, the wireless communication module 11 can send a special broadcast message, denoted as broadcast message A. The aforementioned broadcast message A may include the identification information of the operation A (shaking operation) performed by the user on the stylus and the identity information of the stylus 1. Since operation A is the first operation, the identification information corresponding to operation A is also called the first information, and the notification message A sent based on operation A is also called the first notification.
[0106] Taking the Bluetooth Low Energy (BLE) protocol as an example, in the standard version of the protocol, broadcast messages may include reserved fields of a certain length, such as service data and manufacturer-specific data. These reserved fields can be used to carry identification information for special operations. Not limited to the BLE protocol, other fields that can be used to store the identification information for the aforementioned special operations, such as the custom service data field in the StarSpark protocol, can also be used in this method. This application does not impose any special restrictions on the protocol or specific fields within the protocol where the identification information for special operations is stored. The identification information for the aforementioned special operations will be explained in detail below using service data as an example.
[0107] Specifically, before the service data, the broadcast message may contain a universal unique identifier (UUID) for the service, which can be 16-bit or 128-bit data. In the broadcast message, this UUID can be used to indicate that the stylus has sensed and recognized a certain action performed by the user on the stylus. For example, the UUID could be 0000000000000001 (i.e., 0x0001), and the corresponding service data can use four bits of binary data to indicate the specific operation performed by the user on the stylus. For instance, service data 0000 can be used to indicate that the stylus has sensed and recognized that the user has not performed any special operation on the stylus. In this case, the broadcast message is still a normal broadcast message. When the service data is not 0000, it indicates that the user has performed a special operation on the stylus, and the broadcast message is the special broadcast message mentioned above, i.e., the first broadcast message sent. For example, service data 0001 can be used to indicate that the stylus has sensed and recognized that the user has shaken the stylus. Therefore, when a user shakes the stylus, the service data corresponding to the aforementioned service in the broadcast message sent by the wireless communication module 11 on the stylus can be changed from the original 0000 to 0001. Correspondingly, when the stylus senses and recognizes that the user is performing other special operations, the value of the service data in the broadcast message can also be modified. For example, when the user presses down on the stylus, the corresponding service data can be set to 0010, and so on. Based on the UUID and the value of the service data corresponding to that UUID, the mobile phone can distinguish whether the broadcast message sent by the stylus is a special advertising message, and further distinguish what kind of special operation the user has performed on the stylus, when receiving the broadcast message sent by the stylus. The aforementioned service data is not limited to four-bit binary data; the length of the service data in the broadcast message depends on the content being transmitted. Regarding the service in the above example, the length of the service data depends on the number of special operations preset by the developer for the stylus. This application embodiment does not specifically limit the specific data format of the service data and UUID in the broadcast message.
[0108] It is understood that the wireless communication module 11 can determine the identification information of the special operation in the broadcast message by receiving the notification message A. Therefore, optionally, the notification message may include the identification information of the special operation. That is, in the above example, the wireless communication module 11 obtains the identification information of operation A from the notification message A sent to itself by the action recognition module, and then constructs the broadcast message A by filling the identification information of operation A into the reserved field of the broadcast message. Optionally, the notification message may also directly include the description information of the special operation performed by the user with the stylus. It is understood that the description information of each special operation may also be preset in the electronic device (e.g., mobile phone and stylus). Not limited to the identification information and description information of the special operation, other data that can be used by the wireless communication module 11 to determine the identification information of the special operation in the broadcast message to be sent may be included in the notification message, and this application does not impose any special restrictions on this.
[0109] Understandably, the mobile phone can receive multiple broadcast messages from multiple nearby electronic devices 200, including the first broadcast message sent by the stylus.
[0110] Specifically, the mobile phone can determine whether a broadcast message is the first broadcast message based on whether it carries first information. Understandably, the determination of whether a broadcast message is the first broadcast message is done by the mobile phone. For the stylus, the stylus does not distinguish between the first broadcast message, other special broadcast messages, or ordinary broadcast messages; the stylus only sends different broadcast messages based on the different special operations performed by the user.
[0111] Optionally, the phone may not pre-store the first operation, but only the first information. Specifically, the phone can only determine that the broadcast message is the first broadcast message and the special operation is the first operation when the value of the first information preset in the phone is the same as the value of the identifier information of the special operation in the actually received broadcast message.
[0112] Optionally, the phone can also pre-store the correspondence between special operations and identification information, including the correspondence between the first operation and the first information. Therefore, after receiving a broadcast message, the phone can determine whether the special operation performed by the user on the stylus is the first operation based on the value of the identification information of the special operation in the broadcast message and the pre-stored correspondence, and thus determine whether the broadcast message is the first broadcast message.
[0113] S103. The mobile phone determines the stylus as the target device based on the first broadcast message.
[0114] Understandably, within the communication range supported by the Bluetooth protocol, it's possible for multiple users to simultaneously perform the first operation on multiple different electronic devices 200 (e.g., multiple users simultaneously shaking their styluses) to pair and connect. This means the first broadcast message received by the phone may not necessarily originate from the user's own shaken stylus (i.e., the target device), but could also come from other users' styluses. Therefore, the phone needs to first determine whether the stylus that sent the first broadcast message from multiple electronic devices 200 includes only the target device.
[0115] Understandably, any stylus that senses and recognizes that the user has performed a first operation on itself can send the aforementioned first broadcast message to the mobile phone. Since the first operation used for pairing and connection between the stylus and the mobile phone is fixed, the first information in the first broadcast messages sent by different styluses is the same. The difference between these multiple first broadcast messages lies in the device identification information they carry. Therefore, the mobile phone can determine whether there is only one electronic device 200 that sent the first broadcast message based on the device identification information carried in the received first broadcast message, and thus determine whether the electronic device 200 that sent the first broadcast message includes only the target device. If the number of devices sent by the electronic device 200 is the same as the number of target devices, then it is considered that the electronic device 200 that sent the first broadcast message includes only the target device.
[0116] Specifically, if the mobile phone receives only one first broadcast message, it can directly determine that it has only received a first broadcast message from one electronic device 200. If the mobile phone receives multiple first broadcast messages, it can further obtain the identity information of the devices in the multiple first broadcast messages. If multiple first broadcast messages all contain the identity information of the same electronic device 200, the mobile phone can also determine that it has only received a first broadcast message from one electronic device 200. Since the current target device is set to 1, the mobile phone can further determine that the electronic device 200 that sent the first broadcast message only includes the target device, that is, only includes the stylus held by the user.
[0117] In some embodiments, the mobile phone can also use the number of identity information items in the first broadcast message received within the time interval to directly determine whether only one electronic device 200 sent the first broadcast message, and then determine whether the electronic device 200 that sent the first broadcast message includes only the target device. This application embodiment does not impose any special restrictions on how the mobile phone determines whether the electronic device 200 that sent the first broadcast message includes only the target device based on the device identity information in the first broadcast message.
[0118] S104. The mobile phone and the target device (i.e., the stylus) are paired and connected.
[0119] Optionally, the phone can directly pair with the stylus. For example, the pairing result can be displayed in the "Paired Devices" section of the Bluetooth device list interface, with "Connected" shown below the stylus's device name. Thus, pairing between the phone and the target device can be performed automatically, eliminating the need for user selection and improving pairing efficiency.
[0120] Optionally, the mobile phone can first display the stylus in a first manner to indicate that the stylus is the target device; then, based on the user's selection, the pairing connection between the mobile phone and the stylus is completed. For example, the mobile phone can highlight the stylus in the device list interface as shown in Figure 9. Subsequently, after detecting the user's selection of the highlighted stylus for pairing connection, the mobile phone then pairs and connects with the stylus. Not limited to highlighting, other special markers that can distinguish the target device from other electronic devices 200, such as flashing, color, or additional icons, are also possible.
[0121] In some embodiments, the mobile phone can display the electronic device 200 in a first manner, specifically including the mobile phone displaying a description of the first operation near the target device in the device list. For example, the mobile phone can add a "shaking" label after the target device (e.g., "Model A stylus" in Figure 9) in the device list. The "shaking" label is the description of the first operation. In one implementation, the mobile phone can determine the description of the first operation based on the first information and an action mapping table pre-stored in the device. The action mapping table reflects the correspondence between the first information and the description of the first operation. In another implementation, the description of the first operation can also come directly from the first broadcast message. For example, the wireless communication module 11 can obtain the description of the first operation from the first notification and add it to the first broadcast message. This application embodiment does not impose special limitations on the specific method by which the mobile phone obtains the description of the first operation corresponding to the target device or the form in which the description of the first operation is displayed.
[0122] In some embodiments, the mobile phone can display the electronic device 200 in a first manner, specifically including the mobile phone playing a first animation near the target device in the device list according to a first operation. Optionally, the first animation corresponds to the first operation. For example, when the target device receives a shaking operation, the column corresponding to the stylus in the pairing list can display a stylus shaking animation, thus intuitively prompting the user that the device in the pairing list accompanied by the first animation is the target device that the user shook. This also maintains a certain level of interest, thereby attracting users to use this method to pair electronic devices.
[0123] Understandably, steps S102-S103 described above can be a process of determining which electronic device 200 to connect to from among multiple nearby electronic devices 200. Prior to this, the mobile phone may also have one or more rounds of processes for determining which electronic device 200 to connect to from among multiple nearby electronic devices 200.
[0124] That is to say, as shown in Figure 7, before step S102, the device connection method provided in this application embodiment may further include the following steps:
[0125] S105, The mobile phone receives a second broadcast message from N electronic devices 200 out of a plurality of electronic devices 200.
[0126] Similar to the first broadcast message, when N electronic devices 200 out of the plurality of electronic devices 200 sense and recognize that the user has performed a special operation (i.e., the second operation) for pairing and connection with the stylus in this round, these N electronic devices 200 can send a second broadcast message. The second broadcast message includes second information and the identity information of the device sending the second broadcast message. The second information is used to instruct the user to perform the second operation on the electronic device 200. For example, a mobile phone can receive the second broadcast message from N styluses out of the plurality of electronic devices 200. Specifically, the mobile phone can determine whether the received broadcast message is the second broadcast message based on whether the received broadcast message carries the aforementioned second information.
[0127] In some embodiments, the second broadcast message received by the mobile phone in step S104 may be different from the first broadcast message in step S102. This difference may be reflected in the different values of the identifier information for the special operation carried, i.e., the values of the first information and the second information are different. These different values can represent different operations performed by the user on the stylus. In other words, during multiple rounds of determining which electronic device 200 to connect from among multiple nearby electronic devices 200, the special operations used for pairing and connecting in the device connection method provided in this application embodiment may be different. This allows the user to quickly switch pairing and connecting actions and retry pairing and connecting after a failed attempt to determine which electronic device 200 to connect from among multiple nearby electronic devices 200, improving the efficiency of distinguishing the target device from the multiple nearby electronic devices 200 and enhancing the efficiency of pairing and connecting between electronic devices. For example, for the stylus, if the first operation is a shaking operation, then the second operation can be a pressing operation. Specifically, as shown in Figures 11 to 13, the pressure sensor in the stylus 1 can detect the pressure value. When the pressure value is greater than the second threshold, the stylus 1 can sense and recognize that the user has performed a pressing operation on the stylus 1, thereby triggering the stylus 1 to send a second broadcast message.
[0128] In other embodiments, the second broadcast message received by the mobile phone in step S104 may be the same as the first broadcast message in step S102. That is, the user can continuously perform the same special operation on the target device until the mobile phone receives only the first broadcast message sent by one electronic device 200, thereby determining that the electronic device 200 is the target device. This scheme can simplify the algorithm design and judgment logic inside the mobile phone to a certain extent and is easy to implement.
[0129] S106. The mobile phone determines, based on the second broadcast message, that the aforementioned N electronic devices 200 include not only the target device.
[0130] Specifically, the mobile phone can determine the number of N electronic devices 200 that sent the second broadcast message based on the device identification information carried in the second broadcast message. Furthermore, it can determine that the number of these N electronic devices 200 is greater than the number of target devices, and therefore, that the N electronic devices 200 include not only the target devices. Continuing the example above, if the number of styluses that sent the second broadcast message is greater than one, the mobile phone can determine that the N styluses that sent the second broadcast message include not only the target devices.
[0131] The specific implementation details of steps S105 and S106 can be found in the descriptions of steps S102 and S103 above, and will not be repeated here.
[0132] Optionally, in the above scheme, the mobile phone can independently perform two rounds of searching for nearby electronic devices 200, thereby receiving a second broadcast message from N electronic devices 200 in the search in step S105 and a first broadcast message from the stylus in the search in step S102, and then independently determining whether the electronic device 200 that sent the special broadcast message (such as the first broadcast message or the second broadcast message) for pairing connection in this round includes only the target device based on the results of each round of search.
[0133] Optionally, in each round of determining which electronic device 200 to connect to from multiple nearby electronic devices 200, the mobile phone can filter out the electronic devices 200 that sent the second broadcast message in the previous round and then determine whether the electronic devices 200 that sent the first broadcast message in this round include only the target device. In other words, in step S103, the mobile phone no longer filters all nearby electronic devices 200, but instead filters out the electronic devices 200 that sent the second broadcast message in the previous round (i.e., the N electronic devices 200 that sent the second broadcast message in step S105) and then selects the electronic devices 200 that still sent the first broadcast message in this round.
[0134] One implementation involves the mobile phone recording N electronic devices 200 that sent the second broadcast message in this round after step S105. Specifically, the mobile phone can obtain the N electronic devices 200 that sent the second broadcast message in this round in step S105. Subsequently, in step S103, the mobile phone can take the intersection of the electronic devices 200 that sent the first broadcast message in this round and the electronic devices 200 that sent the second broadcast message recorded after step S105, thereby obtaining the electronic devices 200 that sent both the first and second broadcast messages. If the electronic device 200 that sent both the first and second broadcast messages includes only a stylus, and the target device is also a single device, then the mobile phone can consider the stylus to be the target device and proceed to the subsequent step S104. Optionally, the mobile phone can record the electronic devices 200 by recording their identity information.
[0135] Not limited to the above implementation, the mobile phone can also store the broadcast messages received in each round, and in each round, the process of determining which electronic device 200 to connect to from multiple nearby electronic devices 200 is based on the broadcast messages received in previous rounds to determine whether the electronic device 200 that sent the special broadcast message for pairing connection in this round also sent the special broadcast message for pairing connection in previous rounds. This application embodiment does not specifically limit the specific implementation method of the mobile phone filtering the stylus that sent the first broadcast message from N electronic devices 200 that sent the second broadcast message in the previous round.
[0136] Understandably, this approach of identifying the stylus that sent the first broadcast message from among N electronic devices 200 that sent the second broadcast message in the previous round as the target device is more efficient than the approach of independently filtering target devices in each round. This allows for faster identification of the target device, improves the efficiency of pairing and connecting between devices, and enhances the user experience.
[0137] Understandably, after executing steps S105 to S106, the mobile phone remains in the first state described above, meaning it can still sense the presence of multiple nearby electronic devices 200 but cannot determine which specific electronic device 200 it is connected to. Specifically, the mobile phone can sense the presence of multiple nearby electronic devices 200 through the device identification information carried in multiple broadcast messages it receives. These multiple broadcast messages can include a first broadcast message, a second broadcast message, and a third broadcast message. The third broadcast message is a traditional Bluetooth broadcast message, specifically a broadcast message emitted by an electronic device 200 during the Bluetooth search process. It does not carry information indicating specific operations, such as the first and second information mentioned above. Therefore, the mobile phone needs to perform another round of methods to determine which electronic device 200 it is connected to from among the multiple nearby electronic devices 200, i.e., continue executing steps S102 to S103. However, it is understandable that after executing step S106, the mobile phone does not necessarily immediately execute step S102.
[0138] In some embodiments, after step S106, the mobile phone may not display the device list of the N electronic devices that sent the second broadcast message in step S105. It is understandable that since the mobile phone does not provide the user with the device list of these N electronic devices, the user can only know that they need to proceed to the next round because the target device and the mobile phone have not yet paired up. Therefore, the mobile phone cannot determine which specific electronic device 200 among the multiple electronic devices 200 to connect to because the mobile phone does not display the device list to the user and the mobile phone has received broadcast messages from multiple electronic devices 200. At this time, the user can directly continue to perform special operations on the target device to pair up and connect. Therefore, for the mobile phone, without displaying the device list of electronic devices to the user, the mobile phone can directly execute step S102 after step S106, so that the mobile phone can receive special broadcast messages when the user continues to perform special operations on the target device.
[0139] In some other embodiments, after step S106 is completed, the mobile phone may display a device list of N electronic devices that sent the second broadcast message in step S105. In this case, the mobile phone may not immediately execute step S102.
[0140] Optionally, the mobile phone may proceed to step S102 without interaction with the user. Specifically, if no first user operation is received within a preset time, the mobile phone can continue to execute subsequent steps S102 after the preset time expires. The aforementioned first user operation refers to the user's operation of selecting a specific electronic device 200 from the device list for connection. It is understood that if the mobile phone receives the aforementioned first user operation within the preset time, it indicates that the user has been able to select the target device for pairing and connection based on the information displayed in the device list, and the mobile phone does not need to execute subsequent steps S102. Therefore, the mobile phone cannot determine which specific electronic device 200 among the multiple electronic devices 200 to connect to; specifically, after displaying the device list to the user, i.e., after the mobile phone displays the identification information of multiple devices, the mobile phone does not receive the user's first user operation within the preset time.
[0141] Optionally, the mobile phone can also proceed to step S102 based on an interaction with the user. Specifically, the mobile phone cannot determine which specific electronic device 200 among the multiple electronic devices 200 is connected. This refers to the mobile phone receiving a second user operation after displaying the device list to the user, i.e., after displaying the identification information of multiple devices. For example, the second user operation could be the user clicking the "Cannot distinguish target device" control on the mobile phone screen. Subsequently, the mobile phone can proceed to the next step S102 based on this click operation.
[0142] Understandably, after ending step S106 and before proceeding to step S102, the mobile phone should determine the special operation for the next round of pairing and connection, namely the first operation.
[0143] In some embodiments, as shown in FIG14, the mobile phone can prompt the user to perform a first operation on the target device, thereby ensuring that in step S102, the mobile phone can receive the first broadcast message sent by the target device (such as a stylus). Optionally, this first operation can be selected directly by the mobile phone from a preset operation set. Optionally, this first operation can also be selected by the user from multiple special operations provided by the mobile phone. In this case, the preset operation set should include more than one special operation. The way the mobile phone selects the first operation or multiple special operations from the preset operation set can be random or according to the preset order of the preset operation set by the developer. For example, the mobile phone can sequentially select three special operations from the preset operation set, selecting the first three special operations the first time, and the fourth to sixth special operations the second time.
[0144] The aforementioned preset operation set is a set of special operations pre-set by the developers for pairing and connection. Preferably, the special operations in the preset operation set can be related to the device type. For example, styluses and cameras have different device types, so the special operations in the preset operation sets can also be different. Optionally, the special operations in the preset operation set may not be related to the device type. For example, the preset operation sets corresponding to electronic devices 200 of different device types can all be set to only a shake operation. Electronic device 200 can support Bluetooth Device Information Service (DIS) to provide the device type of electronic device 200 to the mobile phone in the broadcast message. The mobile phone can further determine the aforementioned preset operation set by reading the device type of electronic device 200 carried in the broadcast message. The embodiments of this application do not impose special limitations on the setting of the preset operation set.
[0145] Not limited to the pop-up window format shown in Figure 14, other methods that prompt the user to perform a first operation on the target device can also be used here. This application embodiment does not specifically limit the way the mobile phone prompts the user to perform a first operation on the target device.
[0146] In some embodiments, the mobile phone may not prompt the user to perform the first operation on the target device. For example, if the preset operation set has few special operations, such as the stylus only having two preset special operations (shaking and pressing), then the stylus may not prompt the user. That is, in actual use cases, when the user performs a pressing operation on the stylus, if there is no newly added paired electronic device 200 in the phone's device list, or if the user finds that the stylus cannot be paired with the phone (for example, the user still cannot write on the phone with the stylus), then the user can manually perform a shaking operation on the stylus to pair it. The user can directly obtain this information from the stylus's user manual without the phone prompting the user separately during the device pairing process, thereby reducing device power consumption.
[0147] Before proceeding to step S102, this application embodiment does not specifically limit whether the mobile phone prompts the user to perform a first operation on the target device.
[0148] In the above method, if the mobile phone also involves one or more rounds of determining which electronic device 200 to connect from multiple nearby electronic devices 200, and the mobile phone displays the searched device list to the user, then it is not limited to the pairing connection before step S104. After each round of pairing connection, for example after step S106, the mobile phone can display the electronic device 200 that sent the special broadcast message for pairing connection in the first manner. This application embodiment does not impose special restrictions on the specific method and timing of the mobile phone's differentiated display. Specific implementation details and other steps can be referred to the relevant description above, and will not be repeated here.
[0149] In the above method, the mobile phone, as the receiver of the first and second broadcast messages, will not actively send broadcast messages to nearby electronic devices 200. However, in some embodiments, after executing step S106, the mobile phone may also broadcast a special notification, which is used to inform the electronic device 200 that receives the special notification that it can turn on its sensor to sense and identify whether the first operation has been received. For example, before receiving the special notification, the accelerometer sensor for detecting shaking operations of the stylus may be in a turned-off state; after receiving the special notification, the stylus may turn on its accelerometer sensor, thereby reducing the power consumption of the stylus. It is understood that the special broadcast notification may be a private command based on a short-range protocol (here, Bluetooth Low Energy protocol), and the embodiments of this application do not limit the specific format of the private command.
[0150] The target device is not limited to one electronic device 200. In this embodiment of the application, the target device can also be multiple electronic devices 200. That is, the mobile phone can eventually pair and connect with multiple electronic devices 200 based on the user's special operation (such as the first operation), thereby improving the pairing efficiency.
[0151] The above embodiments are described with electronic device 100 as a mobile phone and electronic device 200 as a stylus. In some embodiments, the electronic device 200 may also include hardware modules such as a camera, for example, a wireless monitoring device. When this type of electronic device 200 is paired with electronic device 100, it can trigger a first broadcast message by detecting changes in the light in the photosensitive area.
[0152] Specifically, taking a wireless monitoring device as an example, the aforementioned wireless monitoring device can have a built-in photosensitive device that can detect light intensity. For instance, the first operation described above could be blocking the lens of the wireless monitoring device, thereby reducing the light intensity detected by the photosensitive area. In this case, the motion recognition module in the wireless monitoring device can obtain the ambient light intensity from the photosensitive device. If the decrease in light intensity within a preset time interval is greater than a third threshold and the final light intensity is less than a fourth threshold, the motion recognition module can determine that the user has performed the aforementioned blocking operation on the wireless monitoring device, and the wireless monitoring device can then send a first broadcast message. The aforementioned third and fourth thresholds can be determined by the developers based on experience. For instance, the second operation could also be the user making a specific gesture towards the lens of the wireless monitoring device. After the motion recognition module in the wireless monitoring device determines that the user has performed the specific gesture based on the image captured by the photosensitive device, the wireless monitoring device can send a second broadcast message. The motion recognition module can use a neural network method to determine whether the image captured by the photosensitive device matches the preset specific gesture. The remaining process can be referred to the relevant descriptions in steps S101-S106 above, and will not be repeated here. This application does not limit the methods by which a user can cause changes in the light intensity of the photosensitive area in an electronic device 200 with hardware modules such as a camera.
[0153] In some embodiments, both electronic device 100 and electronic device 200 can be changed. For example, electronic device 100 can be a laptop computer, and electronic device 200 can be a mouse, with the laptop computer and mouse connected wirelessly. As shown in Figures 15 to 17, for mouse 1, the first operation can include double-clicking the mouse. In this case, sensor 12 in mouse 1 can be a pressure sensor. When the pressure value is greater than a fifth threshold twice consecutively, mouse 1 can sense and recognize that the user has double-clicked it, thereby triggering mouse 1 to send a first broadcast message. The fifth threshold can be determined by the researchers based on experience. The laptop computer can determine from among the nearby multiple electronic devices 200 that at least one electronic device 200 that sent the first broadcast message includes only mouse 1, i.e., mouse 1 is the target device. For mouse 1, the second operation can include triple-clicking the mouse. The remaining specific process can be referred to the relevant descriptions in steps S101-S106 above, and will not be repeated here.
[0154] Not limited to pressure sensors, other sensors that can be used to detect when a mouse button is pressed, such as capacitive sensors, can also be used as sensor 12 here. This application embodiment does not make any special limitation on the specific type of sensor 12 in the mouse.
[0155] Figure 18 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may be the electronic device 100 shown in Figure 1.
[0156] As shown in Figure 18, the electronic device may include components such as a processor 211, a memory 212, a wireless communication processing module 213, a power switch 214, and a display screen 215. The wireless communication processing module 213 may include components such as a Bluetooth communication processing module 213A, a WLAN communication processing module 213B, and an infrared communication processing module 213C. The components in the electronic device are connected via a bus and communicate with each other based on the bus.
[0157] Processor 211 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0158] Memory 212 is coupled to processor 211 and is used to store various software programs and / or multiple sets of instructions. Memory 212 can be used to store computer executable program code, which includes instructions. Processor 211 executes various functional applications and data processing of the electronic device by running the instructions stored in memory 212. Memory may also be provided in processor 211 for storing instructions and data.
[0159] The memory 212 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM can be directly read and written by the processor 211. The RAM can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. The NVM can also store executable programs and user and application data. Executable programs, i.e., user data, stored in the NVM can be pre-loaded into the RAM for direct reading and writing by the processor 211.
[0160] The executable program code and data used to implement the pairing method provided in the embodiments of this application can be stored in non-volatile memory. During the implementation of the above pairing method, the electronic device can load the executable program code and data from the non-volatile memory into random access memory, so that when there are multiple electronic devices 200 around the user's electronic device 100, the user can quickly identify the target device, thereby realizing a convenient and fast pairing and connection process and improving the user experience.
[0161] The wireless communication processing module 213 can provide wireless communication solutions including WLAN, such as Wi-Fi, Bluetooth communication, ZigBee communication, NFC communication, infrared communication, UWB communication, and satellite communication. Figure 18 only shows the Bluetooth communication processing module 213A, WLAN communication processing module 213B, and infrared communication processing module 213C as examples. It can be understood that the wireless communication processing module 213 shown in Figure 18 is the same as the wireless communication module 01 shown in Figure 6.
[0162] Taking Bluetooth as an example, the Bluetooth communication processing module 213A can detect signals emitted by other devices, such as probe requests and scan signals, and can send response signals, such as probe responses and scan responses, enabling other devices to discover electronic devices and establish Bluetooth-based wireless communication connections with them. The Bluetooth communication processing module 213A can provide solutions for one or more Bluetooth communication methods, including Classic Bluetooth (BR / EDR) or Bluetooth Low Energy (BLE).
[0163] In this embodiment of the application, the electronic device 100 can communicate with the wireless communication module 11 in the electronic device 200 through the Bluetooth communication processing module 213A, including receiving Bluetooth broadcast messages (such as a first broadcast message and other broadcast messages) sent by the wireless communication module 11. Thus, the electronic device 100 can determine, based on the received first broadcast message, that the electronic device 200 that sent the first broadcast message only includes the target device, enabling the user to quickly and conveniently pair the devices and improving the user experience.
[0164] The power switch 214 can be used to control the power supply to electronic devices, thereby supplying power to the processor 211, memory 212, wireless communication processing module 213, display screen 215, etc.
[0165] Display screen 215 is used for display. Display screen 215 includes a display panel. Touch sensor can be installed in display screen 215. Touch sensor is used to detect touch operations applied to or near it. Touch sensor can transmit the detected touch operation to application processor to determine the touch event type. Then, electronic device can provide visual output related to touch operation through display screen 215. Electronic device can implement display function through GPU, display screen 215, touch sensor, and application processor, etc. In the embodiment of this application, electronic device 100 can display user interaction interface for device pairing (e.g., Bluetooth pairing) through display function provided by GPU, display screen 215, touch sensor, and application processor, etc., so that user can perform operations such as selecting pairing device. When electronic device 100 determines in step S106 that the N electronic devices 200 that sent the second broadcast message include not only the target device, electronic device 100 can display the special operation for the next round of pairing connection on display screen 215, that is, display the first operation to prompt the user to perform the first operation on the target device. Once electronic device 100 determines, based on the first broadcast message, that at least one electronic device 200 that sent the first broadcast message includes only the target device, electronic device 100 can distinguish and display the target device on display screen 215, or it can directly display on display screen 215 that it is paired and connected with the target device.
[0166] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on electronic devices 100 and 200. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. Components may be implemented in hardware, software, or a combination of software and hardware.
[0167] Figure 19 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may be the electronic device 200 shown in Figure 1.
[0168] Compared to electronic devices 100, such as mobile phones and laptops, electronic devices 200, such as styluses and mice, can include fewer components.
[0169] As shown in Figure 19, the electronic device 200 may include components such as a processor 311, a memory 312, a wireless communication processing module 313, a power switch 314, and a sensor module 315.
[0170] The memory 312 is coupled to the processor 311 and is used to store various software programs and / or multiple sets of instructions. The processor 311 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the memory 312, such as sending a first broadcast message and pairing with the electronic device 100.
[0171] The wireless communication processing module 313 corresponds to the wireless communication processing module 213 shown in Figure 18. This wireless communication processing module is the same as the wireless communication module 11 shown in Figure 6. The wireless communication processing module 313 can provide communication services equivalent to those of the wireless communication processing module 213. For example, when the wireless communication processing module 213 includes and uses a Bluetooth communication processing module 213A for communication, the wireless communication processing module 313 can also provide Bluetooth communication services, thereby completing pairing and connection operations with the Bluetooth communication processing module 213A, establishing a stable communication channel, and receiving data.
[0172] In this embodiment, electronic device 200 can send a first broadcast message and other broadcast messages based on wireless communication processing module 313, so that electronic device 100 can determine, based on receiving the first broadcast message, that at least one electronic device 200 that sent the first broadcast message includes only the target device. Electronic device 200 can also pair and connect with electronic device 100 based on the wireless communication capabilities provided by wireless communication processing module 313, thereby providing users with a fast and convenient pairing and connection experience.
[0173] The electronic device 200 may also include a power switch 314, which can be used to control the power supply to the electronic device, thereby supplying power to the processor 311, memory 312, wireless communication processing module 313, sensor module 315, etc.
[0174] The sensor module 315 may include one or more sensors, such as a pressure sensor, a gyroscope sensor, and an accelerometer sensor. The pressure sensor senses pressure signals and converts them into electrical signals. The gyroscope sensor determines the angular velocity of the electronic device 200 around three axes (x, y, and z). The accelerometer sensor detects the magnitude of the acceleration of the electronic device 200 in various directions (typically three axes).
[0175] In this embodiment of the application, the electronic device 200 can identify whether the operation performed by the user on the electronic device 200 is a special operation based on the data detected by the sensor (such as angular velocity, acceleration, pressure magnitude), so that the electronic device 200 can determine the identification information of the special operation that needs to be carried in the broadcast message sent.
[0176] Similarly, the structural diagram shown in Figure 19 is only an example and should not constitute a specific limitation on the electronic device 200.
[0177] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer. Embodiments of this application also provide a computer program product, including a computer program that, when run on a processor, implements the steps in the various method embodiments described above.
[0178] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.
Claims
1. A device connection method, characterized in that, The method is applied to a first device, and the method includes: The first device enters a first state based on the search for nearby devices. The first state is when the first device senses the existence of multiple nearby devices but cannot determine which of the multiple devices it is connected to. In a first state, the first device receives a first broadcast message from at least one of the plurality of devices, the first broadcast message including first information, the first information being used to instruct the user to perform a first operation on the at least one device; The first device determines, based on the first broadcast message, that the at least one device includes only the second device; The first device establishes a connection with the second device.
2. The method according to claim 1, characterized in that, The first device determines, based on the first broadcast message, that the at least one device includes only the second device, specifically including: The first device determines the number of the at least one device based on the device identification information carried in the first broadcast message; The first device determines, based on the number of devices, that the at least one device includes only the second device.
3. The method according to claim 1 or 2, characterized in that, The second device may include one device, or the second device may include more than one device.
4. The method according to any one of claims 1-3, characterized in that, Before the first device receives the first broadcast message from at least one of the plurality of devices, the method further includes: In the first state, the first device receives a second broadcast message from N devices among the plurality of devices. The second broadcast message includes second information, which is used to instruct the user to perform a second operation on the N devices. The first device determines, based on the second broadcast message, that the N devices include not only the second device.
5. The method according to claim 4, characterized in that, The first operation is different from the second operation.
6. The method according to claim 4 or 5, characterized in that, The first device determines, based on the first broadcast message, that the at least one device includes only the second device, specifically including: The first device determines the at least one device that sent the first broadcast message from the N devices as the second device.
7. The method according to any one of claims 1-6, characterized in that, The first device senses the presence of multiple nearby devices, specifically including: The first device receives multiple broadcast messages, which include one or more of the following: the first broadcast message, the second broadcast message, and the third broadcast message, wherein the third broadcast message does not carry the first information or the second information; The first device determines that there are multiple devices nearby based on the device identity information carried in the multiple broadcast messages.
8. The method according to any one of claims 1-7, characterized in that, The inability to determine which of the multiple devices is connected specifically includes: The first device displays the identification information of the plurality of devices, and the first device does not receive a first user operation from the user within a preset time. The first user operation is used to select a connected device.
9. The method according to any one of claims 1-7, characterized in that, The inability to determine which of the multiple devices is connected specifically includes: The first device displays the identification information of the plurality of devices and detects a second user operation, which triggers the first device to determine which device to connect to from the plurality of devices.
10. The method according to any one of claims 1-7, characterized in that, The inability to determine which of the multiple devices is connected specifically includes: The first device does not display the identification information of the plurality of devices.
11. The method according to any one of claims 1-10, characterized in that, Before the first device receives the first broadcast message from the plurality of devices, the method further includes: The first device prompts the user to perform a first operation on the second device, the first operation being selected by the first device from a preset set of operations.
12. The method according to any one of claims 1-10, characterized in that, Before the first device receives the first broadcast message from the plurality of devices, the method further includes: The first device prompts the user to perform a first operation on the second device. The first operation is selected by the user from a plurality of special operations provided by the first device, and the plurality of special operations are selected by the first device from a preset set of operations.
13. The method according to any one of claims 1-9, characterized in that, Before the first device establishes a connection with the second device, the method further includes: The first device displays the identification information of the second device in a first manner.
14. The method according to claim 13, characterized in that, The first device displays the identification information of the second device in a first manner, specifically including: Along with the identification information of the second device, the first device displays description information of the first operation received by the second device.
15. The method according to claim 13, characterized in that, The first device distinguishes the second device by displaying it differently, specifically including: Accompanied by the identification information of the second device, the first device plays a first animation according to the first operation received by the second device, and different first operations correspond to different first animations.
16. A device communication system, characterized in that, The device communication system includes a first device and nearby devices of the first device, wherein... The first device is used to search for nearby devices; The first device is used to enter a first state based on the search of nearby devices. The first state is that the first device senses the existence of multiple nearby devices and cannot determine which of the multiple devices it is connected to. In a first state, the first device is configured to receive a first broadcast message from at least one of the plurality of devices, the first broadcast message including first information, the first information being used to instruct a user to perform a first operation on the at least one device; The first device is configured to determine, based on the first broadcast message, that the at least one device includes only the second device; The first device is used to establish a connection with the second device.
17. An electronic device comprising a memory and a processor, i.e., a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method as described in any one of claims 1-15.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-15.
19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-15.
Citation Information
Patent Citations
Method and equipment for pairing blue-tooth devices
CN104917551A
Equipment connecting method and equipment connecting device
CN105979604A
Binding method and device and computer equipment
CN112804651A
Electronic apparatus and method for identifying at least one pairing subject in electronic apparatus
US20160309286A1