Method for establishing wireless connection between devices by touching each other, electronic device and chip

By employing Wi-Fi scanning with a large duty cycle and sensor detection in electronic devices, the device connectivity problem under the hardware limitations of NFC is solved, enabling fast wireless connection and interaction while reducing hardware requirements.

CN114339698BActive Publication Date: 2024-11-15NOKIA TECHNOLOGIES OY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202011070213.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2024-11-15
Estimated Expiration
2040-09-30

AI Technical Summary

Technical Problem

Due to hardware limitations of NFC in existing technologies, electronic devices cannot quickly establish connections, especially when the device does not have NFC functionality or the NFC sensing area is not in close contact.

Method used

The first electronic device uses a Wi-Fi scan with a large scanning duty cycle to detect motion and establish a Wi-Fi connection with the second electronic device when preset conditions are met. Sensors are used to detect the motion and distance of the devices to achieve rapid discovery and connection.

Benefits of technology

Wireless connections between devices can be established quickly without the need for NFC devices, reducing hardware requirements and improving the speed of device interaction and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114339698B_ABST
    Figure CN114339698B_ABST
Patent Text Reader

Abstract

The present application provides a method, electronic device and chip for establishing a wireless connection between devices by touching each other, and relates to the field of short-distance communication technology. When a first electronic device is detected to be close to or touching a second electronic device, the first electronic device can accelerate the scan, such as increasing the WiFi scan frequency or the Bluetooth scan duty cycle, so that the first electronic device can quickly discover the second electronic device. At this time, if the quality of the broadcast message signal of the second electronic device scanned by the first electronic device meets the preset conditions, the two devices can be triggered to quickly establish a WiFi connection, thereby achieving the effect of connecting devices with one touch. The present application scheme can quickly trigger the start of connection and business interaction between electronic devices without the need for NFC devices, which can reduce the hardware requirements for electronic devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of short-distance communication technology, and more specifically to a method for establishing a wireless connection between devices by touching each other in the communication field, an electronic device, a chip, and a computer-readable storage medium. Background Art

[0002] With the development of mobile Internet and smart electronic devices, business interactions between different smart electronic devices are becoming more and more popular. For example, smart electronic devices such as mobile phones, desktops, tablets, TVs, speakers, etc. can share files (such as pictures, videos, audio, text, etc.), cast screens, and wirelessly control each other. Before transmitting business data between devices, it is necessary to establish a connection between the devices that supports the transmission of business data, such as Bluetooth connection, wireless local area network (WLAN) connection, etc.

[0003] Currently, with the help of NFC proximity sensing function, NFC sensing can be used to trigger a quick connection between electronic devices. For example, by placing the NFC sensing areas of two electronic devices with NFC function (referred to as NFC devices for short) close together, Bluetooth pairing or WLAN direct connection can be quickly established between the two NFC devices without manually searching for devices, pairing, and entering passwords.

[0004] For example, take the Bluetooth pairing of a mobile phone and a tablet computer as an example. When the NFC function of the mobile phone is turned on, if the NFC sensing area of ​​the mobile phone (the area is equipped with an NFC card reader) is close to the NFC tag area of ​​the tablet computer, the mobile phone will display a "Bluetooth pairing request" prompt box. If the pairing is confirmed, the Bluetooth pairing can be quickly established. Among them, when the mobile phone is close to the NFC tag area of ​​the tablet computer, the NFC tag can obtain a very small power supply from the NFC card reader and use it to drive the circuit of the NFC tag, and transmit the tag information of the NFC tag to the NFC card reader. Once the NFC card reader receives the tag information, it can trigger a quick connection between electronic devices.

[0005] However, in the above process of triggering the connection between electronic devices, the prerequisite is that the two electronic devices are equipped with NFC devices (such as NFC card readers, NFC tags), and the two electronic devices need to put their respective NFC sensing areas close together to trigger the establishment of a connection between the devices. In other words, if any of the two electronic devices does not have an NFC function (currently many electronic devices are not equipped with NFC devices), or the NFC sensing areas of the two electronic devices are not close together, the connection between the electronic devices cannot be triggered by the above method, and the purpose of quickly starting the interactive service between the electronic devices cannot be achieved. Summary of the invention

[0006] The present application provides a method for establishing a wireless connection between devices by touching each other, an electronic device, a chip and a computer-readable storage medium, which can solve the problem in the related art that a connection cannot be triggered between electronic devices due to the limitation of NFC hardware.

[0007] In a first aspect, the present application provides a method for establishing a wireless connection between devices by touching, the method comprising: a first electronic device performs a wireless fidelity (Wi-Fi) scan using a first scanning duty cycle, wherein the Wi-Fi scan is used to discover other electronic devices around the first electronic device; when the first electronic device detects that the first electronic device is in a preset motion state, the first electronic device performs a Wi-Fi scan using a second scanning duty cycle, wherein the second scanning duty cycle is greater than the first scanning duty cycle; when the signal quality of a first broadcast message scanned by the first electronic device meets a preset condition, the first electronic device establishes a Wi-Fi connection with a second electronic device, wherein the first broadcast message is a message sent by the second electronic device.

[0008] The scanning duty cycle refers to the time proportion of the scanning window in a cycle. The larger the scanning duty cycle, the greater the probability of scanning a broadcast message, and the more power is consumed accordingly; the smaller the scanning duty cycle, the smaller the probability of scanning a broadcast message, and the less power is consumed accordingly. Since the second scanning duty cycle is greater than the first scanning duty cycle, accelerated scanning can be achieved, so that the first electronic device can quickly discover other electronic devices around it.

[0009] Through the above scheme, when the first electronic device detects that the first electronic device is close to or touching the second electronic device, the first electronic device can accelerate the WiFi scan, so that the first electronic device can quickly discover the second electronic device. At this time, if the quality of the broadcast message signal of the second electronic device scanned by the first electronic device meets the preset conditions, the two devices can be triggered to quickly establish a WiFi connection, thereby achieving the effect of connecting the devices with one touch. Since the scanning duty cycle of the first electronic device becomes larger, it helps the first electronic device to accelerate the scanning of the first broadcast signal, so that the first electronic device can discover the device to be connected faster, which helps to establish the speed of connection between devices and business interaction. And without the help of NFC devices, the hardware requirements for electronic devices can be reduced.

[0010] Optionally, whether the signal quality meets the preset condition can be determined by at least one of the following parameters: received signal strength indication (RSSI), reference signal received power (RSRP), signal-to-noise ratio (SNR). Exemplarily, taking RSSI as an example, when the RSSI value of the first broadcast message received by the first electronic device is greater than a preset threshold, the first electronic device can determine that the signal quality meets the preset condition.

[0011] In a possible implementation of the first aspect, the preset motion state includes at least one of the following: the first electronic device moves toward the second electronic device, and the first electronic device touches the second electronic device. The first electronic device can detect the motion state information or motion parameters of the first electronic device through a built-in sensor, and determine the device motion state according to the motion state information or motion parameters.

[0012] Exemplarily, the sensor may be at least one of the following: an acceleration sensor, a proximity light sensor, a Hall sensor, a gyroscope sensor, and of course, may be any other sensor that meets actual usage requirements.

[0013] In a possible implementation of the first aspect, after the signal quality of the first broadcast message received by the first electronic device meets a preset condition, the method further includes: the first electronic device displays a first prompt message, and the first prompt message is used to prompt whether to establish a Wi-Fi connection with the second electronic device. At this time, the first electronic device establishes a Wi-Fi connection with the second electronic device, including: the first electronic device responds to the user's confirmation connection operation on the first prompt message, and establishes a Wi-Fi connection with the second electronic device. In this way, the device can be connected with one touch according to the actual use needs of the user, thereby improving the user experience.

[0014] In a possible implementation of the first aspect, after the first electronic device establishes a Wi-Fi connection with the second electronic device, the method further includes: the first electronic device sends first service data related to the first service to the second electronic device; and / or the first electronic device receives the first service data sent by the second electronic device. In this way, after the devices are connected by one touch, the service data between the devices can be quickly interacted with, thereby improving the interactive experience function between the devices.

[0015] In a possible implementation of the first aspect, the method further includes: when the first electronic device detects that the first electronic device is in the preset motion state, the first electronic device sends a first indication message to the second electronic device, the first indication message being used to instruct the second electronic device to start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message. Since the broadcast frequency of the second electronic device increases, it helps the second electronic device to be discovered faster, which helps to speed up the establishment of connection and interaction between devices.

[0016] In a possible implementation of the first aspect, the first broadcast message includes a device identification and Wi-Fi channel information of the second electronic device. The first electronic device establishing a Wi-Fi connection with the second electronic device includes: the first electronic device establishing a Wi-Fi connection with the second electronic device based on the first broadcast message.

[0017] Among them, the Wi-Fi channel information can indicate the Wi-Fi channel supported by the second electronic device. The first electronic device can send a connection request message to the second electronic device according to the device identification of the second electronic device, and then the first electronic device and the second electronic device establish a Wi-Fi connection based on the Wi-Fi channel information.

[0018] In a possible implementation of the first aspect, the first broadcast message further includes a device identifier of a third electronic device; and the method further includes: the first electronic device establishes a Wi-Fi connection with the third electronic device. In this way, the embodiment of the present application not only achieves the effect of connecting two devices with one touch, but also can achieve the effect of connecting more devices with one touch.

[0019] In a second aspect, the present application provides an electronic device, which includes a unit for executing the method in the first aspect.

[0020] In a third aspect, the present application provides an electronic device, the electronic device is a first electronic device, and the electronic device includes a wireless short-range communication chip and a sensor;

[0021] The wireless short-range communication chip is used to perform scanning using a first scanning duty cycle, wherein the scanning is used to discover other electronic devices around the first electronic device;

[0022] The sensor is used to detect the motion state of the first electronic device relative to the other electronic devices;

[0023] The wireless short-range communication chip is further configured to scan using a second scanning duty cycle when the sensor detects that the first electronic device is in a preset motion state, wherein the second scanning duty cycle is greater than the first scanning duty cycle;

[0024] The wireless short-range communication chip is used to establish a wireless connection between the first electronic device and the second electronic device when the signal quality of the first broadcast message scanned by the first electronic device meets a preset condition, and the first broadcast message is a message sent by the second electronic device.

[0025] In a possible implementation manner of the third aspect, the preset motion state includes at least one of the following: the first electronic device moves toward the second electronic device, and the first electronic device touches the second electronic device.

[0026] In some embodiments, the electronic device further comprises a display screen, the display screen being used to display a first prompt message after the signal quality of the first broadcast message scanned by the wireless short-range communication chip meets a preset condition, the first prompt message being used to prompt whether to establish a wireless connection with the second electronic device. The wireless short-range communication chip is specifically used to establish a wireless connection with the second electronic device in response to a user's confirmation connection operation on the first prompt message.

[0027] In a possible implementation of the third aspect, the wireless short-range communication chip is also used to: after the first electronic device establishes a wireless connection with the second electronic device, send first business data related to the first business to the second electronic device; and / or receive the first business data sent by the second electronic device.

[0028] In a possible implementation of the third aspect, the wireless short-range communication chip is also used to: when the sensor detects that the first electronic device is in the preset motion state, send a first indication message to the second electronic device, and the first indication message is used to instruct the second electronic device to start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message.

[0029] In a possible implementation of the third aspect, the first broadcast message includes a device identification and channel information of the second electronic device. The wireless short-range communication chip is specifically configured to establish a wireless connection between the first electronic device and the second electronic device based on the first broadcast message.

[0030] In a possible implementation of the third aspect, the first broadcast message further includes a device identification of a third electronic device. The wireless short-range communication chip is further configured to establish a wireless connection between the first electronic device and the third electronic device.

[0031] In a possible implementation manner of the third aspect, the wireless short-range communication chip is a Wireless Fidelity Wi-Fi chip or a Bluetooth chip.

[0032] In a fourth aspect, the present application provides a method for establishing a wireless connection between devices by touching, the method comprising: a first electronic device detects first motion state information of the first electronic device through a first sensor; the first electronic device detects a first distance value between the first electronic device and a second electronic device; when the first motion state information conforms to preset motion state information and the first distance value is within a preset distance range, the first electronic device establishes a wireless connection with a target electronic device; wherein the target electronic device is the second electronic device or a third electronic device indicated by the second electronic device through a broadcast message.

[0033] Through the above scheme, by detecting that the motion state information of the first electronic device meets the preset motion state information and detecting that the distance between the first electronic device and the second electronic device is within the preset distance range for establishing a wireless connection, the first electronic device can be triggered to quickly establish a wireless connection with the second electronic device or other electronic devices associated with the second electronic device. Since the above method of establishing a wireless connection between devices by touching does not require the help of an NFC device, that is, there is no need to trigger the start of the connection and interaction between electronic devices by the close contact of an NFC reader and an NFC tag, the scheme for establishing a connection and interaction between electronic devices provided in the embodiment of the present application can reduce the hardware requirements for electronic devices.

[0034] In a possible implementation of the fourth aspect, the first sensor is a sensor for detecting movement and / or touch of the first electronic device, and the preset motion state information is used to indicate that the first electronic device moves toward the second electronic device and / or touches the second electronic device.

[0035] Exemplarily, the first sensor may be at least one of the following: an acceleration sensor, a proximity light sensor, a Hall sensor, a gyroscope sensor, and of course, any other sensor that meets actual usage requirements. For example, the first sensor is an acceleration sensor, the first motion state information includes a plurality of speed values ​​or acceleration values ​​that change over time, and the preset motion state information indicates that the speed value or the acceleration value changes and the change amount is greater than a preset threshold.

[0036] In a possible implementation of the fourth aspect, after the first electronic device detects the first motion state information of the first electronic device through a first sensor, the method further includes: if the first motion state information matches the preset motion state information, the first electronic device performs a first action, and the first action includes any one of the following: turning on a scanning function of the first electronic device, and increasing a scanning duty cycle when the scanning function of the first electronic device is turned on.

[0037] Since the scanning duty cycle of the first electronic device becomes larger, it helps the first electronic device to speed up scanning of the first broadcast signal, so that the first electronic device can find the device to be connected more quickly, which indirectly helps to speed up the establishment of connection and interaction between devices.

[0038] In a possible implementation of the fourth aspect, after the first electronic device detects the first motion state information of the first electronic device through a first sensor, the method further includes: if the first motion state information matches the preset motion state information, the first electronic device sends a first indication message to the second electronic device, and the first indication message is used to instruct the execution of a second action; wherein the second action includes any one of the following: starting to broadcast a first broadcast message, and increasing the frequency of broadcasting the first broadcast message when the broadcast function of the second electronic device is turned on.

[0039] In a possible implementation of the fourth aspect, the first electronic device detects a first distance value between the first electronic device and a second electronic device, including: when the first electronic device scans a first broadcast message broadcast by the second electronic device, the first electronic device calculates the first distance value based on the first broadcast message.

[0040] In a possible implementation of the fourth aspect, the first broadcast message includes a device identification of the target electronic device and first channel information, and the first channel information is used to indicate a Wi-Fi channel or a Bluetooth (BT) channel. The first electronic device establishes a wireless connection with the target electronic device, including: the first electronic device establishes a wireless connection with the target electronic device through Wi-Fi or Bluetooth according to the first broadcast message.

[0041] The device identifier of the target electronic device is an identifier used to uniquely identify the target electronic device, such as a media access control (MAC) address. The first channel information indicates a channel used to establish a wireless connection. For example, taking a Wi-Fi channel as an example, the first channel information may indicate one of the first to thirteenth channels.

[0042] In another possible implementation of the fourth aspect, the first broadcast message includes the device identification of the target electronic device; the first electronic device establishes a wireless connection with the target electronic device, including: when the first electronic device scans the first broadcast message, the first electronic device sends a response message to the target electronic device according to the first broadcast message, the response message including the device identification of the first electronic device and second channel information, the second channel information is used to indicate a Wi-Fi channel or a Bluetooth channel; the first electronic device establishes a wireless connection with the target electronic device via Wi-Fi or Bluetooth according to the first broadcast message and the response message.

[0043] The device identification of the first electronic device is an identification used to uniquely identify the first electronic device. The second channel information indicates a channel used to establish a wireless connection.

[0044] Optionally, the first broadcast message may further include a target password, where the target password is used for authentication when establishing a wireless connection to improve the security of the wireless connection.

[0045] In a possible implementation of the fourth aspect, the first electronic device establishes a wireless connection with a target electronic device, including: the first electronic device sends first business data related to a first business to the target electronic device; or, the first electronic device receives the first business data sent by the target electronic device.

[0046] In a possible implementation of the fourth aspect, before the first electronic device establishes a wireless connection with the target electronic device, the method further includes: the first electronic device displays a first prompt message, where the first prompt message is used to prompt whether to establish a wireless connection with the target electronic device;

[0047] The first electronic device establishes a wireless connection with the target electronic device, comprising: the first electronic device establishes a wireless connection with the target electronic device when receiving a user's confirmation connection operation on the first prompt message.

[0048] In a fifth aspect, the present application provides a method for establishing a wireless connection between devices by touching, the method comprising: when the first motion state information of the first electronic device satisfies the preset motion state information and the first distance value is within the preset distance range, the target electronic device establishes a wireless connection with the first electronic device. Wherein, the first distance value is used to indicate the distance between the first electronic device and the second electronic device, and the target electronic device is the second electronic device or a third electronic device indicated by the second electronic device through a broadcast message.

[0049] In a possible implementation manner of the fifth aspect, the preset motion state information is used to indicate that the first electronic device moves toward the second electronic device and / or touches the second electronic device.

[0050] In a possible implementation of the fifth aspect, the method also includes: when the first motion state information satisfies the preset motion state information, the second electronic device receives a first indication message sent by the first electronic device, and the first indication message is used to instruct the second electronic device to perform a second action; the second electronic device performs the second action, and the second action includes any one of the following: starting to broadcast a first broadcast message, and increasing the frequency of broadcasting the first broadcast message when the broadcast function of the second electronic device is turned on.

[0051] In a possible implementation of the fifth aspect, the method also includes: the second electronic device detects the first motion state information; the second electronic device determines that the first motion state information meets the preset motion state information; the second electronic device performs a third action, and the third action includes any one of the following: starting to broadcast the first broadcast message, increasing the frequency of broadcasting the first broadcast message.

[0052] In a possible implementation of the fifth aspect, the first broadcast message includes a device identification and first channel information of the target electronic device, and the first channel information is used to indicate a Wi-Fi channel or a Bluetooth channel. The target electronic device establishes a wireless connection with the first electronic device, including: the target electronic device establishes a wireless connection with the first electronic device through Wi-Fi or Bluetooth according to the first broadcast message.

[0053] In another possible implementation of the fifth aspect, the first broadcast message includes the device identification of the target electronic device; the target electronic device establishes a wireless connection with the first electronic device, including: the target electronic device receives a response message sent by the first electronic device, the response message includes the device identification of the first electronic device and second channel information, the second channel information is used to indicate a Wi-Fi channel or a Bluetooth channel; the target electronic device establishes a wireless connection with the first electronic device via Wi-Fi or Bluetooth according to the first broadcast message and the response message.

[0054] In a possible implementation of the fifth aspect, after the target electronic device establishes a wireless connection with the first electronic device, the method further includes: the target electronic device receives first business data related to a first business sent by the first electronic device; or, the target electronic device sends the first business data to the first electronic device.

[0055] In a sixth aspect, the present application provides an apparatus for establishing a wireless connection, the apparatus comprising a unit for executing the method in the fourth aspect.

[0056] In a seventh aspect, the present application provides an apparatus for establishing a wireless connection, the apparatus comprising a unit for executing the method in the fifth aspect.

[0057] In an eighth aspect, the present application provides a wireless communication system, the system comprising a first electronic device and a second electronic device; the system is used to execute the method in the first aspect and / or the fourth aspect and / or the fifth aspect.

[0058] In a ninth aspect, the present application provides an electronic device, the electronic device comprising a processor, the processor coupled to a memory, the memory being used to store a computer program or instruction, the processor being used to execute the computer program or instruction stored in the memory, so that the method in the first aspect and / or the fourth aspect and / or the fifth aspect is executed. For example, the processor is used to execute the computer program or instruction stored in the memory, so that the electronic device executes the method in the first aspect and / or the fourth aspect and / or the fifth aspect.

[0059] In a tenth aspect, the present application provides a computer-readable storage medium on which a computer program (also referred to as instructions or codes) for implementing the method in the first aspect and / or the second aspect is stored. For example, when the computer program is executed by a computer, the computer can execute the method in the first aspect and / or the fourth aspect and / or the fifth aspect.

[0060] In an eleventh aspect, the present application provides a chip, comprising a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and / or the fourth aspect and / or the fifth aspect. Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire. Optionally, the chip is a wireless short-range communication chip, such as a Wi-Fi chip or a Bluetooth chip.

[0061] In the twelfth aspect, the present application provides a computer program product, which includes a computer program (also referred to as instructions or codes), and when the computer program is executed by a computer, the computer enables the computer to implement the method in the first aspect and / or the fourth aspect and / or the fifth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a schematic diagram of a system architecture provided in an embodiment of the present application.

[0063] Figure 2 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0064] Figure 3This is one of the flow charts of a method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0065] Figure 4 It is a schematic diagram of an acceleration sensor provided in an embodiment of the present application applied to an electronic device.

[0066] Figure 5 It is a schematic diagram of a combined acceleration waveform detected by an acceleration sensor provided in an embodiment of the present application.

[0067] Figure 6 This is the second flow chart of a method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0068] Figure 7 It is a schematic diagram of the Bluetooth scanning window and scanning interval.

[0069] Figure 8 It is a comparison diagram of normal scanning mode, power saving scanning mode and accelerated scanning mode.

[0070] Fig. 9 This is the third flow chart of a method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0071] Fig.10 This is a fourth flow chart of a method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0072] Figures 11 to 13 It is an interface and scenario diagram of an application of a method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0073] Fig.14 This is the fifth flow chart of another method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0074] Figures 15 to 18 It is an interface and scenario diagram of another method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0075] Fig.19 This is the sixth flow chart of another method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application.

[0076] Fig. 20 and Fig.21 It is a schematic block diagram of a device for establishing a wireless connection provided in an embodiment of the present application.

[0077] Fig. 22 It is a schematic diagram of a system for establishing a wireless connection provided in an embodiment of the present application.

[0078] Fig.23 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0080] In the description of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. Also, in the description of the present application, unless otherwise specified, "multiple" means two or more than two. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, the "first" and "second" described in the embodiments of the present application are used to distinguish different objects, or to distinguish different treatments of the same object, rather than to describe the specific order of objects.

[0081] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0082] The present application embodiment provides an electronic device 10, which can be applied to Figure 1 The communication system 100 shown in FIG. 1 may include an electronic device 10 and at least one electronic device 20 .

[0083] The electronic device 10 can establish a wireless connection with the electronic device 20 through wireless communication technology. For example, the wireless communication technology can be Bluetooth (BT), traditional Bluetooth or low-power BLE Bluetooth, wireless local area networks (WLAN) (such as Wi-Fi networks), Zigbee, frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), or general 2.4G / 5G frequency band wireless communication technology. The wireless connection is a connection established using the wireless communication technology. The embodiment of the present application does not specifically limit the type of wireless communication technology.

[0084] The electronic device 10 may be a mobile terminal. For example, the electronic device 10 may be a mobile phone (eg Figure 1 As shown), tablet computers, laptop computers, PDAs, vehicle terminals, wearable devices, ultra-mobile personal computers (ultra-mobile personal computers, UMPCs), netbooks or personal digital assistants (personal digital assistants, PDAs) and other mobile terminals. The electronic device 20 can be a mobile terminal or a non-mobile terminal. Exemplarily, the electronic device 20 can be a mobile phone, a tablet computer, a laptop computer, a PDA, a wearable device, a UMPC, a netbook or a PDA, a wireless headset, a wireless bracelet, a wireless smart glasses, a wireless watch, an augmented reality (AR) / virtual reality (VR) device, a desktop computer, a wireless vehicle, a smart home appliance (such as a TV, a speaker, a refrigerator, an air purifier, an air conditioner, an electric rice cooker), etc. Among them, the electronic device 20 can also be collectively referred to as an Internet of Things (IoT) device. The embodiment of the present application does not specifically limit the device types of the electronic device 10 and the electronic device 20.

[0085] Figure 2The structure diagram of an electronic device 10 is shown. The electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management unit 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180I, a touch sensor 180J, an ambient light sensor 180K and a bone conduction sensor 180L, etc.

[0086] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0087] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 10. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0088] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0089] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation of the electronic device 10. In other embodiments of the present application, the electronic device 10 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0090] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 10. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management unit 141.

[0091] The power management unit 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management unit 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193 and the wireless communication module 160. The power management unit 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management unit 141 can also be set in the processor 110. In other embodiments, the power management unit 141 and the charging management module 140 can also be set in the same device.

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

[0093] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 10 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0094] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 10. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0095] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0096] The wireless communication module 160 can provide wireless communication solutions including WLAN (such as Wi-Fi), BT, global navigation satellite system (GNSS), FM, NFC, IR or general 2.4G / 5G wireless communication technology applied to the electronic device 10. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0097] In some embodiments, the wireless communication module 160 may be a Bluetooth chip. The electronic device 10 may be paired with and connected to a Bluetooth chip of an electronic device such as a wireless headset through the Bluetooth chip, so as to achieve wireless communication and service processing between the electronic device 10 and other electronic devices through the connection. The Bluetooth chip may generally support BR / EDR Bluetooth and BLE.

[0098] In some embodiments, the antenna 1 of the electronic device 10 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 10 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TDSCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).

[0099] The electronic device 10 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0100] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 10 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0101] The electronic device 10 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.

[0102] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0103] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 10 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0104] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 10 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0105] Video codecs are used to compress or decompress digital videos. The electronic device 10 may support one or more video codecs. Thus, the electronic device 10 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0106] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 10 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0107] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0108] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 10 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 10 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0109] The processor 110 can be used to execute the above program code and call related modules to implement the functions of the electronic device in the embodiment of the present application. For example, pairing with a wireless headset; when there is an audio service, sending a connection request message to the wireless headset according to the priority of the audio service; establishing / disconnecting a physical connection or a virtual connection with the wireless headset, etc.

[0110] The electronic device 10 can implement audio functions such as music playing and recording through the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor in the audio module 170 .

[0111] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0112] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 10 can listen to music or listen to a hands-free call through the speaker 170A.

[0113] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 10 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0114] Microphone 170C, also called "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting his mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 10 can be provided with at least one microphone 170C. In other embodiments, the electronic device 10 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 10 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.

[0115] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0116] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 10 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 10 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 10 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0117] The gyro sensor 180B can be used to determine the motion posture of the electronic device 10. In some embodiments, the angular velocity of the electronic device 10 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 10 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 10 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0118] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 10 in all directions (generally three axes). When the electronic device 10 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0119] The distance sensor 180F is used to measure the distance. The electronic device 10 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 10 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0120] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode may be an infrared light-emitting diode. The electronic device 10 emits infrared light outward through the light-emitting diode. The electronic device 10 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 10. When insufficient reflected light is detected, the electronic device 10 can determine that there is no object near the electronic device 10. The electronic device 10 can use the proximity light sensor 180G to detect that the user holds the electronic device 10 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0121] The ambient light sensor 180K is used to sense the brightness of the ambient light. The electronic device 10 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180K can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180K can also cooperate with the proximity light sensor 180G to detect whether the electronic device 10 is in a pocket to prevent accidental touch.

[0122] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 10 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0123] The magnetic sensor 180D includes a Hall sensor. The electronic device 10 can use the magnetic sensor 180D to detect the displacement of the electronic device 10. In some embodiments, the Hall sensor can use a magnet to form a linear trapezoidal magnetic field (or called a ramp magnetic field). The displacement change of the Hall plate in the linear magnetic field is consistent with the change in magnetic field strength. The Hall potential formed is proportional to the displacement. The electronic device 10 obtains the Hall potential and can measure the displacement.

[0124] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 10 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.

[0125] The temperature sensor 180I is used to detect temperature. In some embodiments, the electronic device 10 uses the temperature detected by the temperature sensor 180I to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180I exceeds a threshold, the electronic device 10 reduces the performance of a processor located near the temperature sensor 180I to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 10 heats the battery 142 to avoid abnormal shutdown of the electronic device 10 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 10 boosts the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.

[0126] The touch sensor 180J is also called a "touch panel". The touch sensor 180J can be set on the display screen 194, and the touch sensor 180J and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180J is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180J can also be set on the surface of the electronic device 10, which is different from the position of the display screen 194.

[0127] The bone conduction sensor 180L can obtain a vibration signal. In some embodiments, the bone conduction sensor 180L can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180L can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180L can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180L to realize the voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180L to realize the heart rate detection function.

[0128] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 10 may receive key input and generate key signal input related to user settings and function control of the electronic device 10.

[0129] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0130] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0131] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 10 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 10 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 10 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 10 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 10 and cannot be separated from the electronic device 10.

[0132] Understandably, Figure 2 The components shown do not constitute a specific limitation on the electronic device 20 , and the electronic device 20 may also include more or fewer components than those shown in the figure, or combine or separate some components, or arrange the components differently.

[0133] Based on the above system architecture and hardware configuration, the embodiment of the present application provides a method for establishing a wireless connection between devices by touching, wherein the first electronic device detects the first motion state information of the first electronic device through a first sensor; the first electronic device detects the first distance value between the first electronic device and the second electronic device; when the first motion state information meets the preset motion state information and the first distance value is within the preset distance range, the first electronic device establishes a wireless connection with the target electronic device, and the target electronic device is the second electronic device or the third electronic device indicated by the second electronic device through a broadcast message. In the embodiment of the present application, by detecting that the motion state information of the first electronic device meets the preset motion state information and detecting that the distance between the first electronic device and the second electronic device is within the preset distance range in which a wireless connection can be established, the first electronic device can be triggered to quickly establish a wireless connection with the second electronic device or other electronic devices associated with the second electronic device. Since the above method for establishing a wireless connection between devices by touching does not require the aid of an NFC device, that is, there is no need to trigger the start of the connection and interaction between electronic devices by the close contact of an NFC card reader and an NFC tag, the scheme for establishing a connection and interaction between electronic devices provided in the embodiment of the present application can reduce the hardware requirements for electronic devices.

[0134] It should be noted that the execution subject of the method for establishing a wireless connection by touching between devices provided in the embodiment of the present application can be the above-mentioned electronic device (for example, the above-mentioned electronic device 10), or it can be a functional module and / or functional entity in the electronic device that can implement the method. The specific details can be determined according to actual use requirements, and the embodiment of the present application is not limited. The following takes the execution subject as an electronic device (for example, the first electronic device) as an example to exemplarily illustrate the method for establishing a wireless connection by touching between devices provided in the embodiment of the present application.

[0135] In an embodiment of the present application, when a wireless connection is not established between a first electronic device and a second electronic device, if a user needs to establish a wireless connection between the first electronic device and the second electronic device, or needs to implement business interaction between the first electronic device and the second electronic device (for example, by projecting a screen displayed by the first electronic device onto the second electronic device for display), then the user can operate according to the method for establishing a wireless connection by touching between devices provided in an embodiment of the present application to implement rapid interconnection or business interaction between devices.

[0136] The following is an exemplary description of a method for establishing a wireless connection between devices by touching each other provided in an embodiment of the present application in conjunction with the accompanying drawings. Figure 3 is a flowchart of a method for establishing a wireless connection between devices by touching each other according to an exemplary embodiment. Figure 3 As shown, the method includes the following steps S310-S330.

[0137] S310: The first electronic device detects first motion state information of the first electronic device through a first sensor.

[0138] In the embodiment of the present application, the first sensor may be a sensor disposed in the first electronic device for sensing movement and / or rotation and / or shaking of the first electronic device. Optionally, the first sensor may be an acceleration sensor, an angular velocity sensor (also known as a gyroscope sensor), a proximity light sensor, a magnetic sensor (such as a Hall sensor), or any other sensor that meets the use requirements, such as a combined sensor, which may be determined based on actual use requirements and is not limited in the embodiment of the present application.

[0139] It can be understood that the first electronic device can detect the first motion state information in real time or periodically through the built-in sensor, and can further determine the motion behavior of the first electronic device (such as moving behavior and / or rotating behavior and / or shaking behavior) based on the first motion state information.

[0140] For example, taking the first sensor as a three-axis acceleration sensor, during the movement of the first electronic device, the acceleration sensor in the first electronic device can detect the acceleration values ​​of the first electronic device in the X direction, the Y direction, and the Z direction (for example, x, y, and z), and can also determine the combined acceleration value (a) of the first electronic device in the X direction, the Y direction, and the Z direction according to the acceleration values ​​of the first electronic device in the X direction, the Y direction, and the Z direction. 2 =x 2 +y 2 +z 2 It should be noted that the embodiment of the present application is not limited to a three-axis acceleration sensor, and other acceleration sensors may also be used. The acceleration value or the combined acceleration value of the first electronic device in each direction as the first motion state information can be used to determine the movement behavior or shaking behavior of the first electronic device.

[0141] As another example, taking the first sensor as a three-axis gyroscope sensor, during the movement of the first electronic device, the gyroscope sensor in the first electronic device can detect the angular velocity values ​​(e.g., α, β, and γ) of the first electronic device in the X direction, the Y direction, and the Z direction, and can also determine the combined angular velocity value (b ) of the first electronic device in the X direction, the Y direction, and the Z direction according to the angular velocity values ​​of the first electronic device in the X direction, the Y direction, and the Z direction. 2 =α 2 +β 2 +γ 2). It should be noted that the embodiments of the present application are not limited to three-axis gyro sensors, and gyro sensors with other degrees of freedom may also be used. The angular velocity values ​​or combined angular velocity values ​​of the first electronic device in each direction as the first motion state information can be used to determine the rotation behavior of the first electronic device.

[0142] For example, the first sensor is a six-axis sensor (including a three-axis acceleration sensor and a three-axis gyroscope sensor). Figure 4 As shown, during the movement of the first electronic device 10, the six-axis sensor in the first electronic device can detect the acceleration values ​​(such as x, y and z) and angular velocity values ​​(such as α, β and γ) of the first electronic device 10 in the +X direction, +Y direction and +Z direction, and can also obtain the combined acceleration value and combined angular velocity value of the first electronic device 10 in the X direction, Y direction and Z direction. The angular velocity value or combined angular velocity value of the first electronic device in each direction as the first motion state information can be used to determine the motion behavior of the first electronic device (such as moving behavior and / or rotating behavior and / or shaking behavior).

[0143] In an embodiment of the present application, the above-mentioned first motion state information can be represented by parameters that can characterize the movement and / or rotation and / or shaking of the electronic device. For example, the first motion state information can be represented by a moving speed (such as the above-mentioned acceleration value), or by a rotation posture (such as an angular velocity value), or by a shaking frequency. It can also be represented by any combination of parameters such as moving speed, rotation posture, shaking frequency, etc., or it can be represented by any other possible motion parameters (such as a motion trajectory). The specific information can be determined based on actual usage requirements and is not limited by the embodiments of the present application.

[0144] For example, if the user moves the first electronic device for a certain distance and then stops, the first sensor in the first electronic device can detect the movement of the first electronic device and obtain the first motion state information. For example, the first sensor can be an acceleration sensor, and the first motion state information can be represented by an acceleration value, such as the first motion state information can include multiple acceleration values ​​that change over time.

[0145] As another example, when the first electronic device displays the Wi-Fi setting interface, if the user shakes the first electronic device, the first sensor in the first electronic device detects one or more parameters corresponding to the shaking behavior (i.e., the first motion state information), and if the one or more parameters are within a preset threshold range (i.e., the first motion state information meets the preset motion state information), an event corresponding to the preset threshold range may be triggered, such as increasing the frequency of Wi-Fi scanning. For example, the first sensor may include an acceleration sensor and a gyroscope sensor, and the first motion state information may be represented by acceleration values ​​and angular velocity values, such as the first motion state information may include multiple acceleration values ​​and multiple angular velocity values ​​that change over time.

[0146] It should be noted that the above are all exemplary examples of the first electronic device obtaining the first motion state information through the first sensor. It can be understood that the embodiments of the present application include but are not limited to the above-mentioned methods, and include but are not limited to the above-mentioned first motion state information; specifically, the first sensor and the obtained first motion state information can be determined according to actual use requirements, and the embodiments of the present application are not limited. For the sake of convenience, the following is an exemplary explanation using the example that the first electronic device is a mobile phone, the first sensor is an acceleration sensor, and the first motion state information is represented by an acceleration value.

[0147] For example, taking the example of moving the first electronic device and then "touching" (for example, bringing it close to or touching) the second electronic device, assuming that the first electronic device and the second electronic device are a certain distance apart, when the first electronic device approaches the second electronic device, the acceleration sensor detects that the acceleration value (and velocity value) of the first electronic device in each axis direction is close to 0 (but not 0), thereby sensing the movement of the first electronic device. Then, after the first electronic device approaches the second electronic device, it "touches" the second electronic device, and the acceleration value has certain characteristics when "touching", for example, the acceleration value detected by the acceleration sensor in each axis direction has a pulse spike, or the combined acceleration value in each axis direction has a pulse spike (such as Figure 5 As shown in the waveform diagram in the figure), the first electronic device can determine the "touch" action by identifying the pulse peak in the waveform diagram.

[0148] Optionally, the first electronic device may compare the first motion state information with the preset motion state information to determine whether the first motion state information conforms to the preset motion state information, that is, to determine whether the motion behavior of the first electronic device is the preset motion behavior. The preset motion state information may be information indicating a preset motion behavior (e.g., moving behavior and / or rotating behavior and / or shaking behavior, etc.), for example, the preset motion state information is used to indicate that the first electronic device touches the second electronic device after moving toward the second electronic device, and the specific setting may be based on actual needs, and the embodiments of the present application are not limited thereto.

[0149] Exemplarily, assuming that the first sensor is an acceleration sensor, the first motion state information includes multiple acceleration values ​​that change over time, and the preset motion state information indicates that the acceleration value changes and the amount of change is greater than a preset threshold. In this case, if the first electronic device detects that the multiple acceleration values ​​in the first motion state information change and the amount of change is greater than the preset threshold, the first electronic device can determine that the first motion state information conforms to the preset motion state information, thereby judging that the first electronic device has a motion behavior of first moving and then stopping moving.

[0150] S320: The first electronic device determines whether the signal quality of the scanned first broadcast message meets a preset condition.

[0151] The first broadcast message is a message broadcast by the second electronic device.

[0152] Optionally, whether the signal quality meets the preset condition can be determined by at least one of the following parameters: RSSI, RSRP, SNR. For example, taking RSSI as an example, when the RSSI value of the first broadcast message received by the first electronic device is greater than a preset threshold, the first electronic device can determine that the signal quality meets the preset condition.

[0153] In some embodiments, the first electronic device can detect the signal strength sent by other surrounding electronic devices, and determine whether the first electronic device and the second electronic device are within a preset distance range based on the signal strength. Optionally, assuming that there is a corresponding relationship between signal strength and distance range, and different signal strengths correspond to different distance ranges, the first electronic device can refer to the corresponding relationship between signal strength and distance range to determine whether the first electronic device and the second electronic device are within the preset distance range. For example, assuming that the minimum signal strength corresponding to the preset distance range is known to be S1, then if the first electronic device detects that the signal strength S2 of the second electronic device is greater than or equal to the minimum signal strength S1, it can be determined that the signal quality sent by the second electronic device meets the preset conditions, thereby determining that the first electronic device and the second electronic device are within the preset distance range.

[0154] In some embodiments, the first electronic device may further detect a first distance value between the first electronic device and the second electronic device. In the embodiment of the present application, the first electronic device may detect the distance information between the first electronic device and various surrounding electronic devices in real time or periodically, for example, detecting the first distance value between the first electronic device and the second electronic device, and further determining whether the first electronic device and the second electronic device are very close (for example, close to or in contact) based on the first distance value.

[0155] Optionally, the first electronic device can determine whether the first electronic device and the second electronic device are very close by determining whether the first distance value is within a preset distance range. Specifically, if the first distance value is within the preset distance range, the first electronic device can determine that the first electronic device and the second electronic device are very close. If the first distance value is not within the preset distance range, the first electronic device can determine that the first electronic device and the second electronic device are not close enough.

[0156] Among them, the above-mentioned preset distance range can be determined according to actual use requirements, for example, the preset distance range is [0, 0.1 meters], and the embodiments of the present application are not limited to this. For example, if the detected first distance value is 0.05 meters, that is, within the preset distance range, the first electronic device can determine that the first electronic device is very close to the second electronic device. For example, if the detected first distance value is 0, that is, within the preset distance range, the first electronic device can determine that the first electronic device is in contact with the second electronic device.

[0157] It should be noted that if the first distance value is within the preset distance range, it can be determined that the first electronic device is very close to the second electronic device. In this case, the first electronic device and the second electronic device are usually suitable for short-range wireless communication.

[0158] Optionally, in an embodiment of the present application, the first electronic device may use the following distance measurement method to detect the first distance value.

[0159] First ranging method: The first electronic device can calculate the distance between the two electronic devices by receiving the energy of the signal sent by the second electronic device (referred to as received signal energy) and a first ranging formula, wherein the first ranging formula includes parameters such as received signal energy value and distance.

[0160] For example, taking the received signal energy as RSSI as an example, when the first electronic device obtains the RSSI value, it can bring the RSSI value into the first ranging formula to calculate the first distance value. The first ranging calculation formula can refer to the calculation formula involving ranging using RSSI value in the relevant technology, which will not be described in detail here.

[0161] Second ranging method: The first electronic device can send an energy wave signal, such as an ultrasonic signal or an ultra wide band (UWB) signal, to the second electronic device, and receive the returned energy wave signal, and then calculate the distance between the two electronic devices based on the round-trip propagation time (also called flight time) of the energy wave signal.

[0162] Exemplarily, assuming that the first electronic device sends a UWB signal to the second electronic device at a first moment t1, and receives the UWB signal returned from the second electronic device at a second moment t1, then the first electronic device can determine the flight time TOF information (t2-t1) of the UWB signal based on the first moment t1 and the second moment t1, and substitute the TOF information into the second ranging formula (for example, L=C*(t2-t1), where L represents distance and C represents the speed of light) to calculate the first distance value.

[0163] Of course, the embodiment of the present application may also adopt other feasible methods to detect the first distance value, which may be determined according to actual usage requirements and is not limited by the embodiment of the present application.

[0164] S330: When the first motion state information conforms to preset motion state information and the signal quality of the first broadcast message meets a preset condition, the first electronic device establishes a connection with the target electronic device.

[0165] The target electronic device is the second electronic device or a third electronic device indicated by the second electronic device through a broadcast message. Optionally, the preset motion state information is used to indicate that the first electronic device moves toward the second electronic device and / or touches the second electronic device.

[0166] In the embodiment of the present application, as described above, if the first motion state information conforms to the preset motion state information, it can be determined that the motion behavior of the first electronic device conforms to the preset motion behavior; if the first distance value is within the preset distance range, it can be determined that the first electronic device is very close to the second electronic device. Therefore, when the first motion state information conforms to the preset motion state information and the first distance value is within the preset distance range, it can be determined that the first electronic device is in close proximity to the second electronic device: for example, the first electronic device moves toward the second electronic device and then comes close to or contacts the second electronic device; or, the first electronic device shakes and / or rotates within the close range of the second electronic device, etc. When the first motion state information conforms to the preset motion state information and the first distance value is within the preset distance range, it can be considered that the first electronic device and the second electronic device meet the conditions for wireless communication (e.g., short-range wireless communication), and thus the establishment of a connection and business interaction between devices can be triggered.

[0167] It should be noted that in the scenario where a connection between devices is to be established, the first electronic device may be in a screen-on state, for example, the first electronic device may be in a screen-on state when the screen is locked, or in a screen-on state when the screen is unlocked, but the embodiment of the present application does not exclude the situation where the first electronic device is in a screen-off state. The second electronic device may be in an on state, and the second electronic device broadcasts a first broadcast message (that is, the target electronic device is in a state where it can be discovered and connected), and the first broadcast message includes, for example, an identifier of the second electronic device, such as a MAC address, a device name, etc. If the first electronic device scans the first broadcast message, the first electronic device exchanges signaling and negotiates information with the target electronic device through paging according to the first broadcast message, and then establishes a wireless connection with the target electronic device.

[0168] Optionally, the first electronic device and the second electronic device may establish a wireless connection via a wireless local area network, or via Bluetooth, or via other possible technologies or methods, which may be determined based on actual usage requirements and are not limited in the embodiments of the present application.

[0169] The following describes the method for establishing a wireless connection between devices by touching provided in the embodiment of the present application in conjunction with an exemplary scenario. Assuming that the first sensor is an acceleration sensor, the preset motion state information indicates that the acceleration value changes and the change amount is greater than the preset threshold value, and the preset distance range is [0, 0.1 meters]. In this case, if the user moves the first electronic device toward the second electronic device until it stops moving after contacting the second electronic device, the acceleration sensor in the first electronic device can detect the movement of the first electronic device and obtain the first motion state information, which includes multiple acceleration values ​​that change over time. If the detected first motion state information meets the preset motion state information, and the detected first distance value (for example, 0) is within the preset distance range, the first electronic device can determine that the first electronic device moves toward the second electronic device and then contacts the second electronic device, that is, the conditions for establishing a wireless connection between electronic devices are met, and in this case the first electronic device can establish a wireless connection with the second electronic device. In this way, the user only needs to bring the first electronic device close to or touch the second electronic device to trigger the first electronic device to establish a wireless connection with the second electronic device, thereby achieving the effect of one touch connection between devices.

[0170] An embodiment of the present application provides a method for establishing a wireless connection between devices by touching each other, wherein a first electronic device detects first motion state information of the first electronic device through a first sensor; the first electronic device detects a first distance value between the first electronic device and the second electronic device; when the first motion state information meets preset motion state information and the first distance value is within a preset distance range, the first electronic device establishes a wireless connection with the second electronic device. In an embodiment of the present application, by detecting that the motion state information of the first electronic device meets the preset motion state information and detecting that the distance between the first electronic device and the second electronic device is within a preset distance range in which a wireless connection can be established, the first electronic device can be triggered to quickly establish a wireless connection with the second electronic device or other electronic devices associated with the second electronic device. Since the above-mentioned method for establishing a wireless connection between devices by touching each other does not require the aid of an NFC device, that is, there is no need to trigger the initiation of a connection between electronic devices by bringing an NFC reader and an NFC tag close together, the solution for establishing a connection between electronic devices provided by an embodiment of the present application can reduce the hardware requirements for electronic devices.

[0171] Optionally, in an embodiment of the present application, before the first electronic device establishes a wireless connection with the target electronic device, the first electronic device may display a first prompt message, which is used to prompt whether to establish a wireless connection with the target electronic device. The user may operate on the first prompt message to confirm the connection, and accordingly, the first electronic device establishes a wireless connection with the target electronic device when receiving the user's confirmation operation on the first prompt message.

[0172] Optionally, in an embodiment of the present application, establishing a wireless connection between the first electronic device and the target electronic device includes: the first electronic device can send first business data related to the first business to the target electronic device, and the first electronic device can also receive the first business data sent by the target electronic device. Among them, the first business can be screen projection display, audio playback, and wireless file transmission. In this way, through the method provided in the embodiment of the present application, it is possible to quickly trigger and start interactive experience functions between devices, such as one-touch transfer, one-touch screen projection and other business interactions, thereby improving the user experience.

[0173] It should be noted that the embodiment of the present application may not limit the execution order of step 310 and step 320. That is, the embodiment of the present application may first execute step 310 and then execute step 320; may first execute step 320 and then execute step 310; may also execute step 310 and step 320 simultaneously. It is understood that the above Figure 3 The example of performing step 310 first and then performing step 320 is used for illustration.

[0174] In a possible implementation, the first electronic device may trigger the first electronic device to start scanning or accelerate scanning of broadcast messages of other devices when it is determined that the first motion state information meets the preset motion state information, and detect the distance between the first electronic device and the other electronic devices according to the scanned broadcast messages (i.e., first perform step 310 and then perform step 320) to reduce energy consumption. Figure 3 ,like Figure 6 As shown, after the above step S310 and before the above step S320, the method for establishing a wireless connection between devices by touching each other provided in the embodiment of the present application may further include the following step S340.

[0175] S340: The first electronic device determines whether the first motion state information conforms to preset motion state information.

[0176] In the embodiment of the present application, if the first electronic device determines that the first motion state information meets the preset motion state information, the first electronic device continues to execute the above step 320; if the first electronic device determines that the first motion state information does not meet the preset motion state information, the first electronic device continues to execute the above step 310. That is, only when the first motion state information meets the preset motion state information, the first electronic device further detects the first distance value, which can reduce the power consumption of the first electronic device caused by the detection.

[0177] As mentioned above, under the premise that the first electronic device scans the first broadcast message, the first electronic device can further exchange signaling and negotiate information with the target electronic device based on the first broadcast message, and then establish a wireless connection with the target electronic device. In other words, accelerating the scanning of broadcast messages when a connection needs to be established can increase the speed of establishing a connection between devices and business interaction.

[0178] First, let's introduce the scan time parameters: scan window and scan interval. Figure 7 As shown in the figure, the time width of a scan is called the scan window, recorded as T1; the time difference between the start time of two consecutive scan windows is called the scan interval, recorded as T2. If the scan window is equal to the scan interval, the scan duty cycle is 1.

[0179] It should be noted that Figure 7In the figure, a fixed scanning window and scanning interval are used for illustration. It can be understood that in actual implementation, the scanning window can be fixed or variable, such as increasing or decreasing, and can be set according to actual conditions; the scanning interval can be fixed or variable, such as increasing or decreasing, and can be set according to actual conditions. It should also be noted that the larger the scanning window, the greater the probability of scanning a broadcast message, and the more power is consumed accordingly; the smaller the scanning window, the smaller the probability of scanning a broadcast message, and the less power is consumed accordingly. In other words, the larger the scanning duty cycle (the proportion of the scanning window in a cycle), the greater the probability of scanning a broadcast message, and the more power is consumed accordingly; the smaller the scanning duty cycle, the smaller the probability of scanning a broadcast message, and the less power is consumed accordingly.

[0180] Normally, the scanning window and scanning interval of Bluetooth scanning are fixed (called normal scanning mode, such as Figure 8 or the scanning window of Bluetooth scanning is fixed and the scanning interval gradually increases (called power saving scanning mode, such as Figure 8 (b) in the figure), for example, the scanning window is 10 seconds, and the scanning interval is 5 seconds, 10 seconds, and 20 seconds in sequence, to save unnecessary power consumption; or the scanning interval of Bluetooth scanning is fixed and the scanning window will gradually become smaller (another power-saving scanning mode, for example, the scanning interval is 5 seconds, and the scanning window is 10 seconds, 5 seconds, and 3 seconds in sequence, until the scanning is stopped, to save unnecessary power consumption. In combination with the embodiment of the present application, since the probability of scanning a broadcast message when the first electronic device is scanning in the normal scanning mode or the power-saving scanning mode is relatively small, the first electronic device can accelerate the scanning when it needs to establish a connection with other electronic devices (called the accelerated scanning mode, such as Figure 8 (c) in the figure) to increase the speed of establishing connections between devices.

[0181] It should be noted that the description of Wi-Fi scanning can refer to the above description of Bluetooth scanning, which will not be repeated here.

[0182] In a possible embodiment, the first broadcast message includes a device identification of the target electronic device and first channel information, and the first channel information is used to indicate a Wi-Fi channel or a Bluetooth channel. The first electronic device can establish a wireless connection with the target electronic device via Wi-Fi or Bluetooth according to the first broadcast message.

[0183] The device identification of the target electronic device is an identification used to uniquely represent the target electronic device, such as the MAC address of the target electronic device, or the device name. Exemplarily, the device identification can be a MAC address used to indicate the second electronic device, or the device identification can be a MAC address used to indicate the third electronic device.

[0184] Among them, the first channel information indicates the channel used to establish a wireless connection, which can be a Wi-Fi channel or a Bluetooth channel. Taking the Wi-Fi channel as an example, the channels of the Wi-Fi 2.4GHz frequency band can generally be divided into 14 channels: channel 1 to channel 14, wherein channel 14 is generally not used. For example, the first channel information can be used to indicate a channel from channel 1 to channel 13. Optionally, the first channel information may include an identifier of a wireless local area network (such as a Wi-Fi identifier), such as a service set identifier (SSID) of a router, and the first electronic device and the target electronic device may perform wireless local area network networking through the identifier of the wireless local area network carried by the first broadcast message. Alternatively, the first channel information may include a Bluetooth device identifier, and the first electronic device and the target electronic device may perform a Bluetooth connection through the Bluetooth device identifier and / or pairing code carried by the first broadcast message.

[0185] In another possible embodiment, when the first broadcast message only includes the device identification of the target electronic device, after scanning the first broadcast message, the first electronic device may send a response message to the target electronic device, and the response message may include at least one of the following: the device identification of the first electronic device and second channel information, where the first channel information is used to indicate a Wi-Fi channel or a Bluetooth channel. The first electronic device and the target electronic device may establish a wireless connection through Wi-Fi or Bluetooth according to the first broadcast message and the response message.

[0186] For the description of the device identification and the second channel information of the first electronic device, reference may be made to the above-mentioned detailed description of the device identification and the first channel information of the target electronic device, which will not be repeated here.

[0187] Optionally, the first broadcast message may also include any other authentication information for wireless connection that meets actual usage requirements. For example, the first broadcast message may also include a target password, which is used for authentication when establishing a wireless connection to improve the security of the wireless connection. For example, the target password may be a Wi-Fi password, or a Bluetooth pairing code. The target password may be a system default password, or it may be set by the user as needed. Similarly, the above response message may also include any other authentication information (such as a password) for wireless connection that meets actual usage requirements.

[0188] The following is a detailed description of three implementation methods of accelerated scanning provided in the embodiments of the present application (the first implementation method, the second implementation method and the third implementation method described below).

[0189] First implementation method

[0190] In a first implementation, the scanning function of the first electronic device may be triggered to start or the scanning duty cycle of the first electronic device may be increased to prompt the first electronic device to accelerate scanning to the first broadcast message, thereby achieving accelerated scanning. Figure 6 As shown, after the above step S340, the method for establishing a wireless connection between devices by touching each other provided in the embodiment of the present application further includes the following step S350A.

[0191] S350A: The first electronic device performs a first action.

[0192] The first action may include any of the following:

[0193] Method 1: Turn on the scanning function of the first electronic device. Specifically, when the scanning function of the first electronic device is not turned on, if the first electronic device detects that the first motion state information meets the preset motion state information, the first electronic device is triggered to automatically turn on the WiFi or Bluetooth function, thereby starting the WiFi scan or Bluetooth scan. Optionally, after the first electronic device turns on the scanning function, it can scan with a preset fixed scanning duty cycle, such as scanning once every 5 seconds. Alternatively, after the first electronic device turns on the scanning function, it can scan with a preset variable scanning duty cycle, such as gradually increasing the scanning duty cycle, such as scanning once every 20 seconds, then scanning once every 10 seconds, and then scanning once every 5 seconds, and so on. Since the scanning function of the first electronic device is triggered to turn on, it helps the first electronic device to quickly scan the first broadcast signal, which indirectly helps to establish the speed of connection between devices and business interaction.

[0194] Method 2: Increasing the scanning duty cycle when the scanning function of the first electronic device is turned on. Specifically, when the scanning function of the first electronic device is turned on, if the first electronic device detects that the first motion state information meets the preset motion state information, the first electronic device is triggered to increase the current scanning duty cycle (corresponding to Figure 8 (c) in the accelerated scanning mode).

[0195] In some embodiments, assuming that the scanning window length remains unchanged, the scanning interval length is reduced to increase the scanning duty cycle. For example, the scanning window length is fixed at 10 seconds (ie, each scanning duration is 10 seconds), and the scanning interval length is reduced from 5 seconds to 3 seconds.

[0196] In some embodiments, assuming that the scanning interval duration remains unchanged, the scanning window duration increases to increase the scanning duty cycle. For example, the scanning interval duration is fixed at 5 seconds, and the scanning window duration increases from 5 seconds to 10 seconds.

[0197] In some embodiments, it is assumed that the scanning window length increases and the scanning interval length decreases to increase the scanning duty cycle, for example, the scanning window length increases from 5 seconds to 10 seconds (that is, the duration of each scan is 10 seconds), and the scanning interval length decreases from 5 seconds to 3 seconds.

[0198] Optionally, after the first electronic device starts scanning or increases the scanning duty cycle, if no other device is scanned after a preset time period or a preset number of times, the scanning duty cycle can be reduced or the scanning can be stopped.

[0199] Since the scanning duty cycle of the first electronic device becomes larger, it helps the first electronic device to speed up scanning of the first broadcast signal, so that the first electronic device can find the device to be connected more quickly, which indirectly helps to speed up the establishment of connection between devices and business interaction.

[0200] Furthermore, after the above step S350A, the above step S320 can be specifically implemented by the following step S320A.

[0201] S320A: The first electronic device determines whether the signal quality of the scanned first broadcast message meets a preset condition.

[0202] Exemplarily, when the first electronic device scans the first broadcast message broadcast by the second electronic device, the first electronic device can determine whether the signal quality of the first broadcast message meets the preset conditions through at least one of the following parameters: RSSI, RSRP, SNR. Exemplarily, taking RSSI as an example, when the RSSI value of the first broadcast message received by the first electronic device is greater than the preset threshold, that is, the signal strength is high, the first electronic device can determine that the signal quality of the first broadcast message meets the preset conditions.

[0203] When the signal quality of the first broadcast message meets the preset condition, the first electronic device and the second electronic device are relatively close to each other and the condition for establishing a wireless connection is met, thus triggering a rapid establishment of a wireless connection between the devices.

[0204] In an embodiment of the present application, once the first electronic device detects that the first motion state information matches the preset motion state information, it can trigger the start of a scanning function or increase the scanning duty cycle. This can increase the probability that the first electronic device scans the broadcast signals of other electronic devices. Specifically in this embodiment, since the first electronic device turns on the scanning function or increases the scanning duty cycle, the first electronic device can quickly scan the first broadcast message broadcast by the second electronic device.

[0205] Further, when the first electronic device scans the first broadcast message broadcast by the second electronic device, the first electronic device can determine whether the signal quality of the first broadcast message meets the preset condition. Exemplarily, the first electronic device can determine the RSSI value based on the first broadcast message; further, when the RSSI value is greater than a preset threshold, the first electronic device can determine that the signal quality of the first broadcast message meets the preset condition.

[0206] Further, after the above step S320A, the above step S330 can be implemented by the following step S330A.

[0207] S330A: When the signal quality of the first broadcast message meets a preset condition, the first electronic device establishes a wireless connection with the second electronic device.

[0208] In a first implementation, the first electronic device may first detect the first motion state information and determine whether the first motion state information conforms to the preset motion state information. When it is determined that the first motion state information conforms to the preset motion state information, the first electronic device is triggered to start scanning or accelerate scanning of broadcast messages of other devices, so that the first electronic device can find the device to be connected faster. When the first electronic device scans the first broadcast message of the second electronic device and the signal quality of the first broadcast message meets the preset conditions, the first electronic device and the target electronic device can establish a wireless connection. Therefore, the solution provided in the embodiment of the present application can more quickly discover the device to be connected and quickly establish a connection between devices.

[0209] Second Implementation

[0210] The above introduces a possible implementation method of accelerating scanning to a broadcast message, that is, by triggering the scanning function of the first electronic device or increasing the scanning duty cycle of the first electronic device, prompting the first electronic device to accelerate scanning to the first broadcast message, so that the first electronic device can find the device to be connected more quickly. The embodiments of the present application include but are not limited to the above-mentioned accelerated scanning method, for example, it can also trigger the broadcast message function of the second electronic device or increase the frequency of the broadcast messages of the second electronic device to prompt the first broadcast message to be scanned more quickly, thereby achieving accelerated scanning. The second implementation method is described in detail below.

[0211] In the second implementation, combined with Figure 6 ,like Fig. 9 As shown, after the above step S340, if the first motion state information meets the preset motion state information, the method for establishing a wireless connection between devices by touching provided in the embodiment of the present application may further include the following step S350B.

[0212] S350B: The first electronic device sends a first instruction message to the second electronic device, where the first instruction message is used to instruct execution of a second action.

[0213] The second action may include any of the following:

[0214] Method 1: Turn on the broadcast message function of the second electronic device. Specifically, when the broadcast message function of the second electronic device is not turned on, if the first electronic device detects that the first motion state information meets the preset motion state information (for example, the first electronic device touches the second electronic device), the first electronic device is triggered to send a first indication message to the second electronic device to instruct the second electronic device to turn on the broadcast message function. It should be noted that it is assumed here that the first electronic device and the second electronic device have been paired or have a connection record, so the first electronic device stores the identification or address of the second electronic device, so the first electronic device can send the first indication message to the second electronic device based on the identification or address.

[0215] Optionally, after the second electronic device turns on the broadcast message function, it can broadcast at a default broadcast message frequency, for example, once every 10 seconds. Since the broadcast message function of the second electronic device is triggered to turn on, it helps the first broadcast message to be quickly scanned, that is, it helps the first electronic device to quickly scan the first broadcast signal, which indirectly helps to establish the speed of connection between devices and business interaction.

[0216] Method 2: Increase the frequency of broadcast messages when the broadcast function of the second electronic device is turned on. Specifically, when the broadcast function of the second electronic device is turned on, if the first electronic device detects that the first motion state information meets the preset motion state information, it triggers the sending of a first instruction message to the second electronic device to instruct the second electronic device to increase the frequency of the current broadcast message, such as increasing the frequency of the current broadcast message (for example, broadcast once every 10 seconds) to the target frequency (for example, broadcast once every 5 seconds). Since the frequency of the broadcast message of the second electronic device is increased, this helps the first broadcast message to be scanned quickly, that is, it helps the first electronic device to quickly scan the first broadcast signal, which indirectly helps to establish the speed of connection between devices and business interaction.

[0217] Optionally, after the second electronic device starts broadcasting messages or increases the frequency of broadcasting messages, if it is not scanned by other devices after a preset time or a preset number of times (for example, the second electronic device does not receive a paging message sent by other electronic devices), the frequency of the broadcasting messages can be reduced, or the broadcasting messages can be stopped.

[0218] In the second implementation, the first electronic device can first detect the first motion state information and determine whether the first motion state information conforms to the preset motion state information. When it is determined that the first motion state information conforms to the preset motion state information, the first electronic device is triggered to send a message to the second electronic device to instruct the second electronic device to start broadcasting or accelerate broadcasting. When the first electronic device scans the first broadcast message of the second electronic device and the signal quality of the first broadcast message meets the preset threshold, the first electronic device and the target electronic device can establish a connection and business interaction. Therefore, the solution provided in the embodiment of the present application can more quickly discover the device to be connected and quickly establish a connection and business interaction between devices.

[0219] The third implementation method

[0220] The above second implementation method introduces that the first electronic device notifies the second electronic device to start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message, so that the first broadcast message is scanned more quickly, thereby realizing accelerated scanning; in addition, the second electronic device can actively detect whether the first motion state information meets the preset motion state information, and when the first motion state information meets the preset motion state information, start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message, so that the first broadcast message is scanned more quickly, thereby realizing accelerated scanning. The third implementation method is described in detail below.

[0221] In a third implementation manner, the method for establishing a wireless connection between devices by touching each other provided in the embodiment of the present application may further include the following steps S350C and S350D.

[0222] S350C, the second electronic device detects the first motion state information;

[0223] S350D: If the second electronic device determines that the first motion state information satisfies the preset motion state information, the second electronic device performs a third action, which includes any one of the following: starting to broadcast the first broadcast message, and increasing the frequency of broadcasting the first broadcast message.

[0224] In a third implementation, the second electronic device can actively detect the first motion state information and determine whether the first motion state information conforms to the preset motion state information. When it is determined that the first motion state information conforms to the preset motion state information, it starts broadcasting or accelerates broadcasting, thereby prompting the first electronic device to quickly scan the first broadcast message of the second electronic device, thereby enabling the first electronic device to more quickly discover the device to be connected and quickly establish a connection between devices.

[0225] It should be noted that, when the first motion state information conforms to the preset motion state information and the first distance value is within the preset distance range, the first electronic device can further exchange signaling and negotiate information with the target electronic device based on the scanned first broadcast message, and then establish a connection and business interaction with the target electronic device. Here, the first electronic device can establish a connection and business interaction with the target electronic device through a wireless local area network, or establish a wireless connection with the target electronic device through Bluetooth (hereinafter referred to as Bluetooth connection), or establish a wireless connection with the target electronic device through other means. The following first and second embodiments are used to exemplify the process of establishing a wireless connection between the first electronic device and the target electronic device.

[0226] First embodiment

[0227] In a first embodiment, a first electronic device scans a first broadcast message broadcast by a second electronic device, and the first broadcast message can be used to request the first electronic device to establish a wireless communication connection with a target electronic device. For example, the first broadcast message is used to request the first electronic device to establish a wireless communication connection with a second electronic device, and the first broadcast message may include an identifier of the second electronic device. For another example, the first broadcast message may be used to request the first electronic device to establish a wireless communication connection with a third electronic device, and the first broadcast message may include an identifier of the third electronic device.

[0228] Exemplarily, the step of establishing a wireless connection between the first electronic device and the target electronic device in step S330 can be specifically implemented by the following steps: the first electronic device sends a response message to the second electronic device according to the first broadcast message. The target electronic device receives the response message and connects to the first wireless local area network according to the response message. Furthermore, the first electronic device can establish a wireless connection and business interaction with the target electronic device through the first wireless local area network.

[0229] For example, the response message may include the device identification of the first electronic device, the identification and password of the first wireless local area network; for example, the SSID and password of the router. The password of the first wireless local area network may be a system default password, or may be set by the user as required. Exemplarily, the response message may include the name and password of the Wi-Fi network.

[0230] It should be noted that the first electronic device may be connected to the first wireless local area network before sending a response message to the target electronic device, or may be connected to the first wireless local area network after sending a response message to the target electronic device, and this embodiment of the present application does not limit this.

[0231] In the present application embodiment, Fig.10As shown in steps S401-S414 in , the first electronic device detects the first motion state information of the first electronic device. If the first motion state information meets the preset motion state information, the Wi-Fi scan is triggered or the Wi-Fi scan is accelerated. At this time, the second electronic device is in a state of waiting for network configuration and broadcasts a message to the outside. For example, the broadcast message contains information about an open hotspot, and the first electronic device and the second electronic device can temporarily communicate through the open hotspot. If the first electronic device scans the broadcast message, the first electronic device can determine the first distance value based on the broadcast message. If the first distance value is within the preset distance range, the first electronic device prompts whether to configure the target electronic device for the network.

[0232] In a possible implementation, the target electronic device is a second electronic device, such as Fig.10 As shown in steps S407-S410 in , if the first electronic device receives user input confirming network configuration, the first electronic device sends a response message (for example, including the name and password of the Wi-Fi network) to the second electronic device based on the user input. After receiving the response message, the second electronic device extracts the name and password of the Wi-Fi network from the response message, and connects to the Wi-Fi network using the name and password of the Wi-Fi network. When both the first electronic device and the second electronic device are connected to the first wireless local area network, the first electronic device and the second electronic device can establish a wireless connection through the first wireless local area network, and further business interaction can be performed.

[0233] In another possible implementation, the target electronic device is a third electronic device, such as Fig.10 As shown in steps S411-S414 in the dotted box in , if the first electronic device receives user input confirming network configuration, the first electronic device sends a response message (for example, including the name and password of the Wi-Fi network) to the third electronic device based on the user input. After receiving the response message, the third electronic device extracts the name and password of the Wi-Fi network from the response message, and connects to the Wi-Fi network using the name and password of the Wi-Fi. When both the first electronic device and the third electronic device are connected to the first wireless local area network, the first electronic device and the third electronic device can establish a wireless connection through the first wireless local area network, and further business interaction can be performed.

[0234] It should be noted that the first electronic device can select one to execute according to the broadcast message. Fig.10S407-S410 and S411-S414 in, for example, the first electronic device can execute S407-S410 to establish a wireless connection between the first electronic device and the second electronic device; or, the first electronic device can execute S411-S414 to establish a wireless connection between the first electronic device and the third electronic device. Of course, the embodiment of the present application does not exclude the following implementation: the first electronic device can execute S407-S410 and S411-S414 at the same time to establish a wireless connection between the first electronic device and the second electronic device and the third electronic device. The specific implementation can be determined according to actual use requirements, and the embodiment of the present application is not limited.

[0235] In the following, the first electronic device is a mobile phone 10, the target electronic device is a second electronic device, and the second electronic device is a notebook computer 20. Figures 11 to 13 The first embodiment is described in detail.

[0236] For example, Fig.11 A schematic diagram of the WLAN setting interface of a mobile phone is shown, such as Fig.11 As shown in the WLAN setting interface 11, the mobile phone 10 has turned on WLAN and has been connected to the router Wi-Fi network (assuming that the name of the Wi-Fi network is WLAN 1). At this time, if the user needs to establish a connection and business interaction between the mobile phone 10 and the laptop computer 20, the user can follow the steps below: Fig.12 and Fig.13 Follow the steps shown.

[0237] like Fig.12 As shown in (a), the mobile phone 10 and the laptop computer 20 are currently a certain distance apart, and the user triggers the laptop computer 20 to start up or turn on the network configuration function, so that the laptop computer 20 is in a state of waiting for network configuration. At this time, the laptop computer 20 will broadcast a message. Fig.12 As shown in (b) of FIG. 1 , when a user holds a mobile phone 10 (the mobile phone 10 can be in a screen-on state or a screen-off state) close to and "touches" the laptop computer 20, the mobile phone 10 senses the "touch" behavior through a first sensor (such as an acceleration sensor), which triggers the mobile phone 10 to start scanning or accelerate scanning. Fig.12 As shown in (c) of FIG. 1 , the mobile phone 10 scans the broadcast message of the laptop computer 20, detects the distance d1 between the mobile phone 10 and the laptop computer 20, and determines that the distance d1 is within the preset distance range. In this way, the user triggers the establishment of a connection and service interaction between the mobile phone 10 and the laptop computer 20 through the "touch" behavior.

[0238] Then, if Fig.13As shown in (a) of FIG. 1 , the mobile phone 10 may display a prompt box 12: If you want to establish a connection between the mobile phone and the device, please click "Connect" to prompt the user to choose whether to establish a connection. After the user clicks the "Connect" option to confirm the establishment of the connection, Fig.13 As shown in (b) in the figure, the mobile phone 10 can display a prompt box 13, displaying the name of the router Wi-Fi network to which the mobile phone 10 is currently connected: WLAN 1, and prompting the user to enter the Wi-Fi password. After the user enters the Wi-Fi password for confirmation, the mobile phone 10 sends the name and password of the router Wi-Fi network to the laptop 20. Of course, after the user clicks the "Connect" option to confirm the establishment of the connection, the mobile phone 10 may not display the prompt box 13, and the user does not need to enter the Wi-Fi password. Instead, the mobile phone 10 directly sends the name and password of the Wi-Fi network to which the mobile phone is currently connected to the laptop 20. After receiving the name and password of the Wi-Fi network, the laptop 20 uses the name and password of the Wi-Fi network to connect to the router Wi-Fi network. Therefore, the mobile phone 10 and the laptop 20 are connected to the same wireless local area network.

[0239] So, like Fig.12 As shown in (d), the mobile phone 10 and the laptop computer 20 can establish a connection and business interaction through the router Wi-Fi network, and can perform business interaction.

[0240] In the first embodiment, the user can directly trigger the establishment of connection and service interaction between devices through the wireless LAN through the "touch" behavior, achieving a one-touch connection effect and improving the convenience of establishing connection and service interaction between devices.

[0241] Second embodiment

[0242] In a second embodiment, a first electronic device scans a first broadcast message broadcast by a second electronic device, and the first broadcast message is used to indicate that the target electronic device is in a Bluetooth connectable state. For example, the first broadcast message can be used to indicate that the second electronic device is in a Bluetooth connectable state, wherein the first broadcast message can include the Bluetooth identifier (and Bluetooth address) of the second electronic device, such as the device model of the second electronic device can be used as the Bluetooth identifier of the second electronic device. For another example, the first broadcast message can be used to indicate that a third electronic device is in a Bluetooth connectable state, wherein the first broadcast message can include the Bluetooth identifier (and Bluetooth address) of the third electronic device, such as the device model of the third electronic device can be used as the Bluetooth identifier of the third electronic device.

[0243] Exemplarily, the step of establishing a connection between the first electronic device and the target electronic device in step S330 can be specifically implemented through the following steps: the first electronic device sends a connection request message to the target electronic device based on the first broadcast message; the target electronic device receives the connection request message sent by the first electronic device, and sends a response message to the first electronic device, wherein the response message is used to indicate that the target electronic device confirms to establish a Bluetooth connection with the first electronic device; the first electronic device receives the response message sent by the target electronic device, and establishes a wireless connection with the target electronic device via Bluetooth based on the response message.

[0244] The connection request message may include the Bluetooth identifier of the first electronic device (e.g., the device MAC address). For example, the device model of the first electronic device may be used as the Bluetooth identifier of the first electronic device. Optionally, the Bluetooth identifier may be set by the system by default or by the user as required.

[0245] It should be noted that the connection request message may also include a Bluetooth pairing code, which is used for authentication through password pairing when the devices are connected for the first time via Bluetooth, and does not require pairing when the devices are reconnected. From the user's perspective, the traditional password pairing method requires entering a pairing code on the electronic device. Of course, other pairing methods can also be used, such as only requiring both parties to confirm that the random numbers displayed on the screen of the electronic device are the same, without entering a pairing code.

[0246] On the one hand, for the first Bluetooth connection: if the user brings the first electronic device close to and "touches" the second electronic device, the first electronic device will prompt to pair with the target electronic device and then establish a connection. After the pairing is completed, the name of the paired device will be added to the paired device list on the Bluetooth setting interface.

[0247] On the other hand, for the situation of reconnecting after pairing (also called reconnecting): since the name of the paired device is displayed in the paired device list of the Bluetooth setting interface after pairing is completed, if the user brings the first electronic device close to and "touches" the second electronic device again, that is, the device needs to reconnect, the first electronic device will directly prompt to connect to the target electronic device without the need to pair again, that is, password-free reconnection.

[0248] In the present application embodiment, Fig.14As shown: the first electronic device detects the first motion state information of the first electronic device, and if the first motion state information meets the preset motion state information, Bluetooth scanning is triggered or the Bluetooth scanning duty cycle is increased. At this time, the target electronic device is in a connectable state and broadcasts messages to the outside via Bluetooth, for example, the broadcast can be a connectable virtual connection broadcast. If the first electronic device scans the broadcast message, the first electronic device can determine the first distance value based on the broadcast message. If the first distance value is within the preset distance range, the first electronic device prompts whether to establish a Bluetooth connection with the target electronic device.

[0249] One possible scenario is that the target electronic device is a second electronic device. If the first electronic device receives user input confirming a Bluetooth connection, the first electronic device sends a connection request to the second electronic device based on the user input. For example, the connection request includes the Bluetooth device identifier (e.g., MAC address) of the first electronic device. After receiving the connection request, the second electronic device extracts the Bluetooth device identifier from the connection request, and uses the Bluetooth device identifier to establish a Bluetooth connection with the first electronic device, and can further perform business interaction.

[0250] Another possible situation is that the target electronic device is a third electronic device, such as Fig.14 As shown in the dotted box, if the first electronic device receives a user input confirming a Bluetooth connection, the first electronic device sends a connection request to the third electronic device according to the user input, for example, the connection request includes the Bluetooth device identifier of the first electronic device. After receiving the connection request, the third electronic device extracts the Bluetooth device identifier from the connection request, and uses the Bluetooth device identifier to establish a Bluetooth connection with the first electronic device, and can further perform business interaction.

[0251] It should be noted that the first Bluetooth connection between devices requires pairing, but there is no need to pair again for the return connection that has already been paired.

[0252] Optionally, the first electronic device may display a prompt message to prompt that the first electronic device and the target electronic device have established a connection. Of course, the target electronic device may also display a prompt message to prompt that the first electronic device and the target electronic device have established a connection. Thereafter, the first electronic device and the target electronic device may perform service interaction.

[0253] It should be noted that since bluetooth low energy (BLE) connections are all based on the generic attribute profile (GATT) protocol, in the process of establishing a BLE connection, the first electronic device will first send a GATT connection request to the second electronic device, and the second electronic device will receive the GATT connection request, thereby establishing a GATT connection between the first electronic device and the second electronic device.

[0254] Optionally, the first electronic device sends a status request message to the target electronic device, the target electronic device receives the status request message and sets "pairable and connectable" according to the status request message, and then returns a status response message to the first electronic device, so that the first electronic device knows that the target electronic device is currently pairable and connectable. Then, the first electronic device sends a pairing request to the target electronic device, and the target electronic device receives the pairing request, so that the first electronic device and the target electronic device complete pairing. Then, the first electronic device sends a connection request to the target electronic device, and the target electronic device receives the connection request, so that the first electronic device and the target electronic device complete connection.

[0255] Optionally, the target electronic device may report information such as battery power and charging status to the first electronic device, where the target electronic device is a rechargeable device. Optionally, the first electronic device may display information such as battery power and charging status reported by the target electronic device. This can improve the convenience of information transmission between devices, and help users to promptly learn about the battery power and charging status of the target electronic device through the first electronic device, thereby improving user experience.

[0256] In the following, the first electronic device is a mobile phone 10, the target electronic device is a second electronic device, and the second electronic device is a speaker 20. Figures 15 to 18 The second embodiment is described in detail.

[0257] For example, Fig.15 A schematic diagram of the Bluetooth setting interface of a mobile phone is shown, such as Fig.15 As shown in the Bluetooth setting interface 14, the mobile phone 10 has turned on Bluetooth. The Bluetooth setting interface 14 also displays a list of paired devices and a list of available devices, where the available devices are searched and unpaired Bluetooth devices. Fig.15 As shown, the mobile phone 10 is not currently connected to other devices by Bluetooth. If the user needs to establish a Bluetooth connection between the mobile phone 10 and the speaker 20, the user can follow the steps below: Fig.16 Follow the steps shown.

[0258] like Fig.16As shown in (a), the mobile phone 10 and the speaker 20 are currently a certain distance apart, and the user triggers the speaker 20 to turn on or turn on the network configuration function, so that the speaker 20 is in a connectable state. At this time, the speaker 20 broadcasts a message via Bluetooth. Fig.16 As shown in (b) of FIG. 1 , when a user holds a mobile phone 10 (the mobile phone 10 can be in a screen-on state or a screen-off state) close to and "touches" the speaker 20, the mobile phone 10 senses the "touch" behavior through a first sensor (such as an acceleration sensor), which triggers the mobile phone 10 to start scanning or accelerate scanning. Fig.16 As shown in (c) in FIG. 1 , the mobile phone 10 scans the broadcast message of the speaker 20, detects the distance d2 between the mobile phone 10 and the speaker 20, and determines that the distance d2 is within the preset distance range. In this way, the user can directly trigger the establishment of a connection and service interaction between the mobile phone 10 and the speaker 20 through the "touch" behavior.

[0259] Then, if Fig.17 As shown in (a) of FIG. 1 , the mobile phone 10 may display a prompt box 15: If you want to establish a Bluetooth connection between the mobile phone and the device, please click "Connect" to prompt the user to choose whether to establish a Bluetooth connection. After the user clicks the "Connect" option to confirm the establishment of the connection, Fig.17 As shown in (b) of FIG. 1 , the mobile phone 10 may display a prompt box 16, displaying the Bluetooth name of the mobile phone 10 (e.g., mobile phone 10), and prompting the user to enter a pairing code. After the user enters the pairing code for confirmation, the mobile phone 10 sends the Bluetooth name and pairing code to the speaker 20. After receiving the Bluetooth name and pairing code, the speaker 20 may use the Bluetooth name and pairing code to complete pairing with the mobile phone 10 and establish a Bluetooth connection.

[0260] So, like Fig.16 As shown in (d), the mobile phone 10 and the speaker 20 can establish a wireless connection via Bluetooth and further perform business interaction.

[0261] Combined with the above Fig.15 ,like Fig.18 As shown, after the mobile phone 10 establishes a Bluetooth connection with the speaker 20, the speaker 20 is added to the paired device list in the Bluetooth setting interface 14, and the "connected" icon prompts that the speaker 20 and the mobile phone 10 are connected.

[0262] In the second embodiment, the user can trigger the establishment of a Bluetooth connection between the two devices by "touching" the two devices, thereby achieving the effect of connecting the devices with one touch, without having to go through a series of operations such as searching, pairing and connecting through the Bluetooth setting interface, thereby improving the convenience of establishing connections between devices and business interactions.

[0263] like Fig.19As shown, the present application provides a method for establishing a wireless connection between devices by touching each other, and the method includes the following steps S510-S530.

[0264] S510: The first electronic device performs Wi-Fi scanning using a first scanning duty cycle.

[0265] The Wi-Fi scan is used to discover other electronic devices around the first electronic device.

[0266] S520: When the first electronic device detects that the first electronic device is in a preset motion state, the first electronic device uses a second scanning duty cycle to perform Wi-Fi scanning, where the second scanning duty cycle is greater than the first scanning duty cycle;

[0267] S530: When the signal quality of the first broadcast message scanned by the first electronic device meets a preset condition, the first electronic device establishes a Wi-Fi connection with the second electronic device, and the first broadcast message is a message sent by the second electronic device.

[0268] The scanning duty cycle refers to the time proportion of the scanning window in a cycle. The larger the scanning duty cycle, the greater the probability of scanning a broadcast message, and the more power is consumed accordingly; the smaller the scanning duty cycle, the smaller the probability of scanning a broadcast message, and the less power is consumed accordingly. Since the second scanning duty cycle is greater than the first scanning duty cycle, accelerated scanning can be achieved, so that the first electronic device can quickly discover other electronic devices around it.

[0269] Through the above scheme, when the first electronic device detects that the first electronic device is close to or touching the second electronic device, the first electronic device can accelerate the WiFi scan, so that the first electronic device can quickly discover the second electronic device. At this time, if the quality of the broadcast message signal of the second electronic device scanned by the first electronic device meets the preset conditions, the two devices can be triggered to quickly establish a WiFi connection, thereby achieving the effect of connecting the devices with one touch. Since the scanning duty cycle of the first electronic device becomes larger, it helps the first electronic device to accelerate the scanning of the first broadcast signal, so that the first electronic device can discover the device to be connected faster, which helps to establish the speed of connection between devices and business interaction. And without the help of NFC devices, the hardware requirements for electronic devices can be reduced.

[0270] Optionally, whether the signal quality meets the preset condition can be determined by at least one of the following parameters: RSSI, RSRP, SNR. For example, taking RSSI as an example, when the RSSI value of the first broadcast message received by the first electronic device is greater than a preset threshold, the first electronic device can determine that the signal quality meets the preset condition.

[0271] In some embodiments, the preset motion state includes at least one of the following: the first electronic device moves toward the second electronic device, and the first electronic device touches the second electronic device. The first electronic device can detect the motion state information or motion parameters of the first electronic device through a built-in sensor, and determine the device motion state according to the motion state information or motion parameters.

[0272] Exemplarily, the sensor may be at least one of the following: an acceleration sensor, a proximity light sensor, a Hall sensor, a gyroscope sensor, and of course, may be any other sensor that meets actual usage requirements.

[0273] In some embodiments, after the signal quality of the first broadcast message received by the first electronic device meets a preset condition, the method of establishing a wireless connection between devices by touching each other further includes: the first electronic device displays a first prompt message, and the first prompt message is used to prompt whether to establish a Wi-Fi connection with the second electronic device. At this time, the first electronic device establishes a Wi-Fi connection with the second electronic device, including: the first electronic device responds to the user's confirmation connection operation on the first prompt message, and establishes a Wi-Fi connection with the second electronic device. In this way, the device can be connected with one touch according to the actual use needs of the user, thereby improving the user experience.

[0274] In some embodiments, after the first electronic device establishes a Wi-Fi connection with the second electronic device, the method for establishing a wireless connection between devices by touching each other further includes: the first electronic device sends first service data related to the first service to the second electronic device; and / or the first electronic device receives the first service data sent by the second electronic device. In this way, after the devices are connected by touching each other, the service data between the devices can be quickly interacted with, thereby improving the interactive experience function between the devices.

[0275] In some embodiments, the method for establishing a wireless connection between devices by touching each other also includes: when the first electronic device detects that the first electronic device is in a preset motion state, the first electronic device sends a first indication message to the second electronic device, and the first indication message is used to instruct the second electronic device to start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message. Since the broadcast frequency of the second electronic device increases, it helps the second electronic device to be discovered faster, which helps to establish the speed of connection between devices and business interaction.

[0276] In some embodiments, the first broadcast message includes a device identification and Wi-Fi channel information of the second electronic device. The first electronic device establishing a Wi-Fi connection with the second electronic device includes: the first electronic device establishing a Wi-Fi connection with the second electronic device based on the first broadcast message.

[0277] Among them, the Wi-Fi channel information can indicate the Wi-Fi channel supported by the second electronic device. The first electronic device can send a connection request message to the second electronic device according to the device identification of the second electronic device, and then the first electronic device and the second electronic device establish a Wi-Fi connection based on the Wi-Fi channel information.

[0278] In some embodiments, the first broadcast message further includes a device identifier of the third electronic device. The method for establishing a wireless connection between devices by touching each other further includes: the first electronic device establishes a Wi-Fi connection with the third electronic device. In this way, the embodiment of the present application not only achieves the effect of connecting two devices with one touch, but also can achieve the effect of connecting more devices with one touch.

[0279] The various embodiments described herein may be independent schemes, or may be combined according to internal logic to achieve different technical effects, and these schemes all fall within the scope of protection of the present application. In order to implement the various functions in the method provided in the above-mentioned embodiment of the present application, the first electronic device may include a hardware structure and / or a software module, and the above-mentioned functions may be implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function in the above-mentioned functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0280] Fig. 20 A schematic block diagram of a device 600 for establishing a wireless connection provided in an embodiment of the present application. The device 600 is a first electronic device, and the device 600 includes a detection unit 610 and a wireless communication unit 620;

[0281] The detection unit 610 is used to detect first motion state information of the first electronic device through a first sensor, and detect a first distance value between the first electronic device and the second electronic device;

[0282] The wireless communication unit 620 is used to establish a wireless connection between the first electronic device and the target electronic device when the first motion state information conforms to the preset motion state information and the first distance value is within the preset distance range;

[0283] The target electronic device is the second electronic device or a third electronic device indicated by the second electronic device through a broadcast message.

[0284] In a possible embodiment, the first sensor is a sensor for detecting movement and / or contact of the first electronic device, and the preset motion state information is used to indicate that the first electronic device moves toward the second electronic device and / or contacts the second electronic device.

[0285] Exemplarily, the first sensor may be at least one of the following: an acceleration sensor, a proximity light sensor, a Hall sensor, a gyroscope sensor, and of course any other sensor that meets actual usage requirements. For example, the first sensor is an acceleration sensor, the first motion state information includes a plurality of speed values ​​or acceleration values ​​that change over time, and the preset motion state information is that the speed value or the acceleration value changes and the change amount is greater than a preset threshold.

[0286] In a possible embodiment, the device 600 for establishing a wireless connection provided in the embodiment of the present application also includes a processing unit, which is used to perform a first action after the detection unit 610 detects first motion state information of the first electronic device through the first sensor, if the first motion state information meets the preset motion state information. The first action includes any one of the following: turning on the scanning function of the first electronic device, and increasing the scanning duty cycle when the scanning function of the first electronic device is turned on.

[0287] In a possible embodiment, the wireless communication unit 620 is also used to send a first indication message to a second electronic device if the first motion state information matches the preset motion state information, and the first indication message is used to instruct the second electronic device to perform a second action; wherein the second action includes any one of the following: starting to broadcast a first broadcast message, and increasing the frequency of broadcasting the first broadcast message when the broadcast function of the second electronic device is turned on.

[0288] In a possible embodiment, the processing unit is configured to calculate a first distance value according to the first broadcast message broadcast by the second electronic device when scanning the first broadcast message.

[0289] In a possible embodiment, the first broadcast message includes a device identification of the target electronic device and first channel information, and the second channel information is used to indicate a Wi-Fi channel or a Bluetooth channel. The wireless communication unit 620 is specifically used to establish a wireless connection with the target electronic device via Wi-Fi or Bluetooth according to the first broadcast message.

[0290] In another possible embodiment, the first broadcast message includes the device identification of the target electronic device. The wireless communication unit 620 is specifically used to: send a response message to the target electronic device according to the scanned first broadcast message, the response message including the device identification of the first electronic device and second channel information, the second channel information is used to indicate a Wi-Fi channel or a Bluetooth channel; and establish a wireless connection with the first electronic device via Wi-Fi or Bluetooth according to the first broadcast message and the response message.

[0291] In a possible embodiment, the wireless communication unit 620 is specifically used to: send first service data related to the first service to the target electronic device; or receive the first service data sent by the target electronic device.

[0292] In a possible embodiment, the apparatus 600 for establishing a wireless connection provided in the embodiment of the present application further includes a display unit, which is used to display a first prompt message, and the first prompt message is used to prompt whether to establish a wireless connection with the target electronic device. The wireless communication unit 620 is specifically used to establish a wireless connection between the first electronic device and the target electronic device when receiving a confirmation connection operation from the user on the first prompt message.

[0293] The embodiment of the present application provides a device for establishing a wireless connection, which can trigger the first electronic device to quickly establish a connection and business interaction with the second electronic device or other electronic devices associated with the second electronic device by detecting that the motion state information of the first electronic device meets the preset motion state information and detecting that the distance between the first electronic device and the second electronic device is within the preset distance range for establishing a wireless connection. Since the above-mentioned method of establishing a wireless connection between devices by touching does not require the aid of an NFC device, that is, there is no need to trigger the start of the connection and business interaction between electronic devices by pressing an NFC reader and an NFC tag together, the device provided by the embodiment of the present application can reduce the hardware requirements for electronic devices.

[0294] According to the embodiment of the present application, the device 600 may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of the modules in the device 600 are respectively for implementing the corresponding processes of the method, which will not be repeated here for the sake of brevity.

[0295] Fig.21 A schematic block diagram of a device 700 for establishing a wireless connection provided in an embodiment of the present application. The device 700 is a second electronic device, and the device 700 includes a wireless communication unit 710;

[0296] The wireless communication unit 710 is used to establish a wireless connection between the target electronic device and the first electronic device when the first motion state information of the first electronic device meets the preset motion state information and the first distance value is within the preset distance range;

[0297] The first distance value is used to indicate the distance between the first electronic device and the second electronic device, and the target electronic device is the second electronic device or a third electronic device indicated by the second electronic device through a broadcast message.

[0298] In a possible embodiment, the preset motion state information is used to indicate that the first electronic device moves toward the second electronic device and / or touches the second electronic device.

[0299] In a possible embodiment, the wireless communication unit 710 is also used to receive a first indication message sent by the first electronic device and perform a second action when the first motion state information meets the preset motion state information. The second action includes any one of the following: starting to broadcast the first broadcast message, and increasing the frequency of broadcasting the first broadcast message when the broadcast function of the second electronic device is turned on. The first indication message is used to instruct the second electronic device to perform the second action.

[0300] In a possible embodiment, the device 700 for establishing a wireless connection provided in the embodiment of the present application also includes a detection unit 720, which is used to detect the first motion state information; if the second electronic device determines that the first motion state information meets the preset motion state information, a third action is performed, and the third action includes any one of the following: starting to broadcast the first broadcast message, and increasing the frequency of broadcasting the first broadcast message.

[0301] In a possible embodiment, the first broadcast message includes a device identification of the target electronic device and first channel information. The wireless communication unit 710 is specifically configured to establish a wireless connection with the first electronic device via Wi-Fi or Bluetooth according to the first broadcast message.

[0302] In another possible embodiment, the first broadcast message includes a device identification of the target electronic device. The wireless communication unit 710 is specifically used to: receive a response message sent by the first electronic device, the response message including the device identification of the first electronic device and second channel information, the second channel information is used to indicate a Wi-Fi channel or a Bluetooth channel; and establish a wireless connection with the first electronic device via Wi-Fi or Bluetooth according to the first broadcast message and the response message.

[0303] In a possible embodiment, the target electronic device is further configured to receive first service data related to the first service sent by the first electronic device; or, to send the first service data to the first electronic device.

[0304] It should be noted that the above-mentioned device 600 for establishing a wireless connection may be Figure 1 The electronic device 10 in the embodiment, the detection unit 610 may be the sensor module 180 in the electronic device 10, the wireless communication unit 620 may be the wireless communication module 160 in the electronic device 10, and the display unit may be the display screen 194 in the electronic device 10. The device 700 for establishing a wireless connection may be Figure 1 In the electronic device 20 , the wireless communication unit 710 may be a wireless communication module in the electronic device 20 , and the detection unit 720 may be a sensor module in the electronic device 20 .

[0305] Fig. 22 8 is a structural schematic diagram of a system 800 for establishing a wireless connection provided in an embodiment of the present application. The system 800 includes: a first electronic device 810 and a second electronic device 820. The first electronic device 810 may correspond to the device 600 in the above embodiment; the second electronic device 820 may correspond to the device 700 in the above embodiment.

[0306] Fig.23 9 is a schematic structural diagram of an electronic device 900 provided in an embodiment of the present application. The electronic device 900 includes: a processor 910 , a memory 920 , a communication interface 930 , and a bus 940 .

[0307] In one possible implementation, Fig.23 The processor 910 in the electronic device 900 shown may correspond to Fig. 20 The detection unit 610 in the device 600, the communication interface 930 may correspond to Fig. 20 The wireless communication unit 620 in the device 600.

[0308] The processor 910 may be connected to a memory 920. The memory 920 may be used to store the program code and data. Therefore, the memory 920 may be a storage unit inside the processor 910, or an external storage unit independent of the processor 910, or a component including a storage unit inside the processor 910 and an external storage unit independent of the processor 910.

[0309] Optionally, the electronic device 900 may further include a bus 940. The memory 920 and the communication interface 930 may be connected to the processor 910 via the bus 940. The bus 940 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 940 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.23 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.

[0310] It should be understood that in the embodiment of the present application, the processor 910 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 910 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present application.

[0311] The memory 920 may include a read-only memory and a random access memory, and provides instructions and data to the processor 910. A portion of the processor 910 may also include a nonvolatile random access memory. For example, the processor 910 may also store information on the device type.

[0312] When the electronic device 900 is running, the processor 910 executes the computer-executable instructions in the memory 920 to perform the operating steps of the above method through the device 600.

[0313] It should be understood that the electronic device 900 according to the embodiment of the present application may correspond to the device 600 in the embodiment of the present application, and the above and other operations and / or functions of each unit in the device 600 are respectively for the corresponding processes of the implementation method, and for the sake of brevity, they will not be repeated here.

[0314] Optionally, in some embodiments, the embodiments of the present application further provide a computer-readable medium, which stores program code. When the computer program code runs on a computer, the computer executes the methods in the above aspects.

[0315] Optionally, in some embodiments, the embodiments of the present application further provide a computer program product, which includes: a computer program code, and when the computer program code runs on a computer, the computer executes the methods in the above aspects.

[0316] In an embodiment of the present application, the electronic device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. Among them, the hardware layer may include hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system of the operating system layer can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer may include applications such as browsers, address books, word processing software, and instant messaging software.

[0317] Various aspects or features of the present application may be implemented as a method, apparatus, or article of manufacture using standard programming and / or engineering techniques. The term "article of manufacture" as used herein may encompass a computer program accessible from any computer-readable device, carrier, or medium. For example, a computer-readable medium may include, but is not limited to, a magnetic storage device (e.g., a hard disk, a floppy disk, or a magnetic tape, etc.), an optical disk (e.g., a compact disc (CD), a digital versatile disc (DVD), etc.), a smart card, and a flash memory device (e.g., an erasable programmable read-only memory (EPROM), a card, a stick, or a key drive, etc.).

[0318] The various storage media described herein may represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing and / or carrying instructions and / or data.

[0319] It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0320] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory RAM. For example, a RAM may be used as an external cache. By way of example and not limitation, RAM may include the following forms: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0321] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.

[0322] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0323] Those of ordinary skill in the art will appreciate that the units and steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of protection of this application.

[0324] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

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

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

[0327] In addition, each functional unit in each embodiment of the present application may be integrated into one unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0328] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a computer software product, which is stored in a storage medium. The computer software product includes several instructions, which are used to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium may include, but is not limited to: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0329] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0330] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for establishing a wireless connection between devices by touching each other. It is characterized in that The method comprises: The first electronic device performs a wireless fidelity Wi-Fi scan using a first scanning duty cycle, where the Wi-Fi scan is used to discover other electronic devices around the first electronic device; When the first electronic device detects that the first electronic device is in a preset motion state, the first electronic device performs Wi-Fi scanning using a second scanning duty cycle, where the second scanning duty cycle is greater than the first scanning duty cycle, wherein the preset motion state includes the first electronic device moving toward the second electronic device, and / or the first electronic device touching the second electronic device; When the signal quality of the first broadcast message scanned by the first electronic device meets a preset condition, the first electronic device establishes a Wi-Fi connection with the second electronic device, and the first broadcast message is a message sent by the second electronic device.

2. The method according to claim 1, It is characterized in that After the signal quality of the first broadcast message received by the first electronic device meets a preset condition, the method further includes: The first electronic device displays a first prompt message, where the first prompt message is used to prompt whether to establish a Wi-Fi connection with the second electronic device; The first electronic device establishes a Wi-Fi connection with the second electronic device, including: The first electronic device establishes a Wi-Fi connection with the second electronic device in response to a user's confirmation connection operation on the first prompt message.

3. The method according to claim 1 or 2, It is characterized in that After the first electronic device establishes a Wi-Fi connection with the second electronic device, the method further includes: The first electronic device sends first service data related to the first service to the second electronic device; and / or, The first electronic device receives the first service data sent by the second electronic device.

4. The method according to claim 1, It is characterized in that The method further comprises: When the first electronic device detects that the first electronic device is in the preset motion state, the first electronic device sends a first indication message to the second electronic device, where the first indication message is used to instruct the second electronic device to start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message.

5. The method according to claim 4, It is characterized in that The first broadcast message includes a device identification and Wi-Fi channel information of the second electronic device; The first electronic device establishes a Wi-Fi connection with the second electronic device, including: The first electronic device establishes a Wi-Fi connection with the second electronic device based on the first broadcast message.

6. The method according to claim 4 or 5, It is characterized in that The first broadcast message also includes a device identification of a third electronic device; and the method further includes: The first electronic device establishes a Wi-Fi connection with the third electronic device.

7. An electronic device, the electronic device being a first electronic device, It is characterized in that The electronic device includes a Wi-Fi unit, a detection unit and a processing unit; The Wi-Fi unit is configured to perform wireless fidelity Wi-Fi scanning using a first scanning duty cycle, wherein the Wi-Fi scanning is configured to discover other electronic devices around the first electronic device; The detection unit is used to detect the motion state of the first electronic device relative to the other electronic devices; The Wi-Fi unit is further configured to scan using a second scanning duty cycle when the detection unit detects that the first electronic device is in a preset motion state, the second scanning duty cycle being greater than the first scanning duty cycle, wherein the preset motion state includes the first electronic device moving toward the second electronic device, and / or the first electronic device touching the second electronic device; The processing unit is configured to establish a Wi-Fi connection between the first electronic device and the second electronic device when the signal quality of the first broadcast message scanned by the first electronic device meets a preset condition, wherein the first broadcast message is a message sent by the second electronic device.

8. The electronic device according to claim 7, It is characterized in that Also includes a display unit; The display unit is configured to display a first prompt message after the signal quality of the first broadcast message scanned by the Wi-Fi unit meets a preset condition, wherein the first prompt message is used to prompt whether to establish a Wi-Fi connection with the second electronic device; The processing unit is specifically configured to establish a Wi-Fi connection with the second electronic device in response to a user's confirmation connection operation on the first prompt message.

9. The electronic device according to claim 7, It is characterized in that The Wi-Fi unit is further used to send first service data related to the first service to the second electronic device after the first electronic device establishes a Wi-Fi connection with the second electronic device; and / or receive the first service data sent by the second electronic device.

10. The electronic device according to claim 9, It is characterized in that The Wi-Fi unit is also used to send a first indication message to the second electronic device when the detection unit detects that the first electronic device is in the preset motion state, and the first indication message is used to instruct the second electronic device to start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message.

11. The electronic device according to claim 10, It is characterized in that The first broadcast message includes a device identification and Wi-Fi channel information of the second electronic device; The processing unit is specifically configured to establish a Wi-Fi connection between the first electronic device and the second electronic device based on the first broadcast message.

12. The electronic device according to claim 9 or 10, It is characterized in that The first broadcast message also includes a device identification of a third electronic device; The processing unit is further configured to establish a Wi-Fi connection between the first electronic device and the third electronic device.

13. An electronic device, the electronic device being a first electronic device, It is characterized in that The electronic device includes a wireless short-range communication chip and a sensor; The wireless short-range communication chip is used to perform scanning using a first scanning duty cycle, wherein the scanning is used to discover other electronic devices around the first electronic device; The sensor is used to detect the motion state of the first electronic device relative to the other electronic devices; The wireless short-range communication chip is further configured to scan using a second scanning duty cycle when the sensor detects that the first electronic device is in a preset motion state, wherein the second scanning duty cycle is greater than the first scanning duty cycle, wherein the preset motion state includes the first electronic device moving toward the second electronic device, and / or the first electronic device touching the second electronic device; The wireless short-range communication chip is used to establish a wireless connection between the first electronic device and the second electronic device when the signal quality of the first broadcast message scanned by the first electronic device meets a preset condition, and the first broadcast message is a message sent by the second electronic device.

14. The electronic device according to claim 13, It is characterized in that Also includes display screen; The display screen is used to display a first prompt message after the signal quality of the first broadcast message scanned by the wireless short-range communication chip meets a preset condition, wherein the first prompt message is used to prompt whether to establish a wireless connection with the second electronic device; The wireless short-range communication chip is specifically used to establish a wireless connection with the second electronic device in response to a user's confirmation connection operation on the first prompt message.

15. The electronic device according to claim 13 or 14, It is characterized in that The wireless short-range communication chip is also used for: After the first electronic device establishes a wireless connection with the second electronic device, first service data related to a first service is sent to the second electronic device; and / or the first service data sent by the second electronic device is received.

16. The electronic device according to claim 13, It is characterized in that The wireless short-range communication chip is also used for: When the sensor detects that the first electronic device is in the preset motion state, a first indication message is sent to the second electronic device, where the first indication message is used to instruct the second electronic device to start broadcasting the first broadcast message or increase the frequency of broadcasting the first broadcast message.

17. The electronic device according to claim 16, It is characterized in that The first broadcast message includes a device identification and channel information of the second electronic device; The wireless short-range communication chip is specifically used to establish a wireless connection between the first electronic device and the second electronic device based on the first broadcast message.

18. The electronic device according to claim 16 or 17, It is characterized in that The first broadcast message also includes a device identification of a third electronic device; The wireless short-range communication chip is also used to establish a wireless connection between the first electronic device and the third electronic device.

19. The electronic device according to claim 13 or 14, It is characterized in that The wireless short-range communication chip is a wireless fidelity Wi-Fi chip or a Bluetooth chip.

20. A chip, It is characterized in that The chip includes a processor coupled to a memory, and the processor is configured to read and execute a computer program stored in the memory to implement the method according to any one of claims 1 to 6.

21. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Method for establishing wireless connection between devices through touching, electronic device, and chip

    EP4701328A2

  • Method for touching to establish wireless connection between devices, electronic device, and chip

    WO2022068670A1