WO2022068670A1 - 设备间触碰建立无线连接的方法、电子设备及芯片 - Google Patents

设备间触碰建立无线连接的方法、电子设备及芯片 Download PDF

Info

Publication number
WO2022068670A1
WO2022068670A1 PCT/CN2021/119929 CN2021119929W WO2022068670A1 WO 2022068670 A1 WO2022068670 A1 WO 2022068670A1 CN 2021119929 W CN2021119929 W CN 2021119929W WO 2022068670 A1 WO2022068670 A1 WO 2022068670A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
connection
broadcast message
message
motion state
Prior art date
Application number
PCT/CN2021/119929
Other languages
English (en)
French (fr)
Inventor
孙方林
王平
王利平
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21874331.8A priority Critical patent/EP4213513A4/en
Publication of WO2022068670A1 publication Critical patent/WO2022068670A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/50Secure pairing of devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • H04W12/68Gesture-dependent or behaviour-dependent
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/023Services making use of location information using mutual or relative location information between multiple location based services [LBS] targets or of distance thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Definitions

  • the present application relates to the technical field of short-range communication, and more particularly to a method, electronic device, chip, and computer-readable storage medium for establishing a wireless connection by touching between devices in the communication field.
  • a connection supporting the transmission of the service data needs to be established between the devices, such as a Bluetooth connection, a wireless local area network (wireless local area network, WLAN) connection, and the like.
  • NFC proximity sensing function it is possible to trigger the rapid establishment of a connection between electronic devices through NFC sensing.
  • the NFC tag can obtain a small power supply from the NFC card reader and drive the circuit of the NFC tag to transmit the tag information of the NFC tag to the NFC card reader.
  • the NFC card reader receives the tag information, it can trigger the rapid establishment of connection between electronic devices.
  • the precondition is that two electronic devices are provided with NFC devices (such as NFC card readers, NFC tags), and the two electronic devices need to have their respective NFC sensing areas close to each other to trigger the establishment of an inter-device connection. That is to say, if either of the two electronic devices does not have the NFC function (currently, many electronic devices do not have NFC devices), or the NFC sensing areas of the two electronic devices are not close to each other, the triggering method cannot be used above.
  • the connection between electronic devices cannot achieve the purpose of quickly starting interactive services between electronic devices.
  • the present application provides a method, an electronic device, a chip and a computer-readable storage medium for establishing a wireless connection by touching between devices, which can solve the problem in the related art that the establishment of a connection between electronic devices cannot be triggered due to the limitation of NFC hardware.
  • the present application provides a method for establishing a wireless connection by touching between devices, the method comprising: a first electronic device performs a wireless fidelity (Wi-Fi) scan using a first scan duty cycle, 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 uses Wi-Fi scanning is performed with a second scan duty cycle, and the second scan duty cycle is greater than the first scan duty cycle; the signal quality of the first broadcast message scanned by the first electronic device satisfies a preset When conditions are met, 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.
  • Wi-Fi wireless fidelity
  • the scan duty cycle refers to the time proportion of the scan window in one cycle. The smaller the probability of reaching the broadcast message, the less power is consumed accordingly. Since the second scan duty cycle is greater than the first scan duty cycle, accelerated scan can be implemented, so that the first electronic device can quickly discover other electronic devices around it.
  • the first electronic device when the first electronic device detects that the first electronic device is approaching or touching the second electronic device, the first electronic device can speed up the WiFi scanning, so that the first electronic device can quickly discover the second electronic device.
  • the two devices can be triggered to quickly establish a WiFi connection, so as to realize the effect of a one-touch connection of the devices. Since the scan duty cycle of the first electronic device becomes larger, it helps the first electronic device to scan the first broadcast signal faster, so that the first electronic device can discover the device to be connected more quickly, which is helpful for establishing a connection between devices and the speed of business interaction. And without resorting to the NFC device, the hardware requirements for the electronic device can be reduced.
  • RSSI received signal strength
  • RSRP received reference signal power
  • SNR signal-to-noise ratio
  • the preset motion state includes at least one of the following: the first electronic device moves toward the second electronic device, the first electronic device and the second electronic device touch.
  • the first electronic device may detect motion state information or motion parameters of the first electronic device through a built-in sensor, and determine the motion state of the device according to the motion state information or motion parameters.
  • the above 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, it may be any other sensor that meets the actual use requirements.
  • the method further includes: the first electronic device displays a first prompt message , the first prompt message is used to prompt whether to establish a Wi-Fi connection with the second electronic device.
  • establishing a Wi-Fi connection between the first electronic device and the second electronic device includes: the first electronic device, in response to a user's confirming the connection operation on the first prompt message, establishes a Wi-Fi connection with the first electronic device.
  • Two electronic devices establish a Wi-Fi connection. In this way, one-touch connection of devices can be realized according to the actual use needs of users, thereby improving user experience.
  • the method further includes: the first electronic device sends a request to the second electronic device sending first service data related to the first service; and/or, the first electronic device receives the first service data sent by the second electronic device.
  • the method further includes: when the first electronic device detects that the first electronic device is in the preset motion state, sending the first electronic device to the first electronic device.
  • the second electronic device sends a first indication message, 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. Since the broadcasting frequency of the second electronic device is increased, it is helpful for the second electronic device to be discovered more quickly, which is helpful for establishing the speed of connection and interaction between the devices.
  • the first broadcast message includes a device identity of the second electronic device and Wi-Fi channel information.
  • establishing a Wi-Fi connection between the first electronic device and 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.
  • the Wi-Fi channel information may indicate a Wi-Fi channel supported by the second electronic device, and the first electronic device may 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 communicates with the second electronic device.
  • the second electronic device establishes a Wi-Fi connection based on the Wi-Fi channel information.
  • the first broadcast message further includes a device identifier of a third electronic device; the method further includes: establishing a Wi-Fi connection between the first electronic device and the third electronic device .
  • the embodiment of the present application not only achieves the effect of one-touch connection of two devices, but also can achieve the effect of one-touch connection of more devices.
  • the present application provides an electronic device, the electronic device comprising a unit for performing the method in the above-mentioned first 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;
  • the wireless short-range communication chip is used for scanning with a first scanning duty cycle, and the scanning is used for discovering other electronic devices around the first electronic device;
  • the sensor for detecting the motion state of the first electronic device relative to the other electronic devices
  • the wireless short-range communication chip is further configured to use a second scan duty cycle to scan when the sensor detects that the first electronic device is in a preset motion state, and the second scan duty cycle is greater than the predetermined motion state. the first scan duty cycle;
  • 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 , the first broadcast message is a message sent by the second electronic device.
  • the preset motion state includes at least one of the following: the first electronic device moves toward the second electronic device, the first electronic device and the second electronic device touch.
  • the above-mentioned electronic device further includes a display screen, and the display screen is configured 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 is used to prompt whether to establish a wireless connection with the second electronic device.
  • the wireless short-range communication chip is specifically configured to establish a wireless connection with the second electronic device in response to a user confirming the connection operation on the first prompt message.
  • the wireless short-range communication chip is further configured to: after the first electronic device establishes a wireless connection with the second electronic device, send a message to the second electronic device First service data related to a service; and/or, receiving the first service data sent by the second electronic device.
  • the wireless short-range communication chip is further configured to: when the sensor detects that the first electronic device is in the preset motion state, send a message to the second electronic device A first instruction message, where the first instruction 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.
  • the first broadcast message includes 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.
  • the first broadcast message further includes a device identifier of the 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.
  • the wireless short-range communication chip is a wireless fidelity Wi-Fi chip or a Bluetooth chip.
  • the present application provides a method for establishing a wireless connection by touching between devices, the method comprising: a first electronic device detecting first motion state information of the first electronic device through a first sensor; A first distance value between an electronic device and a second 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, the first electronic device and the target electronic device The device establishes a wireless connection; wherein, the target electronic device is the second electronic device or the third electronic device indicated by the second electronic device through a broadcast message.
  • the trigger can be triggered by detecting that the motion state information of the first electronic device conforms to 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 where a wireless connection can be established.
  • the first electronic device quickly establishes 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 by touching between devices does not require the aid of an NFC device, that is, it is not necessary to trigger the connection and interaction between electronic devices through the close contact of an NFC card reader and an NFC tag.
  • the connection and interaction scheme can reduce the hardware requirements for electronic equipment.
  • the first sensor is a sensor for detecting movement and/or touch of the first electronic device
  • the preset motion state information is used to indicate the first electronic device moving towards and/or touching the second electronic device.
  • 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, it may also be any other sensor that meets actual use requirements.
  • the first sensor is an acceleration sensor
  • the first motion state information includes a plurality of speed values or acceleration values that change with time
  • the preset motion state information indicates that the speed value or the acceleration value has changed and the change amount is greater than a preset amount threshold.
  • the method further includes: if the first motion state information conforms to the 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 the scanning function of the first electronic device, scanning the first electronic device Increase the scan duty cycle when the function is on.
  • the scanning duty cycle of the first electronic device Since the scanning duty cycle of the first electronic device becomes larger, it helps the first electronic device to scan the first broadcast signal faster, so that the first electronic device can discover the device to be connected more quickly, which indirectly helps to establish a device speed of connections and interactions.
  • the method further includes: if the first motion state information conforms to the the preset motion state information, the first electronic device sends a first instruction message to the second electronic device, where the first instruction message is used to instruct the execution of a second action; wherein the second action includes the following Any one: start broadcasting the first broadcast message, and increase the frequency of broadcasting the first broadcast message when the broadcasting function of the second electronic device is enabled.
  • the first electronic device detecting a first distance value between the first electronic device and the second electronic device includes: scanning the first electronic device to the first distance value In the case of a first broadcast message broadcast by two electronic devices, the first electronic device calculates the first distance value according to the first broadcast message.
  • the first broadcast message includes a device identifier of the target electronic device and first channel information, where the first channel information is used to indicate a Wi-Fi channel or a Bluetooth (Bluetooth, BT) )channel.
  • Establishing a wireless connection between the first electronic device and the target electronic device includes: the first electronic device establishes a wireless connection with the target electronic device through Wi-Fi or Bluetooth according to the first broadcast message.
  • the device identifier of the target electronic device is an identifier used to uniquely represent the target electronic device, such as a media access control (media access control, MAC) address.
  • the first channel information indicates a channel for establishing 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.
  • the device identifier of the first electronic device is an identifier used to uniquely represent the first electronic device.
  • the second channel information indicates a channel for establishing a wireless connection.
  • the first broadcast message may further include a target password, where the target password is used for authentication when establishing a wireless connection, so as to improve the security of the wireless connection.
  • establishing a wireless connection between the first electronic device and the target electronic device includes: sending, by the first electronic device, first service data related to the first service to the target electronic device; Or, the first electronic device receives the first service data sent by the target electronic device.
  • the method 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, the first prompt message Used to prompt whether to establish a wireless connection with the target electronic device;
  • the first electronic device establishing a wireless connection with the target electronic device includes: the first electronic device establishing a wireless connection with the target electronic device in the case of receiving the user's confirmation connection operation on the first prompt message connect.
  • the present application provides a method for establishing a wireless connection by touching between devices, 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 In the case of being within range, the target electronic device establishes a wireless connection with the first electronic device.
  • 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 the second electronic device passes through The third electronic device indicated by the broadcast message.
  • the preset motion state information is used to instruct the first electronic device to move toward the second electronic device and/or to touch the second electronic device.
  • the method further includes: in the case that the first motion state information satisfies the preset motion state information, receiving, by the second electronic device, a message sent by the first electronic device
  • the first instruction message is used to instruct the second electronic device to perform a second action; the second electronic device performs a second action, and the second action includes any of the following: start broadcasting For a first broadcast message, when the broadcast function of the second electronic device is turned on, the frequency of broadcasting the first broadcast message is increased.
  • the method further includes: the second electronic device detects the first motion state information; 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, where 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.
  • the first broadcast message includes a device identifier of the target electronic device and first channel information, where the first channel information is used to indicate a Wi-Fi channel or a Bluetooth channel.
  • Establishing a wireless connection between the target electronic device and the first electronic device includes: the target electronic device establishes a wireless connection with the first electronic device through Wi-Fi or Bluetooth according to the first broadcast message.
  • the method further includes: receiving, by the target electronic device, a message sent by the first electronic device with the first electronic device. First service data related to a service; or, the target electronic device sends the first service data to the first electronic device.
  • the present application provides an apparatus for establishing a wireless connection, the apparatus comprising a unit for performing the method in the above-mentioned fourth aspect.
  • the present application provides an apparatus for establishing a wireless connection, the apparatus comprising a unit for performing the method in the fifth aspect.
  • the present application provides a wireless communication system, the system includes a first electronic device and a second electronic device; the system is configured to execute the method in the first aspect and/or the fourth aspect and/or the fifth aspect .
  • the present application provides an electronic device, the electronic device includes a processor, the processor is coupled with a memory, the memory is used for storing computer programs or instructions, and the processor is used for executing the computer programs or instructions stored in the memory, so that the first The method of the aspect and/or the fourth aspect and/or the fifth aspect is performed.
  • the processor is configured to execute a computer program or instructions stored in the memory to cause the electronic device to perform the method of the first aspect and/or the fourth aspect and/or the fifth 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.
  • a computer program also referred to as instructions or codes
  • the computer program when executed by a computer, causes the computer to perform the method of the first aspect and/or the fourth aspect and/or the fifth aspect.
  • the present application provides a chip including a processor.
  • the processor is configured to read and execute the computer program stored in the memory to perform the method of the first aspect and/or the fourth aspect and/or the fifth aspect.
  • the chip further includes a memory, and the memory is connected to the processor through a circuit or a wire.
  • the chip is a wireless short-range communication chip, such as a Wi-Fi chip or a Bluetooth chip.
  • the present application provides a computer program product, the computer program product comprising a computer program (also referred to as instructions or code), which when executed by a computer causes the computer to implement the first aspect and/or or the method of the fourth aspect and/or the fifth aspect.
  • a computer program also referred to as instructions or code
  • FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 3 is one of the schematic flowcharts of a method for establishing a wireless connection by touch between devices according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an acceleration sensor provided in an embodiment of the present application applied to an electronic device.
  • FIG. 5 is a schematic diagram of a resultant acceleration waveform detected by an acceleration sensor provided in an embodiment of the present application.
  • FIG. 6 is a second schematic flowchart of a method for establishing a wireless connection by touch between devices according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a Bluetooth scan window and scan interval.
  • FIG. 8 is a schematic diagram of a comparison between a normal scan mode, a power-saving scan mode, and an accelerated scan mode.
  • FIG. 9 is a third schematic flowchart of a method for establishing a wireless connection by touch between devices according to an embodiment of the present application.
  • FIG. 10 is a fourth schematic flowchart of a method for establishing a wireless connection by touch between devices according to an embodiment of the present application.
  • 11 to 13 are schematic diagrams of interfaces and scenarios of applications of a method for establishing a wireless connection by touch between devices provided by an embodiment of the present application.
  • FIG. 14 is a fifth schematic flowchart of another method for establishing a wireless connection by touch between devices according to an embodiment of the present application.
  • 15 to 18 are schematic diagrams of interfaces and scenarios of another method for establishing a wireless connection by touch between devices provided by an embodiment of the present application.
  • FIG. 19 is a sixth schematic flowchart of another method for establishing a wireless connection by touch between devices according to an embodiment of the present application.
  • FIG. 20 and FIG. 21 are schematic block diagrams of an apparatus for establishing a wireless connection provided by an embodiment of the present application.
  • FIG. 22 is a schematic diagram of a system for establishing a wireless connection provided by an embodiment of the present application.
  • FIG. 23 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the embodiment of the present application provides an electronic device 10, and the electronic device 10 can be applied to the communication system 100 shown in FIG. 1 .
  • the communication system 100 may include an electronic device 10 and at least one electronic device 20 .
  • the electronic device 10 can establish a wireless connection with the electronic device 20 through a wireless communication technology.
  • the wireless communication technology can be bluetooth (BT), traditional bluetooth or low-power BLE bluetooth, wireless local area networks (WLAN) (such as Wi-Fi network), Zigbee, frequency modulation (frequency modulation) , FM), short-range wireless communication technology (near field communication, NFC), infrared technology (infrared, IR), or general 2.4G/5G frequency band wireless communication technology.
  • the wireless connection is a connection established using the wireless communication technology. This embodiment of the present application does not specifically limit the type of wireless communication technology.
  • the electronic device 10 may be a mobile terminal.
  • the electronic device 10 may be a mobile phone (as shown in FIG. 1 ), a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted terminal, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a Mobile terminals such as personal digital assistants (PDAs).
  • the electronic device 20 may be a mobile terminal or a non-mobile terminal.
  • the electronic device 20 may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, 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) devices, desktop computers, wireless vehicles, smart home appliances (such as TVs, speakers, refrigerators, air purifiers, air conditioners, rice cookers), etc.
  • the electronic device 20 may also be collectively referred to as an Internet of Things (Internet of Things, IoT) device.
  • IoT Internet of Things
  • the device types of the electronic device 10 and the electronic device 20 are not specifically limited in this embodiment of the present application.
  • FIG. 2 shows a schematic structural diagram of an electronic device 10 .
  • 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 charge management module 140, a power management unit 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM Subscriber identification module
  • 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, and ambient light. Sensor 180K, bone conduction sensor 180L, etc.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 10 .
  • the electronic device 10 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • 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), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 10 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal). asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, And/or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 10 .
  • the electronic device 10 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through the wireless charging coil of the electronic device 10 . While charging the battery 142 , the charging management module 140 can also supply power to the electronic device through the power management unit 141 .
  • the power management unit 141 is used for connecting 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 battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management unit 141 may also be provided in the processor 110 .
  • the power management unit 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 10 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 10 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 10 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify 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 then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless communication including WLAN (such as Wi-Fi), BT, global navigation satellite system (GNSS), FM, NFC, IR or general 2.4G/5G applied on the electronic device 10 Technology and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency 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 , perform frequency modulation and amplification on the signal, and then convert it into electromagnetic waves for radiation through the antenna 2 .
  • the wireless communication module 160 may be a Bluetooth chip.
  • the electronic device 10 can pair and establish a connection with the Bluetooth chip of an electronic device such as a wireless headset through the Bluetooth chip, so as to realize wireless communication and service processing between the electronic device 10 and other electronic devices through the connection.
  • Bluetooth chips can usually support BR/EDR Bluetooth and BLE.
  • the antenna 1 of the electronic device 10 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 10 can communicate with the network and other devices through wireless communication technology.
  • Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband code division Multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TDSCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc.
  • GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi-zenith) satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 10 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • 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 (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 10 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the electronic device 10 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, 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, converting it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize parameters such as exposure and color temperature of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 10 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 10 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, and the like.
  • Video codecs are used to compress or decompress digital video.
  • Electronic device 10 may support one or more video codecs.
  • the electronic device 10 can play or record videos in various encoding formats, for example, moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 10 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • 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 realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 10 by executing the instructions stored in the internal memory 121 .
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 10 and the like.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 110 may be configured to execute the above-mentioned program codes, and invoke relevant modules to implement the functions of the electronic device in the embodiments of the present application. For example, pairing with a wireless headset; when there is an audio service, sending connection request information to the wireless headset according to the priority of the audio service; establishing/disconnecting the physical connection or virtual connection with the wireless headset and other functions.
  • the electronic device 10 may implement audio functions through the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor in the audio module 170 . Such as music playback, recording, etc.
  • the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
  • the electronic device 10 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also referred to as "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be answered by placing the receiver 170B close to the human ear.
  • Microphone 170C also referred to as "microphone" is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 10 may be provided with at least one microphone 170C.
  • the electronic device 10 may be provided with two microphones 170C, which can implement a noise reduction function in addition to collecting sound signals.
  • the electronic device 10 may further be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
  • the earphone jack 170D is used to connect wired earphones.
  • the earphone interface 170D can be the USB interface 130, or can be a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 180A may be provided on the display screen 194 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to 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 intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 10 can also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing 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, the instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the motion attitude of the electronic device 10 .
  • the angular velocity of electronic device 10 about three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyroscope sensor 180B detects the shaking angle of the electronic device 10, calculates the distance to be compensated by the lens module according to the angle, and allows the lens to counteract the shaking of the electronic device 10 through reverse motion to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 10 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 10 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 10 can measure distances 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.
  • Proximity light sensor 180G may include, for example, light-emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 10 emits infrared light to the outside through light emitting diodes.
  • Electronic device 10 uses photodiodes 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 may 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 holster mode, pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180K is used to sense ambient light brightness.
  • 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 the pocket to prevent accidental touch.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 10 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 10 may detect the displacement of the electronic device 10 using the magnetic sensor 180D.
  • the Hall sensor can use a magnet to form a linear trapezoidal magnetic field (or called a slope magnetic field).
  • the displacement change of the Hall plate in the linear magnetic field is consistent with the change of the magnetic field strength, and the formed Hall potential is also the same as that of the magnetic field.
  • the displacement is proportional, and the electronic device 10 can measure the displacement by acquiring the Hall potential.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 10 can use the collected fingerprint characteristics to unlock the fingerprint, access the application lock, take a picture with the fingerprint, answer the incoming call with the fingerprint, and the like.
  • the temperature sensor 180I is used to detect the temperature.
  • the electronic device 10 utilizes the temperature detected by the temperature sensor 1801 to execute a temperature handling strategy. For example, when the temperature reported by the temperature sensor 180I exceeds a threshold value, the electronic device 10 reduces the performance of the processor located near the temperature sensor 180I in order 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 caused by the low temperature. In some 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 caused by low temperature.
  • the touch sensor 180J is also called “touch panel”.
  • the touch sensor 180J may be disposed on the display screen 194, and the touch sensor 180J and the display screen 194 form a touch screen, also referred to as a "touch screen”.
  • the touch sensor 180J is used to detect a touch operation 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 touch operations may be provided through display screen 194 .
  • the touch sensor 180J may also be disposed on the surface of the electronic device 10 , which is different from the location where the display screen 194 is located.
  • the bone conduction sensor 180L can acquire vibration signals.
  • the bone conduction sensor 180L can acquire the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180L can also contact the pulse of the human body and receive the blood pressure beating signal.
  • the bone conduction sensor 180L can also be disposed in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the voice part vibrating bone mass obtained by the bone conduction sensor 180L, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180L, and realize the function of heart rate detection.
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • the electronic device 10 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 10 .
  • Motor 191 can generate vibrating cues.
  • the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, game, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, which can be used to indicate a charging state, a change in power, or a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the electronic device 10 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the electronic device 10 may 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 card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. Multiple cards can be of the same type or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 10 interacts with the network through the SIM card to realize functions such as call and data communication.
  • the electronic device 10 employs an eSIM, ie: an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 10 and cannot be separated from the electronic device 10 .
  • FIG. 2 do not constitute a specific limitation on the electronic device 20, and the electronic device 20 may also include more or less components than those shown in the figure, or combine some components, or split some components, Or a different component arrangement.
  • an embodiment of the present application provides a method for establishing a wireless connection by touching between devices.
  • the first electronic device detects first motion state information of the first electronic device through a first sensor;
  • the device detects a first distance value between the first electronic device and the second 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, the first electronic device
  • a wireless connection is established with a target electronic device, where the target electronic device is a second electronic device or a third electronic device indicated by the second electronic device through a broadcast message.
  • the first electronic device by detecting that the motion state information of the first electronic device conforms to 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 that can establish a wireless connection, that is, 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 by touching between devices does not require the aid of an NFC device, that is, it is not necessary to trigger the connection and interaction between electronic devices through the close contact of an NFC card reader and an NFC tag. The connection and interaction scheme can reduce the hardware requirements for electronic equipment.
  • the executive body of the method for establishing a wireless connection by touch between devices provided in this embodiment of the present application may be the above-mentioned electronic device (for example, the above-mentioned electronic device 10 ), or may be a function in the electronic device that can implement the method
  • the modules and/or functional entities can be specifically determined according to actual usage requirements, which are not limited in the embodiments of the present application.
  • the method for establishing a wireless connection by touch between devices provided in this embodiment of the present application is exemplarily described below by taking the execution subject as an electronic device (for example, a first electronic device) as an example.
  • the user in the case where a wireless connection is not established between the first electronic device and the second electronic device, if the user needs to establish a wireless connection between the first electronic device and the second electronic device, or needs to connect the first electronic device to the second electronic device
  • the user can establish a wireless connection by touching between devices according to the embodiments of this application. method to operate to achieve rapid interconnection or business interaction between devices.
  • FIG. 3 is a flowchart of a method for establishing a wireless connection by touch between devices according to an exemplary embodiment. Referring to Fig. 3 , the method includes the following steps S310-S330.
  • the first electronic device detects the first motion state information of the first electronic device through the first sensor.
  • the above-mentioned first sensor may be a sensor disposed in the first electronic device and used for sensing motion behaviors such as movement and/or rotation and/or shaking of the first electronic device.
  • the first sensor may be an acceleration sensor, an angular velocity sensor (for example, also called a gyro sensor), a proximity light sensor, a magnetic sensor (for example, a Hall sensor), or other Any sensor that meets the usage requirements, such as a combined sensor, can be specifically determined according to the actual usage requirements, which is not limited in the embodiment of the present application.
  • the first electronic device can detect the first motion state information in real time or periodically through a built-in sensor, and can further judge the motion behavior (for example, moving behavior and/or rotation behavior and / or shaking behavior).
  • the motion behavior for example, moving behavior and/or rotation behavior and / or shaking behavior.
  • the acceleration sensor in the first electronic device can detect that the first electronic device is in the X direction, the Y direction and the Z direction.
  • the above-mentioned acceleration values or combined acceleration values of the first electronic device in various directions are used as the first motion state information, and can be used to determine the moving behavior or shaking behavior of the first electronic device.
  • the gyro sensor in the first electronic device can detect the movement of the first electronic device in the X direction, the Y direction, and the The angular velocity values in the Z direction (such as ⁇ , ⁇ and ⁇ ) can also be determined according to the angular velocity values of the first electronic device in the X, Y and Z directions to determine the X, Y and Z directions of the first electronic device
  • the resultant angular velocity value on (b 2 ⁇ 2 + ⁇ 2 + ⁇ 2 ).
  • 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 above-mentioned angular velocity values or combined angular velocity values of the first electronic device in various directions are used as the first motion state information, and can be used to determine the rotation behavior of the first electronic device.
  • the first sensor as a six-axis sensor (including a three-axis acceleration sensor and a three-axis gyroscope sensor) as an example, as shown in FIG. 4
  • the first electronic device The six-axis sensor in can detect the acceleration values (eg x, y and z) and angular velocity values (eg ⁇ , ⁇ and ⁇ ) of the first electronic device 10 in the +X direction, +Y direction and +Z direction, or The resultant acceleration values and resultant angular velocity values of the first electronic device 10 in the X direction, the Y direction and the Z direction are obtained.
  • the above-mentioned angular velocity values or combined angular velocity values of the first electronic device in various directions, as the first motion state information, can be used to determine the motion behavior (eg, moving behavior and/or rotation behavior and/or shaking behavior) of the first electronic device.
  • the motion behavior eg, moving behavior and/or rotation behavior and/or shaking behavior
  • the above-mentioned first motion state information may be represented by a parameter that can characterize the movement and/or rotation and/or shaking of the electronic device.
  • the first motion state information may be represented by a moving speed (such as the above acceleration value), or It can be represented by rotational attitude (such as angular velocity value), or by shaking frequency, or by any combination of parameters such as moving speed, rotational attitude, and shaking frequency, or by any other possible motion parameters (such as motion trajectory) Indicates that the specificity can be determined according to actual use requirements, which is not limited in the embodiments of the present application.
  • the first sensor in the first electronic device can detect this movement behavior of the first electronic device, and obtain the first motion state information.
  • the first sensor may be an acceleration sensor, and the first motion state information may be represented by an acceleration value.
  • the first motion state information may include multiple acceleration values that vary with time.
  • the first sensor in the first electronic device detects one or more corresponding shaking behaviors.
  • parameters that is, the first motion state information
  • the preset threshold range that is, the first motion state information conforms to the preset motion state information
  • an event corresponding to the preset threshold range can be triggered, For example, increase the frequency of Wi-Fi scans.
  • the first sensor may include an acceleration sensor and a gyro sensor, and the first motion state information may be represented by an acceleration value and an angular velocity value.
  • the first motion state information may include multiple acceleration values and multiple angular velocity values that vary over time.
  • the first electronic device obtains the first motion state information through the first sensor.
  • the embodiments of the present application include but are not limited to the above enumerated methods, and include but are not limited to the above-mentioned first motion state information.
  • Motion state information specifically, the first sensor and the acquired first motion state information may be determined according to actual usage requirements, which are not limited in this embodiment of the present application.
  • the following is an exemplary description taking as an 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.
  • the acceleration sensor detects that the acceleration value (and the speed value) of the first electronic device in each axis direction is close to 0 (but not 0), thus sensing the movement of the first electronic device .
  • the first electronic device "touches" with the second electronic device after approaching 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 will be A pulse peak appears, or a pulse peak appears in the resultant acceleration value in each axis direction (as shown in the waveform diagram in Figure 5), at this time, the first electronic device can identify the "touch” by identifying the pulse peak in the waveform diagram. touch" action.
  • the first electronic device can judge whether the first motion state information conforms to the preset motion state information by comparing the first motion state information with the preset motion state information, that is, judge whether the motion behavior of the first electronic device is Preset motion behavior.
  • the preset motion state information may be information indicating preset motion behaviors (such as moving behavior and/or rotation behavior and/or shaking behavior, etc.), for example, the preset motion state information is used to indicate the direction of the first electronic device After the second electronic device moves, it touches the second electronic device, which may be specifically set according to actual needs, which is not limited in this embodiment of the present application.
  • the first motion state information includes a plurality of acceleration values that change with time
  • the preset motion state information indicates that the acceleration value changes and the change amount is greater than a preset threshold.
  • the first electronic device may determine that the first motion state information conforms to the preset motion state information, and thus determine that the first motion state information conforms to the preset motion state information.
  • An electronic device has a motion behavior of first moving and then stopping.
  • the first electronic device determines whether the signal quality of the scanned first broadcast message satisfies a preset condition.
  • the first broadcast message is a message broadcast by the second electronic device.
  • whether the signal quality satisfies the preset condition may be determined by at least one of the following parameters: RSSI, RSRP, and SNR.
  • 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 may determine that the signal quality satisfies the preset condition.
  • the first electronic device may detect signal strengths sent by other surrounding electronic devices, and determine whether the first electronic device and the second electronic device are within a preset distance range according to the signal strengths.
  • the first electronic device can refer to the corresponding relationship between the signal strength and the distance range to determine the first electronic device and the second electronic device. Is within the preset distance range.
  • 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
  • the first electronic device may also detect a first distance value between the first electronic device and the second electronic device.
  • 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, detect the first distance value between the first electronic device and the second electronic device, and further According to the first distance value, it can be determined whether the first electronic device and the second electronic device are very close (for example, close to or in contact with each other).
  • the first electronic device may judge whether the first electronic device and the second electronic device are very close by judging 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 may determine that the first electronic device and the second electronic device are not close enough.
  • the above-mentioned preset distance range may be determined according to actual use requirements, for example, the preset distance range is [0, 0.1 meters], which is not limited in this embodiment of the present application.
  • the preset distance range is [0, 0.1 meters], which is not limited in this embodiment of the present application.
  • the first electronic device may determine that the first electronic device is very close to the second electronic device.
  • the detected first distance value is 0, that is, within a preset distance range
  • the first electronic device may determine that the first electronic device is in contact with the second electronic device.
  • the first distance value is within the preset distance range, it can be determined that the first electronic device and the second electronic device are very close. for short-range wireless communication.
  • the first electronic device may detect the first distance value in the following distance measurement manner.
  • the 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 the energy of the received signal) and the first ranging formula, wherein the first A ranging formula includes parameters such as received signal energy value and distance.
  • the first electronic device may bring the RSSI value into the first ranging formula to calculate the first distance value.
  • the first ranging calculation formula reference may be made to the calculation formula involving the use of RSSI value for ranging in the related art, which will not be repeated here.
  • the first electronic device can send an energy wave signal, such as an ultrasonic signal, an ultra wide band (UWB) signal, to the second electronic device, and receive the returned energy wave signal, and then according to the energy wave signal Round-trip travel time (also called time-of-flight) calculates the distance between these two electronic devices.
  • an energy wave signal such as an ultrasonic signal, an ultra wide band (UWB) signal
  • UWB ultra wide band
  • the embodiment of the present application may also adopt other feasible ways to detect the first distance value, which may be specifically determined according to actual use requirements, which is not limited in the embodiment of the present application.
  • the first electronic device When the first motion state information complies with the preset motion state information and the signal quality of the first broadcast message satisfies the preset condition, the first electronic device establishes a connection with the target electronic device.
  • the above-mentioned target electronic device is a second electronic device or a third electronic device indicated by the second electronic device through a broadcast message.
  • the preset motion state information is used to instruct the first electronic device to move toward and/or touch the second electronic device.
  • 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, in the case where 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 moving at a close distance relative to the second electronic device: for example, the first electronic device After the device moves toward the second electronic device, it approaches or contacts the second electronic device; or, the first electronic device shakes and/or rotates within a short range of the second electronic device.
  • the first electronic device and the second electronic device meet the conditions for wireless communication (eg, short-range wireless communication). , so it can trigger connection establishment and service interaction between devices.
  • wireless communication eg, short-range wireless communication
  • the first electronic device may be in a bright screen state, for example, the first electronic device may be in a bright screen state when the screen is locked, or in a bright screen state when the screen is unlocked
  • the second electronic device may be in an on state, and the second electronic device broadcasts a first broadcast message (ie, the target electronic device is in a discoverable and connectable state), the first broadcast message including, for example, an identification of the second electronic device, such as MAC address, device name, etc. If the first electronic device scans the first broadcast message, the first electronic device establishes a wireless connection with the target electronic device after exchanging signaling and negotiating information with the target electronic device through paging according to the first broadcast message.
  • the first electronic device and the second electronic device can establish a wireless connection through a wireless local area network, or establish a wireless connection through Bluetooth, or establish a wireless connection through other possible technologies or methods, which can be determined according to actual use requirements.
  • the embodiments of the present application are not limited.
  • the preset motion state information indicates that the acceleration value has changed and the change amount is greater than the preset threshold, and the preset distance range is [0, 0.1 meters].
  • the acceleration sensor in the first electronic device can detect this moving behavior of the first electronic device, and obtain the first motion state information.
  • the motion state information includes a plurality of acceleration values that vary over time.
  • the first electronic device can use this to determine the orientation of the first electronic device
  • the second electronic device moves and then contacts the second electronic device, that is, the conditions for establishing a wireless connection between the electronic devices are satisfied.
  • 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 lightly 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 the devices.
  • An embodiment of the present application provides a method for establishing a wireless connection by touching between devices.
  • a first electronic device detects first motion state information of the first electronic device through a first sensor; the first electronic device detects the first electronic device and the first electronic device. The first distance value between the two electronic devices; 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 and the second electronic device establish a wireless connection .
  • the first electronic device by detecting that the motion state information of the first electronic device conforms to 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 that can establish a wireless connection, that is, 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 by touching between devices does not require the aid of an NFC device, that is, it is not necessary to trigger a connection between electronic devices through the close contact of an NFC card reader and an NFC tag, the method for establishing a connection between electronic devices provided by the embodiments of the present application The solution can reduce the hardware requirements for electronic equipment.
  • the first electronic device may display a first prompt message, where the first prompt message is used to prompt whether to establish a wireless connection with the target electronic device.
  • Wireless connections The user can 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 in the case of receiving the user's confirming connection operation on the first prompt message.
  • establishing a wireless connection between the first electronic device and the target electronic device includes: the first electronic device may send first service data related to the first service to the target electronic device, and the first electronic device may also The first service data sent by the target electronic device is received.
  • the first service may be screen projection, audio playback, and wireless file transmission.
  • step 310 may be performed first, and then step 320 may be performed; or step 320 may be performed first, and then step 310 may be performed; or step 310 and step 320 may be performed simultaneously.
  • FIG. 3 is an example of performing step 310 first and then performing step 320 as an example.
  • the first electronic device may trigger the first electronic device to start scanning or accelerate the scanning of broadcast messages of other devices when judging that the first motion state information conforms to the preset motion state information, and according to the scan
  • the received broadcast message detects the distance between the first electronic device and other electronic devices (ie, step 310 is performed first, and then step 320 is performed), so as to reduce energy consumption.
  • the method for establishing a wireless connection by touch between devices provided in this embodiment of the present application may further include the following steps: S340.
  • the first electronic device determines whether the first motion state information conforms to the preset motion state information.
  • the first electronic device determines that the first motion state information conforms to the preset motion state information
  • the first electronic device continues to perform the above step 320; if the first electronic device determines that the first motion state information does not conform to the preset motion state information Assuming the motion state information, the first electronic device continues to perform the above-mentioned step 310 . That is to say, the first electronic device further detects the first distance value only when the first motion state information conforms to the preset motion state information, which can reduce the power consumption of the first electronic device caused by the detection.
  • the first electronic device can further exchange signaling and negotiate information with the target electronic device according to the first broadcast message, and then communicate with the target electronic device.
  • the target electronic device establishes a wireless connection. That is to say, when a connection needs to be established, the scanning to the broadcast message is accelerated, which can improve the speed of establishing the connection between the devices and the service interaction.
  • scan window and scan interval As shown in FIG. 7 , the time width of one scan is called a scan window, and is denoted as T1; the time difference between the start times of two consecutive scan windows is called a scan interval, and is denoted as T2. If the scan window is equal to the scan interval, then the scan duty cycle is 1.
  • Fig. 7 shows a fixed scan window and scan interval.
  • the scan window can be fixed or changed, such as increasing or decreasing, and the specificity can be determined according to the actual situation.
  • the scanning interval can be fixed or variable, such as increasing or decreasing, which can be set according to the actual situation.
  • the larger the scanning window the higher the probability of scanning broadcast messages and the correspondingly more power consumption; the smaller the scanning window, the lower the probability of scanning broadcast messages and the correspondingly less power consumption.
  • the larger the scan duty cycle (the time proportion of the scan window in one cycle), the greater the probability of scanning broadcast messages, and the correspondingly more power consumption; the smaller the scan duty cycle, the more broadcast messages are scanned. The smaller the probability is, the less power is consumed accordingly.
  • the scanning window and scanning interval of Bluetooth scanning are fixed (called normal scanning mode, as shown in (a) in Figure 8); or the scanning window of Bluetooth scanning is fixed and the scanning interval will gradually increase (called It is a power-saving scanning mode, as shown in (b) in Figure 8).
  • the scanning window is 10 seconds, and the scanning interval is 5 seconds, 10 seconds, and 20 seconds in order to save unnecessary power consumption;
  • the scan interval is fixed and the scan window will gradually become smaller (another power-saving scan mode, such as the scan interval is 5 seconds, the scan window is 10 seconds, 5 seconds, 3 seconds in sequence, until the scan is stopped to save unnecessary power consumption
  • the first electronic device since the probability of scanning a broadcast message is relatively small when the first electronic device scans in the normal scanning mode or the power-saving scanning mode, the first electronic device needs to establish a connection with other electronic devices when Scanning can be accelerated (called accelerated scan mode, as shown in (c) in Figure 8) to increase the speed of establishing a connection between devices.
  • the above-mentioned first broadcast message includes a device identifier of the target electronic device and first channel information, where the first channel information is used to indicate a Wi-Fi channel or a Bluetooth channel.
  • the first electronic device may establish a wireless connection with the target electronic device through Wi-Fi or Bluetooth according to the first broadcast message.
  • the device identifier of the target electronic device is an identifier used to uniquely represent the target electronic device, such as the MAC address of the target electronic device, or the device name.
  • the device identifier may be a MAC address used to indicate the second electronic device, or the device identifier may be a MAC address used to indicate the third electronic device.
  • the first channel information indicates a channel for establishing a wireless connection, which may be a Wi-Fi channel or a Bluetooth channel.
  • the channels in the Wi-Fi 2.4GHz frequency band can usually be divided into 14 channels: the first channel to the 14th channel, of which the 14th channel is generally not used.
  • the first channel information can be used to indicate the first channel. channel to one of the 13th channels.
  • 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 (service set identifier, SSID) of a router, and the first electronic device and the target electronic device may pass the first broadcast.
  • the identifier of the wireless local area network carried in the message performs wireless local area network networking.
  • the first channel information may include a Bluetooth device identification, and the first electronic device and the target electronic device may perform Bluetooth connection through the Bluetooth device identification and/or pairing code carried in the first broadcast message.
  • the first electronic device may send a response message to the target electronic device, the response message It may include at least one of the following: a device identifier 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.
  • the first broadcast message may further include any other authentication information for wireless connection that meets actual usage requirements.
  • the first broadcast message may further include a target password, where the target password is used for authentication when establishing a wireless connection, so as to improve the security of the wireless connection.
  • the target password can be a Wi-Fi password, or a Bluetooth pairing password.
  • the target password can be the password set by default by the system, or can be set by the user according to requirements.
  • the above-mentioned response message may also include any other authentication information (eg, password) for wireless connection that meets the actual use requirements.
  • the first electronic device may be prompted to accelerate the scan to the first broadcast message by triggering to enable the scan function of the first electronic device or increasing the scan duty cycle of the first electronic device, thereby realizing accelerated scan.
  • the method for establishing a wireless connection by touch between devices provided in this embodiment of the present application further includes the following step S350A.
  • the first electronic device performs the first action.
  • the above-mentioned first action may include any one of the following:
  • Manner 1 Turn on the scanning function of the first electronic device. Specifically, in the case where the scanning function of the first electronic device is not enabled, if the first electronic device detects that the first motion state information conforms to the preset motion state information, the first electronic device is triggered to automatically turn on the WiFi or Bluetooth function, thereby Start WiFi scan or Bluetooth scan.
  • the first electronic device may perform scanning with a preset fixed scanning duty cycle, for example, scanning every 5 seconds.
  • the first electronic device enables the scanning function it may scan with a preset variable scanning duty cycle, for example, gradually increasing the scanning duty cycle, such as scanning once every 20 seconds, and then scanning once every 10 seconds, Then scan every 5 seconds, and so on. Since the scanning function of the first electronic device is triggered to be turned 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 service interaction.
  • Manner 2 Increase the scan duty cycle when the scan function of the first electronic device is enabled. Specifically, when the scanning function of the first electronic device is enabled, if the first electronic device detects that the first motion state information conforms to the preset motion state information, the first electronic device is triggered to increase the current scan duty cycle (corresponding to the accelerated scan pattern shown in (c) in FIG. 8 ).
  • the scan interval duration is decreased to increase the scan duty cycle, for example, the scan window duration is fixed at 10 seconds (ie, the duration of each scan is 10 seconds), and the scan interval Duration reduced from 5 seconds to 3 seconds.
  • the scan window duration is increased to increase the scan duty cycle, for example, the scan interval duration is fixed at 5 seconds, and the scan window duration is increased from 5 seconds to 10 seconds.
  • the scan interval duration is decreased to increase the scan duty cycle, eg, the scan window duration is increased from 5 seconds to 10 seconds (ie, the duration of each scan is 10 seconds) , and the scan interval is reduced from 5 seconds to 3 seconds.
  • the scanning duty cycle may be decreased, or the scanning may be stopped.
  • the scanning duty cycle of the first electronic device Since the scanning duty cycle of the first electronic device becomes larger, it helps the first electronic device to scan the first broadcast signal faster, so that the first electronic device can discover the device to be connected more quickly, which indirectly helps to establish a device speed of connections and business interactions.
  • step S320 can be specifically implemented by the following step S320A.
  • the first electronic device determines whether the signal quality of the scanned first broadcast message satisfies a preset condition.
  • the first electronic device when the first electronic device scans the first broadcast message broadcast by the second electronic device, the first electronic device can use at least one of the following parameters to determine whether the signal quality of the first broadcast message satisfies the preset: Conditions: RSSI, RSRP, SNR.
  • Conditions RSSI, RSRP, SNR.
  • RSSI 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 may determine that the signal quality of the first broadcast message satisfies preset conditions.
  • the first electronic device and the second electronic device are relatively close to each other, and the condition for establishing a wireless connection is satisfied, so the rapid establishment of a wireless connection between the devices can be triggered.
  • the first electronic device can trigger the start of the scan function or increase the scan duty cycle, which can increase the number of scans the first electronic device scans to other The probability of the broadcast signal of the electronic device, specifically to this embodiment, because the first electronic device enables the scan function or increases the scan duty cycle, the first electronic device can quickly scan 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 satisfies the preset condition.
  • the first electronic device may determine the RSSI value according to the first broadcast message; further, when the RSSI value is greater than a preset threshold, the first electronic device may determine that the signal quality of the first broadcast message satisfies a preset condition.
  • step S330 may be implemented by the following step S330A.
  • the first electronic device When the signal quality of the first broadcast message satisfies the preset condition, the first electronic device establishes a wireless connection with the second electronic device.
  • 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, and in the case of judging that the first motion state information conforms to the preset motion state information , triggering the first electronic device to start scanning or speeding up the scanning of broadcast messages of other devices, so that the first electronic device can discover the device to be connected more quickly.
  • the first electronic device scans the first broadcast message of the second electronic device, and the signal quality of the first broadcast message satisfies the preset condition, the first electronic device and the target electronic device can establish a wireless connection. Therefore, the solutions provided by the embodiments of the present application can more quickly discover the device to be connected and quickly establish a connection between the devices.
  • a possible implementation manner of accelerating the scanning to the broadcast message has been introduced above, that is, by triggering the scanning function of the first electronic device to be turned on or increasing the scanning duty cycle of the first electronic device, the first electronic device is urged to accelerate the scanning to the first broadcast message. message, so that the first electronic device can discover the device to be connected more quickly.
  • the embodiments of the present application include but are not limited to the above-mentioned ways of accelerating scanning. For example, by triggering the activation of the broadcast message function of the second electronic device or increasing the frequency of the broadcast message of the second electronic device, the first broadcast message can be accelerated faster. Scan to, thereby realizing accelerated scanning, and the second implementation manner will be described in detail below.
  • connection method may further include the following step S350B.
  • S350B The first electronic device sends a first instruction message to the second electronic device, where the first instruction message is used to instruct the execution of the second action.
  • the second action may include any of the following:
  • Manner 1 Turn on the broadcast message function of the second electronic device. Specifically, in the case where the broadcast message function of the second electronic device is not enabled, if the first electronic device detects that the first motion state information conforms to the preset motion state information (for example, the first electronic device touches the second electronic device), Then, the first electronic device is triggered to send a first instruction message to the second electronic device, so as to instruct the second electronic device to enable 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, then the first electronic device stores the identification or address of the second electronic device, so the first electronic device can be based on the identification or address. , and send the first indication message to the second electronic device.
  • the second electronic device may 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 be turned 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 a device speed of connections and business interactions.
  • Manner 2 Increase the frequency of broadcast messages when the broadcast function of the second electronic device is enabled. Specifically, when the broadcasting function of the second electronic device is enabled, if the first electronic device detects that the first motion state information conforms to the preset motion state information, it triggers sending a first indication message to the second electronic device to The second electronic device is instructed to increase the frequency of the current broadcast message, eg, increase the frequency of the current broadcast message (eg, broadcast every 10 seconds) to a target frequency (eg, broadcast every 5 seconds). Since the frequency of broadcast messages of the second electronic device increases, 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 device speed of connections and business interactions.
  • the first electronic device detects that the first motion state information conforms to the preset motion state information, it triggers sending a first indication message to the second electronic device to The second electronic device is instructed to increase the frequency of the current broadcast message, eg, increase the frequency of the current broadcast message (eg,
  • the frequency of broadcast messages can be reduced, or the broadcast messages can be stopped.
  • 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, and in the case of determining that the first motion state information conforms to the preset motion state information , triggering the first electronic device to send a message to the second electronic device to instruct the second electronic device to start broadcasting or speeding up broadcasting, when the first electronic device scans the first broadcast message of the second electronic device, and the signal of the first broadcast message
  • the first electronic device and the target electronic device can establish a connection and interact with each other. Therefore, the solutions provided by the embodiments of the present application can discover devices to be connected more quickly, and quickly establish connections and service interactions between devices.
  • the second implementation above describes 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;
  • the second electronic device can actively detect whether the first motion state information conforms to the preset motion state information, and start broadcasting the first broadcast message or increase the The frequency of broadcasting the first broadcast message is increased, so that the first broadcast message is scanned more quickly, thereby realizing accelerated scanning.
  • the third implementation manner is described in detail below.
  • the method for establishing a wireless connection by touch between devices may further include the following steps S350C and S350D.
  • the second electronic device detects the first motion state information
  • 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, and the third action includes any one of the following: start broadcasting the first broadcast message, increase the broadcast The frequency of the first broadcast message.
  • the second electronic device may actively detect the first motion state information and determine whether the first motion state information conforms to the preset motion state information, and in the case of judging that the first motion state information conforms to the preset motion state information , start broadcasting or accelerate broadcasting, thus prompting the first electronic device to quickly scan the first broadcast message of the second electronic device, thus enabling the first electronic device to discover the device to be connected more quickly and establish a connection between devices quickly.
  • the first electronic device may further communicate with the target electronic device according to the scanned first broadcast message.
  • the device exchanges signaling and negotiates information, and then establishes a connection and service interaction with the target electronic device.
  • the first electronic device can establish a connection and business interaction with the target electronic device through a wireless local area network, or can establish a wireless connection with the target electronic device through Bluetooth (hereinafter referred to as a Bluetooth connection), and can also establish a wireless connection with the target electronic device through other means. connect.
  • the process of establishing a wireless connection between the first electronic device and the target electronic device is exemplified by the following first and second embodiments below.
  • the first electronic device scans the first broadcast message broadcast by the second electronic device, and the first broadcast message can be used to request the first electronic device to establish a wireless communication connection with the target electronic device.
  • the first broadcast message is used to request the first electronic device to establish a wireless communication connection with the second electronic device, and the first broadcast message may include the identifier of the second electronic device.
  • the first broadcast message may be used to request the first electronic device to establish a wireless communication connection with the third electronic device, and the first broadcast message may include an identifier of the third electronic device.
  • the step of establishing a wireless connection between the first electronic device and the target electronic device in step S330 may 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. Further, the first electronic device can establish a wireless connection and service interaction with the target electronic device through the first wireless local area network.
  • 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 the password set by default by the system, or may be set by the user according to requirements.
  • the response message may include the name and password of the Wi-Fi network.
  • the first electronic device may be connected to the first wireless local area network before sending the response message to the target electronic device, or may be connected to the first wireless local area network after sending the response message to the target electronic device. This is not limited.
  • the first electronic device detects the first motion state information of the first electronic device, and if the first motion state information conforms to the preset motion state information, Wi-Fi is triggered. -Fi scan or accelerated Wi-Fi scan.
  • the second electronic device is in a network-to-be-configured state, and broadcasts a message, for example, the broadcast message includes information about an open hotspot, and the first electronic device and the second electronic device can temporarily communicate through the open hotspot.
  • the first electronic device may determine the first distance value according to the broadcast message. If the first distance value is within the preset distance range, the first electronic device prompts whether to perform network distribution on the target electronic device.
  • the target electronic device is the second electronic device, as shown in steps S407-S410 in FIG. 10 , if the first electronic device receives the user input confirming the distribution network, the first electronic device will User input sends a response message (eg, including the name and password of the Wi-Fi network) to the second electronic device. After receiving the response message, the second electronic device extracts the name and password of the Wi-Fi network from the response message, and uses the name and password of the Wi-Fi to connect to the Wi-Fi network.
  • the first electronic device and the second electronic device can establish a wireless connection through the first wireless local area network, and further conduct business interaction.
  • the target electronic device is a third electronic device, as shown in steps S411-S414 in the dotted box in FIG. 10 , if the first electronic device receives the user input confirming the distribution network, the The first electronic device sends a response message (eg, including the name and password of the Wi-Fi network) to the third electronic device according to 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 uses the name and password of the Wi-Fi to connect to the Wi-Fi network. In the case where 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 conduct business interaction.
  • a response message eg, including the name and password of the Wi-Fi network
  • the first electronic device may selectively execute S407-S410 and S411-S414 in FIG. 10 according to the broadcast message.
  • the first electronic device may execute S407-S410 to implement the first electronic device and the second electronic device.
  • the device establishes a wireless connection; alternatively, the first electronic device may implement S411-S414 to establish a wireless connection between the first electronic device and the third electronic device.
  • the embodiments of the present application do not exclude the following implementations: the first electronic device may execute S407-S410 and S411-S414 simultaneously, so as to establish wireless connections between the first electronic device and the second electronic device and the third electronic device.
  • it can be determined according to actual use requirements, which is not limited in the embodiment of the present application.
  • the first embodiment will be described in detail below with reference to FIGS. 11 to 13 , taking as an example that 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 .
  • FIG. 11 shows a schematic diagram of the WLAN setting interface of the mobile phone.
  • the mobile phone 10 has turned on the WLAN, and the mobile phone 10 has been connected to the router Wi-Fi network (assuming Wi-Fi The name of the network is WLAN 1).
  • the user needs to establish a connection and service interaction between the mobile phone 10 and the notebook computer 20, the user can operate according to the steps shown in Figure 12 and Figure 13.
  • the mobile phone 10 and the notebook computer 20 are currently separated by a certain distance, and the user triggers the notebook computer 20 to turn on or enable the network distribution function, so that the notebook computer 20 is in the state of waiting for network distribution. At this time, the notebook computer 20 will broadcast message.
  • the mobile phone 10 passes through The first sensor (eg, an acceleration sensor) senses the behavior of "touching", and at this time, the mobile phone 10 is triggered to start scanning or accelerate scanning.
  • the first sensor eg, an acceleration sensor
  • the mobile phone 10 scans the broadcast message of the notebook computer 20, detects the distance d1 between the mobile phone 10 and the notebook computer 20, and determines that the distance d1 is within the preset distance range. In this way, the user triggers the establishment of connection and business interaction between the mobile phone 10 and the notebook computer 20 through the behavior of "touching".
  • the mobile phone 10 can display a prompt box 12 : 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, as shown in (b) of FIG. 13 , the mobile phone 10 may display a prompt box 13, displaying the name of the router Wi-Fi network currently connected to the mobile phone 10: WLAN 1, and prompting User enters 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 computer 20.
  • the mobile phone 10 may not display the prompt box 13, and the user does not need to input the Wi-Fi password, but the mobile phone 10 directly sends the name and password of the Wi-Fi network currently connected to the mobile phone.
  • the laptop 20 After receiving the name and password of the Wi-Fi network, the notebook computer 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 notebook computer 20 are connected to the same wireless local area network.
  • the mobile phone 10 and the notebook computer 20 can establish connection and service interaction through the router Wi-Fi network, and can conduct service interaction.
  • the user can directly trigger the establishment of a connection and business interaction between devices through a wireless local area network through the behavior of "touching", which achieves the effect of one-touch connection and improves the convenience of establishing a connection between devices and business interaction. .
  • the first electronic device scans the first broadcast message broadcast by the second electronic device, where the first broadcast message is used to indicate that the target electronic device is in a Bluetooth connectable state.
  • the first broadcast message may be used to indicate that the second electronic device is in a Bluetooth connectable state, wherein the first broadcast message may include the Bluetooth identification (and Bluetooth address) of the second electronic device, such as the device model of the second electronic device Can be used as the Bluetooth identification of the second electronic device.
  • the first broadcast message may be used to indicate that the third electronic device is in a Bluetooth connectable state, wherein the first broadcast message may include a Bluetooth identifier (and a Bluetooth address) of the third electronic device, such as the device of the third electronic device
  • the model number can be used as the Bluetooth identification of the third electronic device.
  • the step of establishing a connection between the first electronic device and the target electronic device in step S330 may be specifically implemented by the following steps: the first electronic device sends a connection request message to the target electronic device according to the first broadcast message; the target electronic device sends a connection request message to the target electronic device; The device receives the connection request message sent by the first electronic device, and sends a response message to the first electronic device, where the response message is used to instruct the target electronic device to confirm establishing a Bluetooth connection with the first electronic device; the first electronic device receives the message sent by the target electronic device and establishes a wireless connection with the target electronic device through Bluetooth according to the response message.
  • connection request message may include a Bluetooth identifier (eg, a device MAC address) of the first electronic device, for example, the device model of the first electronic device may be used as the Bluetooth identifier of the first electronic device.
  • the Bluetooth identifier may be set by default by the system, or may be set by the user according to requirements.
  • connection request message may also include a Bluetooth pairing code.
  • the Bluetooth pairing code is used for authentication through password pairing during the first Bluetooth connection between the devices, and does not need to be paired when the devices are reconnected. From the user's point of view, the traditional password pairing method requires inputting the pairing code on the electronic device. Of course, other pairing methods can also be used. For example, both parties only need to confirm that the random numbers displayed on the screen of the electronic device are the same, without entering the matching password.
  • 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 paired device name will be added to the paired device list in the Bluetooth settings interface.
  • reconnection after pairing also known as reconnection: after the pairing is completed, the name of the paired device is displayed in the paired device list in the Bluetooth setting interface, so if the user reconnects the first electronic
  • the device approaches and "touches" the second electronic device that is, the device needs to be reconnected
  • the first electronic device will directly prompt to connect with the target electronic device, and there is no need to pair again, that is, password-free reconnection.
  • the first electronic device detects the first motion state information of the first electronic device, and if the first motion state information conforms to the preset motion state information, the Bluetooth scan is triggered or the Bluetooth scan rate is increased. empty ratio.
  • the target electronic device is in a connectable state, and broadcasts a message through Bluetooth, for example, the broadcast may be a connectable virtual connection broadcast. If the first electronic device scans the broadcast message, the first electronic device may determine the first distance value according to 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.
  • a possible situation is that the target electronic device is the second electronic device, and if the first electronic device receives the user input confirming the Bluetooth connection, the first electronic device sends a connection request to the second electronic device according to the user input, for example, this
  • the connection request includes the Bluetooth device identification (eg, MAC address) of the first electronic device.
  • the second electronic device extracts the Bluetooth device identification from the connection request, and establishes a Bluetooth connection with the first electronic device by using the Bluetooth device identification, and can further conduct business interaction.
  • the target electronic device is a third electronic device, as shown in the dotted box in FIG. 14 , if the first electronic device receives the user input confirming the Bluetooth connection, the first electronic device will The user input sends a connection request to the third electronic device, 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 identification from the connection request, and establishes a Bluetooth connection with the first electronic device by using the Bluetooth device identification, and can further conduct business interaction.
  • the first Bluetooth connection between the devices needs to be paired, and the paired back connection does not need to be paired again.
  • the first electronic device may display prompt information to prompt that the first electronic device and the target electronic device have established a connection.
  • the target electronic device may also display prompt information 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 can perform business interaction.
  • the bluetooth low energy (BLE) connection is based on the generic attribute profile (GATT) protocol
  • GATT generic attribute profile
  • the first electronic device sends a status request message to the target electronic device, and 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, like this
  • the first electronic device learns 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 the 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 the connection.
  • 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.
  • the first electronic device may display information such as battery power and charging status reported by the target electronic device. In this way, the convenience of information transmission between devices can be improved, and the user can timely know the battery level and charging state of the target electronic device through the first electronic device, thereby improving user experience.
  • the second embodiment will be described in detail below with reference to FIGS. 15 to 18 , taking the first electronic device as the mobile phone 10 , the target electronic device as the second electronic device, and the second electronic device as the sound box 20 as examples.
  • FIG. 15 shows a schematic diagram of a Bluetooth setting interface of the mobile phone.
  • the mobile phone 10 has turned on Bluetooth.
  • the Bluetooth setting interface 14 a list of paired devices and a list of available devices are also displayed, wherein the available devices are the searched and unpaired Bluetooth devices.
  • the mobile phone 10 does not currently establish a Bluetooth connection with other devices. At this time, if the user needs to establish a Bluetooth connection between the mobile phone 10 and the speaker 20, the user can operate according to the steps shown in FIG. 16 .
  • the mobile phone 10 and the speaker 20 are currently separated by a certain distance.
  • the user triggers the speaker 20 to turn on or enable the network distribution function, so that the speaker 20 is in a connectable state.
  • the speaker 20 broadcasts messages through Bluetooth.
  • the mobile phone 10 passes the first A sensor (eg, an acceleration sensor) senses the "touch" behavior, and at this time, the mobile phone 10 is triggered to start scanning or accelerate scanning.
  • the first A sensor eg, an acceleration sensor
  • 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 business interaction between the mobile phone 10 and the speaker 20 through the behavior of "touching".
  • the mobile phone 10 can display a prompt box 15: 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 connection is established, as shown in (b) of FIG. After the user enters the pairing code for confirmation, the mobile phone 10 sends the Bluetooth name and the pairing code to the speaker 20 . After receiving the Bluetooth name and pairing code, the speaker 20 can use the Bluetooth name and pairing code to complete pairing with the mobile phone 10 and establish a Bluetooth connection.
  • the mobile phone 10 and the speaker 20 can establish a wireless connection through Bluetooth, and further conduct business interaction.
  • the speaker 20 is added to the paired device list in the Bluetooth setting interface 14 , and the “connected” icon prompts the speaker 20 to be connected to the mobile phone. 10 is connected.
  • the user can “touch” the two devices to trigger the establishment of a Bluetooth connection between the two devices, thereby realizing the effect of one-touch connection of the devices, without the need to search, search and then pair and connect through the Bluetooth setting interface.
  • a series of operations such as connection improves the convenience of establishing connections between devices and business interaction.
  • the present application provides a method for establishing a wireless connection by touch between devices.
  • the method includes the following steps S510-S530.
  • the first electronic device uses the first scan duty cycle to perform Wi-Fi scanning.
  • the Wi-Fi scan is used to discover other electronic devices around the first electronic device.
  • the first electronic device uses a second scan duty cycle to perform Wi-Fi scanning, and the second scan duty cycle is greater than the first scan duty cycle ;
  • the first electronic device When the signal quality of the first broadcast message scanned by the first electronic device satisfies the 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 .
  • the scan duty cycle refers to the time proportion of the scan window in one cycle. The smaller the probability of reaching the broadcast message, the less power is consumed accordingly. Since the second scan duty cycle is greater than the first scan duty cycle, accelerated scan can be implemented, so that the first electronic device can quickly discover other electronic devices around it.
  • the first electronic device when the first electronic device detects that the first electronic device is approaching or touching the second electronic device, the first electronic device can speed up the WiFi scanning, so that the first electronic device can quickly discover the second electronic device.
  • the two devices can be triggered to quickly establish a WiFi connection, so as to realize the effect of a one-touch connection of the devices. Since the scan duty cycle of the first electronic device becomes larger, it helps the first electronic device to scan the first broadcast signal faster, so that the first electronic device can discover the device to be connected more quickly, which is helpful for establishing a connection between devices and the speed of business interaction. And without resorting to the NFC device, the hardware requirements for the electronic device can be reduced.
  • whether the signal quality satisfies the preset condition may be determined by at least one of the following parameters: RSSI, RSRP, and SNR.
  • 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 may determine that the signal quality satisfies the preset condition.
  • the above-mentioned 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 may detect motion state information or motion parameters of the first electronic device through a built-in sensor, and determine the motion state of the device according to the motion state information or motion parameters.
  • the above 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, it may be any other sensor that meets the actual use requirements.
  • the above method for establishing a wireless connection by touch between devices further includes: the first electronic device displays a first prompt message, The first prompt message is used to prompt whether to establish a Wi-Fi connection with the second electronic device.
  • establishing a Wi-Fi connection between the first electronic device and the second electronic device includes: the first electronic device establishes a Wi-Fi connection with the second electronic device in response to the user's confirming the connection operation on the first prompt message.
  • the above-mentioned method for establishing a wireless connection by touching the devices further includes: the first electronic device sends a connection with the first service to the second electronic device relevant first service data; and/or, the first electronic device receives the first service data sent by the second electronic device.
  • the above method for establishing a wireless connection by touch between devices further 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 to the second electronic device message, the first instruction 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 broadcasting frequency of the second electronic device is increased, it is helpful for the second electronic device to be discovered more quickly, which is helpful for establishing the connection between devices and the speed of service interaction.
  • the first broadcast message includes device identification and Wi-Fi channel information of the second electronic device.
  • establishing a Wi-Fi connection between the first electronic device and 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.
  • the Wi-Fi channel information may indicate a Wi-Fi channel supported by the second electronic device, and the first electronic device may 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 communicates with the second electronic device.
  • the second electronic device establishes a Wi-Fi connection based on the Wi-Fi channel information.
  • the above-mentioned first broadcast message further includes a device identification of the third electronic device.
  • the method for establishing a wireless connection by touching between devices further includes: establishing a Wi-Fi connection between the first electronic device and the third electronic device.
  • the first electronic device may include a hardware structure and/or software modules, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is performed 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.
  • FIG. 20 is a schematic block diagram of an apparatus 600 for establishing a wireless connection according to an embodiment of the present application.
  • the apparatus 600 is a first electronic device, and the apparatus 600 includes a detection unit 610 and a wireless communication unit 620;
  • the detection unit 610 is configured to detect the first motion state information of the first electronic device through the first sensor, and detect the first distance value between the first electronic device and the second electronic device;
  • the wireless communication unit 620 is configured 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;
  • the target electronic device is a second electronic device or a third electronic device indicated by the second electronic device through a broadcast message.
  • the first sensor is a sensor for detecting movement and/or touch of the first electronic device
  • the above-mentioned preset motion state information is used to indicate that the first electronic device moves toward the second electronic device and/or contact with the second electronic device.
  • the above-mentioned 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, it may also be any other sensor that meets actual use requirements.
  • the first sensor is an acceleration sensor
  • the first motion state information includes a plurality of speed values or acceleration values that change with time
  • 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.
  • the apparatus 600 for establishing a wireless connection further includes a processing unit, where the processing unit is configured to detect the first motion state information of the first electronic device after the detection unit 610 detects the first motion state information of the first electronic device through the first sensor. , if the first motion state information conforms to the preset motion state information, execute the first action, and the first action includes any one of the following: turning on the scanning function of the first electronic device, and when the scanning function of the first electronic device is turned on to increase the scan duty cycle.
  • the wireless communication unit 620 is further configured to send a first indication message to the second electronic device if the first motion state information conforms to the preset motion state information, where the first indication message is used to indicate the second
  • the electronic device performs a second action; wherein 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 enabled .
  • the processing unit is configured to calculate the first distance value according to the first broadcast message when the first broadcast message broadcast by the second electronic device is scanned.
  • the above-mentioned first broadcast message includes a device identifier of the target electronic device and first channel information, where the second channel information is used to indicate a Wi-Fi channel or a Bluetooth channel.
  • the wireless communication unit 620 is specifically configured to establish a wireless connection with the target electronic device through Wi-Fi or Bluetooth according to the first broadcast message.
  • the first broadcast message includes the device identification of the target electronic device.
  • the wireless communication unit 620 is specifically configured to: send a response message to the target electronic device according to the scanned first broadcast message, where the response message includes the device identification of the first electronic device and second channel information, where the second channel information is used to indicate Wi-Fi channel or Bluetooth channel; according to the first broadcast message and the response message, establish a wireless connection with the first electronic device through Wi-Fi or Bluetooth.
  • the wireless communication unit 620 is specifically configured to: send first service data related to the first service to the target electronic device; or receive first service data sent by the target electronic device.
  • the apparatus 600 for establishing a wireless connection provided in this embodiment of the present application further includes a display unit, where the display unit is configured to display a first prompt message, where the first prompt message is used to prompt whether to establish a connection with the target electronic device Wireless connections.
  • the wireless communication unit 620 is specifically configured to establish a wireless connection between the first electronic device and the target electronic device in the case of receiving the user's confirmation connection operation on the first prompt message.
  • An embodiment of the present application provides an apparatus for establishing a wireless connection, which can establish a wireless connection by detecting that the motion state information of the first electronic device conforms to the preset motion state information and detecting that the distance between the first electronic device and the second electronic device is in a Within the preset distance range of the connection, the first electronic device and the second electronic device or other electronic devices associated with the second electronic device can be triggered to quickly establish a connection and business interaction. Since the above-mentioned method for establishing a wireless connection by touching between devices does not require the aid of an NFC device, that is, it is not necessary to trigger the connection and service interaction between electronic devices through the close contact between the NFC card reader and the NFC tag, the device provided by the embodiment of the present application can reduce the Hardware requirements for electronic equipment.
  • the apparatus 600 may correspond to executing the methods described in the embodiments of the present application, and the above-mentioned and other operations and/or functions of the modules in the apparatus 600 are respectively to implement the corresponding processes of the methods, and are not described herein for brevity. Repeat.
  • FIG. 21 is a schematic block diagram of an apparatus 700 for establishing a wireless connection according to an embodiment of the present application.
  • the apparatus 700 is a second electronic device, and the apparatus 700 includes a wireless communication unit 710;
  • the wireless communication unit 710 is configured 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 satisfies the preset motion state information and the first distance value is within the preset distance range ;
  • 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 the third electronic device indicated by the second electronic device through a broadcast message.
  • the above-mentioned preset motion state information is used to indicate that the first electronic device moves toward and/or touches the second electronic device.
  • the wireless communication unit 710 is further configured to receive the first indication message sent by the first electronic device when the first motion state information satisfies the preset motion state information, and perform a second action, the The second action includes any one of the following: starting to broadcast the first broadcast message, increasing the frequency of broadcasting the first broadcast message when the broadcast function of the second electronic device is enabled, and the first instruction message is used to instruct the second electronic device Perform the second action.
  • the apparatus 700 for establishing a wireless connection provided by this embodiment of the present application further includes a detection unit 720, and the detection unit 720 is configured to detect the first motion state information; When the motion state information satisfies 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.
  • the above-mentioned first broadcast message includes the device identification of the target electronic device and the first channel information.
  • the wireless communication unit 710 is specifically configured to establish a wireless connection with the first electronic device through Wi-Fi or Bluetooth according to the first broadcast message.
  • the first broadcast message includes a device identification of the target electronic device.
  • the wireless communication unit 710 is specifically configured to: receive a response message sent by the first electronic device, where the response message includes a device identifier of the first electronic device and second channel information, where the second channel information is used to indicate a Wi-Fi channel or a Bluetooth channel ; According to the first broadcast message and the response message, establish a wireless connection with the first electronic device through Wi-Fi or Bluetooth.
  • the target electronic device is further configured to receive first service data related to the first service sent by the first electronic device; or, send the first service data to the first electronic device.
  • the above-mentioned apparatus 600 for establishing a wireless connection may be the electronic device 10 in FIG. 1
  • the above-mentioned detecting unit 610 may be the sensor module 180 in the electronic device 10
  • the above-mentioned wireless communication unit 620 may be
  • the above-mentioned display unit may be the display screen 194 in the electronic device 10
  • the above-mentioned apparatus 700 for establishing a wireless connection may be the electronic device 20 in FIG.
  • FIG. 22 is a schematic structural diagram of a system 800 for establishing a wireless connection provided by 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 apparatus 600 in the foregoing embodiment; the second electronic device 820 may correspond to the apparatus 700 in the foregoing embodiment.
  • FIG. 23 is a schematic structural diagram of an electronic device 900 provided by 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 .
  • the processor 910 in the electronic device 900 shown in FIG. 23 may correspond to the detection unit 610 in the apparatus 600 in FIG. 20
  • the communication interface 930 may correspond to the apparatus 600 in FIG. 20
  • the wireless communication unit 620 may correspond to the apparatus 600 in FIG. 20 .
  • the processor 910 can be connected with the memory 920 .
  • the memory 920 may be used to store the program codes and data. Therefore, the memory 920 may be a storage unit within the processor 910 , or may be an external storage unit independent of the processor 910 , or may include a storage unit within the processor 910 and an external storage unit independent of the processor 910 . part.
  • 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 through the bus 940 .
  • the bus 940 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus 940 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one line is shown in Figure 23, but it does not mean that there is only one bus or one type of bus.
  • the processor 910 may adopt a central processing unit (central processing unit, CPU).
  • the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs off-the-shelf programmable gate arrays
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the processor 910 uses one or more integrated circuits to execute related programs to implement the technical solutions provided by the embodiments of the present application.
  • the memory 920 which may include read-only memory and random access memory, provides instructions and data to the processor 910 .
  • a portion of processor 910 may also include non-volatile random access memory.
  • the processor 910 may also store device type information.
  • the processor 910 executes the computer-executed instructions in the memory 920 to perform the operation steps of the above-mentioned method through the apparatus 600 .
  • the electronic device 900 may correspond to the apparatus 600 in the embodiment of the present application, and the above and other operations and/or functions of each unit in the apparatus 600 are for the purpose of implementing the corresponding flow of the method, and for the sake of brevity , and will not be repeated here.
  • embodiments of the present application further provide a computer-readable medium, where program codes are stored in the computer-readable medium, and when the computer program codes are run on a computer, the computer can execute the above aspects method in .
  • the embodiments of the present application further provide a computer program product
  • the computer program product includes: computer program code, when the computer program code runs on the computer, the computer program code enables the computer to perform the above aspects.
  • 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.
  • the hardware layer may include hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory).
  • the operating system of the operating system layer may be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system.
  • the application layer may include applications such as browsers, address books, word processing software, and instant messaging software.
  • Computer readable media may include, but are not limited to, magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs), etc. ), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), cards, stick or key drives, etc.).
  • magnetic storage devices eg, hard disks, floppy disks, or magnetic tapes, etc.
  • optical disks eg, compact discs (CDs), digital versatile discs (DVDs), etc.
  • smart cards and flash memory devices eg, erasable programmable read-only memory (EPROM), cards, stick or key drives, etc.
  • 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.
  • processors mentioned in the embodiments of the present application may be a central processing unit (central processing unit, CPU), and may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits ( application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, 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 be any conventional processor or the like.
  • the memory mentioned in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory RAM.
  • RAM can be used as an external cache.
  • 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 (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and Direct memory bus random access memory (direct rambus RAM, DR RAM).
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • Direct memory bus random access memory direct rambus RAM, DR RAM
  • the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components
  • the memory storage module
  • memory described herein is intended to include, but not be limited to, these and any other suitable types of memory.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the above-mentioned units or modules is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined. Either it can be integrated into another system, or some features can be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
  • the units described above as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the technical solution of the present application can be embodied in the form of a computer software product, and the computer software product is stored in a storage
  • the computer software product includes several instructions, the instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium can include, but is not limited to: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other various programs that can be stored medium of code.

Abstract

本申请提供了一种设备间触碰建立无线连接的方法、电子设备及芯片,涉及短距离通信技术领域。在检测到第一电子设备靠近或触碰第二电子设备时,第一电子设备可加速扫描,例如增大WiFi扫描频率或者蓝牙扫描占空比,使得第一电子设备快速发现第二电子设备,此时第一电子设备扫描到的第二电子设备的广播消息信号质量满足预设条件,即可触发这两个设备快速建立WiFi连接,从而实现设备一碰连的效果。本申请方案可以快速触发启动电子设备间连接及业务交互,而无需借助于NFC装置,可降低对电子设备的硬件要求。

Description

设备间触碰建立无线连接的方法、电子设备及芯片
本申请要求于2020年09月30日提交国家知识产权局、申请号为202011070213.3、申请名称为“设备间触碰建立无线连接的方法、电子设备及芯片”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及短距离通信技术领域,并且更具体地涉及通信领域中的一种设备间触碰建立无线连接的方法、电子设备、芯片及计算机可读存储介质。
背景技术
随着移动互联网和智能电子设备的发展,不同智能电子设备之间的业务互动越来越普及,例如手机、台式机、平板电脑、电视机、音箱等智能电子设备相互之间可以实现文件(例如图片、视频、音频、文本等)分享、投屏显示、无线操控等业务互动。其中,在设备间传输业务数据之前需要在设备间建立支持传输业务数据的连接,例如蓝牙连接,无线局域网(wireless local area network,WLAN)连接等。
目前,借助于NFC靠近感应功能,可以通过NFC感应来触发电子设备间快速建立连接,例如将具有NFC功能的两个电子设备(简称为NFC设备)的NFC感应区域紧贴,即可在两个NFC设备间快速建立蓝牙配对或者WLAN直连,而无需手动查找设备、配对和输入密码等操作。
示例性的,以手机与平板电脑进行蓝牙配对为例,在手机NFC功能已开启的情况下,若手机的NFC感应区域(该区域设置有NFC读卡器)紧贴平板电脑的NFC标签区域,则手机会显示“蓝牙配对请求”提示框,若确认配对,则即可快速建立蓝牙配对。其中,当手机紧贴平板电脑的NFC标签区域时,NFC标签可以从NFC读卡器获得很小的电源并以此驱动NFC标签的电路,将NFC标签的标签信息传输到NFC读卡器,一旦NFC读卡器接收到该标签信息,即可触发电子设备间快速建立连接。
然而,在上述触发电子设备间连接的过程中,前提条件是两个电子设备设置有NFC装置(例如NFC读卡器、NFC标签),并且这两个电子设备需要将各自的NFC感应区域紧贴,才能触发建立设备间连接。也就是说,如果两个电子设备中的任一电子设备不具有NFC功能(目前很多电子设备中未设置NFC装置),或者两个电子设备的NFC感应区域未紧贴,则无法通过上述方法触发电子设备间连接,从而无法实现快速启动电子设备间互动业务的目的。
发明内容
本申请提供了一种设备间触碰建立无线连接的方法、电子设备、芯片及计算机可读存储介质,可以解决相关技术中由于受NFC硬件限制而引起无法触发在电子设备间建立连接的问题。
第一方面,本申请提供了一种设备间触碰建立无线连接的方法,所述方法包括:第一电子设备采用第一扫描占空比进行无线保真(wireless fidelity,Wi-Fi)扫描,所述Wi-Fi扫描用于发现所述第一电子设备周围的其他电子设备;在所述第一电子设备 检测到所述第一电子设备处于预设运动状态时,所述第一电子设备采用第二扫描占空比进行Wi-Fi扫描,所述第二扫描占空比大于所述第一扫描占空比;在所述第一电子设备扫描到的第一广播消息的信号质量满足预设条件时,所述第一电子设备与第二电子设备建立Wi-Fi连接,所述第一广播消息为所述第二电子设备发送的消息。
其中,扫描占空比指一个周期内扫描窗口的时间占比,扫描占空比越大,则扫描到广播消息的概率越大,相应地耗电越多;扫描占空比越小,则扫描到广播消息的概率越小,相应地耗电越少。由于第二扫描占空比大于第一扫描占空比,这样可实现加速扫描,使得第一电子设备快速发现周围的其他电子设备。
通过上述方案,在第一电子设备检测到第一电子设备靠近或触碰第二电子设备时,第一电子设备可加速WiFi扫描,使得第一电子设备快速发现第二电子设备,此时第一电子设备扫描到的第二电子设备的广播消息信号质量满足预设条件,即可触发这两个设备快速建立WiFi连接,从而实现设备一碰连的效果。由于第一电子设备的扫描占空比变大,因此有助于第一电子设备加速扫描到第一广播信号,使第一电子设备能更快发现待连接设备,如此有助于建立设备间连接及业务交互的速度。并且无需借助于NFC装置,可降低对电子设备的硬件要求。
可选的,可以通过下述至少一项参数来判断信号质量是否满足预设条件:接收信号强度(received signal strength indication,RSSI)、接收的参考信号功率(reference signal received power,RSRP)、信号与噪声比(signal-to-noise ratio,SNR)。示例性的,以RSSI为例,在第一电子设备接收到的第一广播消息的RSSI值大于预设阈值时,第一电子设备可以确定信号质量满足预设条件。
在第一方面的可能实现方式中,所述预设运动状态包括以下至少一项:所述第一电子设备朝向所述第二电子设备移动,所述第一电子设备与所述第二电子设备触碰。其中,第一电子设备可以通过内置的传感器检测第一电子设备的运动状态信息或运动参数,并根据该运动状态信息或运动参数确定设备运动状态。
示例性的,上述传感器可以为以下至少一种:加速度传感器,接近光传感器,霍尔传感器,陀螺仪传感器,当然还可能为其他任意满足实际使用需求的传感器。
在第一方面的可能实现方式中,在所述第一电子设备接收到的第一广播消息的信号质量满足预设条件之后,所述方法还包括:所述第一电子设备显示第一提示消息,所述第一提示消息用于提示是否与所述第二电子设备建立Wi-Fi连接。此时,所述第一电子设备与所述第二电子设备建立Wi-Fi连接,包括:所述第一电子设备响应于用户在所述第一提示消息上的确认连接操作,与所述第二电子设备建立Wi-Fi连接。这样可以根据用户实际使用需求,实现设备一碰连,从而提升用户使用体验。
在第一方面的可能实现方式中,在所述第一电子设备与所述第二电子设备建立Wi-Fi连接之后,所述方法还包括:所述第一电子设备向所述第二电子设备发送与第一业务相关的第一业务数据;和/或,所述第一电子设备接收所述第二电子设备发送的所述第一业务数据。这样,在设备一碰连之后实现设备之间的业务数据快速交互,提升了设备间的互动体验功能。
在第一方面的可能实现方式中,所述方法还包括:在所述第一电子设备检测到所述第一电子设备处于所述预设运动状态时,所述第一电子设备向所述第二电子设备发 送第一指示消息,所述第一指示消息用于指示所述第二电子设备开始广播所述第一广播消息或者增大广播所述第一广播消息的频率。由于第二电子设备的广播频率变大,因此有助于第二电子设备被更快发现,如此有助于建立设备间连接及交互的速度。
在第一方面的可能实现方式中,所述第一广播消息包括所述第二电子设备的设备标识和Wi-Fi信道信息。其中,所述第一电子设备与所述第二电子设备建立Wi-Fi连接,包括:所述第一电子设备基于所述第一广播消息与所述第二电子设备建立Wi-Fi连接。
其中,Wi-Fi信道信息可以指示第二电子设备支持的Wi-Fi信道,第一电子设备可以根据第二电子设备的设备标识,向第二电子设备发送连接请求消息,进而第一电子设备与所述第二电子设备基于Wi-Fi信道信息建立Wi-Fi连接。
在第一方面的可能实现方式中,所述第一广播消息还包括第三电子设备的设备标识;所述方法还包括:所述第一电子设备与所述第三电子设备建立Wi-Fi连接。这样,本申请实施例不但实现两个设备一碰连的效果,而且可以实现更多个设备一碰连的效果。
第二方面,本申请提供了一种电子设备,该电子设备包括用于执行上述第一方面中的方法的单元。
第三方面,本申请提供了一种电子设备,所述电子设备为第一电子设备,所述电子设备包括无线短距离通信芯片和传感器;
所述无线短距离通信芯片,用于采用第一扫描占空比进行扫描,所述扫描用于发现所述第一电子设备周围的其他电子设备;
所述传感器,用于检测所述第一电子设备相对于所述其他电子设备的运动状态;
所述无线短距离通信芯片,还用于在所述传感器检测到所述第一电子设备处于预设运动状态时,采用第二扫描占空比进行扫描,所述第二扫描占空比大于所述第一扫描占空比;
所述无线短距离通信芯片,用于在所述第一电子设备扫描到的第一广播消息的信号质量满足预设条件时,将所述第一电子设备与所述第二电子设备建立无线连接,所述第一广播消息为所述第二电子设备发送的消息。
在第三方面的可能实现方式中,所述预设运动状态包括以下至少一项:所述第一电子设备朝向所述第二电子设备移动,所述第一电子设备与所述第二电子设备触碰。
在一些实施例中,上述电子设备还包括显示屏,所述显示屏用于在所述无线短距离通信芯片扫描到的第一广播消息的信号质量满足预设条件之后,显示第一提示消息,所述第一提示消息用于提示是否与所述第二电子设备建立无线连接。所述无线短距离通信芯片,具体用于响应于用户在所述第一提示消息上的确认连接操作,与所述第二电子设备建立无线连接。
在第三方面的可能实现方式中,所述无线短距离通信芯片还用于:在所述第一电子设备与所述第二电子设备建立无线连接之后,向所述第二电子设备发送与第一业务相关的第一业务数据;和/或,接收所述第二电子设备发送的所述第一业务数据。
在第三方面的可能实现方式中,所述无线短距离通信芯片还用于:在所述传感器检测到所述第一电子设备处于所述预设运动状态时,向所述第二电子设备发送第一指 示消息,所述第一指示消息用于指示所述第二电子设备开始广播所述第一广播消息或者增大广播所述第一广播消息的频率。
在第三方面的可能实现方式中,所述第一广播消息包括所述第二电子设备的设备标识和信道信息。所述无线短距离通信芯片,具体用于基于所述第一广播消息将所述第一电子设备与所述第二电子设备建立无线连接。
在第三方面的可能实现方式中,所述第一广播消息还包括第三电子设备的设备标识。所述无线短距离通信芯片,还用于将所述第一电子设备与所述第三电子设备建立无线连接。
在第三方面的可能实现方式中,所述无线短距离通信芯片为无线保真Wi-Fi芯片或者蓝牙芯片。
第四方面,本申请提供了一种设备间触碰建立无线连接的方法,该方法包括:第一电子设备通过第一传感器检测第一电子设备的第一运动状态信息;第一电子设备检测第一电子设备和第二电子设备之间的第一距离值;在第一运动状态信息符合预设运动状态信息且第一距离值在预设距离范围内的情况下,第一电子设备与目标电子设备建立无线连接;其中,所述目标电子设备为所述第二电子设备或者为所述第二电子设备通过广播消息指示的第三电子设备。
通过上述方案,通过检测到第一电子设备的运动状态信息符合预设运动状态信息并且检测到第一电子设备和第二电子设备的距离处于可以建立无线连接的预设距离范围内,即可触发第一电子设备与第二电子设备或第二电子设备关联的其他电子设备快速建立无线连接。由于上述设备间触碰建立无线连接的方法无需借助于NFC装置,即无需通过NFC读卡器和NFC标签紧贴来触发启动电子设备间连接及交互,因此本申请实施例提供的建立电子设备间连接及交互的方案可以降低对电子设备的硬件要求。
在第四方面的可能实现方式中,所述第一传感器为用于检测所述第一电子设备移动和/或触碰的传感器,所述预设运动状态信息用于指示所述第一电子设备朝向所述第二电子设备移动和/或与所述第二电子设备碰触。
示例性的,所述第一传感器可以为以下至少一种:加速度传感器,接近光传感器,霍尔传感器,陀螺仪传感器,当然还可能为其他任意满足实际使用需求的传感器。例如,第一传感器为加速度传感器,所述第一运动状态信息包括随时间变化的多个速度值或加速度值,所述预设运动状态信息指示速度值或加速度值发生变化且变化量大于预设阈值。
在第四方面的可能实现方式中,在第一电子设备通过第一传感器检测所述第一电子设备的第一运动状态信息之后,所述方法还包括:若所述第一运动状态信息符合所述预设运动状态信息,则所述第一电子设备执行第一动作,所述第一动作包括以下任一项:开启所述第一电子设备的扫描功能,在所述第一电子设备的扫描功能开启的情况下增大扫描占空比。
由于第一电子设备的扫描占空比变大,因此有助于第一电子设备加速扫描到第一广播信号,使第一电子设备能更快发现待连接设备,如此间接地有助于建立设备间连接及交互的速度。
在第四方面的可能实现方式中,在第一电子设备通过第一传感器检测所述第一电 子设备的第一运动状态信息之后,所述方法还包括:若所述第一运动状态信息符合所述预设运动状态信息,则所述第一电子设备向所述第二电子设备发送第一指示消息,所述第一指示消息用于指示执行第二动作;其中,所述第二动作包括以下任一项:开始广播第一广播消息,在所述第二电子设备的广播功能开启的情况下增大广播所述第一广播消息的频率。
在第四方面的可能实现方式中,所述第一电子设备检测所述第一电子设备和第二电子设备之间的第一距离值,包括:在所述第一电子设备扫描到所述第二电子设备广播的第一广播消息的情况下,所述第一电子设备根据所述第一广播消息,计算所述第一距离值。
在第四方面的可能实现方式中,所述第一广播消息包括所述目标电子设备的设备标识和第一信道信息,所述第一信道信息用于指示Wi-Fi信道或者蓝牙(bluetooth,BT)信道。所述第一电子设备与目标电子设备建立无线连接,包括:所述第一电子设备根据所述第一广播消息,与所述目标电子设备通过Wi-Fi或者蓝牙建立无线连接。
其中,目标电子设备的设备标识为用于唯一表示目标电子设备的标识,例如媒体访问控制(media access control,MAC)地址。第一信道信息指示用于建立无线连接的信道,例如以Wi-Fi信道为例,第一信道信息可以指示第1信道至第13信道中的一个信道。
在第四方面的另一可能实现方式中,所述第一广播消息包括所述目标电子设备的设备标识;所述第一电子设备与目标电子设备建立无线连接,包括:第一电子设备在扫描到第一广播消息的情况下,根据第一广播消息,向所述目标电子设备发送响应消息,所述响应消息包括所述第一电子设备的设备标识和第二信道信息,所述第二信道信息用于指示Wi-Fi信道或者蓝牙信道;所述第一电子设备根据所述第一广播消息和所述响应消息,与所述目标电子设备通过Wi-Fi或者蓝牙建立无线连接。
其中,第一电子设备的设备标识为用于唯一表示第一电子设备的标识。第二信道信息指示用于建立无线连接的信道。
可选的,第一广播消息还可以包括目标密码,该目标密码用于建立无线连接时进行认证,以提升无线连接的安全性。
在第四方面的可能实现方式中,所述第一电子设备与目标电子设备建立无线连接,包括:所述第一电子设备向所述目标电子设备发送与第一业务相关的第一业务数据;或者,所述第一电子设备接收所述目标电子设备发送的所述第一业务数据。
在第四方面的可能实现方式中,在所述第一电子设备与目标电子设备建立无线连接之前,所述方法还包括:所述第一电子设备显示第一提示消息,所述第一提示消息用于提示是否与所述目标电子设备建立无线连接;
所述第一电子设备与目标电子设备建立无线连接,包括:所述第一电子设备在接收到用户在所述第一提示消息上的确认连接操作的情况下,与所述目标电子设备建立无线连接。
第五方面,本申请提供了一种设备间触碰建立无线连接的方法,该方法包括:在第一电子设备的第一运动状态信息满足预设运动状态信息且第一距离值在预设距离范围内的情况下,目标电子设备与所述第一电子设备建立无线连接。其中,所述第一距 离值用于指示所述第一电子设备和所述第二电子设备之间的距离,所述目标电子设备为所述第二电子设备或者为所述第二电子设备通过广播消息指示的第三电子设备。
在第五方面的可能实现方式中,所述预设运动状态信息用于指示所述第一电子设备朝向所述第二电子设备移动和/或与所述第二电子设备触碰。
在第五方面的可能实现方式中,所述方法还包括:在所述第一运动状态信息满足所述预设运动状态信息的情况下,所述第二电子设备接收所述第一电子设备发送的第一指示消息,所述第一指示消息用于指示所述第二电子设备执行第二动作;所述第二电子设备执行第二动作,所述第二动作包括以下任一项:开始广播第一广播消息,在所述第二电子设备的广播功能开启的情况下增大广播所述第一广播消息的频率。
在第五方面的可能实现方式中,所述方法还包括:所述第二电子设备检测所述第一运动状态信息;所述第二电子设备判断所述第一运动状态信息满足所述预设运动状态信息;所述第二电子设备执行第三动作,所述第三动作包括以下任一项:开始广播第一广播消息,增大广播所述第一广播消息的频率。
在第五方面的可能实现方式中,所述第一广播消息包括所述目标电子设备的设备标识和第一信道信息,所述第第一信道信息用于指示Wi-Fi信道或者蓝牙信道。所述目标电子设备与所述第一电子设备建立无线连接,包括:所述目标电子设备根据所述第一广播消息,与所述第一电子设备通过Wi-Fi或者蓝牙建立无线连接。
在第五方面的另一可能实现方式中,所述第一广播消息包括所述目标电子设备的设备标识;所述目标电子设备与所述第一电子设备建立无线连接,包括:所述目标电子设备接收所述第一电子设备发送的响应消息,所述响应消息包括所述第一电子设备的设备标识和第二信道信息,所述第二信道信息用于指示Wi-Fi信道或者蓝牙信道;所述目标电子设备根据所述第一广播消息和所述响应消息,与所述第一电子设备通过Wi-Fi或者蓝牙建立无线连接。
在第五方面的可能实现方式中,在所述目标电子设备与所述第一电子设备建立无线连接之后,所述方法还包括:所述目标电子设备接收所述第一电子设备发送的与第一业务相关的第一业务数据;或者,所述目标电子设备向所述第一电子设备发送所述第一业务数据。
第六方面,本申请提供了一种建立无线连接的装置,该装置包括用于执行上述第四方面中的方法的单元。
第七方面,本申请提供了一种建立无线连接的装置,该装置包括用于执行上述第五方面中的方法的单元。
第八方面,本申请提供了一种无线通信系统,该系统包括第一电子设备和第二电子设备;该系统用于执行第一方面和/或第四方面和/或第五方面中的方法。
第九方面,本申请提供一种电子设备,所述电子设备包括处理器,处理器与存储器耦合,存储器用于存储计算机程序或指令,处理器用于执行存储器存储的计算机程序或指令,使得第一方面和/或第四方面和/或第五方面中的方法被执行。例如,处理器用于执行存储器存储的计算机程序或指令,使得该电子设备执行第一方面和/或第四方面和/或第五方面中的方法。
第十方面,本申请提供一种计算机可读存储介质,其上存储有用于实现第一方面 和/或第二方面中的方法的计算机程序(也可称为指令或代码)。例如,该计算机程序被计算机执行时,使得该计算机可以执行第一方面和/或第四方面和/或第五方面中的方法。
第十一方面,本申请提供一种芯片,包括处理器。处理器用于读取并执行存储器中存储的计算机程序,以执行第一方面和/或第四方面和/或第五方面中的方法。可选地,所述芯片还包括存储器,存储器与处理器通过电路或电线连接。可选的,所述芯片为无线短距离通信芯片,例如Wi-Fi芯片或蓝牙芯片。
第十二方面,本申请提供一种计算机程序产品,所述计算机程序产品包括计算机程序(也可称为指令或代码),所述计算机程序被计算机执行时使得所述计算机实现第一方面和/或第四方面和/或第五方面中的方法。
附图说明
图1是本申请实施例提供的一种系统架构示意图。
图2是本申请实施例提供的一种电子设备的结构示意图。
图3是本申请实施例提供的一种设备间触碰建立无线连接的方法的流程示意图之一。
图4是本申请实施例提供的一种加速度传感器应用于电子设备的示意图。
图5是本申请实施例提供的一种加速度传感器检测得到的合加速度波形的示意图。
图6是本申请实施例提供的一种设备间触碰建立无线连接的方法的流程示意图之二。
图7是蓝牙扫描窗口和扫描间隔的示意图。
图8是正常扫描模式、省电扫描模式和加速扫描模式的对比示意图。
图9是本申请实施例提供的一种设备间触碰建立无线连接的方法的流程示意图之三。
图10是本申请实施例提供的一种设备间触碰建立无线连接的方法的流程示意图之四。
图11至图13是本申请实施例提供的一种设备间触碰建立无线连接的方法应用的界面及场景示意图。
图14是本申请实施例提供的另一种设备间触碰建立无线连接的方法的流程示意图之五。
图15至图18是本申请实施例提供的另一种设备间触碰建立无线连接的方法应用的界面及场景示意图。
图19是本申请实施例提供的另一种设备间触碰建立无线连接的方法的流程示意图之六。
图20和图21是本申请实施例提供的一种建立无线连接的装置的示意性框图。
图22是本申请实施例提供的一种建立无线连接的系统的示意图。
图23是本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
在本申请的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A 或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。并且,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,本申请实施例中所述的“第一”和“第二”等是用于区别不同的对象,或者用于区别对同一对象的不同处理,而不是用于描述对象的特定顺序。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
本申请实施例提供了一种电子设备10,该电子设备10可以应用于如图1所示的通信系统100。该通信系统100可以包括电子设备10和至少一个电子设备20。
电子设备10可以通过无线通信技术与电子设备20建立无线连接。例如,该无线通信技术可以是蓝牙(bluetooth,BT),可以是传统蓝牙或者低功耗BLE蓝牙,无线局域网(wireless local area networks,WLAN)(如Wi-Fi网络),Zigbee,调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR),或通用2.4G/5G频段无线通信技术等。该无线连接为利用该无线通信技术建立的连接。本申请实施例对无线通信技术的类型不予具体限定。
其中,电子设备10可以为移动终端。示例性的,电子设备10可以为手机(如图1所示)、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等移动终端。电子设备20可以为移动终端,也可以为非移动终端。示例性的,电子设备20可以为手机、平板电脑、笔记本电脑、掌上电脑、可穿戴设备、UMPC、上网本或者PDA、无线耳机、无线手环、无线智能眼镜、无线手表、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、台式计算机、无线车载、智能家电(例如电视、音箱、冰箱、空气净化器、空调、电饭煲)等。其中,电子设备20也可以被统称为物联网(Internet of Things,IoT)设备。本申请实施例对电子设备10和电子设备20的设备类型不予具体限定。
图2示出了一种电子设备10的结构示意图。电子设备10可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理单元141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传 感器180H,温度传感器180I,触摸传感器180J,环境光传感器180K以及骨传导传感器180L等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备10的具体限定。在本申请另一些实施例中,电子设备10可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备10的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。该接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备10的结构限定。在本申请另一些实施例中,电子设备10也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备10的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理单元141为电子设备供电。
电源管理单元141用于连接电池142,充电管理模块140与处理器110。电源管理单元141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193和无线通信模块160等供电。电源管理单元141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理单元141也可以设置于处理器110中。在另一些实施例中,电源管理单元141和充电管理模块140也可以设置于同一个器件中。
电子设备10的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备10中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备10上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器、开关、功率放大器、低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A、受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备10上的包括WLAN(如Wi-Fi)、BT、全球导航卫星系统(global navigation satellite system,GNSS)、FM、NFC、IR或通用2.4G/5G无线通信技术等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频、放大,经天线2转为电磁波辐射出去。
在一些实施例中,该无线通信模块160可以为蓝牙芯片。电子设备10可以通过该蓝牙芯片,与无线耳机等电子设备的蓝牙芯片之间进行配对并建立连接,以通过该连接实现电子设备10和其他电子设备之间的无线通信和业务处理。蓝牙芯片通常可以支持BR/EDR蓝牙和BLE。
在一些实施例中,电子设备10的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备10可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(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,和/或IR 技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备10通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备10可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备10可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点、亮度、肤色进行算法优化。ISP还可以对拍摄场景的曝光、色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备10可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备10在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备10可以支持一种或多种视频编解码器。这样,电子设备10可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备10的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备10的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备10的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备10使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
处理器110可以用于执行上述程序代码,调用相关模块以实现本申请实施例中电子设备的功能。例如,与无线耳机进行配对;在有音频业务时,根据音频业务的优先级向无线耳机发送连接请求信息;建立/断开与无线耳机之间的物理连接或虚拟连接等功能。
电子设备10可以通过音频模块170中的扬声器170A、受话器170B、麦克风170C、耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备10可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备10接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备10可以设置至少一个麦克风170C。在另一些实施例中,电子设备10可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备10还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间 的电容改变。电子设备10根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备10根据压力传感器180A检测触摸操作强度。电子设备10也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备10的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备10围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备10抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备10的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
加速度传感器180E可检测电子设备10在各个方向上(一般为三轴)加速度的大小。当电子设备10静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F用于测量距离。电子设备10可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备10可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(light-emitting diode,LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备10通过发光二极管向外发射红外光。电子设备10使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备10附近有物体。当检测到不充分的反射光时,电子设备10可以确定电子设备10附近没有物体。电子设备10可以利用接近光传感器180G检测用户手持电子设备10贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180K用于感知环境光亮度。电子设备10可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180K也可用于拍照时自动调节白平衡。环境光传感器180K还可以与接近光传感器180G配合,检测电子设备10是否在口袋里,以防误触。
气压传感器180C用于测量气压。在一些实施例中,电子设备10通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备10可以利用磁传感器180D检测电子设备10的位移。在一些实施例中,霍尔传感器可以利用磁铁形成线性的梯形磁场(或称为斜坡磁场),霍尔片在线性磁场中的位移变化与磁场强度变化相一致,形成的霍尔电势也就与位移成正比,电子设备10获取霍尔电势,就可以测量出位移大小。
指纹传感器180H用于采集指纹。电子设备10可以利用采集的指纹特性实现指纹解锁,访问应用锁、指纹拍照、指纹接听来电等。
温度传感器180I用于检测温度。在一些实施例中,电子设备10利用温度传感器 180I检测的温度,执行温度处理策略。例如,当温度传感器180I上报的温度超过阈值,电子设备10执行降低位于温度传感器180I附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备10对电池142加热,以避免低温导致电子设备10异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备10对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180J,也称“触控面板”。触摸传感器180J可以设置于显示屏194,由触摸传感器180J与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180J用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180J也可以设置于电子设备10的表面,与显示屏194所处的位置不同。
骨传导传感器180L可以获取振动信号。在一些实施例中,骨传导传感器180L可以获取人体声部振动骨块的振动信号。骨传导传感器180L也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180L也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于骨传导传感器180L获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于骨传导传感器180L获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键、音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备10可以接收按键输入,产生与电子设备10的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照、音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒、接收信息、闹钟、游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态、电量变化,也可以用于指示消息、未接来电、通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备10的接触和分离。电子设备10可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备10通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备10采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备10中,不能和电子设备10分离。
可以理解,图2所示的部件并不构成对电子设备20的具体限定,电子设备20还可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。
基于上述系统架构和硬件配置,本申请实施例提供了一种设备间触碰建立无线连 接的方法,第一电子设备通过第一传感器检测第一电子设备的第一运动状态信息;该第一电子设备检测第一电子设备和第二电子设备之间的第一距离值;在第一运动状态信息符合预设运动状态信息且第一距离值在预设距离范围内的情况下,第一电子设备与目标电子设备建立无线连接,该目标电子设备为第二电子设备或者为第二电子设备通过广播消息指示的第三电子设备。本申请实施例中,通过检测到第一电子设备的运动状态信息符合预设运动状态信息并且检测到第一电子设备和第二电子设备的距离处于可以建立无线连接的预设距离范围内,即可触发第一电子设备与第二电子设备或第二电子设备关联的其他电子设备快速建立无线连接。由于上述设备间触碰建立无线连接的方法无需借助于NFC装置,即无需通过NFC读卡器和NFC标签紧贴来触发启动电子设备间连接及交互,因此本申请实施例提供的建立电子设备间连接及交互的方案可以降低对电子设备的硬件要求。
需要说明的是,本申请实施例提供的设备间触碰建立无线连接的方法的执行主体可以为上述电子设备(例如上述的电子设备10),也可以为该电子设备中能够实现该方法的功能模块和/或功能实体,具体的可以根据实际使用需求确定,本申请实施例不作限定。下面以执行主体为电子设备(例如第一电子设备)为例,对本申请实施例提供的设备间触碰建立无线连接的方法进行示例性的说明。
本申请实施例中,在第一电子设备和第二电子设备之间未建立无线连接的情况下,如果用户需要将第一电子设备与第二电子设备建立无线连接,或者需要在第一电子设备与第二电子设备之间实现业务互动(例如通过将第一电子设备显示的画面投屏到第二电子设备上显示),那么用户可以按照本申请实施例提供的设备间触碰建立无线连接的方法进行操作,以实现设备间快速互连或者业务互动。
下面结合附图对本申请实施例提供的一种设备间触碰建立无线连接的方法进行示例性说明。图3是根据示例性实施例示出的一种设备间触碰建立无线连接的方法的流程图,参照图3所示,该方法包括下述的步骤S310-S330。
S310、第一电子设备通过第一传感器检测第一电子设备的第一运动状态信息。
本申请实施例中,上述第一传感器可以为设置于第一电子设备中的用于感应第一电子设备移动和/或转动和/或晃动等运动行为的传感器。可选的,第一传感器可以为加速度传感器,也可以为角速度传感器(例如也称为陀螺仪传感器),也可以为接近光传感器,还可以为磁传感器(例如霍尔传感器),或者可以为其他任意满足使用需求的传感器,例如组合型传感器,具体可以根据实际使用需求确定,本申请实施例不作限定。
可以理解,第一电子设备可以通过内置的传感器实时或周期性地检测第一运动状态信息,进一步可以根据第一运动状态信息判断第一电子设备的运动行为(例如移动行为和/或转动行为和/或晃动行为)。
示例性的,以第一传感器为三轴加速度传感器为例,在第一电子设备运动的过程中,第一电子设备中的加速度传感器可以检测第一电子设备在X方向、Y方向和Z方向上的加速度值(例如x、y和z),也可以根据第一电子设备在X方向、Y方向和Z方向上的加速度值,确定第一电子设备在X方向、Y方向和Z方向上的合加速度值(a 2=x 2+y 2+z 2)。需要说明的是,本申请实施例不限于三轴加速度传感器,还可以采 用其他加速度传感器。上述第一电子设备在各个方向上的加速度值或合加速度值作为第一运动状态信息,可以用于判断第一电子设备的移动行为或者晃动行为。
再示例性的,以第一传感器为三轴陀螺仪传感器为例,在第一电子设备运动的过程中,第一电子设备中的陀螺仪传感器可以检测第一电子设备在X方向、Y方向和Z方向上的角速度值(例如α,β和γ),也可以根据第一电子设备在X方向、Y方向和Z方向上的角速度值,确定第一电子设备在X方向、Y方向和Z方向上的合角速度值(b 2=α 222)。需要说明的是,本申请实施例不限于三轴陀螺仪传感器,还可以采用其他自由度的陀螺仪传感器。上述第一电子设备在各个方向上的角速度值或合角速度值作为第一运动状态信息,可以用于判断第一电子设备的转动行为。
又示例性的,以第一传感器为六轴传感器(包括三轴加速度传感器和三轴陀螺仪传感器)为例,如图4所示,在第一电子设备10运动的过程中,第一电子设备中的六轴传感器可以检测第一电子设备10在+X方向、+Y方向和+Z方向上的加速度值(例如x、y和z)以及角速度值(例如α,β和γ),也可以得到第一电子设备10在X方向、Y方向和Z方向上的合加速度值以及合角速度值。上述第一电子设备在各个方向上的角速度值或合角速度值作为第一运动状态信息,可以用于判断第一电子设备的运动行为(例如移动行为和/或转动行为和/或晃动行为)。
本申请实施例中,上述第一运动状态信息可以通过能够表征电子设备移动和/或转动和/或晃动的参数表示,例如第一运动状态信息可以通过移动速度(例如上述加速度值)表示,也可以通过转动姿态(例如角速度值)表示,也可以通过晃动频率表示,还可以通过移动速度、转动姿态、晃动频率等参数的任意组合表示,或者可以通过其他任意可能的运动参数(例如运动轨迹)表示,具体可以根据实际使用需求确定,本申请实施例不作限定。
示例性的,若用户将第一电子设备移动一段距离后停止,则第一电子设备中的第一传感器可以检测到第一电子设备的这一移动行为,得到第一运动状态信息。例如,第一传感器可以为加速度传感器,第一运动状态信息可以采用加速度值表示,比如第一运动状态信息可以包括随时间变化的多个加速度值。
又示例性的,在第一电子设备显示Wi-Fi设置界面时,若用户晃动第一电子设备,此时第一电子设备中的第一传感器检测到与这一晃动行为对应的一个或多个参数(即第一运动状态信息),若该一个或多个参数在预设阈值范围内(即第一运动状态信息符合预设运动状态信息),则可触发与预设阈值范围对应的事件,例如增大Wi-Fi扫描的频率。例如,第一传感器可以包括加速度传感器和陀螺仪传感器,第一运动状态信息可以采用加速度值和角速度值表示,比如第一运动状态信息可以包括随时间变化的多个加速度值和多个角速度值。
需要说明的是,以上均为第一电子设备通过第一传感器获取第一运动状态信息的示例性列举,可以理解,本申请实施例包括但不限于上述列举的方式,并且包括但不限于上述第一运动状态信息;具体的,第一传感器和获取的第一运动状态信息可以根据实际使用需求确定,本申请实施例不作限定。为了便于说明,下文以第一电子设备为手机、第一传感器为加速度传感器、第一运动状态信息采用加速度值表示为例进行示例性的说明。
示例性的,以移动第一电子设备后将第一电子设备与第二电子设备“碰触”(例如贴近或触碰)为例,假设第一电子设备与第二电子设备相距一定距离,第一电子设备在靠近第二电子设备时,通过加速度传感器检测到第一电子设备在各个轴方向上的加速度值(及速度值)接近为0(但不为0),如此感知第一电子设备移动。然后,第一电子设备靠近第二电子设备后与第二电子设备“碰触”,在“触碰”时加速度值具有一定的特征,例如通过加速度传感器检测到各个轴方向上的加速度值均会出现一个脉冲尖峰,或者各个轴方向上的合加速度值会出现一个脉冲尖峰(如图5中的波形图所示),此时第一电子设备可以通过识别波形图中的脉冲尖峰判断该“触碰”的动作。
可选的,第一电子设备可以通过将第一运动状态信息与预设运动状态信息进行对比,判断第一运动状态信息是否符合预设运动状态信息,即判断第一电子设备的运动行为是否为预设运动行为。其中,该预设运动状态信息可以为指示预设的运动行为(例如移动行为和/或转动行为和/或晃动行为等)的信息,例如,预设运动状态信息用于指示第一电子设备朝向第二电子设备移动后与第二电子设备触碰,具体可以根据实际需求进行设置,本申请实施例不作限定。
示例性的,假设第一传感器为加速度传感器,第一运动状态信息包括随时间变化的多个加速度值,预设运动状态信息指示加速度值发生变化且变化量大于预设阈值,在此情况下,若第一电子设备检测到第一运动状态信息中的多个加速度值发生变化且变化量大于预设阈值,则第一电子设备可以确定第一运动状态信息符合预设运动状态信息,从而判断第一电子设备有先移动然后停止移动的运动行为。
S320、第一电子设备确定扫描到的第一广播消息的信号质量是否满足预设条件。
其中,第一广播消息为第二电子设备广播的消息。
可选的,可以通过下述至少一项参数来判断信号质量是否满足预设条件:RSSI、RSRP、SNR。示例性的,以RSSI为例,在第一电子设备接收到的第一广播消息的RSSI值大于预设阈值时,第一电子设备可以确定信号质量满足预设条件。
在一些实施例中,第一电子设备可以检测周围其他电子设备发送的信号强度,并根据该信号强度确定第一电子设备和第二电子设备是否在预设距离范围内。可选的,假设信号强度与距离范围存在对应关系,不同的信号强度对应不同的距离范围,那么第一电子设备可以参照信号强度与距离范围的对应关系,确定第一电子设备和第二电子设备是否在预设距离范围内。例如,假设已知预设距离范围对应的最小信号强度为S1,那么若第一电子设备检测到第二电子设备的信号强度S2大于或等于该最小信号强度S1,则可以确定第二电子设备发送的信号质量满足预设条件,由此可以判定第一电子设备和第二电子设备在预设距离范围内。
在一些实施例中,第一电子设备还可以检测第一电子设备和第二电子设备之间的第一距离值。本申请实施例中,第一电子设备可以实时或周期性地检测第一电子设备与周围的各个电子设备之间的距离信息,例如检测到与第二电子设备之间的第一距离值,进一步可以根据第一距离值,判断第一电子设备与第二电子设备是否非常接近(例如贴近或接触)。
可选的,第一电子设备可以通过判断第一距离值是否在预设距离范围内来判断第一电子设备与第二电子设备是否非常接近。具体的,若第一距离值在预设距离范围内, 则第一电子设备可以判断第一电子设备与第二电子设备非常接近。若第一距离值不在预设距离范围内,则第一电子设备可以判断第一电子设备与第二电子设备不够接近。
其中,上述预设距离范围可以根据实际使用需求确定,例如预设距离范围为[0,0.1米],本申请实施例对此不作限定。示例性的,若检测到的第一距离值为0.05米,即在预设距离范围内,则第一电子设备可以判断第一电子设备与第二电子设备非常接近。再示例性的,若检测到的第一距离值为0,即在预设距离范围内,则第一电子设备可以判断第一电子设备与第二电子设备接触。
需要说明的是,若第一距离值在预设距离范围内,则可以确定第一电子设备与第二电子设备非常接近,在此情况下第一电子设备与第二电子设备之间通常是适于进行短距离无线通信的。
可选的,本申请实施例中,第一电子设备可以采用如下测距方式来检测第一距离值。
第一测距方式:第一电子设备可以通过接收到第二电子设备发送的信号的能量(简称为接收信号能量)以及第一测距公式,计算这两个电子设备之间的距离,其中第一测距公式包括接收信号能量值和距离等参数。
示例性的,以接收信号能量为RSSI为例,第一电子设备在获取RSSI值的情况下,可以将RSSI值带入第一测距公式,计算第一距离值。其中,第一测距计算公式可以参考相关技术中涉及利用RSSI值测距的计算公式,此处不予赘述。
第二测距方式:第一电子设备可以向第二电子设备发送能量波信号,比如超声波信号、超带宽(ultra wide band,UWB)信号,并接收返回的能量波信号,然后根据能量波信号的往返传播时间(也称为飞行时间)计算这两个电子设备之间的距离。
示例性的,假设第一电子设备在第一时刻t1向第二电子设备发送UWB信号,并且在第二时刻t1接收到从第二电子设备返回的该UWB信号,那么第一电子设备可以根据第一时刻t1和第二时刻t1可以确定该UWB信号的飞行时间TOF信息(t2-t1),并将该TOF信息带入第二测距公式(例如L=C*(t2-t1),其中L代表距离,C代表光速),计算第一距离值。
当然,本申请实施例还可以采用其他可行的方式检测第一距离值,具体可以根据实际使用需求确定,本申请实施例不作限定。
S330、在第一运动状态信息符合预设运动状态信息且第一广播消息的信号质量满足预设条件时,第一电子设备与目标电子设备建立连接。
其中,上述目标电子设备为第二电子设备或者为第二电子设备通过广播消息指示的第三电子设备。可选的,预设运动状态信息用于指示第一电子设备朝向第二电子设备移动和/或与第二电子设备触碰。
本申请实施例中,如上所述,若第一运动状态信息符合预设运动状态信息,则可以确定第一电子设备的运动行为符合预设运动行为;若第一距离值在预设距离范围内,则可以确定第一电子设备与第二电子设备非常接近。因此,在第一运动状态信息符合预设运动状态信息且第一距离值在预设距离范围内的情况下,可以确定第一电子设备相对于第二电子设备近距离运动:例如,第一电子设备朝向第二电子设备移动后与第二电子设备贴近或接触;或者,第一电子设备在第二电子设备的近距离范围内晃动和/ 或转动等。在第一运动状态信息符合预设运动状态信息且第一距离值在预设距离范围内的情况下,可以认为第一电子设备与第二电子设备满足无线通信(例如短距离无线通信)的条件,因此可以触发设备间建立连接及业务交互。
需要说明的是,在待建立设备间连接的场景中,第一电子设备可以处于亮屏状态,例如第一电子设备可以处于屏幕锁闭时的亮屏状态,也可以处于屏幕解锁时的亮屏状态,但是本申请实施例并不排除第一电子设备处于灭屏状态的情况。第二电子设备可以处于开启状态,并且第二电子设备广播第一广播消息(即目标电子设备处于可被发现可被连接的状态),该第一广播消息包括例如第二电子设备的标识,例如MAC地址、设备名称等。若第一电子设备扫描到第一广播消息,则第一电子设备根据该第一广播消息,通过寻呼与目标电子设备交互信令并协商信息后,与目标电子设备建立无线连接。
可选的,第一电子设备与第二电子设备可以通过无线局域网建立无线连接,也可以通过蓝牙建立无线连接,还可以通过其他可能的技术或方式建立无线连接,具体可以根据实际使用需求确定,本申请实施例不作限定。
下面结合示例性的场景对本申请实施例提供的设备间触碰建立无线连接的方法进行描述。假设第一传感器为加速度传感器,预设运动状态信息指示加速度值发生变化且变化量大于预设阈值,预设距离范围为[0,0.1米],在此情况下,若用户将第一电子设备朝向第二电子设备移动后直至与第二电子设备接触后停止移动,则第一电子设备中的加速度传感器可以检测到第一电子设备的这一移动行为,得到第一运动状态信息,该第一运动状态信息包括随时间变化的多个加速度值。若检测到的第一运动状态信息符合预设运动状态信息,并且检测到的第一距离值(例如为0)在预设距离范围内,则第一电子设备可以以此确定第一电子设备朝向第二电子设备移动然后与第二电子设备接触,即满足在电子设备间建立无线连接的条件,在此情况下第一电子设备可以与第二电子设备建立无线连接。如此,用户只需要将第一电子设备在第二电子设备上贴近或轻触,即可触发第一电子设备与第二电子设备建立无线连接,从而可以实现设备间一碰连的效果。
本申请实施例提供了一种设备间触碰建立无线连接的方法,第一电子设备通过第一传感器检测第一电子设备的第一运动状态信息;该第一电子设备检测第一电子设备和第二电子设备之间的第一距离值;在第一运动状态信息符合预设运动状态信息且第一距离值在预设距离范围内的情况下,第一电子设备与第二电子设备建立无线连接。本申请实施例中,通过检测到第一电子设备的运动状态信息符合预设运动状态信息并且检测到第一电子设备和第二电子设备的距离处于可以建立无线连接的预设距离范围内,即可触发第一电子设备与第二电子设备或第二电子设备关联的其他电子设备快速建立无线连接。由于上述设备间触碰建立无线连接的方法无需借助于NFC装置,即无需通过NFC读卡器和NFC标签紧贴来触发启动电子设备间连接,因此本申请实施例提供的建立电子设备间连接的方案可以降低对电子设备的硬件要求。
可选的,本申请实施例中,在上述第一电子设备与目标电子设备建立无线连接之前,第一电子设备可以显示第一提示消息,该第一提示消息用于提示是否与目标电子设备建立无线连接。用户可以在第一提示消息上操作以确认连接,相应地,第一电子 设备在接收到用户在第一提示消息上的确认连接操作的情况下,与目标电子设备建立无线连接。
可选的,本申请实施例中,第一电子设备与目标电子设备建立无线连接包括:第一电子设备可以向目标电子设备发送与第一业务相关的第一业务数据,第一电子设备也可以接收目标电子设备发送的第一业务数据。其中,第一业务可以为投屏显示、音频播放、文件无线传输。如此,通过本申请实施例提供的方法,可以快速触发启动设备间的互动体验功能,例如一碰传、一碰投屏等业务互动,提升了用户体验。
需要说明的是,本申请实施例可以不限定步骤310和步骤320的执行顺序。即本申请实施例可以先执行步骤310,后执行步骤320;也可以先执行步骤320,后执行步骤310;还可以同时执行步骤310和步骤320。可以理解,上述图3是以先执行步骤310后执行步骤320为例示意的。
在一种可能的实现方式中,第一电子设备可以在判断第一运动状态信息符合预设运动状态信息的情况下,触发第一电子设备开始扫描或加速扫描其他设备的广播消息,并根据扫描到的广播消息检测第一电子设备与其他电子设备之间的距离(即先执行步骤310,后执行步骤320),以减少能耗。示例性的,结合图3,如图6所示,在上述的步骤S310之后,在上述的步骤S320之前,本申请实施例提供的设备间触碰建立无线连接的方法还可以包括下述的步骤S340。
S340、第一电子设备判断第一运动状态信息是否符合预设运动状态信息。
本申请实施例中,若第一电子设备判断第一运动状态信息符合预设运动状态信息,则第一电子设备继续执行上述的步骤320;若第一电子设备判断第一运动状态信息不符合预设运动状态信息,则第一电子设备继续执行上述的步骤310。也就是说,只有在第一运动状态信息符合预设运动状态信息的情况下,第一电子设备才进一步检测第一距离值,这样可以减少第一电子设备因检测引起的耗电量。
如前文所提到的,在第一电子设备扫描到该第一广播消息的前提条件下,第一电子设备可以进一步根据该第一广播消息,与目标电子设备交互信令并协商信息,进而与目标电子设备建立无线连接。也就是说,在需要建立连接时加速扫描到广播消息,可以提升建立设备间连接及业务交互的速度。
首先介绍一下扫描时间参数:扫描窗口和扫描间隔。如图7所示,一次扫描进行的时间宽度,称为扫描窗口,记为T1;两个连续的扫描窗口的起始时间之间的时间差,称为扫描间隔,记为T2。如果扫描窗口等于扫描间隔,那么扫描占空比为1。
需要说明的是,图7中是以固定的扫描窗口和扫描间隔示意的,可以理解,在实际实现时,扫描窗口可以是固定的,也可以是变化的,例如递增或递减,具体可以根据实际情况进行设置;扫描间隔可以是固定的,也可以是变化的,例如递增或递减,具体可以根据实际情况进行设置。还需要说明的是,扫描窗口越大,则扫描到广播消息的概率越大,相应地耗电越多;扫描窗口越小,则扫描到广播消息的概率越小,相应地耗电越少。或者说,扫描占空比(一个周期内扫描窗口的时间占比)越大,则扫描到广播消息的概率越大,相应地耗电越多;扫描占空比越小,则扫描到广播消息的概率越小,相应地耗电越少。
通常情况下,蓝牙扫描的扫描窗口和扫描间隔为固定的(称为正常扫描模式,如 图8中的(a)所示);或者蓝牙扫描的扫描窗口固定且扫描间隔会逐渐变大(称为省电扫描模式,如图8中的(b)所示),比如扫描窗口为10秒,扫描间隔依次为5秒、10秒、20秒,以节省不必要的耗电;或者蓝牙扫描的扫描间隔固定且扫描窗口会逐渐变小(另一种省电扫描模式,比如扫描间隔为5秒,扫描窗口依次为10秒、5秒、3秒,直到停止扫描,以节省不必要的耗电。结合到本申请实施例中,由于第一电子设备在以正常扫描模式或省电扫描模式进行扫描时,扫描到广播消息的概率比较小,因此第一电子设备在需要与其他电子设备建立连接时可以加速扫描(称为加速扫描模式,如图8中的(c)所示),以提升建立设备间连接的速度。
需要说明的是,对于Wi-Fi扫描的描述可参见上述对蓝牙扫描的描述,此处不再赘述。
在一种可能实施例中,上述第一广播消息包括目标电子设备的设备标识和第一信道信息,第一信道信息用于指示Wi-Fi信道或者蓝牙信道。第一电子设备可以根据第一广播消息,与目标电子设备通过Wi-Fi或者蓝牙建立无线连接。
其中,目标电子设备的设备标识为用于唯一表示目标电子设备的标识,例如目标电子设备的MAC地址,或者设备名称。示例性的,设备标识可以为用于指示第二电子设备的MAC地址,或者,设备标识可以为用于指示第三电子设备的MAC地址。
其中,第一信道信息指示用于建立无线连接的信道,可以是Wi-Fi信道,也可以是蓝牙信道。以Wi-Fi信道为例,Wi-Fi 2.4GHz频带的信道通常可以划分为14个信道:第1信道至第14信道,其中第14信道一般不用,例如第一信道信息可以用于指示第1信道至第13信道中的一个信道。可选的,第一信道信息可以包括无线局域网的标识(比如Wi-Fi标识),例如路由器的服务集标识符(service set identifier,SSID),第一电子设备和目标电子设备可以通过第一广播消息携带的该无线局域网的标识进行无线局域网组网。或者,第一信道信息可以包括蓝牙设备标识,第一电子设备和目标电子设备可以通过第一广播消息携带的该蓝牙设备标识和/或配对码进行蓝牙连接。
在另一种可能实施例中,在第一广播消息仅包括目标电子设备的设备标识的情况下,第一电子设备在扫描到第一广播消息之后,可以向目标电子设备发送响应消息,响应消息可以包括以下至少一项:第一电子设备的设备标识和第二信道信息,该第一信道信息用于指示Wi-Fi信道或者蓝牙信道。第一电子设备和目标电子设备可以根据第一广播消息和响应消息,通过Wi-Fi或者蓝牙建立无线连接。
其中,对于第一电子设备的设备标识和第二信道信息的描述具体可以参见上述对目标电子设备的设备标识和第一信道信息的详细描述,此处不再赘述。
可选的,第一广播消息还可以包括其他任意满足实际使用需求的用于无线连接的鉴权信息。例如,第一广播消息还可以包括目标密码,该目标密码用于建立无线连接时进行认证,以提升无线连接的安全性。例如,目标密码可以为Wi-Fi密码,或者蓝牙配对码。该目标密码可以为系统默认设置的密码,也可以由用户根据需求进行设置。同理,上述响应消息中也可以包括其他任意满足实际使用需求的用于无线连接的鉴权信息(例如密码)。
下面详细描述本申请实施例提供的三种加速扫描的实现方式(下述的第一实现方式、第二实现方式和第三实现方式)。
第一实现方式
在第一实现方式中,可以通过触发开启第一电子设备的扫描功能或者增大第一电子设备的扫描占空比,促使第一电子设备加速扫描到第一广播消息,从而实现加速扫描。如图6所示,在上述的步骤S340之后,本申请实施例提供的设备间触碰建立无线连接的方法还包括下述的步骤S350A。
S350A、第一电子设备执行第一动作。
其中,上述第一动作可以包括以下任一项:
方式一:开启第一电子设备的扫描功能。具体的,在第一电子设备的扫描功能未开启的情况下,若第一电子设备检测到第一运动状态信息符合预设运动状态信息,则触发第一电子设备自动开启WiFi或者蓝牙功能,从而开始WiFi扫描或者蓝牙扫描。可选的,第一电子设备开启扫描功能后,可以以预设的固定扫描占空比进行扫描,例如每隔5秒扫描一次。或者,第一电子设备开启扫描功能后,可以以预设的可变扫描占空比进行扫描,例如逐渐增大扫描占空比,比如每隔20秒扫描一次,然后每隔10秒扫描一次,再然后每隔5秒扫描一次,以此类推。由于第一电子设备的扫描功能被触发开启,因此有助于第一电子设备快速扫描到第一广播信号,如此间接地有助于建立设备间连接及业务交互的速度。
方式二:在第一电子设备的扫描功能开启的情况下增大扫描占空比。具体的,在第一电子设备的扫描功能已开启的情况下,若第一电子设备检测到第一运动状态信息符合预设运动状态信息,则触发第一电子设备增大当前的扫描占空比(对应于如图8中的(c)所示的加速扫描模式)。
在一些实施例中,假设扫描窗口时长不变,扫描间隔时长减小,以增大扫描占空比,例如扫描窗口时长固定为10秒(即每次扫描的时长为10秒),且扫描间隔时长从5秒减小为3秒。
在一些实施例中,假设扫描间隔时长不变,扫描窗口时长增大,以增大扫描占空比,例如扫描间隔时长固定为5秒,扫描窗口时长从5秒增大到10秒。
在一些实施例中,假设扫描窗口时长增大,扫描间隔时长减小,以增大扫描占空比,例如扫描窗口时长从5秒增大为10秒(即每次扫描的时长为10秒),且扫描间隔时长从5秒减小为3秒。
可选的,在第一电子设备开始扫描或者增大扫描占空比之后,若在预设时长后或预设次数后未扫描到其他设备,则可以减小扫描占空比,或者停止扫描。
由于第一电子设备的扫描占空比变大,因此有助于第一电子设备加速扫描到第一广播信号,使第一电子设备能更快发现待连接设备,如此间接地有助于建立设备间连接及业务交互的速度。
进一步的,在上述的步骤S350A之后,上述的步骤S320具体可以通过下述的步骤S320A实现。
S320A、第一电子设备判断扫描到的第一广播消息的信号质量是否满足预设条件。
示例性的,在第一电子设备扫描到第二电子设备广播的第一广播消息的情况下,第一电子设备可以通过下述至少一项参数来判断第一广播消息的信号质量是否满足预设条件:RSSI、RSRP、SNR。示例性的,以RSSI为例,在第一电子设备接收到的第 一广播消息的RSSI值大于预设阈值时,即信号强度较高,第一电子设备可以确定第一广播消息的信号质量满足预设条件。
在第一广播消息的信号质量满足预设条件时,此时满足第一电子设备和第二电子设备比较靠近,满足建立无线连接的条件,因此可触发设备之间快速建立无线连接。
本申请实施例中,第一电子设备一旦检测到第一运动状态信息符合预设运动状态信息,即可触发开启扫描功能或者增大扫描占空比,这样可以增大第一电子设备扫描到其他电子设备的广播信号的概率,具体到本实施例,由于第一电子设备开启扫描功能或者增大扫描占空比,因此第一电子设备可以快速扫描到第二电子设备广播的第一广播消息。
进一步的,在第一电子设备扫描到第二电子设备广播的第一广播消息的情况下,第一电子设备可以判断第一广播消息的信号质量是否满足预设条件。示例性的,第一电子设备可以根据第一广播消息,确定RSSI值;进一步的,在RSSI值大于预设阈值时,第一电子设备可以确定第一广播消息的信号质量满足预设条件。
进一步的,在上述的步骤S320A之后,上述的步骤S330可以通过下述的步骤S330A实现。
S330A、在第一广播消息的信号质量满足预设条件时,第一电子设备与第二电子设备建立无线连接。
在第一实现方式中,第一电子设备可以先检测第一运动状态信息并且判断第一运动状态信息是否符合预设运动状态信息,在判断第一运动状态信息符合预设运动状态信息的情况下,触发第一电子设备开始扫描或加速扫描其他设备的广播消息,使第一电子设备能更快发现待连接设备。在第一电子设备扫描到第二电子设备的第一广播消息,且第一广播消息的信号质量满足预设条件时,第一电子设备与目标电子设备可以建立无线连接。因此,本申请实施例提供的方案可以更快速地发现待连接设备并快速建立设备间连接。
第二实现方式
以上介绍了一种加速扫描到广播消息的可能实现方式,即通过触发开启第一电子设备的扫描功能或者增大第一电子设备的扫描占空比,促使第一电子设备加速扫描到第一广播消息,使第一电子设备能更快发现待连接设备。本申请实施例包括但不限于上述加速扫描的方式,例如还可以通过触发开启第二电子设备的广播消息功能或者增大第二电子设备的广播消息的频率,促使第一广播消息被更快地扫描到,从而实现加速扫描,下面对第二实现方式进行详细描述。
在第二实现方式中,结合图6,如图9所示,在上述的步骤S340之后,若第一运动状态信息符合预设运动状态信息,则本申请实施例提供的设备间触碰建立无线连接的方法还可以包括下述的步骤S350B。
S350B、第一电子设备向第二电子设备发送第一指示消息,第一指示消息用于指示执行第二动作。
其中,第二动作可以包括以下任一项:
方式一:开启第二电子设备的广播消息功能。具体的,在第二电子设备的广播消息功能未开启的情况下,若第一电子设备检测到第一运动状态信息符合预设运动状态 信息(例如第一电子设备碰触第二电子设备),则触发第一电子设备向第二电子设备发送第一指示消息,以指示第二电子设备开启广播消息功能。需要说明的是,这里假设第一电子设备和第二电子设备已经配对过或者有连接记录,那么第一电子设备存储有第二电子设备的标识或地址,因此第一电子设备可以根据标识或地址,向第二电子设备发送第一指示消息。
可选的,第二电子设备开启广播消息功能后,可以以默认广播消息频率进行广播,例如每隔10秒广播一次。由于第二电子设备的广播消息功能被触发开启,因此有助于第一广播消息被快速扫描到,即有助于第一电子设备快速扫描到第一广播信号,如此间接地有助于建立设备间连接及业务交互的速度。
方式二:在第二电子设备的广播功能开启的情况下增大广播消息的频率。具体的,在第二电子设备的广播功能已开启的情况下,若第一电子设备检测到第一运动状态信息符合预设运动状态信息,则触发向第二电子设备发送第一指示消息,以指示第二电子设备增大当前广播消息的频率,例如将当前广播消息的频率(例如每隔10秒广播一次)增大到目标频率(例如每隔5秒广播一次)。由于第二电子设备的广播消息的频率增大,如此有助于第一广播消息被快速扫描到,即有助于第一电子设备快速扫描到第一广播信号,如此间接地有助于建立设备间连接及业务交互的速度。
可选的,在第二电子设备开始广播消息或者增大广播消息的频率之后,若在预设时长后或预设次数后未被其他设备扫描到(例如第二电子设备未接收到其他电子设备发送的寻呼消息),则可以减小广播消息的频率,或者停止广播消息。
在第二实现方式中,第一电子设备可以先检测第一运动状态信息并且判断第一运动状态信息是否符合预设运动状态信息,在判断第一运动状态信息符合预设运动状态信息的情况下,触发第一电子设备向第二电子设备发消息,以指示第二电子设备开始广播或加速广播,在第一电子设备扫描到第二电子设备的第一广播消息,且第一广播消息的信号质量满足预设阈值时,第一电子设备与目标电子设备可以建立连接及业务交互。因此,本申请实施例提供的方案可以更快速地发现待连接设备并快速建立设备间连接及业务交互。
第三实现方式
上述第二实现方式介绍了第一电子设备通知第二电子设备开始广播第一广播消息或者增大广播第一广播消息的频率,促使第一广播消息被更快地扫描到,从而实现加速扫描;除此之外,第二电子设备可以主动检测第一运动状态信息是否符合预设运动状态信息,并且在第一运动状态信息符合预设运动状态信息的情况下,开始广播第一广播消息或者增大广播第一广播消息的频率,促使第一广播消息被更快地扫描到,从而实现加速扫描。下面对第三实现方式进行详细描述。
在第三实现方式中,本申请实施例提供的设备间触碰建立无线连接的方法还可以包括下述的步骤S350C和S350D。
S350C、第二电子设备检测第一运动状态信息;
S350D、若第二电子设备判断第一运动状态信息满足预设运动状态信息,则第二电子设备执行第三动作,该第三动作包括以下任一项:开始广播第一广播消息,增大广播第一广播消息的频率。
在第三实现方式中,第二电子设备可以主动检测第一运动状态信息并且判断第一运动状态信息是否符合预设运动状态信息,在判断第一运动状态信息符合预设运动状态信息的情况下,开始广播或加速广播,这样促使第一电子设备快速扫描到第二电子设备的第一广播消息,因此可以使得第一电子设备更快速地发现待连接设备并快速建立设备间连接。
需要说明的是,在第一运动状态信息符合预设运动状态信息且第一距离值在预设距离范围内的情况下,第一电子设备可以进一步根据扫描到的第一广播消息,与目标电子设备交互信令并协商信息,进而与目标电子设备建立连接及业务交互。这里,第一电子设备可以与目标电子设备通过无线局域网建立连接及业务交互,也可以与目标电子设备通过蓝牙建立无线连接(以下简称为蓝牙连接),还可以与目标电子设备通过其他方式建立无线连接。下面通过下述的第一实施例和第二实施例对第一电子设备和目标电子设备建立无线连接的过程进行示例性地举例。
第一实施例
在第一实施例中,第一电子设备扫描到第二电子设备广播的第一广播消息,该第一广播消息可以用于请求第一电子设备与目标电子设备建立无线通信连接。例如,第一广播消息用于请求第一电子设备与第二电子设备建立无线通信连接,该第一广播消息可以包括第二电子设备的标识。再例如,第一广播消息可以用于请求第一电子设备与第三电子设备建立无线通信连接,该第一广播消息可以包括第三电子设备的标识。
示例性的,步骤S330中的第一电子设备与目标电子设备建立无线连接的步骤具体可以通过下述的步骤实现:第一电子设备根据第一广播消息,向第二电子设备发送响应消息。目标电子设备接收响应消息,并根据响应消息连接至第一无线局域网。进一步的,第一电子设备可以与目标电子设备通过第一无线局域网建立无线连接及业务交互。
例如,该响应消息可以包括第一电子设备的设备标识、第一无线局域网的标识和密码;例如,路由器的SSID和密码。其中,第一无线局域网的密码可以为系统默认设置的密码,也可以由用户根据需求进行设置。示例性的,该响应消息可以包括Wi-Fi网络的名称和密码。
需要说明的是,第一电子设备可以在向目标电子设备发送响应消息之前已连接至第一无线局域网,也可以在向目标电子设备发送响应消息之后连接至第一无线局域网,本申请实施例对此不作限定。
本申请实施例中,如图10中的步骤S401-S414所示,第一电子设备检测第一电子设备的第一运动状态信息,若第一运动状态信息符合预设运动状态信息,则触发Wi-Fi扫描或加速Wi-Fi扫描。此时第二电子设备处于待配网状态,且向外广播消息,例如广播消息包含开放热点的信息,第一电子设备和第二电子设备可以通过该开放热点暂时通信。若第一电子设备扫描到该广播消息,则第一电子设备可以根据该广播消息确定第一距离值。若第一距离值在预设距离范围内,则第一电子设备提示是否对目标电子设备进行配网。
在一种可能的实现方式中,目标电子设备为第二电子设备,如图10中的步骤S407-S410所示,若第一电子设备接收到确认配网的用户输入,则第一电子设备根据 用户输入,向第二电子设备发送响应消息(例如包括Wi-Fi网络的名称和密码)。第二电子设备在接收到响应消息之后,从响应消息中提取Wi-Fi网络的名称和密码,并采用Wi-Fi的名称和密码连接至该Wi-Fi网络。在第一电子设备和第二电子设备均连接至第一无线局域网的情况下,第一电子设备和第二电子设备可以通过该第一无线局域网建立无线连接,进一步可以进行业务交互。
在另一种可能的实现方式中,目标电子设备为第三电子设备,如图10中的虚线框中的步骤S411-S414所示,若第一电子设备接收到确认配网的用户输入,则第一电子设备根据用户输入,向第三电子设备发送响应消息(例如包括Wi-Fi网络的名称和密码)。第三电子设备在接收到响应消息之后,从响应消息中提取Wi-Fi网络的名称和密码,并采用Wi-Fi的名称和密码连接至该Wi-Fi网络。在第一电子设备和第三电子设备均连接至第一无线局域网的情况下,第一电子设备和第三电子设备可以通过该第一无线局域网建立无线连接,进一步可以进行业务交互。
需要说明的是,第一电子设备可以根据广播消息,择一执行图10中的S407-S410以及S411-S414,例如,第一电子设备可以执行S407-S410,实现第一电子设备与第二电子设备建立无线连接;或者,第一电子设备可以S411-S414,实现第一电子设备与第三电子设备建立无线连接。当然,本申请实施例并不排除如下实现方式:第一电子设备可以同时执行S407-S410以及S411-S414,实现第一电子设备与第二电子设备和第三电子设备均建立无线连接。具体可以根据实际使用需求确定,本申请实施例不作限定。
下面以第一电子设备为手机10、目标电子设备为第二电子设备且第二电子设备为笔记本电脑20为例,结合图11至图13对第一实施例进行详细描述。
示例性的,图11示出了手机的WLAN设置界面的示意图,如图11中WLAN设置界面11所示,手机10已开启WLAN,且手机10已连接至路由器Wi-Fi网络(假设Wi-Fi网络的名称为WLAN 1),此时如果用户需要将手机10与笔记本电脑20建立连接及业务交互,那么用户可以按照如图12和图13所示的步骤进行操作。
如图12中的(a)所示,手机10与笔记本电脑20当前相距一定距离,用户触发笔记本电脑20开机或开启配网功能,使得笔记本电脑20处于待配网状态,此时笔记本电脑20会广播消息。如图12中的(b)所示,在用户持手机10(此时手机10可以处于亮屏状态,也可以处于灭屏状态)靠近并“触碰”笔记本电脑20的情况下,手机10通过第一传感器(例如加速度传感器)感知到“触碰”的行为,此时会触发手机10开始扫描或加速扫描。如图12中的(c)所示,手机10扫描到笔记本电脑20的广播消息,并检测到手机10与笔记本电脑20的距离d1,且判断该距离d1在预设距离范围内。如此,用户通过“触碰”的行为来触发在手机10与笔记本电脑20之间建立连接及业务交互。
然后,如图13中的(a)所示,手机10可以显示提示框12:如需将手机与该设备建立连接,请点击“连接”,以提示用户选择是否建立连接。在用户点击“连接”选项确认建立连接之后,如图13中的(b)所示,手机10可以显示提示框13,显示手机10当前连接的路由器Wi-Fi网络的名称:WLAN 1,并提示用户输入Wi-Fi密码。在用户输入Wi-Fi密码确认后,手机10将路由器Wi-Fi网络的名称和密码发送给笔记 本电脑20。当然,在用户点击“连接”选项确认建立连接之后,手机10可以不显示提示框13,无需用户输入Wi-Fi密码,而是手机10直接将手机当前连接的Wi-Fi网络的名称和密码发送给笔记本电脑20。笔记本电脑20在接收到Wi-Fi网络的名称和密码之后,采用该Wi-Fi网络的名称和密码连接到该路由器Wi-Fi网络。因此,手机10和笔记本电脑20接入同一无线局域网。
如此,如图12中的(d)所示,手机10和笔记本电脑20可以通过该路由器Wi-Fi网络建立连接及业务交互,并且可以进行业务交互。
在第一实施例中,用户可以直接通过“触碰”的行为触发在设备间通过无线局域网建立连接及业务交互,实现了一碰连的效果,提升了建立设备间连接及业务交互的便捷性。
第二实施例
在第二实施例中,第一电子设备扫描到第二电子设备广播的第一广播消息,该第一广播消息用于指示目标电子设备处于蓝牙可连接状态。例如,第一广播消息可以用于指示第二电子设备处于蓝牙可连接状态,其中,该第一广播消息可以包括第二电子设备的蓝牙标识(和蓝牙地址),例如第二电子设备的设备型号可作为第二电子设备的蓝牙标识。再例如,第一广播消息可以用于指示第三电子设备处于蓝牙可连接状态,其中,该第一广播消息可以包括第三电子设备的蓝牙标识(和蓝牙地址),例如第三电子设备的设备型号可作为第三电子设备的蓝牙标识。
示例性的,步骤S330中的第一电子设备与目标电子设备建立连接的步骤具体可以通过下述的步骤实现:第一电子设备根据第一广播消息,向目标电子设备发送连接请求消息;目标电子设备接收第一电子设备发送的连接请求消息,并向第一电子设备发送响应消息,该响应消息用于指示目标电子设备确认与第一电子设备建立蓝牙连接;第一电子设备接收目标电子设备发送的响应消息,并根据响应消息,与目标电子设备通过蓝牙建立无线连接。
其中,该连接请求消息可以包括第一电子设备的蓝牙标识(例如设备MAC地址),例如第一电子设备的设备型号可作为第一电子设备的蓝牙标识。可选的,蓝牙标识可以由系统默认设置,也可以由用户根据需求进行设置。
需要说明的是,连接请求消息还可以包括蓝牙配对码,蓝牙配对码用于在设备间首次蓝牙连接时通过密码配对进行认证,在设备回连时无需进行配对。从用户角度上看,传统的密码配对方式需要在电子设备上输入配对码,当然还可以采用其他配对方式,例如只需要双方确认电子设备屏幕上显示的随机数相同即可,无需输入配密码。
一方面,对于首次蓝牙连接的情况:如果用户将第一电子设备靠近并“触碰”第二电子设备,第一电子设备会提示与目标电子设备配对,然后建立连接。在配对完成后,蓝牙设置界面的已配对设备列表中会增加已配对设备的名称。
另一方面,对于配对后的再次连接(也称为回连)的情况:由于配对完成后,蓝牙设置界面的已配对设备列表中已显示已配对设备的名称,因此如果用户再次将第一电子设备靠近并“触碰”第二电子设备,即需要设备回连,则第一电子设备会直接提示与目标电子设备连接,无需再次配对,即免密回连。
本申请实施例中,如图14所示:第一电子设备检测第一电子设备的第一运动状态 信息,若第一运动状态信息符合预设运动状态信息,则触发蓝牙扫描或提高蓝牙扫描占空比。此时目标电子设备处于可连接状态,且向外通过蓝牙广播消息,例如该广播可以为可连接的虚拟连接广播。若第一电子设备扫描到该广播消息,则第一电子设备可以根据该广播消息确定第一距离值。若第一距离值在预设距离范围内,则第一电子设备提示是否与目标电子设备建立蓝牙连接。
一种可能的情况是,目标电子设备为第二电子设备,若第一电子设备接收到确认蓝牙连接的用户输入,则第一电子设备根据用户输入,向第二电子设备发送连接请求,例如该连接请求包括第一电子设备的蓝牙设备标识(例如MAC地址)。第二电子设备在接收到连接请求之后,从连接请求中提取蓝牙设备标识,并采用蓝牙设备标识与第一电子设备建立蓝牙连接,并且可以进一步进行业务交互。
另一种可能的情况是,目标电子设备为第三电子设备,如图14所示中的虚线框中所示,若第一电子设备接收到确认蓝牙连接的用户输入,则第一电子设备根据用户输入,向第三电子设备发送连接请求,例如该连接请求包括第一电子设备的蓝牙设备标识。第三电子设备在接收到连接请求之后,从连接请求中提取蓝牙设备标识,并采用蓝牙设备标识与第一电子设备建立蓝牙连接,并且可以进一步进行业务交互。
需要说明的是,设备间的首次蓝牙连接需要配对,对于配对过的回连则无需再次配对。
可选的,第一电子设备可以显示提示信息,以提示第一电子设备和目标电子设备已建立连接。当然,目标电子设备也可以显示提示信息,以提示第一电子设备和目标电子设备已建立连接。此后第一电子设备和目标电子设备可以进行业务交互。
需要说明的是,由于低功耗蓝牙(bluetooth low energy,BLE)连接都是建立在通用属性(generic attribute profile,GATT)协议之上,因此在建立BLE连接的过程中,第一电子设备会先向第二电子设备发送GATT连接请求,且第二电子设备接收GATT连接请求,从而第一电子设备和第二电子设备建立GATT连接。
可选的,第一电子设备向目标电子设备发送状态请求消息,目标电子设备接收状态请求消息并根据状态请求消息,设置“可配对可连接”,然后向第一电子设备返回状态响应消息,如此第一电子设备获知目标电子设备当前可配对可连接。然后,第一电子设备会向目标电子设备发送配对请求,且目标电子设备接收配对请求,从而第一电子设备和目标电子设备完成配对。然后,第一电子设备会向目标电子设备发送连接请求,且目标电子设备接收连接请求,从而第一电子设备和目标电子设备完成连接。
可选的,目标电子设备可以向第一电子设备上报电池电量和充电状态等信息,其中目标电子设备为可充电的设备。可选的,第一电子设备可以显示目标电子设备上报的电池电量和充电状态等信息。这样可以提升设备间信息传输的便捷性,并且有助于用户通过第一电子设备及时获知目标电子设备的电池电量和充电状态,可提升用户体验。
下面以第一电子设备为手机10、目标电子设备为第二电子设备且第二电子设备为音箱20为例,结合图15至图18对第二实施例进行详细描述。
示例性的,图15示出了手机的蓝牙设置界面的示意图,如图15中蓝牙设置界面14所示,手机10已开启蓝牙。在蓝牙设置界面14中还显示有已配对设备列表以及可 用设备列表,其中可用设备为搜索到的且未配对的蓝牙设备。如图15所示,手机10当前未与其他设备建立蓝牙连接。此时如果用户需要将手机10与音箱20建立蓝牙连接,那么用户可以按照如图16所示的步骤进行操作。
如图16中的(a)所示,手机10与音箱20当前相距一定距离,用户触发音箱20开机或开启配网功能,使得音箱20处于可连接状态,此时音箱20会通过蓝牙广播消息。如图16中的(b)所示,在用户持手机10(此时手机10可以处于亮屏状态,也可以处于灭屏状态)靠近并“触碰”音箱20的情况下,手机10通过第一传感器(例如加速度传感器)感知到“触碰”的行为,此时会触发手机10开始扫描或加速扫描。如图16中的(c)所示,手机10扫描到音箱20的广播消息,并检测到手机10与音箱20的距离d2,且判断该距离d2在预设距离范围内。如此,用户可以直接通过“触碰”的行为触发在手机10与音箱20之间建立连接及业务交互。
然后,如图17中的(a)所示,手机10可以显示提示框15:如需将手机与该设备建立蓝牙连接,请点击“连接”,以提示用户选择是否建立蓝牙连接。在用户点击“连接”选项确认建立连接之后,如图17中的(b)所示,手机10可以显示提示框16,显示手机10的蓝牙名称(例如手机10),并提示用户输入配对码。在用户输入配对码确认后,手机10将蓝牙名称和配对码发送给音箱20。音箱20在接收到蓝牙名称和配对码之后,可以采用该蓝牙名称和配对码与手机10完成配对并建立蓝牙连接。
如此,如图16中的(d)所示,手机10和音箱20可以通过蓝牙建立无线连接,进一步可以进行业务交互。
结合上述图15,如图18所示,在手机10与音箱20建立蓝牙连接之后,蓝牙设置界面14中的已配对设备列表中增加了音箱20,且“已连接”图标提示该音箱20与手机10已连接。
在第二实施例中,用户可以将两个设备“触碰”触发在两个设备之间建立蓝牙连接,实现了设备一碰连的效果,而无需通过蓝牙设置界面先查找、搜索然后配对及连接等一系列操作,提升了建立设备间连接及业务交互的便捷性。
如图19所示,本申请提供了一种设备间触碰建立无线连接的方法,该方法包括下述的步骤S510-S530。
S510、第一电子设备采用第一扫描占空比进行Wi-Fi扫描。
其中,Wi-Fi扫描用于发现第一电子设备周围的其他电子设备。
S520、在第一电子设备检测到第一电子设备处于预设运动状态时,第一电子设备采用第二扫描占空比进行Wi-Fi扫描,第二扫描占空比大于第一扫描占空比;
S530、在第一电子设备扫描到的第一广播消息的信号质量满足预设条件时,第一电子设备与第二电子设备建立Wi-Fi连接,第一广播消息为第二电子设备发送的消息。
其中,扫描占空比指一个周期内扫描窗口的时间占比,扫描占空比越大,则扫描到广播消息的概率越大,相应地耗电越多;扫描占空比越小,则扫描到广播消息的概率越小,相应地耗电越少。由于第二扫描占空比大于第一扫描占空比,这样可实现加速扫描,使得第一电子设备快速发现周围的其他电子设备。
通过上述方案,在第一电子设备检测到第一电子设备靠近或触碰第二电子设备时,第一电子设备可加速WiFi扫描,使得第一电子设备快速发现第二电子设备,此时第一 电子设备扫描到的第二电子设备的广播消息信号质量满足预设条件,即可触发这两个设备快速建立WiFi连接,从而实现设备一碰连的效果。由于第一电子设备的扫描占空比变大,因此有助于第一电子设备加速扫描到第一广播信号,使第一电子设备能更快发现待连接设备,如此有助于建立设备间连接及业务交互的速度。并且无需借助于NFC装置,可降低对电子设备的硬件要求。
可选的,可以通过下述至少一项参数来判断信号质量是否满足预设条件:RSSI、RSRP、SNR。示例性的,以RSSI为例,在第一电子设备接收到的第一广播消息的RSSI值大于预设阈值时,第一电子设备可以确定信号质量满足预设条件。
在一些实施例中,上述预设运动状态包括以下至少一项:第一电子设备朝向所述第二电子设备移动,第一电子设备与第二电子设备触碰。其中,第一电子设备可以通过内置的传感器检测第一电子设备的运动状态信息或运动参数,并根据该运动状态信息或运动参数确定设备运动状态。
示例性的,上述传感器可以为以下至少一种:加速度传感器,接近光传感器,霍尔传感器,陀螺仪传感器,当然还可能为其他任意满足实际使用需求的传感器。
在一些实施例中,在第一电子设备接收到的第一广播消息的信号质量满足预设条件之后,上述设备间触碰建立无线连接的方法还包括:第一电子设备显示第一提示消息,该第一提示消息用于提示是否与第二电子设备建立Wi-Fi连接。此时,第一电子设备与第二电子设备建立Wi-Fi连接,包括:第一电子设备响应于用户在第一提示消息上的确认连接操作,与第二电子设备建立Wi-Fi连接。这样可以根据用户实际使用需求,实现设备一碰连,从而提升用户使用体验。
在一些实施例中,在第一电子设备与第二电子设备建立Wi-Fi连接之后,上述设备间触碰建立无线连接的方法还包括:第一电子设备向第二电子设备发送与第一业务相关的第一业务数据;和/或,第一电子设备接收第二电子设备发送的第一业务数据。这样,在设备一碰连之后实现设备之间的业务数据快速交互,提升了设备间的互动体验功能。
在一些实施例中,上述设备间触碰建立无线连接的方法还包括:在第一电子设备检测到第一电子设备处于预设运动状态时,第一电子设备向第二电子设备发送第一指示消息,该第一指示消息用于指示第二电子设备开始广播第一广播消息或者增大广播第一广播消息的频率。由于第二电子设备的广播频率变大,因此有助于第二电子设备被更快发现,如此有助于建立设备间连接及业务交互的速度。
在一些实施例中,第一广播消息包括第二电子设备的设备标识和Wi-Fi信道信息。其中,上述第一电子设备与第二电子设备建立Wi-Fi连接,包括:第一电子设备基于第一广播消息与第二电子设备建立Wi-Fi连接。
其中,Wi-Fi信道信息可以指示第二电子设备支持的Wi-Fi信道,第一电子设备可以根据第二电子设备的设备标识,向第二电子设备发送连接请求消息,进而第一电子设备与第二电子设备基于Wi-Fi信道信息建立Wi-Fi连接。
在一些实施例中,上述第一广播消息还包括第三电子设备的设备标识。上述设备间触碰建立无线连接的方法还包括:第一电子设备与第三电子设备建立Wi-Fi连接。这样,本申请实施例不但实现两个设备一碰连的效果,而且可以实现更多个设备一碰 连的效果。
本文中描述的各个实施例可以为独立的方案,也可以根据内在逻辑进行组合,以实现不同的技术效果,这些方案都落入本申请的保护范围中。为了实现上述本申请实施例提供的方法中的各功能,第一电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。
图20为本申请实施例提供的一种建立无线连接的装置600的示意性框图。该装置600为第一电子设备,该装置600包括检测单元610和无线通信单元620;
检测单元610用于通过第一传感器检测第一电子设备的第一运动状态信息,并检测第一电子设备和第二电子设备之间的第一距离值;
无线通信单元620用于在第一运动状态信息符合预设运动状态信息且第一距离值在预设距离范围内的情况下,将第一电子设备与目标电子设备建立无线连接;
其中,该目标电子设备为第二电子设备或者为第二电子设备通过广播消息指示的第三电子设备。
在一种可能实施例中,第一传感器为用于检测第一电子设备移动和/或触碰的传感器,上述预设运动状态信息用于指示第一电子设备朝向第二电子设备移动和/或与第二电子设备碰触。
示例性的,上述第一传感器可以为以下至少一种:加速度传感器,接近光传感器,霍尔传感器,陀螺仪传感器,当然还可能为其他任意满足实际使用需求的传感器。例如,第一传感器为加速度传感器,该第一运动状态信息包括随时间变化的多个速度值或加速度值,该预设运动状态信息为速度值或加速度值发生变化且变化量大于预设阈值。
在一种可能实施例中,本申请实施例提供的建立无线连接的装置600还包括处理单元,该处理单元用于在检测单元610通过第一传感器检测第一电子设备的第一运动状态信息之后,若第一运动状态信息符合预设运动状态信息,则执行第一动作,该第一动作包括以下任一项:开启第一电子设备的扫描功能,在第一电子设备的扫描功能开启的情况下增大扫描占空比。
在一种可能实施例中,无线通信单元620还用于若第一运动状态信息符合预设运动状态信息,则向第二电子设备发送第一指示消息,该第一指示消息用于指示第二电子设备执行第二动作;其中,所述第二动作包括以下任一项:开始广播第一广播消息,在所述第二电子设备的广播功能开启的情况下增大广播第一广播消息的频率。
在一种可能实施例中,处理单元用于在扫描到第二电子设备广播的第一广播消息的情况下,根据第一广播消息,计算第一距离值。
在一种可能实施例中,上述第一广播消息包括目标电子设备的设备标识和第一信道信息,该第二信道信息用于指示Wi-Fi信道或者蓝牙信道。无线通信单元620具体用于根据第一广播消息,与目标电子设备通过Wi-Fi或者蓝牙建立无线连接。
在另一种可能实施例中,第一广播消息包括所述目标电子设备的设备标识。无线通信单元620具体用于:根据扫描到的第一广播消息,向目标电子设备发送响应消息, 该响应消息包括第一电子设备的设备标识和第二信道信息,该第二信道信息用于指示Wi-Fi信道或者蓝牙信道;根据第一广播消息和响应消息,与第一电子设备通过Wi-Fi或者蓝牙建立无线连接。
在一种可能实施例中,无线通信单元620具体用于:向目标电子设备发送与第一业务相关的第一业务数据;或者,接收目标电子设备发送的第一业务数据。
在一种可能实施例中,本申请实施例提供的建立无线连接的装置600还包括显示单元,该显示单元用于显示第一提示消息,该第一提示消息用于提示是否与目标电子设备建立无线连接。无线通信单元620具体用于在接收到用户在第一提示消息上的确认连接操作的情况下,将第一电子设备与目标电子设备建立无线连接。
本申请实施例提供了一种建立无线连接的装置,可以通过检测到第一电子设备的运动状态信息符合预设运动状态信息并且检测到第一电子设备和第二电子设备的距离处于可以建立无线连接的预设距离范围内,即可触发第一电子设备与第二电子设备或第二电子设备关联的其他电子设备快速建立连接及业务交互。由于上述设备间触碰建立无线连接的方法无需借助于NFC装置,即无需通过NFC读卡器和NFC标签紧贴来触发启动电子设备间连接及业务交互,因此本申请实施例提供的装置可以降低对电子设备的硬件要求。
根据本申请实施例的装置600可对应于执行本申请实施例中描述的方法,并且装置600中的模块的上述和其它操作和/或功能分别为了实现方法的相应流程,为了简洁,在此不再赘述。
图21为本申请实施例提供的一种建立无线连接的装置700的示意性框图。该装置700为第二电子设备,该装置700包括无线通信单元710;
无线通信单元710用于在第一电子设备的第一运动状态信息满足预设运动状态信息且第一距离值在预设距离范围内的情况下,将目标电子设备与第一电子设备建立无线连接;
其中,该第一距离值用于指示第一电子设备和第二电子设备之间的距离,该目标电子设备为第二电子设备或者为第二电子设备通过广播消息指示的第三电子设备。
在一种可能实施例中,上述预设运动状态信息用于指示第一电子设备朝向第二电子设备移动和/或与所述第二电子设备碰触。
在一种可能实施例中,无线通信单元710还用于在第一运动状态信息满足预设运动状态信息的情况下,接收第一电子设备发送的第一指示消息,并执行第二动作,该第二动作包括以下任一项:开始广播第一广播消息,在第二电子设备的广播功能开启的情况下增大广播第一广播消息的频率,该第一指示消息用于指示第二电子设备执行第二动作。
在一种可能实施例中,本申请实施例提供的建立无线连接的装置700还包括检测单元720,该检测单元720用于检测所述第一运动状态信息;若所述第二电子设备判断第一运动状态信息满足预设运动状态信息,则执行第三动作,该第三动作包括以下任一项:开始广播第一广播消息,增大广播第一广播消息的频率。
在一种可能实施例中,上述第一广播消息包括目标电子设备的设备标识和第一信道信息。无线通信单元710具体用于根据所述第一广播消息,与第一电子设备通过 Wi-Fi或者蓝牙建立无线连接。
在另一种可能实施例中,第一广播消息包括目标电子设备的设备标识。无线通信单元710具体用于:接收第一电子设备发送的响应消息,该响应消息包括第一电子设备的设备标识和第二信道信息,该第二信道信息用于指示Wi-Fi信道或者蓝牙信道;根据第一广播消息和响应消息,与第一电子设备通过Wi-Fi或者蓝牙建立无线连接。
在一种可能实施例中,目标电子设备还用于接收第一电子设备发送的与第一业务相关的第一业务数据;或者,向第一电子设备发送第一业务数据。
需要说明的是,上述建立无线连接的装置600可以为图1中的电子设备10,上述检测单元610可以为该电子设备10中的传感器模块180,上述无线通信单元620可以为电子设备10中的无线通信模块160,上述的显示单元可以为电子设备10中的显示屏194。上述建立无线连接的装置700可以为图1中的电子设备20,上述无线通信单元710可以为电子设备20中的无线通信模块,上述检测单元720可以为该电子设备20中的传感器模块。
图22是本申请实施例提供的建立无线连接的系统800的结构性示意性图。该系统800包括:第一电子设备810和第二电子设备820。其中,第一电子设备810可以对应于上述实施例中的装置600;第二电子设备820可以对应于上述实施例中的装置700。
图23是本申请实施例提供的电子设备900的结构性示意性图。该电子设备900包括:处理器910、存储器920、通信接口930、总线940。
在一种可能的实现方式中,图23所示的电子设备900中的处理器910可以对应于图20中的装置600中的检测单元610,通信接口930可以对应于图20中的装置600中的无线通信单元620。
其中,该处理器910可以与存储器920连接。该存储器920可以用于存储该程序代码和数据。因此,该存储器920可以是处理器910内部的存储单元,也可以是与处理器910独立的外部存储单元,还可以是包括处理器910内部的存储单元和与处理器910独立的外部存储单元的部件。
可选的,电子设备900还可以包括总线940。其中,存储器920、通信接口930可以通过总线940与处理器910连接。总线940可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。该总线940可以分为地址总线、数据总线、控制总线等。为便于表示,图23中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。
应理解,在本申请实施例中,该处理器910可以采用中央处理单元(central processing unit,CPU)。该处理器还可以是其它通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。或者该处理器910采用一个或多个集成电路,用于执行相关程序,以实现本申请实施例所提供的技术方案。
该存储器920可以包括只读存储器和随机存取存储器,并向处理器910提供指令和数据。处理器910的一部分还可以包括非易失性随机存取存储器。例如,处理器910 还可以存储设备类型的信息。
在电子设备900运行时,该处理器910执行存储器920中的计算机执行指令以通过装置600执行上述方法的操作步骤。
应理解,根据本申请实施例的电子设备900可对应于本申请实施例中的装置600,并且装置600中的各个单元的上述和其它操作和/或功能分别为了实现方法的相应流程,为了简洁,在此不再赘述。
可选地,在一些实施例中,本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有程序代码,当计算机程序代码在计算机上运行时,使得计算机执行上述各方面中的方法。
可选地,在一些实施例中,本申请实施例还提供了一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当计算机程序代码在计算机上运行时,使得计算机执行上述各方面中的方法。
在本申请实施例中,电子设备包括硬件层、运行在硬件层之上的操作系统层,以及运行在操作系统层上的应用层。其中,硬件层可以包括中央处理器(central processing unit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。操作系统层的操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。应用层可以包含浏览器、通讯录、文字处理软件、即时通信软件等应用。
本申请的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本文中使用的术语“制品”可以涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读介质可以包括但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatile disc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。
本文描述的各种存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读介质。术语“机器可读介质”可以包括但不限于:无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。
应理解,本申请实施例中提及的处理器可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器RAM。 例如,RAM可以用作外部高速缓存。作为示例而非限定,RAM可以包括如下多种形式:静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
需要说明的是,当处理器为通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件时,存储器(存储模块)可以集成在处理器中。
还需要说明的是,本文描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的保护范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,上述单元或模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。此外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
上述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上,或者说对现有技术做出贡献的部分,或者该技术方案的部分,可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,该计算机软件产品包括若干指令,该指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。前述的存储介质可以包括但不限于:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的 介质。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (24)

  1. 一种设备间触碰建立无线连接的方法,其特征在于,所述方法包括:
    第一电子设备采用第一扫描占空比进行无线保真Wi-Fi扫描,所述Wi-Fi扫描用于发现所述第一电子设备周围的其他电子设备;
    在所述第一电子设备检测到所述第一电子设备处于预设运动状态时,所述第一电子设备采用第二扫描占空比进行Wi-Fi扫描,所述第二扫描占空比大于所述第一扫描占空比;
    在所述第一电子设备扫描到的第一广播消息的信号质量满足预设条件时,所述第一电子设备与第二电子设备建立Wi-Fi连接,所述第一广播消息为所述第二电子设备发送的消息。
  2. 根据权利要求1所述的方法,其特征在于,所述预设运动状态包括以下至少一项:所述第一电子设备朝向所述第二电子设备移动,所述第一电子设备与所述第二电子设备触碰。
  3. 根据权利要求1或2所述的方法,其特征在于,在所述第一电子设备接收到的第一广播消息的信号质量满足预设条件之后,所述方法还包括:
    所述第一电子设备显示第一提示消息,所述第一提示消息用于提示是否与所述第二电子设备建立Wi-Fi连接;
    所述第一电子设备与所述第二电子设备建立Wi-Fi连接,包括:
    所述第一电子设备响应于用户在所述第一提示消息上的确认连接操作,与所述第二电子设备建立Wi-Fi连接。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,在所述第一电子设备与所述第二电子设备建立Wi-Fi连接之后,所述方法还包括:
    所述第一电子设备向所述第二电子设备发送与第一业务相关的第一业务数据;和/或,
    所述第一电子设备接收所述第二电子设备发送的所述第一业务数据。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:
    在所述第一电子设备检测到所述第一电子设备处于所述预设运动状态时,所述第一电子设备向所述第二电子设备发送第一指示消息,所述第一指示消息用于指示所述第二电子设备开始广播所述第一广播消息或者增大广播所述第一广播消息的频率。
  6. 根据权利要求5所述的方法,其特征在于,所述第一广播消息包括所述第二电子设备的设备标识和Wi-Fi信道信息;
    所述第一电子设备与所述第二电子设备建立Wi-Fi连接,包括:
    所述第一电子设备基于所述第一广播消息与所述第二电子设备建立Wi-Fi连接。
  7. 根据权利要求5或6所述的方法,其特征在于,所述第一广播消息还包括第三电子设备的设备标识;所述方法还包括:
    所述第一电子设备与所述第三电子设备建立Wi-Fi连接。
  8. 一种电子设备,所述电子设备为第一电子设备,其特征在于,所述电子设备包括Wi-Fi单元、检测单元和处理单元;
    所述Wi-Fi单元,用于采用第一扫描占空比进行无线保真Wi-Fi扫描,所述Wi-Fi扫描用于发现所述第一电子设备周围的其他电子设备;
    所述检测单元,用于检测所述第一电子设备相对于所述其他电子设备的运动状态;
    所述Wi-Fi单元,还用于在所述检测单元检测到所述第一电子设备处于预设运动状态时,采用第二扫描占空比进行扫描,所述第二扫描占空比大于所述第一扫描占空 比;
    所述处理单元,用于在所述第一电子设备扫描到的第一广播消息的信号质量满足预设条件时,将所述第一电子设备与所述第二电子设备建立Wi-Fi连接,所述第一广播消息为所述第二电子设备发送的消息。
  9. 根据权利要求8所述的电子设备,其特征在于,所述预设运动状态包括以下至少一项:所述第一电子设备朝向所述第二电子设备移动,所述第一电子设备与所述第二电子设备触碰。
  10. 根据权利要求8或9所述的电子设备,其特征在于,还包括显示单元;
    所述显示单元,用于在所述Wi-Fi单元扫描到的第一广播消息的信号质量满足预设条件之后,显示第一提示消息,所述第一提示消息用于提示是否与所述第二电子设备建立Wi-Fi连接;
    所述处理单元,具体用于响应于用户在所述第一提示消息上的确认连接操作,与所述第二电子设备建立Wi-Fi连接。
  11. 根据权利要求8至10中任一项所述的电子设备,其特征在于,所述Wi-Fi单元,还用于在所述第一电子设备与所述第二电子设备建立Wi-Fi连接之后,向所述第二电子设备发送与第一业务相关的第一业务数据;和/或,接收所述第二电子设备发送的所述第一业务数据。
  12. 根据权利要求11所述的电子设备,其特征在于,所述Wi-Fi单元,还用于在所述检测单元检测到所述第一电子设备处于所述预设运动状态时,向所述第二电子设备发送第一指示消息,所述第一指示消息用于指示所述第二电子设备开始广播所述第一广播消息或者增大广播所述第一广播消息的频率。
  13. 根据权利要求12所述的电子设备,其特征在于,所述第一广播消息包括所述第二电子设备的设备标识和Wi-Fi信道信息;
    所述处理单元,具体用于基于所述第一广播消息将所述第一电子设备与所述第二电子设备建立Wi-Fi连接。
  14. 根据权利要求12或13所述的电子设备,其特征在于,所述第一广播消息还包括第三电子设备的设备标识;
    所述处理单元,还用于将所述第一电子设备与所述第三电子设备建立Wi-Fi连接。
  15. 一种电子设备,所述电子设备为第一电子设备,其特征在于,所述电子设备包括无线短距离通信芯片和传感器;
    所述无线短距离通信芯片,用于采用第一扫描占空比进行扫描,所述扫描用于发现所述第一电子设备周围的其他电子设备;
    所述传感器,用于检测所述第一电子设备相对于所述其他电子设备的运动状态;
    所述无线短距离通信芯片,还用于在所述传感器检测到所述第一电子设备处于预设运动状态时,采用第二扫描占空比进行扫描,所述第二扫描占空比大于所述第一扫描占空比;
    所述无线短距离通信芯片,用于在所述第一电子设备扫描到的第一广播消息的信号质量满足预设条件时,将所述第一电子设备与所述第二电子设备建立无线连接,所述第一广播消息为所述第二电子设备发送的消息。
  16. 根据权利要求15所述的电子设备,其特征在于,所述预设运动状态包括以下至少一项:所述第一电子设备朝向所述第二电子设备移动,所述第一电子设备与所述第二电子设备触碰。
  17. 根据权利要求15或16所述的电子设备,其特征在于,还包括显示屏;
    所述显示屏,用于在所述无线短距离通信芯片扫描到的第一广播消息的信号质量 满足预设条件之后,显示第一提示消息,所述第一提示消息用于提示是否与所述第二电子设备建立无线连接;
    所述无线短距离通信芯片,具体用于响应于用户在所述第一提示消息上的确认连接操作,与所述第二电子设备建立无线连接。
  18. 根据权利要求15至17中任一项所述的电子设备,其特征在于,所述无线短距离通信芯片还用于:
    在所述第一电子设备与所述第二电子设备建立无线连接之后,向所述第二电子设备发送与第一业务相关的第一业务数据;和/或,接收所述第二电子设备发送的所述第一业务数据。
  19. 根据权利要求15至18中任一项所述的电子设备,其特征在于,所述无线短距离通信芯片还用于:
    在所述传感器检测到所述第一电子设备处于所述预设运动状态时,向所述第二电子设备发送第一指示消息,所述第一指示消息用于指示所述第二电子设备开始广播所述第一广播消息或者增大广播所述第一广播消息的频率。
  20. 根据权利要求19所述的电子设备,其特征在于,所述第一广播消息包括所述第二电子设备的设备标识和信道信息;
    所述无线短距离通信芯片,具体用于基于所述第一广播消息将所述第一电子设备与所述第二电子设备建立无线连接。
  21. 根据权利要求19或20所述的电子设备,其特征在于,所述第一广播消息还包括第三电子设备的设备标识;
    所述无线短距离通信芯片,还用于将所述第一电子设备与所述第三电子设备建立无线连接。
  22. 根据权利要求15至21中任一项所述的电子设备,其特征在于,所述无线短距离通信芯片为无线保真Wi-Fi芯片或者蓝牙芯片。
  23. 一种芯片,其特征在于,所述芯片包括处理器,所述处理器与存储器耦合,所述处理器用于读取并执行所述存储器中存储的计算机程序,以实现如权利要求1至7中任一项所述的方法。
  24. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序被运行时,实现如权利要求1至7中任一项所述的方法。
PCT/CN2021/119929 2020-09-30 2021-09-23 设备间触碰建立无线连接的方法、电子设备及芯片 WO2022068670A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP21874331.8A EP4213513A4 (en) 2020-09-30 2021-09-23 CONTACT METHOD FOR ESTABLISHING A WIRELESS CONNECTION BETWEEN DEVICES, ELECTRONIC DEVICE AND CHIP

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011070213.3A CN114339698A (zh) 2020-09-30 2020-09-30 设备间触碰建立无线连接的方法、电子设备及芯片
CN202011070213.3 2020-09-30

Publications (1)

Publication Number Publication Date
WO2022068670A1 true WO2022068670A1 (zh) 2022-04-07

Family

ID=80949593

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/119929 WO2022068670A1 (zh) 2020-09-30 2021-09-23 设备间触碰建立无线连接的方法、电子设备及芯片

Country Status (3)

Country Link
EP (1) EP4213513A4 (zh)
CN (1) CN114339698A (zh)
WO (1) WO2022068670A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115276849A (zh) * 2022-07-27 2022-11-01 杭州逗酷软件科技有限公司 传屏方法、装置、电子设备和可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107094372A (zh) * 2014-12-16 2017-08-25 高通股份有限公司 用于实现低能量iot设备之间的快速连接的iot设备
CN110072269A (zh) * 2019-04-01 2019-07-30 Oppo广东移动通信有限公司 扫描控制方法、装置、移动终端以及存储介质
CN110166974A (zh) * 2019-05-30 2019-08-23 拉扎斯网络科技(上海)有限公司 建立通信连接的方法、装置、电子设备及存储介质
US20200162883A1 (en) * 2017-08-11 2020-05-21 Sonova Ag Communication device having a wireless interface

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9380520B2 (en) * 2013-03-13 2016-06-28 Qualcomm Incorporated Using motion to improve local wireless network connectivity
US10206170B2 (en) * 2015-02-05 2019-02-12 Apple Inc. Dynamic connection path detection and selection for wireless controllers and accessories
WO2018000134A1 (zh) * 2016-06-27 2018-01-04 华为技术有限公司 一种蓝牙连接的方法及终端
KR102496058B1 (ko) * 2016-08-01 2023-02-06 삼성전자 주식회사 근거리 무선 통신 네트워크에서 스캔 방법 및 이를 구현하는 전자 장치
CN110784830B (zh) * 2019-09-18 2022-07-29 华为技术有限公司 数据处理方法、蓝牙模块、电子设备与可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107094372A (zh) * 2014-12-16 2017-08-25 高通股份有限公司 用于实现低能量iot设备之间的快速连接的iot设备
US20200162883A1 (en) * 2017-08-11 2020-05-21 Sonova Ag Communication device having a wireless interface
CN110072269A (zh) * 2019-04-01 2019-07-30 Oppo广东移动通信有限公司 扫描控制方法、装置、移动终端以及存储介质
CN110166974A (zh) * 2019-05-30 2019-08-23 拉扎斯网络科技(上海)有限公司 建立通信连接的方法、装置、电子设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4213513A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115276849A (zh) * 2022-07-27 2022-11-01 杭州逗酷软件科技有限公司 传屏方法、装置、电子设备和可读存储介质

Also Published As

Publication number Publication date
EP4213513A4 (en) 2024-02-21
CN114339698A (zh) 2022-04-12
EP4213513A1 (en) 2023-07-19

Similar Documents

Publication Publication Date Title
WO2021036835A1 (zh) 一种蓝牙搜索方法、系统及相关装置
CN115209194B (zh) 一种通过遥控器实现一碰投屏的终端设备、方法以及系统
WO2021052178A1 (zh) 一种Wi-Fi连接方法及设备
WO2021036776A1 (zh) 一种无线充电方法及电子设备
WO2021043170A1 (zh) 一种蓝牙连接方法及相关装置
WO2021043198A1 (zh) 一种蓝牙配对方法及相关装置
WO2020062344A1 (zh) 一种数据传输方法及电子设备
US20230129780A1 (en) Wi-Fi Aware Link Establishment Method and System, Electronic Device, and Storage Medium
WO2021017909A1 (zh) 一种通过nfc标签实现功能的方法、电子设备及系统
WO2021043219A1 (zh) 一种蓝牙回连方法及相关装置
WO2020042119A1 (zh) 一种消息传输方法及设备
WO2021023046A1 (zh) 一种电子设备控制方法及一种电子设备
WO2022068513A1 (zh) 无线通信方法和终端设备
EP4250075A1 (en) Content sharing method, electronic device, and storage medium
US20230125956A1 (en) Wireless Communication System and Method
US20240008107A1 (en) Communication connection establishment method and system, electronic device, and storage medium
US20230370920A1 (en) Communication method, terminal device, and storage medium
WO2021027623A1 (zh) 一种设备能力发现方法及p2p设备
WO2022068670A1 (zh) 设备间触碰建立无线连接的方法、电子设备及芯片
WO2022267974A1 (zh) 一种投屏方法及相关装置
CN115022852B (zh) 控制蓝牙传输速率的方法及电子设备
RU2795130C2 (ru) Оконечное устройство, способ и система реализации экранной проекции одним касанием, используя дистанционное управление
EP4362507A1 (en) Communication system and communication method
RU2780224C1 (ru) Оконечное устройство, способ и система реализации экранной проекции одним касанием, используя дистанционное управление
WO2023226645A1 (zh) 通信方法、通信系统及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21874331

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021874331

Country of ref document: EP

Effective date: 20230410

NENP Non-entry into the national phase

Ref country code: DE