WO2020191570A1 - Method for establishing wireless communication connection, and related devices - Google Patents

Method for establishing wireless communication connection, and related devices Download PDF

Info

Publication number
WO2020191570A1
WO2020191570A1 PCT/CN2019/079461 CN2019079461W WO2020191570A1 WO 2020191570 A1 WO2020191570 A1 WO 2020191570A1 CN 2019079461 W CN2019079461 W CN 2019079461W WO 2020191570 A1 WO2020191570 A1 WO 2020191570A1
Authority
WO
WIPO (PCT)
Prior art keywords
connection
terminal device
electronic device
wireless
wireless connection
Prior art date
Application number
PCT/CN2019/079461
Other languages
French (fr)
Chinese (zh)
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 PCT/CN2019/079461 priority Critical patent/WO2020191570A1/en
Priority to CN201980093314.1A priority patent/CN113508635B/en
Publication of WO2020191570A1 publication Critical patent/WO2020191570A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • This application relates to the field of information technology, and more specifically, to a method and related equipment for establishing a wireless communication connection.
  • Current terminal devices can support multiple wireless communication methods, for example, Bluetooth (bluetooth) communication, Wi-Fi communication, and so on.
  • the roles of two terminal devices supporting Bluetooth communication can be divided into a master device and a slave device.
  • the master device establishes a connection by scanning the information broadcast by the slave device. Specifically, after starting the Bluetooth connection, the slave device will turn on Bluetooth broadcasting and broadcast a Bluetooth name; the master device will perform a Bluetooth scan, and the scan result will be presented on the display device of the master device.
  • the user can use the input device of the master device to select the Bluetooth name of the slave device. After obtaining the Bluetooth name selected by the user, the master device initiates a Bluetooth connection with the slave device broadcasting the Bluetooth name.
  • the above connection process requires the user to manually select the device to be connected.
  • the main device scans multiple Bluetooth names, the user also needs to know the Bluetooth name broadcast by the device to be connected. Therefore, if multiple similar Bluetooth names appear, the user cannot quickly determine the Bluetooth name broadcast by the device to be connected.
  • Wi-Fi communication Similar to Bluetooth communication, the process of establishing a connection in Wi-Fi communication requires one party to broadcast and one party to scan. Therefore, Wi-Fi communication also has similar problems.
  • the embodiments of the present application provide a method for establishing a wireless communication connection and related equipment, which can provide a method for establishing a wireless connection across speeds and can reduce the power consumption of the terminal device.
  • an embodiment of the present application provides a method for establishing a wireless connection.
  • the method includes: an electronic device obtains connection establishment information stored in the terminal device through near field communication (NFC) with a terminal device, and the connection establishment information Including a connection identification; the electronic device broadcasts a wireless connection broadcast message containing the connection identification; the electronic device establishes a wireless connection with the terminal device according to the connection identification.
  • NFC near field communication
  • the electronic device when the electronic device performs near field communication with the terminal device, the power of the terminal device is not consumed. In this way, the battery life of the terminal device can be improved.
  • using the NFC connection to establish a wireless connection can avoid manual search and selection of connection identification. This can improve the user experience.
  • the connection establishment information further includes: first verification information; before the electronic device establishes a wireless connection with the terminal device, the method further includes: the electronic device The device establishes a temporary connection with the terminal device; the electronic device receives the second verification information sent by the terminal device through the temporary connection; the electronic device determines that the second verification information is the same as the first verification information To confirm that the terminal device passes the identity verification. By verifying the identity of the terminal device through the verification information, it can be ensured that the established connection is a secure connection.
  • the method before the electronic device establishes a wireless connection with the terminal device, the method further includes: the electronic device establishes a temporary connection with the terminal device; The temporary connection sends the first random number to the terminal device; the electronic device obtains the second random number stored in the terminal device through the NFC; the electronic device determines that the first random number is the same as the second random number In the case, it is determined that the terminal device passes the identity verification. By verifying the identity of the terminal device through a random number, it can be ensured that the established connection is a secure connection. It can also support the use of random numbers to establish wireless connections.
  • the method before the electronic device broadcasts the wireless connection broadcast message containing the connection identifier, the method further includes: the electronic device obtains the connection establishment information after the In this case, make sure to turn on the wireless connection function.
  • the electronic device obtains the connection establishment information after the In this case, make sure to turn on the wireless connection function.
  • the connection establishment information further includes a broadcast period;
  • the electronic device broadcasting a wireless connection broadcast message containing the connection identifier includes: the electronic device periodically broadcasting In the wireless connection broadcast message, the period during which the electronic device broadcasts the wireless connection broadcast message is the broadcast period.
  • the electronic device obtains connection establishment information stored in the terminal device through near field communication (NFC) with the terminal device, including: the electronic device reads The NFC tag in the terminal device obtains the connection establishment information stored in the NFC tag.
  • NFC near field communication
  • the electronic device reads the NFC tag
  • the NFC tag itself does not consume power.
  • the process of using the NFC connection to establish a wireless connection will not consume the internal power of the terminal device, so that the battery life of the terminal device can be improved.
  • connection identifier is a Bluetooth name
  • the electronic device establishing a wireless connection with the terminal device according to the connection identifier includes: the electronic device connects with the terminal device according to the Bluetooth name The terminal device establishes a Bluetooth connection.
  • connection identifier is a service set identifier SSID
  • the electronic device establishing a wireless connection with the terminal device according to the connection identifier includes: the electronic device according to the SSID Establish a wireless local area network connection with the terminal device.
  • an embodiment of the present application provides a method for establishing a wireless connection.
  • the method includes: a terminal device sends saved connection establishment information to an electronic device through near field communication (NFC), where the connection establishment information includes a connection identifier; the terminal The device scans for the wireless connection broadcast message containing the connection identifier; after scanning the wireless connection broadcast message, the terminal device establishes a wireless connection with the electronic device according to the connection identifier.
  • NFC near field communication
  • the connection establishment information further includes: first verification information; before the wireless connection is established with the electronic device, the method further includes: the terminal device A temporary connection is established with the electronic device; the terminal device sends the first verification information to the electronic device through the temporary connection. By verifying the identity of the terminal device through the verification information, it can be ensured that the established connection is a secure connection.
  • the method before the electronic device establishes a wireless connection, the method further includes: the terminal device establishes a temporary connection with the electronic device; and the terminal device receives the electronic device The first random number sent through the temporary connection; the terminal device saves the first random number. By verifying the identity of the terminal device through a random number, it can be ensured that the established connection is a secure connection. It can also support the use of random numbers to establish wireless connections.
  • the connection establishment information further includes: a broadcast period; the terminal device scanning for a wireless connection broadcast message containing the connection identifier includes: the terminal device periodically scanning In the wireless connection broadcast information, the period during which the terminal device scans the wireless connection broadcast information is the broadcast period.
  • the connection establishment information is stored in an NFC tag in the terminal device, and the terminal device scans the wireless connection broadcast message containing the connection identifier, including: When determining that the NFC tag is read by the electronic device, the terminal device scans the wireless connection broadcast message.
  • the terminal device scans the wireless connection broadcast message.
  • connection identifier is a Bluetooth name
  • establishing a wireless connection with the electronic device according to the connection identifier includes: establishing a Bluetooth with the electronic device according to the Bluetooth name connection.
  • connection identifier is a service set identifier SSID
  • establishing a wireless connection with the electronic device according to the connection identifier includes: establishing a wireless connection with the electronic device according to the SSID Wireless LAN connection.
  • an embodiment of the present application provides an electronic device, which includes a unit for executing the first aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides a terminal device.
  • the terminal device includes a unit for executing the second aspect or any possible implementation manner of the second aspect.
  • embodiments of the present application provide a terminal device, which includes a processor, a memory, a wireless module, and a communication interface.
  • the memory is used to store instructions used to implement the first aspect or any one of the possible implementation manners of the first aspect, and the processor controls the execution.
  • the processor executes the instructions stored in the memory, and combines the wireless module and the communication interface to implement the first aspect or any one of the possible implementation methods of the first aspect.
  • an embodiment of the present application provides an electronic device that includes a processor, a memory, a wireless module, and a communication interface.
  • the memory is used to store instructions for implementing the second aspect or any one of the possible implementation manners of the second aspect, and the processor controls the execution.
  • the processor executes the instructions stored in the memory, and combines the wireless module and the communication interface to implement the second aspect or any one of the possible implementation methods of the second aspect.
  • an embodiment of the present application provides a storage medium that stores instructions for implementing the first aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides a storage medium that stores instructions for implementing the second aspect or any one of the possible implementation manners of the second aspect.
  • this application provides a computer program product containing instructions, when the computer program product is run on a computer, the computer can execute the first aspect or any one of the possible implementations of the first aspect. .
  • this application provides a computer program product containing instructions, when the computer program product runs on a computer, the computer executes the second aspect or any one of the possible implementation methods of the second aspect. .
  • Fig. 1 is a schematic structural block diagram of a terminal device according to an embodiment of the present application.
  • Fig. 2 is a schematic structural block diagram of an electronic device according to an embodiment of the present application.
  • Fig. 3 is a schematic flowchart of a method for establishing a wireless connection according to an embodiment of the present application.
  • Fig. 4 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
  • Fig. 5 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
  • Fig. 6 is a structural block diagram of an electronic device according to an embodiment of the present application.
  • Fig. 7 is a structural block diagram of a terminal device according to an embodiment of the present application.
  • At least one refers to one or more, and “multiple” refers to two or more.
  • And/or describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, both A and B exist, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the associated objects are in an "or” relationship.
  • At least one item (a) in the following” or similar expressions refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a).
  • At least one of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c may be single or multiple.
  • words such as “first” and “second” do not limit the number and execution order.
  • the terminal 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 includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also referred to as main memory).
  • the operating system may be any one or more computer operating systems that implement business processing through processes, for example, Linux operating system, Unix operating system, Android operating system, iOS operating system, or windows operating system.
  • the application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
  • the embodiments of the application do not specifically limit the specific structure of the execution subject of the methods provided in the embodiments of the application, as long as the program that records the codes of the methods provided in the embodiments of the application can be provided according to the embodiments of the application.
  • the execution subject of the method provided in the embodiment of the present application may be a terminal device or a network device, or a functional module in the terminal device or network device that can call and execute the program.
  • computer-readable media may include, but are not limited to: magnetic storage devices (for example, hard disks, floppy disks, or tapes, etc.), optical disks (for example, compact discs (CDs), digital versatile discs (digital versatile discs, DVDs) Etc.), smart cards and flash memory devices (for example, erasable programmable read-only memory (EPROM), cards, sticks or key drives, etc.).
  • magnetic storage devices for example, hard disks, floppy disks, or tapes, etc.
  • optical disks for example, compact discs (CDs), digital versatile discs (digital versatile discs, DVDs) Etc.
  • smart cards and flash memory devices for example, erasable programmable read-only memory (EPROM), cards, sticks 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.
  • Bluetooth is a wireless technology standard that can realize short-distance data exchange between fixed and mobile terminals.
  • the establishment process of Bluetooth connection includes device discovery and connection.
  • the device discovery process mainly includes: terminal device A is in a visible state, broadcasting the Bluetooth name; terminal device B first scans the terminal in the visible state, and then selects terminal device A from the scannable devices. It can be seen that in the process of Bluetooth device discovery, the terminal device will obtain the Bluetooth name broadcast by the peer device.
  • the Bluetooth referred to in the embodiments of the present application may refer to classic Bluetooth or Bluetooth Low Energy (BLE).
  • BLE Bluetooth Low Energy
  • Wireless Local Area Networks is a technology that uses wireless technology to connect two or more devices to form a local area network. Most modern WLANs are based on the Institute of Electrical and Electronics Engineers (IEEE) 802.11 series of standards. Wi-Fi is the marketable brand name of WLAN. The meanings of Wi-Fi and WLAN are not strictly distinguished in the embodiments of the present application. In other words, both Wi-Fi and WLAN in the embodiments of this application refer to wireless communication technologies based on the IEEE 802.11 series of standards.
  • the router can broadcast a Service Set Identifier (SSID). The terminal device can search for the SSID and select the SSID that needs to be connected among the scanned SSIDs. It can be seen that during the Wi-Fi connection establishment process, the terminal device will obtain the SSID broadcast by the router.
  • SSID Service Set Identifier
  • NFC Near field communication
  • the working distance of NFC is usually less than 10 cm, so it has high security.
  • NFC has the advantages of faster transmission creation speed, fast transmission speed, and low power consumption.
  • NFC tags are passive devices that do not require power supply.
  • the NFC tag obtains a small power source from the NFC reader to drive the NFC tag
  • the circuit transmits the data stored in the NFC tag to the NFC reader.
  • Type 1 Tag (Tag 1 Type), Type 2 Tag (Tag 2 Type), Type 3 Tag (Tag 3 Type) and Type 4 Tag (Tag 4 Type) .
  • Different types of NFC tags have different storage capabilities. For example, the storage energy of type 1 tags is 96 bytes, and the storage capacity of type 2 tags is 48 bytes.
  • Different types of NFC tags have different reading and writing capabilities. For example, Type 1 tags and Type 2 tags have the ability to read and rewrite, and can also be configured as read-only. Type 3 tags and Type 4 tags are read-only, and the content saved in the tag is actually written when the tag is produced or written by a special tag writer.
  • the embodiment of the present application provides a method for establishing a wireless communication connection.
  • the basic principle of the method is that an electronic device provided with an NFC reader obtains the connection establishment information stored in the NFC tag through the NFC reader, and the connection establishment information Includes the connection identification; the electronic device broadcasts the connection identification.
  • the terminal device establishes a wireless connection with the electronic device through the connection identifier, wherein the connection establishment information is pre-stored in the terminal device.
  • connection identification broadcast by the electronic device is obtained from the NFC tag, and the connection identification is pre-stored in the terminal device.
  • the terminal device can directly choose to establish a wireless connection with the electronic device broadcasting the connection identifier.
  • the method provided in the embodiment of the present application can eliminate the need for the user to manually select a connection identifier that needs to establish a wireless connection.
  • the above technical solutions can enable devices to quickly acquire information that should have been acquired in the device discovery process through the NFC connection, and avoid the device from repeating the tedious and complicated device discovery process.
  • the terminal device searches for multiple devices that can be connected wirelessly
  • the user does not need to know the connection identification broadcast by the electronic device that needs to be connected, nor does it need to search for multiple connections Find the broadcast connection identifier of the electronic device that you want to connect to in the identifier.
  • the time for establishing a wireless connection can be further saved, the efficiency of establishing a wireless connection can be improved, and the user experience can be enhanced.
  • the terminal device referred to in the embodiment of the present application may be a mobile terminal device, such as a mobile phone, a tablet computer, a notebook computer, and the like.
  • the terminal device referred to in the embodiments of the present application may also refer to a power consumption sensitive device.
  • the power consumption-sensitive device referred to in the embodiments of the present application refers to a terminal device that is powered by a battery (usually a rechargeable battery) and has a battery capacity of usually tens to hundreds of mAh.
  • a battery usually a rechargeable battery
  • power-sensitive devices that use rechargeable batteries are not easy to use when they are charged. Therefore, power consumption-sensitive devices usually hope to provide users with long-term service as much as possible when the battery capacity is limited.
  • Common power-sensitive devices include Bluetooth headsets, smart watches, smart bracelets, and smart glasses.
  • the electronic device referred to in the embodiments of the present application refers to an electronic device that can communicate with the terminal device through a wireless connection. It can be a terminal device or other types of electronic devices that can perform wireless communication. This electronic device is generally not sensitive to power consumption. For example, the electronic device can be directly powered by AC power, or the electronic device can be used normally in a charged state. For example, the electronic device may be sports equipment (such as treadmills, elliptical machines, etc.), Bluetooth speakers, etc.
  • the wireless connection established by the electronic device and the terminal device is a Bluetooth connection, so that the electronic device can perform Bluetooth communication with the terminal device.
  • the wireless connection established by the electronic device and the terminal device may be a WLAN connection (for example, a Wi-Fi connection), so that the electronic device can perform WLAN communication with the terminal device.
  • Fig. 1 is a schematic structural block diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 100 shown in FIG. 1 includes a processor 110, a memory 120, an output module 130, and a communication interface 140.
  • the processor 110 may include a central processing unit (CPU) 111, a Bluetooth module 112, and a WLAN module 113.
  • the CPU 111 included in the processor 110 may also be a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, for example: one or more microprocessors ( Digital signal processor, DSP), or, one or more Field Programmable Gate Array (FPGA).
  • ASIC Application Specific Integrated Circuit
  • DSP Digital signal processor
  • FPGA Field Programmable Gate Array
  • the CPU 111 can execute various functions of the terminal device in combination with the Bluetooth module 112 and/or the Wi-Fi module 113 by running or executing a software program stored in the memory 120 and calling data stored in the memory 120.
  • the terminal may include multiple processors.
  • processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU).
  • the processor here may refer to one or more terminals, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • the memory 120 may be a read-only memory (ROM) or other types of static storage terminals that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions
  • the dynamic storage terminal can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic disk storage medium or other magnetic storage terminal, or it can be used to carry or store instructions or data structures
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • the memory 120 may exist independently and is connected to the processor 110 through a communication bus 150.
  • the memory 120 may also be integrated with the processor 110.
  • the memory 120 is also used to store a software program for executing the solution of the application, and is controlled by the processor 110 to execute.
  • the memory 120 is also used to store connection establishment information.
  • the output module 130 may be used to display information input by the user or information provided to the user and various menus of the terminal device 100.
  • the output module 130 may include a display panel 131.
  • the display panel 131 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), etc.
  • the terminal device 100 may further include an input device.
  • the input device may include a touch screen.
  • the touch screen can cover the display panel 131.
  • the input device and the display panel can be used as two independent components to implement the input and output functions of the terminal device 100.
  • the display panel 131 can be integrated with a touch screen to implement the input and output functions of the terminal device 100.
  • the input device may further include keys.
  • the communication interface 140 uses any device such as a transceiver to communicate with other devices or communication networks.
  • the communication interface 140 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.
  • the Bluetooth module 112 is integrated with a Bluetooth chip, is suitable for the classic Bluetooth protocol and the low-power Bluetooth protocol, and is used to support the terminal device 110 to establish Bluetooth connections with other devices.
  • the WLAN module 113 is integrated with a Wi-Fi chip for supporting the terminal device 110 to establish a WLAN connection with other devices.
  • the structure of the terminal device shown in FIG. 1 does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or a combination of some components, or a different component arrangement.
  • the terminal device may not include the WLAN module 113 shown in FIG. 1.
  • the NFC tag storing the connection establishment information may be provided inside the terminal device 100.
  • the arrangement of the NFC tag inside the terminal device means that the NFC tag is arranged inside the housing of the terminal device.
  • the NFC tag may be a readable and writable NFC tag.
  • the user can set the connection establishment information stored in the NFC tag by himself.
  • the connection establishment information set by the user can be stored in the NFC tag and the internal memory of the terminal device.
  • the NFC tag may also be a read-only NFC tag. In this case, the connection establishment information stored in the NFC tag is written into the NFC tag during the production phase.
  • connection establishment information can be written into the memory in the terminal device during the production stage of the terminal device.
  • the NFC tag is a passive device that does not require a power source.
  • the NFC tag set inside the terminal device does not consume the power of the terminal device. In this way, the terminal device can quickly establish a wireless connection without requiring additional power consumption.
  • the NFC tag storing the connection establishment information may also be provided outside the terminal device 100.
  • the setting of the NFC tag outside the terminal device means that the NFC tag can be pasted on the shell of the terminal device by pasting, or the NFC tag can be used as an object independent of the terminal device, for example, set inside a card.
  • the user can use the input device of the terminal device to input the connection establishment information stored in the NFC tag into the terminal device, and save it in the memory in the terminal device.
  • the user can also use a device capable of communicating (wired or wireless communication) with the terminal device to transmit the connection establishment information to the terminal device and save it in the memory in the terminal device.
  • the terminal device may be a smart watch.
  • the smart watch can be connected to a computer through a data line, and communicate with the computer through the data line.
  • the user can use the computer to transfer the connection establishment information to the smart watch via a data cable, and save it in the memory in the smart watch.
  • the NFC tag may be a read-only NFC tag.
  • the connection establishment information stored in the NFC tag is written into the NFC tag during the production phase.
  • the NFC tag can also be a readable and writable NFC tag, and the NFC tag can be pre-written with a preset connection establishment information during the production stage.
  • the user can directly use the preset connection establishment information or can also modify the connection establishment information saved in the NFC tag.
  • terminal devices that do not include the NFC tag in the hardware can also support the method for establishing a wireless connection provided in the embodiments of the present application.
  • Fig. 2 is a schematic structural block diagram of an electronic device according to an embodiment of the present application.
  • the electronic device 200 shown in FIG. 2 includes a processor 210, a memory 220, an output module 230, a communication interface 240, and an NFC reader 250.
  • the processor 210 may include a central processing unit (CPU) 211, a Bluetooth module 212, and a WLAN module 213.
  • the CPU 211 included in the processor 210 may also be a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, for example: one or more microprocessors ( Digital signal processor, DSP), or, one or more Field Programmable Gate Array (FPGA). Wherein, the CPU 211 can execute various functions of the electronic device in combination with the Bluetooth module 212 and/or the Wi-Fi module 213 by running or executing a software program stored in the memory 220 and calling data stored in the memory 220.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital signal processor
  • FPGA Field Programmable Gate Array
  • the terminal may include multiple processors.
  • processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU).
  • the processor here may refer to one or more terminals, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • the memory 220 may be a read-only memory (ROM) or other types of static storage terminals that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions
  • the dynamic storage terminal can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic disk storage medium or other magnetic storage terminal, or it can be used to carry or store instructions or data structures
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • the memory 220 may exist independently and is connected to the processor 210 through the communication bus 260.
  • the memory 220 may also be integrated with the processor 210.
  • the memory 220 is also used to store a software program for executing the solution of the present application, and the processor 210 controls the execution.
  • the output module 230 may be used to display information provided to the user and various menus of the electronic device 200.
  • the output module 230 may include a display panel 231.
  • the display panel 231 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), etc.
  • the electronic device 200 may further include an input device.
  • the input device may include a touch screen.
  • the touch screen can cover the display panel 231.
  • the input device and the display panel can be used as two independent components to implement the input and output functions of the electronic device 200.
  • the display panel 231 can be integrated with a touch screen to implement the input and output functions of the electronic device 200.
  • the input device may further include keys.
  • the communication interface 240 uses any device such as a transceiver to communicate with other devices or communication networks.
  • the communication interface 240 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.
  • the Bluetooth module 212 is integrated with a Bluetooth chip, is suitable for the classic Bluetooth protocol and the low-power Bluetooth protocol, and is used to support the electronic device 210 to establish Bluetooth connections with other devices.
  • the WLAN module 213 is integrated with a WLAN chip for supporting the electronic device 210 to establish a WLAN connection with other devices.
  • the NFC reader 250 is used to obtain the connection establishment information stored in the NFC tag.
  • the NFC reader 250 may be connected to the processor 210 through the communication bus 260.
  • the NFC reader 250 may send the connection establishment information to the processor 210.
  • the processor 210 may initiate a wireless connection according to the acquired connection establishment information.
  • the NFC reader 250 may also be connected to the memory 220 via the communication bus 260, and send the connection establishment information to the memory 220.
  • the structure of the electronic device shown in FIG. 2 does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or a combination of some components, or a different component arrangement.
  • the electronic device may not include the WLAN module 213 as shown in FIG. 2.
  • Fig. 3 is a schematic flowchart of a method for establishing a wireless connection according to an embodiment of the present application.
  • the electronic device obtains connection establishment information stored in the terminal device by performing NFC with the terminal device, and broadcasts a wireless connection broadcast message including a connection identifier.
  • the connection establishment information includes the connection identifier.
  • an NFC tag is provided in the terminal device, and the connection establishment information is stored in the NFC tag.
  • the electronic device can obtain the connection establishment information by reading the NFC tag in the terminal device.
  • the NFC tag may be provided outside the terminal device, and the connection establishment information may be stored in a storage device inside the terminal device.
  • the electronic device may stop broadcasting the wireless connection broadcast message when the duration of broadcasting the wireless connection broadcast message exceeds a preset duration and the wireless connection is not established with the terminal device. For example, the electronic device may start a timer after starting to broadcast the wireless connection broadcast message. If the duration of the timer exceeds a preset duration (for example, 30 seconds), the electronic device may stop broadcasting the wireless connection broadcast message.
  • a preset duration for example, 30 seconds
  • the terminal device starts a wireless connection broadcast scan.
  • the terminal device may initiate the wireless connection broadcast scan when it is determined that the NFC tag inside the terminal device is read. In other words, if the NFC tag is inside the terminal device, the terminal device can determine whether the NFC tag is read. The terminal device may start the wireless connection broadcast scan when it is determined that the NFC tag is read. If the terminal device determines that the NFC tag has not been read, the terminal device may not need to start the wireless connection broadcast scan. In this way, the power of the terminal device can be saved.
  • the terminal device when the terminal device performs the wireless connection broadcast scan for more than a preset time and the terminal device does not detect that the connection identifier is broadcast, the terminal device may stop performing the Wireless connection broadcast scan.
  • the user can manually start the wireless connection broadcast scan.
  • the user can start the wireless connection broadcast scan through the input device of the terminal device.
  • the terminal device may periodically start the wireless connection broadcast scan.
  • the user can set a scan period.
  • the terminal device can start the wireless connection broadcast scan according to the scan period.
  • the user can set to start a wireless connection broadcast scan every 10 minutes. In this way, the terminal device can start the wireless connection broadcast scan every 10 minutes.
  • the terminal device scans through the wireless connection broadcast and scans the wireless connection broadcast message containing the connection identifier.
  • the connection establishment information may also include a broadcast period.
  • the electronic device can periodically broadcast the connection identification; accordingly, the terminal device can periodically perform the wireless connection broadcast scan, wherein the electronic device broadcasts the connection identification period and the terminal device performs the The period of wireless connection broadcast scanning is the broadcast period.
  • the terminal device establishes a wireless connection with the electronic device.
  • the wireless connection may be any of the following connections: Bluetooth connection, WLAN connection, and so on.
  • identity verification may be performed between the electronic device and the terminal device. In other words, in some cases, if the identity verification is passed, the electronic device establishes the wireless connection with the terminal device. In the case that the identity verification fails the identity verification, the electronic device will not establish the wireless connection with the terminal device.
  • the identity verification process may be implemented by the electronic device.
  • the connection establishment information further includes verification information (the verification information may also be referred to as a key, and the key may be a preset key or a temporarily generated temporary key. key).
  • the terminal device and the electronic device can use the verification information to complete the identity verification process.
  • the terminal device may send the verification information to the electronic device through a temporary connection.
  • the electronic device can compare the verification information read from the NFC tag (for ease of description, the verification information in the NFC tag is referred to as the first verification information below) and the terminal received through the temporary connection.
  • the verification information sent by the device (for ease of description, the verification information received by the electronic device through the temporary connection is referred to as the second verification information below); if the first verification information is the same as the second verification information, Then the electronic device can determine that the terminal device passes the identity verification; if the first verification information is different from the second verification information, the electronic device can determine that the terminal device fails the identity verification.
  • the NFC tag is located inside the terminal device and the terminal device can perform read and write operations on the content held in the NFC tag.
  • the electronic device can send a random number (also called a random code, pairing code, etc.) to the terminal device through a temporary connection, and complete the identity verification process according to the random number.
  • the terminal device can write the random number received through the temporary connection into the NFC tag; the electronic device can read the NFC tag to obtain the random number stored in the NFC tag, and compare the electronic device
  • the random number sent to the terminal device (for ease of description, the random number sent by the electronic device to the terminal device is called the first random number below) and the random number in the NFC tag (for ease of description, the NFC The random number in the tag is called the second random number); if the first random number is the same as the second random number, the electronic device can determine that the terminal device passes the identity verification; if the first random number is the same as the second random number If the random number is different, the electronic device can determine that the terminal device has not passed the identity verification.
  • the identity verification process may also be completed by the terminal device.
  • the terminal device may send the verification information to the electronic device through a temporary connection.
  • the electronic device can read the verification information stored in the NFC tag (for ease of description, the verification information in the NFC tag is referred to as the first verification information below), and the temporary connection will read The first verification information is sent to the terminal device.
  • the terminal device compares the first verification information with the verification information sent by the electronic device received through the temporary connection (for ease of description, the verification information received by the terminal device through the temporary connection and sent by the electronic device is referred to as the first Three verification information); if the first verification information is the same as the third verification information, the terminal device can determine that the electronic device passes the identity verification; if the first verification information is different from the third verification information , The terminal device can determine that the electronic device has not passed the identity verification.
  • the random number may be generated by the terminal device.
  • the terminal device can write the generated random number into the NFC tag; the electronic device can read the NFC tag to obtain the random number stored in the NFC tag, and send the read random number through a temporary connection To the terminal device.
  • the terminal device can compare the random number sent by the electronic device received through the temporary link (for ease of description, the random number sent by the electronic device to the terminal device is called the first random number below) and saved in the NFC tag (For ease of description, the random number in the NFC tag is called the second random number below); if the first random number is the same as the second random number, the terminal device can determine that the electronic device passes Identity verification; if the first random number is different from the second random number, the terminal device can determine that the electronic device fails the identity verification.
  • the identity verification can pass.
  • the verification information and the random number can be verified at the same time, and the identity verification can pass only when the verification information and the random number are the same.
  • the work of using the verification verification information and the random number for identity verification may be performed by the same device.
  • the terminal device can perform verification information verification and random number verification to determine whether the electronic device passes the identity verification.
  • the electronic device may perform verification information verification and random number verification to determine whether the terminal device passes the identity verification.
  • the work of using verification information and random numbers for identity verification may be performed by different devices.
  • the terminal device may be responsible for verifying the verification information, and the electronic device may be responsible for verifying the random number.
  • the terminal device may be responsible for the random number verification, and the terminal device may be responsible for the verification information verification.
  • the process of performing identity verification between the electronic device and the terminal device may be considered as part of the process of establishing a wireless connection.
  • Fig. 4 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
  • the smart watch uses NFC to send connection establishment information to the treadmill.
  • the treadmill uses the NFC reader provided in the treadmill to read the connection establishment information stored in the NFC tag provided in the smart watch, and the connection establishment information may include a connection identifier. Since the connection establishment information is used to establish a Bluetooth connection, the connection establishment information may also be referred to as Bluetooth interconnection information, Bluetooth interconnection parameters, or Bluetooth interconnection parameter information.
  • connection identifier may be a Bluetooth name or a remote name (remote name).
  • connection identifier may be a Bluetooth address.
  • the user needs to close the smart watch to the NFC reader of the treadmill so that the NFC reader of the treadmill can read the NFC tag set in the smart watch.
  • the treadmill performs Bluetooth broadcasting.
  • the treadmill can broadcast wireless connection broadcast messages via Bluetooth broadcast.
  • the wireless connection broadcast message may include a connection identifier.
  • the treadmill acts as a Bluetooth slave device (Peripheral Device) to perform Bluetooth broadcast and broadcast the connection identification.
  • connection identification is a Bluetooth name or a remote name
  • the treadmill will broadcast the Bluetooth address or remote name as the name of the Bluetooth connection.
  • connection identifier is a Bluetooth address
  • the treadmill uses the Bluetooth address as the Bluetooth address of the treadmill itself, and performs Bluetooth broadcast.
  • the connection identifier is a Bluetooth address
  • the treadmill broadcasts using the Bluetooth address as the target connection address.
  • the treadmill may activate the Bluetooth module and perform Bluetooth broadcasting when the NFC reader reads the connection establishment information.
  • the Bluetooth module in the treadmill can be in a closed or dormant state before the NFC reader reads the connection establishment information.
  • the Bluetooth broadcast time of the treadmill is limited.
  • the treadmill can stop performing Bluetooth broadcasting when the duration of Bluetooth broadcasting exceeds the preset period and the Bluetooth connection is not established.
  • the treadmill can start a timer after starting Bluetooth broadcast. If the duration of the timer exceeds a preset duration (for example, 30 seconds) and the treadmill does not establish a Bluetooth connection, the treadmill can stop performing Bluetooth broadcasting.
  • the Bluetooth broadcast of the treadmill is temporary.
  • the smart watch performs a Bluetooth scan, and establishes a Bluetooth connection with the treadmill through the connection identifier when the wireless connection broadcast message containing the connection identifier is scanned.
  • the smart watch can be used as a Bluetooth master device (Central Device) to perform Bluetooth scanning.
  • a Bluetooth master device Central Device
  • scanning that contains the connection identifier saved by the NFC tag in the smart watch, use the connection identifier and broadcast the connection identifier.
  • the treadmill establishes a Bluetooth connection.
  • the smart watch when the smart watch detects that the NFC tag with the connection establishment information stored in the smart watch is read, it can be determined that a peripheral device will start Bluetooth broadcasting with the identification information (such as the remote name) in the connection establishment information . Therefore, the smart watch can use the identification information (for example, remote name) as a master device to perform Bluetooth scanning.
  • the identification information for example, remote name
  • the smart watch can turn on the Bluetooth module and perform Bluetooth scanning when it is determined that the NFC tag is read.
  • the user can manually turn on the Bluetooth module in advance.
  • the smart watch can detect that the connection identification is broadcast. In this case, the smart watch can directly use the connection identifier to establish a Bluetooth connection with the treadmill.
  • the connection establishment information may also include security information.
  • the security information may be verification information and/or random numbers.
  • the verification information is a remote security manager TK-Value (Remote Security Manager TK-Value)).
  • the treadmill can perform identity verification based on the security information before establishing a Bluetooth connection with the smart watch, and continue to complete the remaining steps of establishing a Bluetooth connection after the identity verification is passed.
  • the specific process of identity verification can participate in the method shown in FIG. 3, and it is not necessary to repeat it here.
  • the connection establishment information may also include a Bluetooth broadcast period.
  • the treadmill may periodically broadcast the connection identification based on the Bluetooth broadcast cycle.
  • the terminal device may also periodically perform Bluetooth scanning according to the Bluetooth broadcast cycle.
  • the smart watch notifies the user that the Bluetooth connection is successfully established.
  • the smart watch may remind the user that the Bluetooth connection is successful through vibration, prompt sound, and/or using the smart watch display device.
  • the treadmill may also remind the user that the Bluetooth connection is successful through a display device and/or a prompt sound.
  • the smart watch can automatically enter the running interface.
  • the treadmill may send device indication information to the smart watch through the Bluetooth connection, and the device indication information is used to indicate that the electronic device establishing the Bluetooth connection with the smart watch is a treadmill.
  • the smart watch can automatically enter the running interface when receiving the device instruction information.
  • the smart watch includes an operating system running on the hardware and an application (Application, APP) running on the operating system layer.
  • an application Application, APP
  • Different functions of the smart watch can be provided by different applications.
  • the time application can provide a clock function.
  • the clock function can include displaying a time interface on the display interface of the smart watch, and the time interface can display information such as time, date, and weather.
  • Running applications can provide functions related to running, such as timing, obtaining the user's heart rate, calculating calories burned, and counting steps.
  • a running interface is displayed on the display interface of the smart watch, and information such as running time, heart rate, calories consumed, and number of steps can be displayed on the running interface.
  • the spinning application can provide functions related to spinning, such as timing, obtaining the user's heart rate, calculating the calories burned, and obtaining the cadence.
  • the display interface of the smart watch will display a spinning interface, which can display information such as riding time, heart rate, calories burned, and cadence.
  • a non-running application such as a time application, a spinning application, etc.
  • the application running on the smart watch can automatically switch from a non-running application to a running application. In other words, if the smart watch receives the device indication information, the display interface of the smart watch can automatically switch to the running interface.
  • the smart watch is connected to different devices and can automatically open different applications or automatically enter the relevant interface of the application. For example, if the smart watch is connected with a treadmill, the smart watch can automatically display the running interface; if the smart watch is connected with the spinning machine, the smart watch can automatically display the exercise interface of the spinning bike.
  • the user can also manually set the application run by the smart watch, so that the smart watch runs the running application and presents a running interface.
  • the smart watch may enter the running interface when it is determined that the NFC tag is read.
  • the treadmill notifies the smart watch to start running.
  • the treadmill can send start-up instruction information to the smart watch through the Bluetooth connection, and the start-up instruction information is used to instruct the treadmill to start.
  • the smart watch enters an exercise state.
  • the smart watch may enter the exercise state after receiving the startup instruction information from the treadmill.
  • the user can also manually set the smart watch so that the smart watch enters an exercise state.
  • the smart watch can start a running application and present a running interface after determining to establish a Bluetooth connection with the treadmill.
  • the running application can provide different states, such as non-exercise state and exercise state.
  • the running interface may only present time information, and the running application may not perform operations such as calorie calculation, obtaining heart rate, and calculating running distance.
  • the running application can perform operations such as calorie calculation, obtaining heart rate, and calculating steps, and the running interface presents the information obtained by the running application.
  • the running application After the smart watch is switched from a non-running application to a running application, the running application may be in a non-exercise state.
  • the running application can automatically switch from the non-exercise state to the exercise state.
  • the display interface of the smart watch can begin to present information such as calories, heart rate, and number of steps.
  • the running application can use the heart rate sensor in the smart watch or an external heart rate sensor to obtain the user's heart rate, calculate calories, and calculate the number of steps.
  • the treadmill sends exercise information to the smart watch through the Bluetooth connection.
  • the treadmill when the treadmill is in the activated state, the treadmill may periodically send exercise information to the smart watch through a Bluetooth connection, and the exercise information may include the time of activation and the running speed. One or more of, distance, slope, etc.
  • the smart watch can save the exercise information.
  • the display device of the smart watch can also display the exercise information.
  • the treadmill may also send exercise information to the smart watch when receiving an instruction from the user.
  • the user instructs the treadmill to send the exercise information to the smart watch through an input device (such as a button) in the treadmill.
  • the treadmill may send the exercise information to the smart watch when the specific information reaches a preset condition.
  • the treadmill may send the exercise information to the smart watch when it is determined that the distance increases by one kilometer.
  • the treadmill may send the exercise information to the smart watch when the running speed exceeds a preset speed.
  • the smart watch sends user data to the treadmill.
  • the smart watch may periodically send the detected user data of the user to the treadmill through the Bluetooth connection.
  • the user data may include information such as the user's heart rate, number of steps, and calories consumed.
  • the display device of the treadmill can display the acquired user data.
  • the treadmill can also save the user data.
  • the smart watch may send the detected user data of the user to the treadmill through the Bluetooth connection when the detected specific user data reaches a preset condition.
  • the smart watch may send the user data or the user's real-time heart rate to the treadmill when the user's real-time heart rate exceeds a preset threshold.
  • the smart watch may send the user data or the calories consumed by the user to the treadmill when the calories consumed by the user exceed a preset value.
  • the display device of the treadmill can display the acquired user data. The treadmill can also save the user data.
  • the smart watch and the treadmill can present and automatically refresh the exercise data.
  • the exercise data may include user data and/or exercise information.
  • the running application running in the smart watch can automatically refresh the exercise data displayed on the running interface according to the acquired user data and exercise information.
  • the treadmill may send stop instruction information to the smart watch via a Bluetooth connection, and the stop instruction information is used to instruct the treadmill to stop starting.
  • the smart watch receives the stop instruction information, it ends the exercise state.
  • the smart watch exits from the exercise state, displays running details and archives exercise data.
  • the smart watch may use the detected user data and the acquired exercise information to generate the first exercise data, and save the first exercise data.
  • the treadmill can generate second exercise data according to the detected exercise information and the acquired user data, and present the second exercise data on the display device of the treadmill.
  • the content of the first motion data and the second motion data may be the same.
  • the first exercise data and the second exercise data may include running time, total distance, average speed, and average heart rate.
  • the content of the first motion data and the second motion data may also be different.
  • the first exercise data may include running time, average speed, average heart rate, maximum heart rate, total steps, and total calories; the second exercise data may include running time, average speed, maximum speed, average slope, and maximum slope.
  • the running application running on the smart watch can automatically exit the exercise state after the exercise ends. For example, switching from the motion state back to the non-motion state. After switching from the exercise state to the non-exercise state, the running application can generate the first exercise data and save the first exercise data.
  • the smart watch can switch from the running application to the time application, or the smart watch can switch from the running application Return to the application/interface before the running interface is displayed, or the smart watch can switch to the home interface.
  • the smart watch in the embodiment shown in FIG. 4 may be equivalent to the terminal device shown in FIG. 1, and the treadmill in the embodiment shown in FIG. 4 is equivalent to the electronic device shown in FIG. 2.
  • the smart watch and treadmill in the method shown in FIG. 4 are just a group of terminal devices and electronic devices that can apply the wireless connection method provided in the embodiments of the present application.
  • Other terminal devices and electronic devices can also use the wireless connection method provided in the embodiments of the present application to establish a wireless connection.
  • the treadmill in FIG. 4 can be replaced with fitness equipment such as an elliptical machine, a mountaineering machine, or a spinning bike.
  • the terminal device may be a Bluetooth headset
  • the electronic device may be a mobile terminal device such as a mobile phone, a tablet computer, or a notebook computer.
  • the terminal device is a mobile terminal device such as a mobile phone, a tablet computer, or a notebook computer
  • the electronic device may be a Bluetooth speaker.
  • Fig. 5 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
  • the portable Wi-Fi device uses an NFC reader set in the portable Wi-Fi device to read connection establishment information stored in an NFC tag set in the mobile phone, and the connection establishment information may include a connection identifier.
  • the portable Wi-Fi device uses the connection identifier to perform Wi-Fi broadcasting.
  • the link identifier is equivalent to an SSID.
  • the portable Wi-Fi device broadcasts with the SSID
  • the portable Wi-Fi device may activate the Wi-Fi module and perform Wi-Fi broadcasting when the NFC reader reads the connection establishment information.
  • the Wi-Fi module in the portable Wi-Fi device may be in a closed or dormant state before the NFC reader reads the connection establishment information.
  • the mobile phone establishes a Wi-Fi connection with the portable Wi-Fi device through the connection identifier.
  • the mobile phone can turn on the Wi-Fi module and perform Wi-Fi scanning when it is determined that the NFC tag is read.
  • the user can manually turn on the Wi-Fi module in advance.
  • the mobile phone can detect that the connection identification is broadcast. In this case, the mobile phone can directly use the connection identifier to establish a Wi-Fi connection with the portable Wi-Fi device.
  • the portable Wi-Fi device before the portable Wi-Fi device establishes a Bluetooth connection with the mobile phone, it can determine that the mobile phone passes the identity verification according to the key. Specifically, through Wi-Fi scanning, the mobile phone can detect that the connection identifier is broadcast. In this case, the mobile phone can establish a temporary connection with the portable Wi-Fi device. The mobile phone can send the key to the portable Wi-Fi device through the temporary connection. The portable Wi-Fi device determines that the mobile phone passes the identity verification when it is determined that the received key is the same as the key obtained by reading the NFC tag. When it is determined that the mobile phone passes the identity verification, the portable Wi-Fi device and the mobile phone can continue to complete the remaining steps of establishing a Wi-Fi connection.
  • the connection establishment information may also include a Wi-Fi broadcast period.
  • the portable Wi-Fi device may periodically broadcast the connection identification based on the Wi-Fi broadcast cycle.
  • the terminal device may also periodically perform Wi-Fi scanning according to the Wi-Fi broadcast period.
  • the mobile phone in the embodiment shown in FIG. 5 can be equivalent to the terminal device shown in FIG. 1, and the portable Wi-Fi device in the embodiment shown in FIG. 5 is equivalent to the electronic device shown in FIG. 2.
  • Fig. 6 is a structural block diagram of an electronic device according to an embodiment of the present application.
  • the electronic device 600 shown in FIG. 6 includes an NFC unit 601 and a communication unit 602.
  • the NFC unit 601 is configured to perform NFC with a terminal device to obtain connection establishment information stored in the terminal device, and the connection establishment information includes a connection identifier.
  • the communication unit 602 is configured to broadcast a wireless connection broadcast message containing the connection identifier.
  • the communication unit 602 is further configured to establish a wireless connection with the terminal device according to the connection identifier.
  • the electronic device shown in FIG. 6 can execute the method shown in any one of FIGS. 3 to 5.
  • the electronic device shown in FIG. 6 may be an electronic device in the method shown in FIG. 3, a treadmill in the method shown in FIG. 4, or a portable device in the method shown in FIG. Wi-Fi equipment.
  • the NFC unit 60 may be an NFC reading unit, the NFC reading unit may be implemented by an NFC reader, and the communication unit may be implemented by a processor, a communication interface, and a wireless module.
  • the wireless module can be a Bluetooth module or a WLAN module.
  • Fig. 7 is a structural block diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 700 shown in FIG. 7 includes a storage unit 701 and a communication unit 702.
  • the storage unit 701 is configured to store connection establishment information, where the connection establishment information includes a connection identifier.
  • the storage unit 701 is further configured to send the connection establishment information stored in the storage unit 701 to the electronic device through near field communication.
  • the communication unit 702 is configured to scan for wireless connection broadcast messages containing the connection identifier.
  • the communication unit 702 is further configured to establish a wireless connection with the electronic device according to the connection identifier when the wireless connection broadcast message is scanned.
  • the storage unit 702 may be implemented by an NFC tag.
  • the communication unit 702 may be realized by a processor, a communication interface, and a wireless module.
  • the wireless module can be a Bluetooth module or a WLAN module.
  • the terminal device shown in Fig. 7 may be the terminal device in the embodiment shown in Fig. 3, the smart watch in the embodiment shown in Fig. 4, or the mobile phone in the embodiment shown in Fig. 5 .
  • the embodiment of the present application also provides a computer-readable storage medium on which an instruction is stored, and when the instruction is executed, the method on the terminal device side in the foregoing method embodiment is executed.
  • the embodiment of the present application also provides a computer-readable storage medium on which an instruction is stored, and when the instruction is executed, the method on the electronic device side of the above method is executed.
  • the embodiment of the present application also provides a computer program product containing instructions that, when executed, execute the method on the terminal device side in the foregoing method embodiment.
  • the embodiment of the present application also provides a computer product containing an instruction, which when executed, executes the method on the electronic device side in the foregoing method embodiment.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: 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 media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are a method for establishing a wireless communication connection, and related devices. The method comprises: an electronic device acquiring, by means of performing near-field communication (NFC) with a terminal device, connection establishment information stored in the terminal device, wherein the connection establishment information comprises a connection identifier; the electronic device broadcasting a wireless connection broadcast message including the connection identifier; and the electronic device establishing, according to the connection identifier, a wireless connection with the terminal device. The technical solution can provide a method for quickly establishing a wireless connection, and can reduce the power consumption of a terminal device.

Description

建立无线通信连接的方法和相关设备Method and related equipment for establishing wireless communication connection 技术领域Technical field
本申请涉及信息技术领域,更具体地,涉及建立无线通信连接的方法和相关设备。This application relates to the field of information technology, and more specifically, to a method and related equipment for establishing a wireless communication connection.
背景技术Background technique
目前的终端设备可以支持多种无线通信方式,例如,蓝牙(bluetooth)通信、Wi-Fi通信等。Current terminal devices can support multiple wireless communication methods, for example, Bluetooth (bluetooth) communication, Wi-Fi communication, and so on.
以蓝牙通信为例,支持蓝牙通信的两个终端设备的角色可以分为主设备和从设备。主设备通过扫描从设备广播的信息来建立连接。具体地,在启动蓝牙连接后,从设备会开启蓝牙广播,并广播一个蓝牙名称;主设备会进行蓝牙扫描,并将扫描结果呈现在主设备的显示装置上。用户可以利用主设备的输入装置选择该从设备的蓝牙名称。该主设备在获取到了用户选择的蓝牙名称后,启动与广播该蓝牙名称的从设备的蓝牙连接。Taking Bluetooth communication as an example, the roles of two terminal devices supporting Bluetooth communication can be divided into a master device and a slave device. The master device establishes a connection by scanning the information broadcast by the slave device. Specifically, after starting the Bluetooth connection, the slave device will turn on Bluetooth broadcasting and broadcast a Bluetooth name; the master device will perform a Bluetooth scan, and the scan result will be presented on the display device of the master device. The user can use the input device of the master device to select the Bluetooth name of the slave device. After obtaining the Bluetooth name selected by the user, the master device initiates a Bluetooth connection with the slave device broadcasting the Bluetooth name.
上述连接过程需要用户手动选择需要连接的设备。此外,如果主设备扫描到多个蓝牙名称,用户还需要知道要连接的设备所广播的蓝牙名称。因此,如果出现多个相似的蓝牙名称,用户无法快速的确定需要连接的设备所广播的蓝牙名称。The above connection process requires the user to manually select the device to be connected. In addition, if the main device scans multiple Bluetooth names, the user also needs to know the Bluetooth name broadcast by the device to be connected. Therefore, if multiple similar Bluetooth names appear, the user cannot quickly determine the Bluetooth name broadcast by the device to be connected.
与蓝牙通信类似,Wi-Fi通信建立连接的过程也是需要一方广播,一方扫描。因此,Wi-Fi通信也存在类似的问题。Similar to Bluetooth communication, the process of establishing a connection in Wi-Fi communication requires one party to broadcast and one party to scan. Therefore, Wi-Fi communication also has similar problems.
发明内容Summary of the invention
本申请实施例提供建立无线通信连接的方法和相关设备,能够提供一种跨速建立无线连接的方法并且可以减少对终端设备的电量消耗。The embodiments of the present application provide a method for establishing a wireless communication connection and related equipment, which can provide a method for establishing a wireless connection across speeds and can reduce the power consumption of the terminal device.
第一方面,本申请实施例提供一种建立无线连接的方法,该方法包括:电子设备通过与终端设备进行近场通信NFC,获取保存在该终端设备内的连接建立信息,该连接建立信息中包括连接标识;该电子设备广播包含该连接标识的无线连接广播消息;该电子设备根据该连接标识与该终端设备建立无线连接。上述技术方案中,该电子设备与终端设备进行近场通信时,不会消耗该终端设备的电量。这样,可以提高该终端设备的续航时间。另外,利用NFC连接建立无线连接,可以避免用于手动搜索、选择连接标识。这样可以提高用户体验。In the first aspect, an embodiment of the present application provides a method for establishing a wireless connection. The method includes: an electronic device obtains connection establishment information stored in the terminal device through near field communication (NFC) with a terminal device, and the connection establishment information Including a connection identification; the electronic device broadcasts a wireless connection broadcast message containing the connection identification; the electronic device establishes a wireless connection with the terminal device according to the connection identification. In the above technical solution, when the electronic device performs near field communication with the terminal device, the power of the terminal device is not consumed. In this way, the battery life of the terminal device can be improved. In addition, using the NFC connection to establish a wireless connection can avoid manual search and selection of connection identification. This can improve the user experience.
结合第一方面,在第一方面的一种可能的实现方式中,该连接建立信息还包括:第一校验信息;在该电子设备与终端设备建立无线连接之前,该方法还包括:该电子设备与该终端设备建立临时连接;该电子设备接收该终端设备通过该临时连接发送的第二校验信息;该电子设备在确定该第二校验信息与该第一校验信息相同的情况下,确定该终端设备通过身份验证。通过校验信息验证终端设备的身份,可以保障所建立的连接是安全连接。With reference to the first aspect, in a possible implementation of the first aspect, the connection establishment information further includes: first verification information; before the electronic device establishes a wireless connection with the terminal device, the method further includes: the electronic device The device establishes a temporary connection with the terminal device; the electronic device receives the second verification information sent by the terminal device through the temporary connection; the electronic device determines that the second verification information is the same as the first verification information To confirm that the terminal device passes the identity verification. By verifying the identity of the terminal device through the verification information, it can be ensured that the established connection is a secure connection.
结合第一方面,在第一方面的一种可能的实现方式中,在该电子设备与终端设备建立无线连接之前,该方法还包括:该电子设备与该终端设备建立临时连接;该电子设备通过 该临时连接向该终端设备发送第一随机数;该电子设备通过该NFC,获取保存在该终端设备内的第二随机数;该电子设备在确定该第一随机数与该第二随机数相同的情况下,确定该终端设备通过身份验证。通过随机数验证终端设备的身份,可以保障所建立的连接是安全连接。另外也可以支持使用随机数建立无线连接的方式。With reference to the first aspect, in a possible implementation of the first aspect, before the electronic device establishes a wireless connection with the terminal device, the method further includes: the electronic device establishes a temporary connection with the terminal device; The temporary connection sends the first random number to the terminal device; the electronic device obtains the second random number stored in the terminal device through the NFC; the electronic device determines that the first random number is the same as the second random number In the case, it is determined that the terminal device passes the identity verification. By verifying the identity of the terminal device through a random number, it can be ensured that the established connection is a secure connection. It can also support the use of random numbers to establish wireless connections.
结合第一方面,在第一方面的一种可能的实现方式中,在该电子设备广播包含该连接标识的无线连接广播消息之前,该方法还包括:该电子设备在获取到该连接建立信息的情况下,确定开启无线连接功能。上述技术方案可以减少对该电子设备的电量消耗。With reference to the first aspect, in a possible implementation of the first aspect, before the electronic device broadcasts the wireless connection broadcast message containing the connection identifier, the method further includes: the electronic device obtains the connection establishment information after the In this case, make sure to turn on the wireless connection function. The above technical solution can reduce the power consumption of the electronic device.
结合第一方面,在第一方面的一种可能的实现方式中,该连接建立信息中还包括广播周期;该电子设备广播包含该连接标识的无线连接广播消息,包括:该电子设备周期性广播该无线连接广播消息,其中该电子设备广播该无线连接广播消息的周期为该广播周期。上述技术方案可以减少对该电子设备的电量消耗。With reference to the first aspect, in a possible implementation of the first aspect, the connection establishment information further includes a broadcast period; the electronic device broadcasting a wireless connection broadcast message containing the connection identifier includes: the electronic device periodically broadcasting In the wireless connection broadcast message, the period during which the electronic device broadcasts the wireless connection broadcast message is the broadcast period. The above technical solution can reduce the power consumption of the electronic device.
结合第一方面,在第一方面的一种可能的实现方式中,该电子设备通过与终端设备进行近场通信NFC,获取保存在该终端设备内的连接建立信息,包括:该电子设备读取该终端设备内的NFC标签,获取保存在该NFC标签中的该连接建立信息。上述技术方案中,该电子设备读取NFC标签时,NFC标签本身并不会消耗电量。换句话说,若该NFC标签位于该终端设备内部,则利用NFC连接建立无线连接的过程不会消耗该终端设备内部的电量,这样,可以提高该终端设备的续航时间。With reference to the first aspect, in a possible implementation of the first aspect, the electronic device obtains connection establishment information stored in the terminal device through near field communication (NFC) with the terminal device, including: the electronic device reads The NFC tag in the terminal device obtains the connection establishment information stored in the NFC tag. In the above technical solution, when the electronic device reads the NFC tag, the NFC tag itself does not consume power. In other words, if the NFC tag is located inside the terminal device, the process of using the NFC connection to establish a wireless connection will not consume the internal power of the terminal device, so that the battery life of the terminal device can be improved.
结合第一方面,在第一方面的一种可能的实现方式中,该连接标识为蓝牙名称,该电子设备根据该连接标识与该终端设备建立无线连接,包括:该电子设备根据该蓝牙名称与该终端设备建立蓝牙连接。With reference to the first aspect, in a possible implementation of the first aspect, the connection identifier is a Bluetooth name, and the electronic device establishing a wireless connection with the terminal device according to the connection identifier includes: the electronic device connects with the terminal device according to the Bluetooth name The terminal device establishes a Bluetooth connection.
结合第一方面,在第一方面的一种可能的实现方式中,该连接标识为服务集标识SSID,该电子设备根据该连接标识与该终端设备建立无线连接,包括:该电子设备根据该SSID与该终端设备建立无线局域网络连接。With reference to the first aspect, in a possible implementation of the first aspect, the connection identifier is a service set identifier SSID, and the electronic device establishing a wireless connection with the terminal device according to the connection identifier includes: the electronic device according to the SSID Establish a wireless local area network connection with the terminal device.
第二方面,本申请实施例提供一种建立无线连接的方法,该方法包括:终端设备通过近场通信NFC将保存的连接建立信息发送至电子设备,其中该连接建立信息包括连接标识;该终端设备扫描包含该连接标识的无线连接广播消息;该终端设备在扫描到该无线连接广播消息后,根据该连接标识与该电子设备建立无线连接。上述技术方案中,该电子设备与终端设备进行近场通信时,不会消耗该终端设备的电量。这样,可以提高该终端设备的续航时间。另外,利用NFC连接建立无线连接,可以避免用于手动搜索、选择连接标识。这样可以提高用户体验。In a second aspect, an embodiment of the present application provides a method for establishing a wireless connection. The method includes: a terminal device sends saved connection establishment information to an electronic device through near field communication (NFC), where the connection establishment information includes a connection identifier; the terminal The device scans for the wireless connection broadcast message containing the connection identifier; after scanning the wireless connection broadcast message, the terminal device establishes a wireless connection with the electronic device according to the connection identifier. In the above technical solution, when the electronic device performs near field communication with the terminal device, the power of the terminal device is not consumed. In this way, the battery life of the terminal device can be improved. In addition, using the NFC connection to establish a wireless connection can avoid manual search and selection of connection identification. This can improve the user experience.
结合第二方面,在第二方面的一种可能的实现方式中,该连接建立信息还包括:第一校验信息;在该与该电子设备建立无线连接之前,该方法还包括:该终端设备与该电子设备建立临时连接;该终端设备通过该临时连接向该电子设备发送该第一校验信息。通过校验信息验证终端设备的身份,可以保障所建立的连接是安全连接。With reference to the second aspect, in a possible implementation of the second aspect, the connection establishment information further includes: first verification information; before the wireless connection is established with the electronic device, the method further includes: the terminal device A temporary connection is established with the electronic device; the terminal device sends the first verification information to the electronic device through the temporary connection. By verifying the identity of the terminal device through the verification information, it can be ensured that the established connection is a secure connection.
结合第二方面,在第二方面的一种可能的实现方式中,在该电子设备建立无线连接之前,该方法还包括:该终端设备与该电子设备建立临时连接;该终端设备接收该电子设备通过该临时连接发送的第一随机数;该终端设备保存该第一随机数。通过随机数验证终端设备的身份,可以保障所建立的连接是安全连接。另外也可以支持使用随机数建立无线连接的方式。With reference to the second aspect, in a possible implementation of the second aspect, before the electronic device establishes a wireless connection, the method further includes: the terminal device establishes a temporary connection with the electronic device; and the terminal device receives the electronic device The first random number sent through the temporary connection; the terminal device saves the first random number. By verifying the identity of the terminal device through a random number, it can be ensured that the established connection is a secure connection. It can also support the use of random numbers to establish wireless connections.
结合第二方面,在第二方面的一种可能的实现方式中,该连接建立信息还包括:广播周期;该终端设备扫描包含该连接标识的无线连接广播消息,包括:该终端设备周期性扫描该无线连接广播信息,其中该终端设备扫描该无线连接广播信息的周期为该广播周期。上述技术方案可以减少对该终端设备的电量消耗。With reference to the second aspect, in a possible implementation of the second aspect, the connection establishment information further includes: a broadcast period; the terminal device scanning for a wireless connection broadcast message containing the connection identifier includes: the terminal device periodically scanning In the wireless connection broadcast information, the period during which the terminal device scans the wireless connection broadcast information is the broadcast period. The above technical solution can reduce the power consumption of the terminal device.
结合第二方面,在第二方面的一种可能的实现方式中,该连接建立信息保存在该终端设备内的NFC标签中,该终端设备扫描包含该连接标识的无线连接广播消息,包括:该终端设备在确定该NFC标签被该电子设备读取的情况下,扫描该无线连接广播消息。上述技术方案中,该电子设备读取NFC标签时,NFC标签本身并不会消耗电量。换句话说,若该NFC标签位于该终端设备内部,则利用NFC连接建立无线连接的过程不会消耗该终端设备内部的电量,这样,可以提高该终端设备的续航时间。With reference to the second aspect, in a possible implementation of the second aspect, the connection establishment information is stored in an NFC tag in the terminal device, and the terminal device scans the wireless connection broadcast message containing the connection identifier, including: When determining that the NFC tag is read by the electronic device, the terminal device scans the wireless connection broadcast message. In the above technical solution, when the electronic device reads the NFC tag, the NFC tag itself does not consume power. In other words, if the NFC tag is located inside the terminal device, the process of using the NFC connection to establish a wireless connection will not consume the internal power of the terminal device, so that the battery life of the terminal device can be improved.
结合第二方面,在第二方面的一种可能的实现方式中,该连接标识为蓝牙名称,该根据该连接标识与该电子设备建立无线连接,包括:根据该蓝牙名称与该电子设备建立蓝牙连接。With reference to the second aspect, in a possible implementation of the second aspect, the connection identifier is a Bluetooth name, and establishing a wireless connection with the electronic device according to the connection identifier includes: establishing a Bluetooth with the electronic device according to the Bluetooth name connection.
结合第二方面,在第二方面的一种可能的实现方式中,该连接标识为服务集标识SSID,该根据该连接标识与该电子设备建立无线连接,包括:根据该SSID与该电子设备建立无线局域网连接。With reference to the second aspect, in a possible implementation of the second aspect, the connection identifier is a service set identifier SSID, and establishing a wireless connection with the electronic device according to the connection identifier includes: establishing a wireless connection with the electronic device according to the SSID Wireless LAN connection.
第三方面,本申请实施例提供一种电子设备,该电子设备包括用于执行第一方面或第一方面的任一种可能的实现方式的单元。In a third aspect, an embodiment of the present application provides an electronic device, which includes a unit for executing the first aspect or any possible implementation manner of the first aspect.
第四方面,本申请实施例提供一种终端设备,该终端设备包括用于执行第二方面或第二方面的任一种可能的实现方式的单元。In a fourth aspect, an embodiment of the present application provides a terminal device. The terminal device includes a unit for executing the second aspect or any possible implementation manner of the second aspect.
第五方面,本申请实施例提供一种终端设备,该终端设备包处理器、存储器、无线模块和通信接口。存储器用于存储用于实现第一方面或第一方面的任一种可能的实现方式该的方法的指令,并由处理器来控制执行。处理器执行存储器中存储的指令,结合无线模块和通信接口,实现第一方面或第一方面任一种可能的实现方式的方法。In a fifth aspect, embodiments of the present application provide a terminal device, which includes a processor, a memory, a wireless module, and a communication interface. The memory is used to store instructions used to implement the first aspect or any one of the possible implementation manners of the first aspect, and the processor controls the execution. The processor executes the instructions stored in the memory, and combines the wireless module and the communication interface to implement the first aspect or any one of the possible implementation methods of the first aspect.
第六方面,本申请实施例提供一种电子设备,该电子设备包处理器、存储器、无线模块和通信接口。存储器用于存储用于实现第二方面或第二方面的任一种可能的实现方式该的方法的指令,并由处理器来控制执行。处理器执行存储器中存储的指令,结合无线模块和通信接口,实现第二方面或第二方面任一种可能的实现方式的方法。In a sixth aspect, an embodiment of the present application provides an electronic device that includes a processor, a memory, a wireless module, and a communication interface. The memory is used to store instructions for implementing the second aspect or any one of the possible implementation manners of the second aspect, and the processor controls the execution. The processor executes the instructions stored in the memory, and combines the wireless module and the communication interface to implement the second aspect or any one of the possible implementation methods of the second aspect.
第七方面,本申请实施例提供一种存储介质,该存储介质存储用于实现第一方面或第一方面的任一种可能的实现方式该的方法的指令。In a seventh aspect, an embodiment of the present application provides a storage medium that stores instructions for implementing the first aspect or any possible implementation manner of the first aspect.
第八方面,本申请实施例提供一种存储介质,该存储介质存储用于实现第二方面或第二方面的任一种可能的实现方式该的方法的指令。In an eighth aspect, an embodiment of the present application provides a storage medium that stores instructions for implementing the second aspect or any one of the possible implementation manners of the second aspect.
第九方面,本申请提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述第一方面或第一方面的任一种可能的实现方式该的方法。In a ninth aspect, this application provides a computer program product containing instructions, when the computer program product is run on a computer, the computer can execute the first aspect or any one of the possible implementations of the first aspect. .
第十方面,本申请提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述第二方面或第二方面的任一种可能的实现方式该的方法。In a tenth aspect, this application provides a computer program product containing instructions, when the computer program product runs on a computer, the computer executes the second aspect or any one of the possible implementation methods of the second aspect. .
附图说明Description of the drawings
图1是根据本申请实施例提供的终端设备的示意性结构框图。Fig. 1 is a schematic structural block diagram of a terminal device according to an embodiment of the present application.
图2是根据本申请实施例提供的电子设备的示意性结构框图。Fig. 2 is a schematic structural block diagram of an electronic device according to an embodiment of the present application.
图3是根据本申请实施例提供的一种建立无线连接的方法的示意性流程图。Fig. 3 is a schematic flowchart of a method for establishing a wireless connection according to an embodiment of the present application.
图4是根据本申请实施例提供的一种建立无线通信连接的方法的示意性流程图。Fig. 4 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
图5是根据本申请实施例提供的一种建立无线通信连接的方法的示意性流程图。Fig. 5 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
图6是根据本申请实施例提供的一种电子设备的结构框图。Fig. 6 is a structural block diagram of an electronic device according to an embodiment of the present application.
图7是根据本申请实施例提供的一种终端设备的结构框图。Fig. 7 is a structural block diagram of a terminal device according to an embodiment of the present application.
具体实施方式detailed description
下面将结合附图,对本申请中的技术方案进行描述。The technical solution in this application will be described below in conjunction with the drawings.
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下中的至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a、b、c、a-b、a-c、b-c、或a-b-c,其中a、b、c可以是单个,也可以是多个。另外,在本申请的实施例中,“第一”、“第二”等字样并不对数量和执行次序进行限定。In this application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, both A and B exist, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the associated objects are in an "or" relationship. "At least one item (a) in the following" or similar expressions refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a). For example, at least one of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c may be single or multiple. In addition, in the embodiments of the present application, words such as "first" and "second" do not limit the number and execution order.
需要说明的是,本申请中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or illustrations. Any embodiment or design solution described as "exemplary" or "for example" in this application should not be construed as being more preferable or advantageous than other embodiments or design solutions. To be precise, words such as "exemplary" or "for example" are used to present related concepts in a specific manner.
在本申请实施例中,终端设备包括硬件层、运行在硬件层之上的操作系统层,以及运行在操作系统层上的应用层。该硬件层包括中央处理器(central processing unit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。该操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。该应用层包含浏览器、通讯录、文字处理软件、即时通信软件等应用。并且,本申请实施例并未对本申请实施例提供的方法的执行主体的具体结构特别限定,只要能够通过运行记录有本申请实施例的提供的方法的代码的程序,以根据本申请实施例提供的方法进行通信即可,例如,本申请实施例提供的方法的执行主体可以是终端设备或网络设备,或者,是终端设备或网络设备中能够调用程序并执行程序的功能模块。In the embodiment of the present application, the terminal 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 includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also referred to as main memory). The operating system may be any one or more computer operating systems that implement business processing through processes, for example, Linux operating system, Unix operating system, Android operating system, iOS operating system, or windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software. In addition, the embodiments of the application do not specifically limit the specific structure of the execution subject of the methods provided in the embodiments of the application, as long as the program that records the codes of the methods provided in the embodiments of the application can be provided according to the embodiments of the application. For example, the execution subject of the method provided in the embodiment of the present application may be a terminal device or a network device, or a functional module in the terminal device or network device that can call and execute the program.
另外,本申请的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本申请中使用的术语“制品”涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读介质可以包括,但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatile disc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。另外,本文描述的各种存储介 质可代表用于存储信息的一个或多个设备和/或其它机器可读介质。术语“机器可读介质”可包括但不限于,无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。In addition, various aspects or features of the present application can be implemented as methods, devices, or products using standard programming and/or engineering techniques. The term "article of manufacture" as used in this application encompasses a computer program accessible from any computer-readable device, carrier, or medium. For example, computer-readable media may include, but are not limited to: magnetic storage devices (for example, hard disks, floppy disks, or tapes, etc.), optical disks (for example, compact discs (CDs), digital versatile discs (digital versatile discs, DVDs) Etc.), smart cards and flash memory devices (for example, erasable programmable read-only memory (EPROM), cards, sticks or key drives, etc.). In addition, 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.
以下简单介绍目前终端设备支持的几种无线连接模式中,终端设备如何进行设备发现。The following briefly introduces how the terminal device performs device discovery in several wireless connection modes currently supported by the terminal device.
1,蓝牙:是一种无线技术标准,可实现固定终端、移动终端之间的短距离数据交换。1. Bluetooth: is a wireless technology standard that can realize short-distance data exchange between fixed and mobile terminals.
蓝牙连接的建立过程包括设备发现、连接。其中,设备发现过程主要包括:终端设备A处于可见状态,广播蓝牙名称;终端设备B首先扫描处于可见状态的终端,随后在扫描到的可连接的设备中选择终端设备A。可见,在蓝牙设备发现过程中,终端设备会获取到对端设备广播的蓝牙名称。The establishment process of Bluetooth connection includes device discovery and connection. Among them, the device discovery process mainly includes: terminal device A is in a visible state, broadcasting the Bluetooth name; terminal device B first scans the terminal in the visible state, and then selects terminal device A from the scannable devices. It can be seen that in the process of Bluetooth device discovery, the terminal device will obtain the Bluetooth name broadcast by the peer device.
本申请实施例中所称的蓝牙可以是指经典蓝牙,也可以是指低功耗蓝牙(Bluetooth Low Energy,BLE)。The Bluetooth referred to in the embodiments of the present application may refer to classic Bluetooth or Bluetooth Low Energy (BLE).
2,无线局域网(Wireless Local Area Networks,WLAN)是一个使用无线技术连接两个或等多设备组成局域网的技术。大多数的现代WLAN是基于基于电气和电子工程师协会(Institute of Electrical and Electronics Engineers,IEEE)802.11系列标准。Wi-Fi是WLAN的市场化的商标名。本申请实施例中并不严格区分的Wi-Fi和WLAN的含义。换句话说,本申请实施例中的Wi-Fi和WLAN都是指基于IEEE 802.11系列标准的无线通信技术。在Wi-Fi建立连接的过程中,路由器可以广播服务集标识(Service Set Identifier,SSID)。终端设备可以搜索SSID,在扫描到的SSID中选择需要连接的SSID。可见,在Wi-Fi连接建立过程中,终端设备会获取到路由器广播的SSID。2. Wireless Local Area Networks (WLAN) is a technology that uses wireless technology to connect two or more devices to form a local area network. Most modern WLANs are based on the Institute of Electrical and Electronics Engineers (IEEE) 802.11 series of standards. Wi-Fi is the marketable brand name of WLAN. The meanings of Wi-Fi and WLAN are not strictly distinguished in the embodiments of the present application. In other words, both Wi-Fi and WLAN in the embodiments of this application refer to wireless communication technologies based on the IEEE 802.11 series of standards. In the process of establishing a Wi-Fi connection, the router can broadcast a Service Set Identifier (SSID). The terminal device can search for the SSID and select the SSID that needs to be connected among the scanned SSIDs. It can be seen that during the Wi-Fi connection establishment process, the terminal device will obtain the SSID broadcast by the router.
为了帮助本领域技术人员更好地理解本申请技术方案,首先对本申请技术方案涉及到的一些技术进行简单介绍。In order to help those skilled in the art to better understand the technical solutions of the present application, firstly, some technologies involved in the technical solutions of the present application are briefly introduced.
近场通信(near field communication,NFC)是一种近距离连接协议。NFC信息也是通过频谱中无线频率部分的电磁感应耦合方式传递。NFC的工作有效距离通常小于10厘米,因此具有很高的安全性。此外,NFC还有传输创建速度较快,传输速度快,并且功耗低等优点。Near field communication (NFC) is a short distance connection protocol. NFC information is also transmitted through electromagnetic induction coupling in the wireless frequency part of the spectrum. The working distance of NFC is usually less than 10 cm, so it has high security. In addition, NFC has the advantages of faster transmission creation speed, fast transmission speed, and low power consumption.
NFC标签(tag)是无需电源的被动装置。在具有NFC读取器与NFC标签接触(这里所称的接触是指NFC设备与NFC标签的距离小于工作有效距离)的情况下,NFC标签从NFC读取器获得很小的电源驱动NFC标签的电路,把NFC标签中存储的数据传输到NFC读取器中。NFC tags are passive devices that do not require power supply. In the case where the NFC reader is in contact with the NFC tag (the contact referred to here refers to the distance between the NFC device and the NFC tag is less than the working effective distance), the NFC tag obtains a small power source from the NFC reader to drive the NFC tag The circuit transmits the data stored in the NFC tag to the NFC reader.
目前业界定义了四种NFC标签,分别为第1类标签(Tag 1 Type)、第2类标签(Tag 2 Type)、第3类标签(Tag 3 Type)和第4类标签(Tag 4 Type)。不同类型的NFC标签的存储能力不同。例如,第1类标签的存储能量为96字节,第2类标签的存储能力为48字节。不同类型的NFC标签的读写能力不同。例如,第1类标签和第2类标签具有可读、重新写入的能力,也可以被配置为只读。第3类标签和第4类标签则是只读,标签中保存的内容实在生产标签时写入或者通过特殊的标签写入器来写入。At present, the industry defines four types of NFC tags, namely Type 1 Tag (Tag 1 Type), Type 2 Tag (Tag 2 Type), Type 3 Tag (Tag 3 Type) and Type 4 Tag (Tag 4 Type) . Different types of NFC tags have different storage capabilities. For example, the storage energy of type 1 tags is 96 bytes, and the storage capacity of type 2 tags is 48 bytes. Different types of NFC tags have different reading and writing capabilities. For example, Type 1 tags and Type 2 tags have the ability to read and rewrite, and can also be configured as read-only. Type 3 tags and Type 4 tags are read-only, and the content saved in the tag is actually written when the tag is produced or written by a special tag writer.
本申请实施例提供一种建立无线通信连接的方法,该方法的基本原理是:设置有NFC读取器的电子设备通过该NFC读取器获取NFC标签中保存的连接建立信息,该连接建立信息中包括连接标识;该电子设备广播该连接标识。终端设备通过该连接标识与该电子设备建立无线连接,其中该终端设备中预先保存该连接建立信息。The embodiment of the present application provides a method for establishing a wireless communication connection. The basic principle of the method is that an electronic device provided with an NFC reader obtains the connection establishment information stored in the NFC tag through the NFC reader, and the connection establishment information Includes the connection identification; the electronic device broadcasts the connection identification. The terminal device establishes a wireless connection with the electronic device through the connection identifier, wherein the connection establishment information is pre-stored in the terminal device.
换句话说,上述技术方案中,电子设备所广播的连接标识是从NFC标签中获取的,而该终端设备中预先保存有该连接标识。这样,该终端设备可以直接选择与广播该连接标识的电子设备建立无线连接。这样,本申请实施例提供的方法可以无需用户手动选择需要建立无线连接的连接标识。上述技术方案可以使得设备之间可以通过NFC连接快速获取到本该在设备发现过程中获取到的信息,避免了设备重复进行繁琐复杂的设备发现过程。特别是在该终端设备搜索到多个可以进行无线连接的设备的情况下,利用上述技术方案,用户无需实现知晓需要连接的电子设备所广播的连接标识,也不需要从搜索到的多个连接标识中找到希望连接的电子设备的所广播的连接标识。这样,可以进一步节省建立连接无线连接的时间,提高建立无线连接的效率,增强用户体验。In other words, in the above technical solution, the connection identification broadcast by the electronic device is obtained from the NFC tag, and the connection identification is pre-stored in the terminal device. In this way, the terminal device can directly choose to establish a wireless connection with the electronic device broadcasting the connection identifier. In this way, the method provided in the embodiment of the present application can eliminate the need for the user to manually select a connection identifier that needs to establish a wireless connection. The above technical solutions can enable devices to quickly acquire information that should have been acquired in the device discovery process through the NFC connection, and avoid the device from repeating the tedious and complicated device discovery process. Especially in the case that the terminal device searches for multiple devices that can be connected wirelessly, using the above technical solution, the user does not need to know the connection identification broadcast by the electronic device that needs to be connected, nor does it need to search for multiple connections Find the broadcast connection identifier of the electronic device that you want to connect to in the identifier. In this way, the time for establishing a wireless connection can be further saved, the efficiency of establishing a wireless connection can be improved, and the user experience can be enhanced.
本申请实施例中所称的终端设备可以是移动终端设备,例如移动电话、平板电脑、笔记本电脑等。本申请实施例中所称的终端设备也可以是指耗电敏感型设备。本申请实施例中所称的耗电敏感型设备是指通过电池(通常是可充电电池)供电、电池容量通常为几十到几百毫安时的终端设备。一般情况下,使用可充电电池的耗电敏感型设备在充电状态下不便于使用。因此,耗电敏感型设备通常希望在电池容量有限的情况下,尽可能为用户提供长时间的服务。常见的耗电敏感型设备包括蓝牙耳机、智能手表、智能手环、智能眼镜等。The terminal device referred to in the embodiment of the present application may be a mobile terminal device, such as a mobile phone, a tablet computer, a notebook computer, and the like. The terminal device referred to in the embodiments of the present application may also refer to a power consumption sensitive device. The power consumption-sensitive device referred to in the embodiments of the present application refers to a terminal device that is powered by a battery (usually a rechargeable battery) and has a battery capacity of usually tens to hundreds of mAh. In general, power-sensitive devices that use rechargeable batteries are not easy to use when they are charged. Therefore, power consumption-sensitive devices usually hope to provide users with long-term service as much as possible when the battery capacity is limited. Common power-sensitive devices include Bluetooth headsets, smart watches, smart bracelets, and smart glasses.
本申请实施例中所称的电子设备是指可以通过无线连接与该终端设备进行通信的电子设备,可以是终端设备,也可以使其他类型的能够进行无线通信的电子设备。该电子设备通常对耗电不敏感。例如,该电子设备可以直接使用交流电供电,或者该电子设备在充电状态下可以正常使用。例如该电子设备可以是运动器械(例如跑步机、椭圆机等)、蓝牙音箱例等。可选的,在一些实施例中,该电子设备与该终端设备建立的无线连接是蓝牙连接,这样该电子设备可以与该终端设备进行蓝牙通信。可选的,在一些实施例中,该电子设备与该终端设备建立的无线连接可是WLAN连接(例如Wi-Fi连接),这样该电子设备可以与该终端设备进行WLAN通信。The electronic device referred to in the embodiments of the present application refers to an electronic device that can communicate with the terminal device through a wireless connection. It can be a terminal device or other types of electronic devices that can perform wireless communication. This electronic device is generally not sensitive to power consumption. For example, the electronic device can be directly powered by AC power, or the electronic device can be used normally in a charged state. For example, the electronic device may be sports equipment (such as treadmills, elliptical machines, etc.), Bluetooth speakers, etc. Optionally, in some embodiments, the wireless connection established by the electronic device and the terminal device is a Bluetooth connection, so that the electronic device can perform Bluetooth communication with the terminal device. Optionally, in some embodiments, the wireless connection established by the electronic device and the terminal device may be a WLAN connection (for example, a Wi-Fi connection), so that the electronic device can perform WLAN communication with the terminal device.
图1是根据本申请实施例提供的终端设备的示意性结构框图。如图1所示的终端设备100包括处理器110、存储器120、输出模块130和通信接口140。处理器110中可以包括中央处理器(central processing unit,CPU)111、蓝牙模块112和WLAN模块113。Fig. 1 is a schematic structural block diagram of a terminal device according to an embodiment of the present application. The terminal device 100 shown in FIG. 1 includes a processor 110, a memory 120, an output module 130, and a communication interface 140. The processor 110 may include a central processing unit (CPU) 111, a Bluetooth module 112, and a WLAN module 113.
处理器110包括的CPU 111还可以是特定集成电路(Application Specific Integrated Circuit,ASIC),或者是被配置成实施本申请实施例的一个或多个集成电路,例如:一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)。其中,CPU 111可以通过运行或执行存储在存储器120内的软件程序,以及调用存储在存储器120内的数据,结合蓝牙模块112和/或Wi-Fi模块113执行终端设备的各种功能。The CPU 111 included in the processor 110 may also be a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, for example: one or more microprocessors ( Digital signal processor, DSP), or, one or more Field Programmable Gate Array (FPGA). Wherein, the CPU 111 can execute various functions of the terminal device in combination with the Bluetooth module 112 and/or the Wi-Fi module 113 by running or executing a software program stored in the memory 120 and calling data stored in the memory 120.
在具体实现中,作为一种实施例,终端可以包括多个处理器。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个终端、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In specific implementation, as an embodiment, the terminal may include multiple processors. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more terminals, circuits, and/or processing cores for processing data (for example, computer program instructions).
存储器120可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储终端,随机存取存储器(random access memory,RAM)或者可存储信 息和指令的其他类型的动态存储终端,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁盘存储介质或者其他磁存储终端、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器120可以是独立存在,通过通信总线150与处理器110相连接。存储器120也可以和处理器110集成在一起。The memory 120 may be a read-only memory (ROM) or other types of static storage terminals that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions The dynamic storage terminal can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic disk storage medium or other magnetic storage terminal, or it can be used to carry or store instructions or data structures The desired program code and any other medium that can be accessed by the computer, but not limited to this. The memory 120 may exist independently and is connected to the processor 110 through a communication bus 150. The memory 120 may also be integrated with the processor 110.
存储器120还用于存储执行本申请方案的软件程序,并由处理器110来控制执行。The memory 120 is also used to store a software program for executing the solution of the application, and is controlled by the processor 110 to execute.
存储器120还用于存储连接建立信息。The memory 120 is also used to store connection establishment information.
输出模块130,可以用于显示由用户输入的信息或提供给用户的信息以及终端设备100的各种菜单。输出模块130可包括显示面板131。可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板131。The output module 130 may be used to display information input by the user or information provided to the user and various menus of the terminal device 100. The output module 130 may include a display panel 131. Optionally, the display panel 131 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), etc.
可选的,在一些实现方式中,终端设备100还可以包括输入装置。该输入装置可以包括触摸屏。该触摸屏可以覆盖显示面板131。换句话说,输入装置和显示面板可以作为两个独立的部件来实现终端设备100的输入和输出功能。Optionally, in some implementation manners, the terminal device 100 may further include an input device. The input device may include a touch screen. The touch screen can cover the display panel 131. In other words, the input device and the display panel can be used as two independent components to implement the input and output functions of the terminal device 100.
可选的,在另一些实现方式中,可以将显示面板131与触摸屏集成而实现终端设备100的输入和输出功能。Optionally, in other implementation manners, the display panel 131 can be integrated with a touch screen to implement the input and output functions of the terminal device 100.
可选的,在一些实现方式中,该输入装置还可以包括按键。Optionally, in some implementation manners, the input device may further include keys.
通信接口140,使用任何收发器一类的装置,用于与其他设备或通信网络通信。通信接口140可以包括接收单元实现接收功能,以及发送单元实现发送功能。The communication interface 140 uses any device such as a transceiver to communicate with other devices or communication networks. The communication interface 140 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.
蓝牙模块112,集成有蓝牙芯片,适用经典蓝牙协议以及低功耗蓝牙协议,用于支持终端设备110与其他设备建立蓝牙连接。The Bluetooth module 112 is integrated with a Bluetooth chip, is suitable for the classic Bluetooth protocol and the low-power Bluetooth protocol, and is used to support the terminal device 110 to establish Bluetooth connections with other devices.
WLAN模块113,集成有Wi-Fi芯片,用于支持终端设备110与其他设备建立WLAN连接。The WLAN module 113 is integrated with a Wi-Fi chip for supporting the terminal device 110 to establish a WLAN connection with other devices.
图1中示出的终端设备结构并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The structure of the terminal device shown in FIG. 1 does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or a combination of some components, or a different component arrangement.
例如,如果终端设备不支持WLAN通信,则该终端设备可以不包括如图1所示的WLAN模块113。For example, if the terminal device does not support WLAN communication, the terminal device may not include the WLAN module 113 shown in FIG. 1.
可选的,在一些实施例中,存储有连接建立信息的NFC标签可以设置于终端设备100内部。NFC标签设置于终端设备内部是指该NFC标签设置于终端设备的外壳内部。在NFC标签设置于终端设备内部的情况下,该NFC标签可以是可读写的NFC标签。在此情况下,用户可以自行设置该NFC标签中保存的该连接建立信息。用户设置的该连接建立信息可以保存在该NFC标签和终端设备内部的存储器中。该NFC标签也可以是只读的NFC标签。在此情况下,该NFC标签中所保存的连接建立信息在生产阶段写入到NFC标签中的。在此情况下,该连接建立信息可以在终端设备生产阶段写入到该终端设备内的存储器中。如上所述,NFC标签是一个不需要电源的被动装置。设置于终端设备内部的NFC标签并不会消耗终端设备的电量。这样,该终端设备可以在不需要额外消耗电量的情况下,实现快速建立无线连接。Optionally, in some embodiments, the NFC tag storing the connection establishment information may be provided inside the terminal device 100. The arrangement of the NFC tag inside the terminal device means that the NFC tag is arranged inside the housing of the terminal device. In the case that the NFC tag is installed inside the terminal device, the NFC tag may be a readable and writable NFC tag. In this case, the user can set the connection establishment information stored in the NFC tag by himself. The connection establishment information set by the user can be stored in the NFC tag and the internal memory of the terminal device. The NFC tag may also be a read-only NFC tag. In this case, the connection establishment information stored in the NFC tag is written into the NFC tag during the production phase. In this case, the connection establishment information can be written into the memory in the terminal device during the production stage of the terminal device. As mentioned above, the NFC tag is a passive device that does not require a power source. The NFC tag set inside the terminal device does not consume the power of the terminal device. In this way, the terminal device can quickly establish a wireless connection without requiring additional power consumption.
可选的,在另一些实施例中,存储有连接建立信息的NFC标签也可以设置于终端设备100外部。NFC标签设置于终端设备外部是指该NFC标签可以通过粘贴的方式粘贴在 终端设备的外壳,或者,该NFC标签可以作为一个独立于终端设备的物件,例如设置于一个卡片内部。用户可以利用终端设备的输入装置将该NFC标签中保存的连接建立信息输入到该终端设备内,并保存在该终端设备内的存储器中。用户也可以利用能够于该终端设备进行通信(有线或无线通信)的设备,将该连接建立信息传输到该终端设备,并保存在该终端设备内的存储器中。例如,该终端设备可以是一个智能手表。该智能手表可以通过数据线与计算机相连,并通过该数据线与该计算机进行通信。在此情况下,用户可以通过该计算机将该连接建立信息通过数据线传输的该智能手表,并保存在该智能手表内的存储器中。该NFC标签可以是只读的NFC标签。该NFC标签中所保存的连接建立信息在生产阶段写入到NFC标签中的。当然,该NFC标签也可以是一个可读写的NFC标签,该NFC标签在生产阶段可以预先写入一个预设的连接建立信息。用户可以直接使用该预设的连接建立信息或者也可以修改该NFC标签中保存的连接建立信息。上述技术方案中,由于该NFC标签设置于该终端设备外部,这样可以使得硬件中不包括NFC标签的终端设备也可以支持本申请实施例所提供的建立无线连接的方法。Optionally, in other embodiments, the NFC tag storing the connection establishment information may also be provided outside the terminal device 100. The setting of the NFC tag outside the terminal device means that the NFC tag can be pasted on the shell of the terminal device by pasting, or the NFC tag can be used as an object independent of the terminal device, for example, set inside a card. The user can use the input device of the terminal device to input the connection establishment information stored in the NFC tag into the terminal device, and save it in the memory in the terminal device. The user can also use a device capable of communicating (wired or wireless communication) with the terminal device to transmit the connection establishment information to the terminal device and save it in the memory in the terminal device. For example, the terminal device may be a smart watch. The smart watch can be connected to a computer through a data line, and communicate with the computer through the data line. In this case, the user can use the computer to transfer the connection establishment information to the smart watch via a data cable, and save it in the memory in the smart watch. The NFC tag may be a read-only NFC tag. The connection establishment information stored in the NFC tag is written into the NFC tag during the production phase. Of course, the NFC tag can also be a readable and writable NFC tag, and the NFC tag can be pre-written with a preset connection establishment information during the production stage. The user can directly use the preset connection establishment information or can also modify the connection establishment information saved in the NFC tag. In the above technical solution, since the NFC tag is provided outside the terminal device, terminal devices that do not include the NFC tag in the hardware can also support the method for establishing a wireless connection provided in the embodiments of the present application.
图2是根据本申请实施例提供的电子设备的示意性结构框图。如图2所示的电子设备200包括处理器210、存储器220、输出模块230、通信接口240和NFC读取器250。处理器210中可以包括中央处理器(central processing unit,CPU)211、蓝牙模块212和WLAN模块213。Fig. 2 is a schematic structural block diagram of an electronic device according to an embodiment of the present application. The electronic device 200 shown in FIG. 2 includes a processor 210, a memory 220, an output module 230, a communication interface 240, and an NFC reader 250. The processor 210 may include a central processing unit (CPU) 211, a Bluetooth module 212, and a WLAN module 213.
处理器210包括的CPU 211还可以是特定集成电路(Application Specific Integrated Circuit,ASIC),或者是被配置成实施本申请实施例的一个或多个集成电路,例如:一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)。其中,CPU 211可以通过运行或执行存储在存储器220内的软件程序,以及调用存储在存储器220内的数据,结合蓝牙模块212和/或Wi-Fi模块213执行电子设备的各种功能。The CPU 211 included in the processor 210 may also be a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, for example: one or more microprocessors ( Digital signal processor, DSP), or, one or more Field Programmable Gate Array (FPGA). Wherein, the CPU 211 can execute various functions of the electronic device in combination with the Bluetooth module 212 and/or the Wi-Fi module 213 by running or executing a software program stored in the memory 220 and calling data stored in the memory 220.
在具体实现中,作为一种实施例,终端可以包括多个处理器。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个终端、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In specific implementation, as an embodiment, the terminal may include multiple processors. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more terminals, circuits, and/or processing cores for processing data (for example, computer program instructions).
存储器220可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储终端,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储终端,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁盘存储介质或者其他磁存储终端、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器220可以是独立存在,通过通信总线260与处理器210相连接。存储器220也可以和处理器210集成在一起。The memory 220 may be a read-only memory (ROM) or other types of static storage terminals that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions The dynamic storage terminal can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic disk storage medium or other magnetic storage terminal, or it can be used to carry or store instructions or data structures The desired program code and any other medium that can be accessed by the computer, but not limited to this. The memory 220 may exist independently and is connected to the processor 210 through the communication bus 260. The memory 220 may also be integrated with the processor 210.
存储器220还用于存储执行本申请方案的软件程序,并由处理器210来控制执行。The memory 220 is also used to store a software program for executing the solution of the present application, and the processor 210 controls the execution.
输出模块230,可以用于显示提供给用户的信息以及电子设备200的各种菜单。输出模块230可包括显示面板231。可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板231。The output module 230 may be used to display information provided to the user and various menus of the electronic device 200. The output module 230 may include a display panel 231. Optionally, the display panel 231 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), etc.
可选的,在一些实现方式中,电子设备200还可以包括输入装置。该输入装置可以包 括触摸屏。该触摸屏可以覆盖显示面板231。换句话说,输入装置和显示面板可以作为两个独立的部件来实现电子设备200的输入和输出功能。Optionally, in some implementation manners, the electronic device 200 may further include an input device. The input device may include a touch screen. The touch screen can cover the display panel 231. In other words, the input device and the display panel can be used as two independent components to implement the input and output functions of the electronic device 200.
可选的,在另一些实现方式中,可以将显示面板231与触摸屏集成而实现电子设备200的输入和输出功能。Optionally, in other implementation manners, the display panel 231 can be integrated with a touch screen to implement the input and output functions of the electronic device 200.
可选的,在一些实现方式中,该输入装置还可以包括按键。Optionally, in some implementation manners, the input device may further include keys.
通信接口240,使用任何收发器一类的装置,用于与其他设备或通信网络通信。通信接口240可以包括接收单元实现接收功能,以及发送单元实现发送功能。The communication interface 240 uses any device such as a transceiver to communicate with other devices or communication networks. The communication interface 240 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.
蓝牙模块212,集成有蓝牙芯片,适用经典蓝牙协议以及低功耗蓝牙协议,用于支持电子设备210与其他设备建立蓝牙连接。The Bluetooth module 212 is integrated with a Bluetooth chip, is suitable for the classic Bluetooth protocol and the low-power Bluetooth protocol, and is used to support the electronic device 210 to establish Bluetooth connections with other devices.
WLAN模块213,集成有WLAN芯片,用于支持电子设备210与其他设备建立WLAN连接。The WLAN module 213 is integrated with a WLAN chip for supporting the electronic device 210 to establish a WLAN connection with other devices.
NFC读取器250,用于获取NFC标签中保存的连接建立信息。The NFC reader 250 is used to obtain the connection establishment information stored in the NFC tag.
可选的,在一些实施例中,NFC读取器250可以通过通信总线260于处理器210相连。NFC读取器250可以将该连接建立信息发送至处理器210。处理器210可以根据获取到的连接建立信息发起无线连接。Optionally, in some embodiments, the NFC reader 250 may be connected to the processor 210 through the communication bus 260. The NFC reader 250 may send the connection establishment information to the processor 210. The processor 210 may initiate a wireless connection according to the acquired connection establishment information.
可选的,在一些实施例中,NFC读取器250还可以通过通信总线260于存储器220相连,并将该连接建立信息发送至存储器220。Optionally, in some embodiments, the NFC reader 250 may also be connected to the memory 220 via the communication bus 260, and send the connection establishment information to the memory 220.
图2中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The structure of the electronic device shown in FIG. 2 does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or a combination of some components, or a different component arrangement.
例如,如果电子设备不支持WLAN通信,则该电子设备可以不包括如图2所示的WLAN模块213。For example, if the electronic device does not support WLAN communication, the electronic device may not include the WLAN module 213 as shown in FIG. 2.
图3是根据本申请实施例提供的一种建立无线连接的方法的示意性流程图。Fig. 3 is a schematic flowchart of a method for establishing a wireless connection according to an embodiment of the present application.
301,电子设备通过与终端设备进行NFC,获取保存在该终端设备内的连接建立信息,并广播包含连接标识的无线连接广播消息。该连接建立信息中包括该连接标识。301. The electronic device obtains connection establishment information stored in the terminal device by performing NFC with the terminal device, and broadcasts a wireless connection broadcast message including a connection identifier. The connection establishment information includes the connection identifier.
可选的,在一些实施例中,该终端设备内设置有NFC标签,该NFC标签中保存有该连接建立信息。该电子设备可以通过读该终端设备内的NFC标签,获取该连接建立信息。Optionally, in some embodiments, an NFC tag is provided in the terminal device, and the connection establishment information is stored in the NFC tag. The electronic device can obtain the connection establishment information by reading the NFC tag in the terminal device.
可选的,在另一些实施例中,该NFC标签可以设置在该终端设备外,该终端设备内部的存储装置中可以保存该连接建立信息。Optionally, in other embodiments, the NFC tag may be provided outside the terminal device, and the connection establishment information may be stored in a storage device inside the terminal device.
可选的,在一些实施例中,该电子设备可以在广播该无线连接广播消息的时长超过预设时长且未与该终端设备建立无线连接的情况下,停止广播该无线连接广播消息。例如,该电子设备可以在开始广播该无线连接广播消息后启动一个计时器。若该计时器的时长超过一个预设时长(例如30秒),则该电子设备可以停止广播该无线连接广播消息。Optionally, in some embodiments, the electronic device may stop broadcasting the wireless connection broadcast message when the duration of broadcasting the wireless connection broadcast message exceeds a preset duration and the wireless connection is not established with the terminal device. For example, the electronic device may start a timer after starting to broadcast the wireless connection broadcast message. If the duration of the timer exceeds a preset duration (for example, 30 seconds), the electronic device may stop broadcasting the wireless connection broadcast message.
302,该终端设备启动无线连接广播扫描。302. The terminal device starts a wireless connection broadcast scan.
可选的,在一些实施例中,该终端设备可以在确定该终端设备内部的NFC标签被读取的情况下,启动该无线连接广播扫描。换句话说,若该NFC标签在该终端设备内部,则该终端设备可确定该NFC标签是否被读取。该终端设备可以在确定该NFC标签被读取的情况下,启动该无线连接广播扫描。若该终端设备确定该NFC标签未被读取,则该终端设备可以无需启动该无线连接广播扫描。这样,可以节省该终端设备的电量。Optionally, in some embodiments, the terminal device may initiate the wireless connection broadcast scan when it is determined that the NFC tag inside the terminal device is read. In other words, if the NFC tag is inside the terminal device, the terminal device can determine whether the NFC tag is read. The terminal device may start the wireless connection broadcast scan when it is determined that the NFC tag is read. If the terminal device determines that the NFC tag has not been read, the terminal device may not need to start the wireless connection broadcast scan. In this way, the power of the terminal device can be saved.
可选的,在一些实施例中,该终端设备在进行该无线连接广播扫描的时间超过一个预 设时间且该终端设备未检测到该连接标识被广播的情况下,该终端设备可以停止进行该无线连接广播扫描。Optionally, in some embodiments, when the terminal device performs the wireless connection broadcast scan for more than a preset time and the terminal device does not detect that the connection identifier is broadcast, the terminal device may stop performing the Wireless connection broadcast scan.
可选的,在一些实施例中,用户可以手动启动该无线连接广播扫描。例如,该用户可以通过该终端设备的输入装置,启动该无线连接广播扫描。Optionally, in some embodiments, the user can manually start the wireless connection broadcast scan. For example, the user can start the wireless connection broadcast scan through the input device of the terminal device.
可选的,在一些实施例中,该终端设备可以周期性地启动该无线连接广播扫描。例如,用户可以设置一个扫描周期。该终端设备可以根据该扫描周期,启动该无线连接广播扫描。例如,用户可以设置每间隔10分钟启动一次无线连接广播扫描。这样,该终端设备可以每隔10分钟启动该无线连接广播扫描。Optionally, in some embodiments, the terminal device may periodically start the wireless connection broadcast scan. For example, the user can set a scan period. The terminal device can start the wireless connection broadcast scan according to the scan period. For example, the user can set to start a wireless connection broadcast scan every 10 minutes. In this way, the terminal device can start the wireless connection broadcast scan every 10 minutes.
303,该终端设备通过该无线连接广播扫描,扫描到包含有该连接标识的无线连接广播消息。303. The terminal device scans through the wireless connection broadcast and scans the wireless connection broadcast message containing the connection identifier.
可选的,在一些实施例中,该连接建立信息中还可以包括广播周期。在此情况下,该电子设备可以周期性地广播该连接标识;相应的,该终端设备可以周期性进行该无线连接广播扫描,其中,该电子设备广播该连接标识的周期以及该终端设备进行该无线连接广播扫描的周期为该广播周期。Optionally, in some embodiments, the connection establishment information may also include a broadcast period. In this case, the electronic device can periodically broadcast the connection identification; accordingly, the terminal device can periodically perform the wireless connection broadcast scan, wherein the electronic device broadcasts the connection identification period and the terminal device performs the The period of wireless connection broadcast scanning is the broadcast period.
304,该终端设备与该电子设备建立无线连接。304. The terminal device establishes a wireless connection with the electronic device.
该无线连接可以是以下连接中的任一种:蓝牙连接、WLAN连接等。The wireless connection may be any of the following connections: Bluetooth connection, WLAN connection, and so on.
可选的,在一些实施例中,在该终端设备与该电子设备建立无线连接之前,该电子设备与该终端设备之间还可以进行身份验证。换句话说,在一些情况下,在身份验证通过的情况下,该电子设备与该终端设备建立该无线连接。在身份验证未通过身份验证的情况下,该电子设备不会与该终端设备建立该无线连接。Optionally, in some embodiments, before the terminal device establishes a wireless connection with the electronic device, identity verification may be performed between the electronic device and the terminal device. In other words, in some cases, if the identity verification is passed, the electronic device establishes the wireless connection with the terminal device. In the case that the identity verification fails the identity verification, the electronic device will not establish the wireless connection with the terminal device.
可选的,在一些实施例中,该身份验证过程可以由该电子设备实现。Optionally, in some embodiments, the identity verification process may be implemented by the electronic device.
可选的,在一些实施例中,该连接建立信息还包括校验信息(该校验信息也可以称为密钥,该密钥可以是一个预设密钥,也可以是临时生成的临时密钥)。该终端设备与该电子设备可以利用该校验信息完成身份验证过程。例如,该终端设备可以将该校验信息通过临时连接发送至该电子设备。该电子设备可以比较从该NFC标签读取到的校验信息(为便于描述,以下将该NFC标签中的校验信息称为第一校验信息)以及通过该临时连接接收到的由该终端设备发送的校验信息(为便于描述,以下将电子设备通过该临时连接接收到的校验信息称为第二校验信息);若该第一校验信息与该第二校验信息相同,则该电子设备可以确定该终端设备通过身份验证;若该第一校验信息与该第二校验信息不同,则该电子设备可以确定该终端设备未通过身份验证。Optionally, in some embodiments, the connection establishment information further includes verification information (the verification information may also be referred to as a key, and the key may be a preset key or a temporarily generated temporary key. key). The terminal device and the electronic device can use the verification information to complete the identity verification process. For example, the terminal device may send the verification information to the electronic device through a temporary connection. The electronic device can compare the verification information read from the NFC tag (for ease of description, the verification information in the NFC tag is referred to as the first verification information below) and the terminal received through the temporary connection. The verification information sent by the device (for ease of description, the verification information received by the electronic device through the temporary connection is referred to as the second verification information below); if the first verification information is the same as the second verification information, Then the electronic device can determine that the terminal device passes the identity verification; if the first verification information is different from the second verification information, the electronic device can determine that the terminal device fails the identity verification.
可选的,在一些实施例中,该NFC标签位于该终端设备内部且该终端设备可以对该NFC标签中保持的内容进行读写操作。在此情况下,该电子设备可以通过临时连接将一个随机数(也可以称为随机码、配对码等)发送至该终端设备,并根据该随机数完成身份验证过程。例如,该终端设备可以将通过该临时连接接收到的随机数写入到该NFC标签中;该电子设备可以通过读取该NFC标签,获取该NFC标签中保存的随机数,并比较该电子设备发送至该终端设备的随机数(为便于描述,以下将该电子设备发送至该终端设备的随机数称为第一随机数)与该NFC标签中的随机数(为便于描述,以下将该NFC标签中的随机数称为第二随机数);若该第一随机数与该第二随机数相同,则该电子设备可以确定该终端设备通过身份验证;若该第一随机数与该第二随机数不同,则该电子设备可以确定 该终端设备未通过身份验证。Optionally, in some embodiments, the NFC tag is located inside the terminal device and the terminal device can perform read and write operations on the content held in the NFC tag. In this case, the electronic device can send a random number (also called a random code, pairing code, etc.) to the terminal device through a temporary connection, and complete the identity verification process according to the random number. For example, the terminal device can write the random number received through the temporary connection into the NFC tag; the electronic device can read the NFC tag to obtain the random number stored in the NFC tag, and compare the electronic device The random number sent to the terminal device (for ease of description, the random number sent by the electronic device to the terminal device is called the first random number below) and the random number in the NFC tag (for ease of description, the NFC The random number in the tag is called the second random number); if the first random number is the same as the second random number, the electronic device can determine that the terminal device passes the identity verification; if the first random number is the same as the second random number If the random number is different, the electronic device can determine that the terminal device has not passed the identity verification.
可选的,在一些实施例中,身份验证过程也可以是由终端设备完成的。Optionally, in some embodiments, the identity verification process may also be completed by the terminal device.
例如,该终端设备可以将该校验信息通过临时连接发送至该电子设备。具体地,该电子设备可以读取保存在该NFC标签中校验信息(为便于描述,以下将该NFC标签中的校验信息称为第一校验信息),该临时连接将读取到的第一校验信息发送至该终端设备。终端设备比较该第一校验信息和通过临时连接接收到的该电子设备发送的校验信息(为便于描述,以下将终端设备通过临时连接接收到的该电子设备发送的校验信息称为第三校验信息);若该第一校验信息与该第三校验信息相同,则该终端设备可以确定该电子设备通过身份验证;若该第一校验信息与该第三校验信息不同,则该终端设备可以确定该电子设备未通过身份验证。For example, the terminal device may send the verification information to the electronic device through a temporary connection. Specifically, the electronic device can read the verification information stored in the NFC tag (for ease of description, the verification information in the NFC tag is referred to as the first verification information below), and the temporary connection will read The first verification information is sent to the terminal device. The terminal device compares the first verification information with the verification information sent by the electronic device received through the temporary connection (for ease of description, the verification information received by the terminal device through the temporary connection and sent by the electronic device is referred to as the first Three verification information); if the first verification information is the same as the third verification information, the terminal device can determine that the electronic device passes the identity verification; if the first verification information is different from the third verification information , The terminal device can determine that the electronic device has not passed the identity verification.
又如,随机数可以是终端设备生成的。该终端设备可以将生成的随机数写入到该NFC标签中;该电子设备可以通过读取该NFC标签,获取该NFC标签中保存的随机数,并通过临时连接将读取到的随机数发送至该终端设备。该终端设备可以比较通过临时链接接收到的该电子设备发送的随机数(为便于描述,以下将该电子设备发送至该终端设备的随机数称为第一随机数)和保存在该NFC标签中的随机数(为便于描述,以下将该NFC标签中的随机数称为第二随机数);若该第一随机数与该第二随机数相同,则该终端设备设备可以确定该电子设备通过身份验证;若该第一随机数与该第二随机数不同,则该终端设备可以确定该电子设备未通过身份验证。For another example, the random number may be generated by the terminal device. The terminal device can write the generated random number into the NFC tag; the electronic device can read the NFC tag to obtain the random number stored in the NFC tag, and send the read random number through a temporary connection To the terminal device. The terminal device can compare the random number sent by the electronic device received through the temporary link (for ease of description, the random number sent by the electronic device to the terminal device is called the first random number below) and saved in the NFC tag (For ease of description, the random number in the NFC tag is called the second random number below); if the first random number is the same as the second random number, the terminal device can determine that the electronic device passes Identity verification; if the first random number is different from the second random number, the terminal device can determine that the electronic device fails the identity verification.
上述例子中,只要校验信息和随机数中的一个相同,身份验证就可以通过。在另一些实施例中,可以同时验证校验信息和随机数,只要在校验信息和随机数均相同的情况下,身份验证才可以通过。In the above example, as long as the verification information is the same as one of the random numbers, the identity verification can pass. In other embodiments, the verification information and the random number can be verified at the same time, and the identity verification can pass only when the verification information and the random number are the same.
可选的,在一些实施例中,利用验证校验信息和随机数进行身份验证的工作可以由同一个设备执行。例如,可以由终端设备进行校验信息验证和随机数验证,以确定电子设备是否通过身份验证。又如,可以由电子设备进行校验信息验证和随机数验证,以确定终端设备是否通过身份验证。Optionally, in some embodiments, the work of using the verification verification information and the random number for identity verification may be performed by the same device. For example, the terminal device can perform verification information verification and random number verification to determine whether the electronic device passes the identity verification. For another example, the electronic device may perform verification information verification and random number verification to determine whether the terminal device passes the identity verification.
可选的,在另一些实施例中,利用校验信息和随机数进行身份验证的工作可以由不同的设备执行。例如,可以由终端设备负责进行校验信息验证,由电子设备负责进行随机数验证。又如,可以由终端设备负责进行随机数验证,由终端设备负责进行校验信息验证。Optionally, in other embodiments, the work of using verification information and random numbers for identity verification may be performed by different devices. For example, the terminal device may be responsible for verifying the verification information, and the electronic device may be responsible for verifying the random number. As another example, the terminal device may be responsible for the random number verification, and the terminal device may be responsible for the verification information verification.
可选的,在一些实施例中,该电子设备与该终端设备进行身份验证的过程可以认为是建立无线连接过程的一部分。Optionally, in some embodiments, the process of performing identity verification between the electronic device and the terminal device may be considered as part of the process of establishing a wireless connection.
为了帮助本领域技术人员更好地理解本申请的技术方案,将结合具体实施例对本申请的技术方案进行描述。可以理解的是,这些具体实施例仅是为了帮助本领域技术人员更好地理解本申请的技术方案,而并非是对本申请技术方案的限定。In order to help those skilled in the art to better understand the technical solutions of the present application, the technical solutions of the present application will be described with reference to specific embodiments. It is understandable that these specific embodiments are only for helping those skilled in the art to better understand the technical solutions of the present application, and are not intended to limit the technical solutions of the present application.
图4是根据本申请实施例提供的一种建立无线通信连接的方法的示意性流程图。Fig. 4 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
401、智能手表利用NFC,将连接建立信息发送至跑步机。401. The smart watch uses NFC to send connection establishment information to the treadmill.
跑步机利用设置在该跑步机中的NFC读取器读取设置在该智能手表中的NFC标签保存的连接建立信息,该连接建立信息中可以包括连接标识。由于该连接建立信息是用于建立蓝牙连接的,因此该连接建立信息也可以称为蓝牙互联信息、蓝牙互联参数或者蓝牙互联参数信息。The treadmill uses the NFC reader provided in the treadmill to read the connection establishment information stored in the NFC tag provided in the smart watch, and the connection establishment information may include a connection identifier. Since the connection establishment information is used to establish a Bluetooth connection, the connection establishment information may also be referred to as Bluetooth interconnection information, Bluetooth interconnection parameters, or Bluetooth interconnection parameter information.
可选的,在一些实施例中,该连接标识可以是蓝牙名称或者远程名称(remote name)。Optionally, in some embodiments, the connection identifier may be a Bluetooth name or a remote name (remote name).
可选的,在另一些实施例中,该连接标识可以是蓝牙地址。Optionally, in other embodiments, the connection identifier may be a Bluetooth address.
可以理解的是,用户需要将该智能手表靠近跑步机的NFC读取器,这样该跑步机的NFC读取器才能读取设置在该智能手表中的NFC标签。It is understandable that the user needs to close the smart watch to the NFC reader of the treadmill so that the NFC reader of the treadmill can read the NFC tag set in the smart watch.
402,该跑步机进行蓝牙广播。402. The treadmill performs Bluetooth broadcasting.
具体地,该跑步机可以通过蓝牙广播,广播无线连接广播消息。该无线连接广播消息中可以包括连接标识。换句话说,该跑步机作为蓝牙从设备(Peripheral Device)进行蓝牙广播,广播该连接标识。Specifically, the treadmill can broadcast wireless connection broadcast messages via Bluetooth broadcast. The wireless connection broadcast message may include a connection identifier. In other words, the treadmill acts as a Bluetooth slave device (Peripheral Device) to perform Bluetooth broadcast and broadcast the connection identification.
例如,若该连接标识是蓝牙名称或远程名称,则该跑步机会以该蓝牙地址或远程名称作为蓝牙连接的名称进行广播。For example, if the connection identification is a Bluetooth name or a remote name, the treadmill will broadcast the Bluetooth address or remote name as the name of the Bluetooth connection.
又如,若该连接标识是蓝牙地址,则该跑步机会以该蓝牙地址作为该跑步机自身的蓝牙地址,并进行蓝牙广播。或者,在另一个实现方式中,该连接标识是蓝牙地址,跑步机会以该蓝牙地址作为目标连接地址进行广播。For another example, if the connection identifier is a Bluetooth address, the treadmill uses the Bluetooth address as the Bluetooth address of the treadmill itself, and performs Bluetooth broadcast. Or, in another implementation manner, the connection identifier is a Bluetooth address, and the treadmill broadcasts using the Bluetooth address as the target connection address.
可选的,在一些实施例中,该跑步机可以在该NFC读取器读取到连接建立信息的情况下,启动蓝牙模块并进行蓝牙广播。换句话说,该跑步机中的蓝牙模块在NFC读取器读取到连接建立信息之前,可以是处于关闭或休眠状态。Optionally, in some embodiments, the treadmill may activate the Bluetooth module and perform Bluetooth broadcasting when the NFC reader reads the connection establishment information. In other words, the Bluetooth module in the treadmill can be in a closed or dormant state before the NFC reader reads the connection establishment information.
可选的,在一些实施例中,该跑步机开启的蓝牙广播的时间是有限的。换句话说,该跑步机可以在进行蓝牙广播的时长超过预设时长且未建立蓝牙连接的情况下,停止进行蓝牙广播。例如,该跑步机可以在开始进行蓝牙广播后启动一个计时器。若该计时器的时长超过一个预设时长(例如30秒)且该跑步机未建立蓝牙连接,则该跑步机可以停止进行蓝牙广播。换句话说,该跑步机进行蓝牙广播是临时的。Optionally, in some embodiments, the Bluetooth broadcast time of the treadmill is limited. In other words, the treadmill can stop performing Bluetooth broadcasting when the duration of Bluetooth broadcasting exceeds the preset period and the Bluetooth connection is not established. For example, the treadmill can start a timer after starting Bluetooth broadcast. If the duration of the timer exceeds a preset duration (for example, 30 seconds) and the treadmill does not establish a Bluetooth connection, the treadmill can stop performing Bluetooth broadcasting. In other words, the Bluetooth broadcast of the treadmill is temporary.
403,该智能手表进行蓝牙扫描,在扫描到包含有该连接标识的无线连接广播消息的情况下通过该连接标识与该跑步机建立蓝牙连接。403. The smart watch performs a Bluetooth scan, and establishes a Bluetooth connection with the treadmill through the connection identifier when the wireless connection broadcast message containing the connection identifier is scanned.
换句话说,该智能手表可以作为蓝牙主设备(Central Device)进行蓝牙扫描,在扫描到包含有该智能手表中的NFC标签保存的连接标识的情况下,利用该连接标识与广播该连接标识的跑步机建立蓝牙连接。In other words, the smart watch can be used as a Bluetooth master device (Central Device) to perform Bluetooth scanning. In the case of scanning that contains the connection identifier saved by the NFC tag in the smart watch, use the connection identifier and broadcast the connection identifier. The treadmill establishes a Bluetooth connection.
换句话说,该智能手表在监测到该智能手表内保存有连接建立信息的NFC标签被读取,可以会确定有外围设备会以该连接建立信息中的标识信息(例如远程名称)开启蓝牙广播。因此,该智能手表可以作为主设备使用该标识信息(例如远程名称)进行蓝牙扫描。In other words, when the smart watch detects that the NFC tag with the connection establishment information stored in the smart watch is read, it can be determined that a peripheral device will start Bluetooth broadcasting with the identification information (such as the remote name) in the connection establishment information . Therefore, the smart watch can use the identification information (for example, remote name) as a master device to perform Bluetooth scanning.
可选的,在一些实施例中,若该NFC标签设置于该智能手表内部,则该智能手表可以在确定NFC标签被读取的情况下,开启蓝牙模块,并进行蓝牙扫描。Optionally, in some embodiments, if the NFC tag is installed inside the smart watch, the smart watch can turn on the Bluetooth module and perform Bluetooth scanning when it is determined that the NFC tag is read.
可选的,在另一些实施例中,若该NFC标签设置于智能手表外部,则用户可以事先手动开启蓝牙模块。Optionally, in other embodiments, if the NFC tag is installed outside the smart watch, the user can manually turn on the Bluetooth module in advance.
通过蓝牙扫描,该智能手表可以检测到该连接标识被广播。在此情况下,该智能手表可以直接使用该连接标识与该跑步机建立蓝牙连接。Through Bluetooth scanning, the smart watch can detect that the connection identification is broadcast. In this case, the smart watch can directly use the connection identifier to establish a Bluetooth connection with the treadmill.
可选的,在一些实施例中,该连接建立信息中还可以包括安全信息。该安全信息可以是校验信息和/或随机数。在一些实施例中,该校验信息是远程安全管理临时密钥(Temporary Key,TK)值(Remote Security Manager TK-Value)))。在此情况下,该跑步机在与该智能手表建立蓝牙连接之前,可以根据该安全信息进行身份验证,在身份验 证通过后继续完成建立蓝牙连接的其余步骤。身份验证的具体过程可以参加图3所示的方法,在此就不必赘述。Optionally, in some embodiments, the connection establishment information may also include security information. The security information may be verification information and/or random numbers. In some embodiments, the verification information is a remote security manager TK-Value (Remote Security Manager TK-Value)). In this case, the treadmill can perform identity verification based on the security information before establishing a Bluetooth connection with the smart watch, and continue to complete the remaining steps of establishing a Bluetooth connection after the identity verification is passed. The specific process of identity verification can participate in the method shown in FIG. 3, and it is not necessary to repeat it here.
可选的,在一些实施例中,该连接建立信息中还可以包括蓝牙广播周期。在此情况下,该跑步机可以基于该蓝牙广播周期,周期性地广播该连接标识。该终端设备也可以根据该蓝牙广播周期,周期性地进行蓝牙扫描。Optionally, in some embodiments, the connection establishment information may also include a Bluetooth broadcast period. In this case, the treadmill may periodically broadcast the connection identification based on the Bluetooth broadcast cycle. The terminal device may also periodically perform Bluetooth scanning according to the Bluetooth broadcast cycle.
404,该智能手表通知用户蓝牙连接建立成功。404: The smart watch notifies the user that the Bluetooth connection is successfully established.
例如,在蓝牙连接成功建立的情况下,该智能手表可以通过震动、提示音和/或利用该智能手表显示装置提醒用户蓝牙连接成功。For example, in the case that the Bluetooth connection is successfully established, the smart watch may remind the user that the Bluetooth connection is successful through vibration, prompt sound, and/or using the smart watch display device.
可选的,在一些实施例中,该跑步机也可以通过显示装置、和/或提示音提醒用户蓝牙连接成功。Optionally, in some embodiments, the treadmill may also remind the user that the Bluetooth connection is successful through a display device and/or a prompt sound.
405,该智能手表可以自动进入跑步界面。405. The smart watch can automatically enter the running interface.
例如,在蓝牙连接成功建立的情况下,该跑步机可以通过蓝牙连接向该智能手表发送设备指示信息,该设备指示信息用于指示与该智能手表建立蓝牙连接的电子设备为跑步机。该智能手表在接收到该设备指示信息的情况下,可以自动进入跑步界面。For example, in the case that the Bluetooth connection is successfully established, the treadmill may send device indication information to the smart watch through the Bluetooth connection, and the device indication information is used to indicate that the electronic device establishing the Bluetooth connection with the smart watch is a treadmill. The smart watch can automatically enter the running interface when receiving the device instruction information.
例如,该智能手表中包括运行在硬件之上的操作系统以及运行在操作系统层之上的应用(Application,APP)。该智能手表的不同功能可以由不同的应用提供。例如,时间应用可以提供时钟功能。该时钟功能可以包括在该智能手表的显示界面上显示时间界面,该时间界面中可以显示时间、日期、天气等信息。跑步应用可以提供与跑步相关的功能,例如计时、获取用户的心率、计算消耗的卡路里、计算步数等功能。在跑步应用运行时,该智能手表的显示界面上会显示跑步界面,该跑步界面中可以显示跑步时间、心率、消耗的卡路里、步数等信息。动感单车应用可以提供与动感单车相关的功能,例如计时、获取用户的心率、计算消耗的卡路里、获取踏频等。在动感单车应用运行时,该智能手表的显示界面上会显示动感单车界面,该动感单车界面中可以显示骑行时间、心率、消耗的卡路里、踏频等信息。在智能手表处于非跑步应用(例如时间应用、动感单车应用等)的情况下,若该智能手表接收到该设备指示信息,则该智能手表运行的应用可以自动从非跑步应用切换到跑步应用。换句话说,若该智能手表接收到该设备指示信息,则该智能手表的显示界面可以自动切换到跑步界面。For example, the smart watch includes an operating system running on the hardware and an application (Application, APP) running on the operating system layer. Different functions of the smart watch can be provided by different applications. For example, the time application can provide a clock function. The clock function can include displaying a time interface on the display interface of the smart watch, and the time interface can display information such as time, date, and weather. Running applications can provide functions related to running, such as timing, obtaining the user's heart rate, calculating calories burned, and counting steps. When the running application is running, a running interface is displayed on the display interface of the smart watch, and information such as running time, heart rate, calories consumed, and number of steps can be displayed on the running interface. The spinning application can provide functions related to spinning, such as timing, obtaining the user's heart rate, calculating the calories burned, and obtaining the cadence. When the spinning application is running, the display interface of the smart watch will display a spinning interface, which can display information such as riding time, heart rate, calories burned, and cadence. When the smart watch is in a non-running application (such as a time application, a spinning application, etc.), if the smart watch receives the device indication information, the application running on the smart watch can automatically switch from a non-running application to a running application. In other words, if the smart watch receives the device indication information, the display interface of the smart watch can automatically switch to the running interface.
或者,在一种可选的实施例中,智能手表与不同的设备连接,可以自动打开不同的应用,或自动进入应用的相关界面。例如,若智能手表与跑步机建立连接,智能手表可以自动显示跑步界面;若智能手表与动感单车建立连接,智能手表可以自动显示动感单车的运动界面。Or, in an optional embodiment, the smart watch is connected to different devices and can automatically open different applications or automatically enter the relevant interface of the application. For example, if the smart watch is connected with a treadmill, the smart watch can automatically display the running interface; if the smart watch is connected with the spinning machine, the smart watch can automatically display the exercise interface of the spinning bike.
可选的,在另一些实施例中,用户也可以手动设置该智能手表运行的应用,使得该智能手表运行跑步应用并呈现跑步界面。Optionally, in some other embodiments, the user can also manually set the application run by the smart watch, so that the smart watch runs the running application and presents a running interface.
可选的,在另一些实施例中,该智能手表可以在确定NFC标签被读取的情况下,进入跑步界面。Optionally, in some other embodiments, the smart watch may enter the running interface when it is determined that the NFC tag is read.
406,用户启动该跑步机。406. The user starts the treadmill.
407,该跑步机通知该智能手表跑步开始。407. The treadmill notifies the smart watch to start running.
在用户启动跑步机的情况下,该跑步机可以通过蓝牙连接向该智能手表发送启动指示信息,该启动指示信息用于指示该跑步机开始启动。In the case that the user starts the treadmill, the treadmill can send start-up instruction information to the smart watch through the Bluetooth connection, and the start-up instruction information is used to instruct the treadmill to start.
408,该智能手表进入运动状态。408. The smart watch enters an exercise state.
可选的,在一些实施例中,该智能手表可以在接收到来自于该跑步机的该启动指示信息的情况下,进入运动状态。Optionally, in some embodiments, the smart watch may enter the exercise state after receiving the startup instruction information from the treadmill.
可选的,在另一些实施例中,用户也可以手动设置该智能手表,使得该智能手表进入运动状态。Optionally, in other embodiments, the user can also manually set the smart watch so that the smart watch enters an exercise state.
如上所述,该智能手表在确定与跑步机建立蓝牙连接后可以启动跑步应用并呈现跑步界面。跑步应用可以提供不同的状态,例如非运动状态和运动状态。在处于非运动状态的情况下,该跑步界面可以仅呈现时间信息,该跑步应用可以不进行卡路里计算、获取心率、计算跑步距离等操作。在处于运动状态的情况下,该跑步应用可以进行卡路里计算、获取心率,计算步数等操作,该跑步界面呈现该跑步应用获取到的信息。当该智能手表从非跑步应用切换到跑步应用后,该跑步应用可以处于非运动状态。在该跑步应用获取到该启动指示信息的情况下,该跑步应用可以自动从非运动状态切换到运动状态。该智能手表的显示界面上可以开始呈现卡路里、心率、步数等信息。该跑步应用可以利用智能手表中的心率传感器或者外置的心率传感器获取用户的心率,计算卡路里,计算步数等。As described above, the smart watch can start a running application and present a running interface after determining to establish a Bluetooth connection with the treadmill. The running application can provide different states, such as non-exercise state and exercise state. In a non-exercise state, the running interface may only present time information, and the running application may not perform operations such as calorie calculation, obtaining heart rate, and calculating running distance. In the case of an exercise state, the running application can perform operations such as calorie calculation, obtaining heart rate, and calculating steps, and the running interface presents the information obtained by the running application. After the smart watch is switched from a non-running application to a running application, the running application may be in a non-exercise state. In the case that the running application obtains the startup instruction information, the running application can automatically switch from the non-exercise state to the exercise state. The display interface of the smart watch can begin to present information such as calories, heart rate, and number of steps. The running application can use the heart rate sensor in the smart watch or an external heart rate sensor to obtain the user's heart rate, calculate calories, and calculate the number of steps.
409,跑步机通过蓝牙连接向该智能手表发送运动信息。409. The treadmill sends exercise information to the smart watch through the Bluetooth connection.
可选的,在一些实施例中,在该跑步机处于启动状态的情况下,该跑步机可以周期性地通过蓝牙连接向该智能手表发送运动信息,该运动信息可以包括启动的时间、跑步速度、距离、坡度等中的一个或多个信息。该智能手表可以保存该运动信息。该智能手表的显示装置也可以显示该运动信息。Optionally, in some embodiments, when the treadmill is in the activated state, the treadmill may periodically send exercise information to the smart watch through a Bluetooth connection, and the exercise information may include the time of activation and the running speed. One or more of, distance, slope, etc. The smart watch can save the exercise information. The display device of the smart watch can also display the exercise information.
可选的,在另一些实施例中,该跑步机也可以接收到用户的指令的情况下向该智能手表发送运动信息。例如,用户通过该跑步机中的输入装置(例如按钮)指示该跑步机将该运动信息发送至该智能手表。Optionally, in other embodiments, the treadmill may also send exercise information to the smart watch when receiving an instruction from the user. For example, the user instructs the treadmill to send the exercise information to the smart watch through an input device (such as a button) in the treadmill.
可选的,在另一些实施例中,该跑步机可以在特定信息达到预设条件的情况下,将该运动信息发送至该智能手表。例如该跑步机可以在确定在距离每增加一公里的情况下,将该运动信息发送至该智能手表。又如,该跑步机可以在跑步速度超过一个预设速度情况下,将该运动信息发送至该智能手表。Optionally, in some other embodiments, the treadmill may send the exercise information to the smart watch when the specific information reaches a preset condition. For example, the treadmill may send the exercise information to the smart watch when it is determined that the distance increases by one kilometer. For another example, the treadmill may send the exercise information to the smart watch when the running speed exceeds a preset speed.
410,该智能手表向该跑步机发送用户数据。410. The smart watch sends user data to the treadmill.
可选的,在一些实施例中,在蓝牙连接成功建立的情况下,该智能手表可以周期性地将检测到的该用户的用户数据通过该蓝牙连接发送至该跑步机。该用户数据可以包括该用户的心率、步数、消耗的卡路里等信息。该跑步机的显示装置可以显示获取到的用户数据。该跑步机也可以保存该用户数据。Optionally, in some embodiments, when the Bluetooth connection is successfully established, the smart watch may periodically send the detected user data of the user to the treadmill through the Bluetooth connection. The user data may include information such as the user's heart rate, number of steps, and calories consumed. The display device of the treadmill can display the acquired user data. The treadmill can also save the user data.
可选的,在一些实施例中,该智能手表可以在检测到的特定的用户数据达到预设条件的情况下,将检测到的该用户的用户数据通过该蓝牙连接发送至该跑步机。例如,该智能手表可以在该用户的实时心率超过一个预设阈值的情况下将该用户数据或者用户的实时心率发送至该跑步机。又如,该智能手表可以在该用户消耗的卡路里超过一个预设数值的情况下,将该用户数据或者该用户消耗的卡路里发送至该跑步机。该跑步机的显示装置可以显示获取到的用户数据。该跑步机也可以保存该用户数据。Optionally, in some embodiments, the smart watch may send the detected user data of the user to the treadmill through the Bluetooth connection when the detected specific user data reaches a preset condition. For example, the smart watch may send the user data or the user's real-time heart rate to the treadmill when the user's real-time heart rate exceeds a preset threshold. For another example, the smart watch may send the user data or the calories consumed by the user to the treadmill when the calories consumed by the user exceed a preset value. The display device of the treadmill can display the acquired user data. The treadmill can also save the user data.
411,该智能手表和该跑步机可以呈现并自动刷新运动数据。该运动数据可以包括用户数据和/或运动信息。411. The smart watch and the treadmill can present and automatically refresh the exercise data. The exercise data may include user data and/or exercise information.
例如,该智能手表中运行的跑步应用可以自动根据获取到的用户数据和运动信息,刷新跑步界面上显示的运动数据。For example, the running application running in the smart watch can automatically refresh the exercise data displayed on the running interface according to the acquired user data and exercise information.
412,用户停止该跑步机。412. The user stops the treadmill.
413,该跑步机通知该智能手表跑步结束。413: The treadmill notifies the smart watch that the running is over.
可选的,在一些实施例中,在用户停止跑步机运行的情况下,该跑步机可以通过蓝牙连接向该智能手表发送停止指示信息,该停止指示信息用于指示该跑步机停止启动。该智能手表在接收到该停止指示信息的情况下,结束运动状态。Optionally, in some embodiments, when the user stops running the treadmill, the treadmill may send stop instruction information to the smart watch via a Bluetooth connection, and the stop instruction information is used to instruct the treadmill to stop starting. When the smart watch receives the stop instruction information, it ends the exercise state.
414,该智能手表从运动状态退出,显示跑步详情并存档运动数据。414. The smart watch exits from the exercise state, displays running details and archives exercise data.
可选的,在一些实施例中,在结束运动后,该智能手表可以利用检测到的用户数据以及获取到的运动信息,生成第一运动数据,并保存第一运动数据。该跑步机可以根据检测到的运动信息和获取到的用户数据,生成第二运动数据,并在跑步机的显示装置上呈现该第二运动数据。可选的,在一些实施例中,该第一运动数据与该第二运动数据的内容可以相同。例如,该第一运动数据和该第二运动数据中可以包括跑步时间、总距离、平均速度、平均心率。可选的,在另一些实施例中,该第一运动数据于该第二运动数据的内容也可以不同。例如,该第一运动数据可以包括跑步时间、平均速度、平均心率、最大心率、总步数、总卡路里;该第二运动数据可以包括跑步时间、平均速度、最大速度、平均坡度、最大坡度。Optionally, in some embodiments, after finishing the exercise, the smart watch may use the detected user data and the acquired exercise information to generate the first exercise data, and save the first exercise data. The treadmill can generate second exercise data according to the detected exercise information and the acquired user data, and present the second exercise data on the display device of the treadmill. Optionally, in some embodiments, the content of the first motion data and the second motion data may be the same. For example, the first exercise data and the second exercise data may include running time, total distance, average speed, and average heart rate. Optionally, in other embodiments, the content of the first motion data and the second motion data may also be different. For example, the first exercise data may include running time, average speed, average heart rate, maximum heart rate, total steps, and total calories; the second exercise data may include running time, average speed, maximum speed, average slope, and maximum slope.
可选的,在一些实施例中,该智能手表运行的跑步应用在运动结束后,可以自动退出运动状态。例如,从运动状态切换回非运动状态。在从运动状态切换到非运动状态后,该跑步应用可以生成第一运动数据,并保存第一运动数据。Optionally, in some embodiments, the running application running on the smart watch can automatically exit the exercise state after the exercise ends. For example, switching from the motion state back to the non-motion state. After switching from the exercise state to the non-exercise state, the running application can generate the first exercise data and save the first exercise data.
可选的,在一些实施例中,在跑步应用从运动状态切换回非运动状态并保存该第一运动数据后,该智能手表可以从跑步应用切换到时间应用,或者智能手表可以从跑步应用切换回显示跑步界面之前的应用/界面,又或者,智能手表可以切换到主(Home)界面。Optionally, in some embodiments, after the running application is switched from the exercise state to the non-exercise state and the first exercise data is saved, the smart watch can switch from the running application to the time application, or the smart watch can switch from the running application Return to the application/interface before the running interface is displayed, or the smart watch can switch to the home interface.
可以看出,图4所示实施例中的智能手表可以相当于是如图1所示的终端设备,图4所示实施例中的跑步机相当于图2所示的电子设备。It can be seen that the smart watch in the embodiment shown in FIG. 4 may be equivalent to the terminal device shown in FIG. 1, and the treadmill in the embodiment shown in FIG. 4 is equivalent to the electronic device shown in FIG. 2.
可以理解的是,图4所示方法中的智能手表和跑步机只是一组可以应用本申请实施例提供的无线连接方法的终端设备和电子设备。其他终端设备和电子设备也可以应用本申请实施例提供的无线连接的方法来建立无线连接。例如,在一些实施例中,图4中的跑步机可以替换为椭圆机、登山机、动感单车等健身器械。又如,在一些实施例中,终端设备可以是蓝牙耳机,电子设备可以是移动电话、平板电脑或笔记本电脑等移动终端设备。又如,在一些实施例中,终端设备是移动电话、平板电脑或笔记本电脑等移动终端设备,该电子设备可以是蓝牙音箱。It is understandable that the smart watch and treadmill in the method shown in FIG. 4 are just a group of terminal devices and electronic devices that can apply the wireless connection method provided in the embodiments of the present application. Other terminal devices and electronic devices can also use the wireless connection method provided in the embodiments of the present application to establish a wireless connection. For example, in some embodiments, the treadmill in FIG. 4 can be replaced with fitness equipment such as an elliptical machine, a mountaineering machine, or a spinning bike. For another example, in some embodiments, the terminal device may be a Bluetooth headset, and the electronic device may be a mobile terminal device such as a mobile phone, a tablet computer, or a notebook computer. For another example, in some embodiments, the terminal device is a mobile terminal device such as a mobile phone, a tablet computer, or a notebook computer, and the electronic device may be a Bluetooth speaker.
图5是根据本申请实施例提供的一种建立无线通信连接的方法的示意性流程图。Fig. 5 is a schematic flowchart of a method for establishing a wireless communication connection according to an embodiment of the present application.
501,随身Wi-Fi设备利用设置在该随身Wi-Fi设备中的NFC读取器读取设置在移动电话中的NFC标签保存的连接建立信息,该连接建立信息中可以包括连接标识。501. The portable Wi-Fi device uses an NFC reader set in the portable Wi-Fi device to read connection establishment information stored in an NFC tag set in the mobile phone, and the connection establishment information may include a connection identifier.
502,该随身Wi-Fi设备以该连接标识进行Wi-Fi广播。换句话说,该链接标识相当于是一个SSID。该随身Wi-Fi设备以该SSID进行广播502. The portable Wi-Fi device uses the connection identifier to perform Wi-Fi broadcasting. In other words, the link identifier is equivalent to an SSID. The portable Wi-Fi device broadcasts with the SSID
可选的,在一些实施例中,该随身Wi-Fi设备可以在该NFC读取器读取到连接建立信息的情况下,启动Wi-Fi模块并进行Wi-Fi广播。换句话说,该随身Wi-Fi设备中的 Wi-Fi模块在NFC读取器读取到连接建立信息之前,可以是处于关闭或休眠状态。Optionally, in some embodiments, the portable Wi-Fi device may activate the Wi-Fi module and perform Wi-Fi broadcasting when the NFC reader reads the connection establishment information. In other words, the Wi-Fi module in the portable Wi-Fi device may be in a closed or dormant state before the NFC reader reads the connection establishment information.
503,该移动电话通过该连接标识与该随身Wi-Fi设备建立Wi-Fi连接。503. The mobile phone establishes a Wi-Fi connection with the portable Wi-Fi device through the connection identifier.
可选的,在一些实施例中,若该NFC标签设置于该移动电话内部,则该移动电话可以在确定NFC标签被读取的情况下,开启Wi-Fi模块,并进行Wi-Fi扫描。Optionally, in some embodiments, if the NFC tag is installed inside the mobile phone, the mobile phone can turn on the Wi-Fi module and perform Wi-Fi scanning when it is determined that the NFC tag is read.
可选的,在另一些实施例中,若该NFC标签设置于移动电话外部,则用户可以事先手动开启Wi-Fi模块。Optionally, in other embodiments, if the NFC tag is installed outside the mobile phone, the user can manually turn on the Wi-Fi module in advance.
通过Wi-Fi扫描,该移动电话可以检测到该连接标识被广播。在此情况下,该移动电话可以直接使用该连接标识与该随身Wi-Fi设备建立Wi-Fi连接。Through Wi-Fi scanning, the mobile phone can detect that the connection identification is broadcast. In this case, the mobile phone can directly use the connection identifier to establish a Wi-Fi connection with the portable Wi-Fi device.
在此情况下,该随身Wi-Fi设备在与该移动电话建立蓝牙连接之前,可以根据该密钥确定该移动电话通过身份验证。具体地,通过Wi-Fi扫描,该移动电话可以检测到该连接标识被广播。在此情况下,该移动电话可以与该随身Wi-Fi设备建立临时连接。该移动电话可以将该密钥通过该临时连接发送至该随身Wi-Fi设备。该随身Wi-Fi设备在确定接收到的密钥与通过读取NFC标签获取到的密钥相同的情况下,确定该移动电话通过身份验证。在确定该移动电话通过身份验证的情况下,该随身Wi-Fi设备与该移动电话可以继续完成建立Wi-Fi连接的其余步骤。In this case, before the portable Wi-Fi device establishes a Bluetooth connection with the mobile phone, it can determine that the mobile phone passes the identity verification according to the key. Specifically, through Wi-Fi scanning, the mobile phone can detect that the connection identifier is broadcast. In this case, the mobile phone can establish a temporary connection with the portable Wi-Fi device. The mobile phone can send the key to the portable Wi-Fi device through the temporary connection. The portable Wi-Fi device determines that the mobile phone passes the identity verification when it is determined that the received key is the same as the key obtained by reading the NFC tag. When it is determined that the mobile phone passes the identity verification, the portable Wi-Fi device and the mobile phone can continue to complete the remaining steps of establishing a Wi-Fi connection.
可选的,在一些实施例中,该连接建立信息中还可以包括Wi-Fi广播周期。在此情况下,该随身Wi-Fi设备可以基于该Wi-Fi广播周期,周期性地广播该连接标识。该终端设备也可以根据该Wi-Fi广播周期,周期性地进行Wi-Fi扫描。Optionally, in some embodiments, the connection establishment information may also include a Wi-Fi broadcast period. In this case, the portable Wi-Fi device may periodically broadcast the connection identification based on the Wi-Fi broadcast cycle. The terminal device may also periodically perform Wi-Fi scanning according to the Wi-Fi broadcast period.
可以看出,图5所示实施例中的移动电话可以相当于是如图1所示的终端设备,图5所示实施例中的随身Wi-Fi设备相当于图2所示的电子设备。It can be seen that the mobile phone in the embodiment shown in FIG. 5 can be equivalent to the terminal device shown in FIG. 1, and the portable Wi-Fi device in the embodiment shown in FIG. 5 is equivalent to the electronic device shown in FIG. 2.
图6是根据本申请实施例提供的一种电子设备的结构框图。如图6所示的电子设备600包括NFC单元601和通信单元602。Fig. 6 is a structural block diagram of an electronic device according to an embodiment of the present application. The electronic device 600 shown in FIG. 6 includes an NFC unit 601 and a communication unit 602.
NFC单元601,用于与终端设备进行NFC,获取保存在该终端设备内的连接建立信息,该连接建立信息中包括连接标识。The NFC unit 601 is configured to perform NFC with a terminal device to obtain connection establishment information stored in the terminal device, and the connection establishment information includes a connection identifier.
通信单元602,用于广播包含该连接标识的无线连接广播消息。The communication unit 602 is configured to broadcast a wireless connection broadcast message containing the connection identifier.
通信单元602,还用于根据该连接标识与该终端设备建立无线连接。The communication unit 602 is further configured to establish a wireless connection with the terminal device according to the connection identifier.
图6所示的电子设备可以执行如图3至图5中任一个所示的方法。具体地,如图6所示的电子设备可以是如图3所示方法中的电子设备,也可以是如图4所示方法中的跑步机,也可以是如图5所示方法中的随身Wi-Fi设备。The electronic device shown in FIG. 6 can execute the method shown in any one of FIGS. 3 to 5. Specifically, the electronic device shown in FIG. 6 may be an electronic device in the method shown in FIG. 3, a treadmill in the method shown in FIG. 4, or a portable device in the method shown in FIG. Wi-Fi equipment.
NFC单元60可以是NFC读取单元,该NFC读取单元可以由NFC读取器实现,通信单元可以由处理器、通信接口和无线模块实现。无线模块可以是蓝牙模块,也可以是WLAN模块。通信单元的具体实现方式可以参考图2所示的电子设备,在此就不必赘述。The NFC unit 60 may be an NFC reading unit, the NFC reading unit may be implemented by an NFC reader, and the communication unit may be implemented by a processor, a communication interface, and a wireless module. The wireless module can be a Bluetooth module or a WLAN module. For the specific implementation of the communication unit, reference may be made to the electronic device shown in FIG. 2, which will not be repeated here.
图6所示的各个单元的具体功能、有益效果和具体实现方式,可以参考图2至图5的实施例,在此就不必赘述。For the specific functions, beneficial effects, and specific implementation manners of each unit shown in FIG. 6, reference may be made to the embodiments in FIG. 2 to FIG.
图7是根据本申请实施例提供的一种终端设备的结构框图。如图7所示的终端设备700包括存储单元701和通信单元702。Fig. 7 is a structural block diagram of a terminal device according to an embodiment of the present application. The terminal device 700 shown in FIG. 7 includes a storage unit 701 and a communication unit 702.
存储单元701,用于保存连接建立信息,该连接建立信息包括连接标识。The storage unit 701 is configured to store connection establishment information, where the connection establishment information includes a connection identifier.
存储单元701,还用于通过近场通信将存储单元701保存的该连接建立信息发送至电子设备。The storage unit 701 is further configured to send the connection establishment information stored in the storage unit 701 to the electronic device through near field communication.
通信单元702,用于扫描包含该连接标识的无线连接广播消息。The communication unit 702 is configured to scan for wireless connection broadcast messages containing the connection identifier.
通信单元702,还用于在扫描到该无线连接广播消息的情况下,根据该连接标识与该电子设备建立无线连接。The communication unit 702 is further configured to establish a wireless connection with the electronic device according to the connection identifier when the wireless connection broadcast message is scanned.
存储单元702可以由NFC标签实现。通信单元702可以由处理器、通信接口和无线模块实现。无线模块可以是蓝牙模块,也可以是WLAN模块。通信单元的具体实现方式可以参考图1所示的终端设备,在此就不必赘述。The storage unit 702 may be implemented by an NFC tag. The communication unit 702 may be realized by a processor, a communication interface, and a wireless module. The wireless module can be a Bluetooth module or a WLAN module. For the specific implementation of the communication unit, reference may be made to the terminal device shown in FIG. 1, and it is not necessary to repeat it here.
图7所示的终端设备可以是如图3所示实施例中的终端设备,也可以是如图4所示实施例中的智能手表,也可以是如图5所示实施例中的移动电话。The terminal device shown in Fig. 7 may be the terminal device in the embodiment shown in Fig. 3, the smart watch in the embodiment shown in Fig. 4, or the mobile phone in the embodiment shown in Fig. 5 .
图7所示的各个单元的具体功能、有益效果和具体实现方式,可以参考图1、图3至图5的实施例,在此就不必赘述。For the specific functions, beneficial effects, and specific implementation manners of each unit shown in FIG. 7, reference may be made to the embodiments of FIG. 1 and FIG. 3 to FIG.
本申请实施例还提供一种计算机可读存储介质,其上存储有指令,该指令被执行时执行上述方法实施例中终端设备侧的方法。The embodiment of the present application also provides a computer-readable storage medium on which an instruction is stored, and when the instruction is executed, the method on the terminal device side in the foregoing method embodiment is executed.
本申请实施例还提供一种计算机可读存储介质,其上存储有指令,该指令被执行时执行上述方法中电子设备侧的方法。The embodiment of the present application also provides a computer-readable storage medium on which an instruction is stored, and when the instruction is executed, the method on the electronic device side of the above method is executed.
本申请实施例还提供一种包含指令的计算机程序产品,该指令被执行时执行上述方法实施例中终端设备侧的方法。The embodiment of the present application also provides a computer program product containing instructions that, when executed, execute the method on the terminal device side in the foregoing method embodiment.
本申请实施例还提供一种包含指令的计算机产品,该指令被执行时执行上述方法实施例中电子设备侧的方法。The embodiment of the present application also provides a computer product containing an instruction, which when executed, executes the method on the electronic device side in the foregoing method embodiment.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机 软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: 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 media that can store program code .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (34)

  1. 一种建立无线连接的方法,其特征在于,所述方法包括:A method for establishing a wireless connection, characterized in that the method includes:
    电子设备通过与终端设备进行近场通信NFC,获取保存在所述终端设备内的连接建立信息,所述连接建立信息中包括连接标识;The electronic device obtains connection establishment information stored in the terminal device through near field communication NFC with the terminal device, and the connection establishment information includes a connection identifier;
    所述电子设备广播包含所述连接标识的无线连接广播消息;The electronic device broadcasts a wireless connection broadcast message including the connection identifier;
    所述电子设备根据所述连接标识与所述终端设备建立无线连接。The electronic device establishes a wireless connection with the terminal device according to the connection identifier.
  2. 如权利要求1所述的方法,其特征在于,所述连接建立信息还包括:第一校验信息;The method according to claim 1, wherein the connection establishment information further comprises: first verification information;
    在所述电子设备与终端设备建立无线连接之前,所述方法还包括:Before the electronic device establishes a wireless connection with the terminal device, the method further includes:
    所述电子设备与所述终端设备建立临时连接;Establishing a temporary connection between the electronic device and the terminal device;
    所述电子设备接收所述终端设备通过所述临时连接发送的第二校验信息;Receiving, by the electronic device, the second verification information sent by the terminal device through the temporary connection;
    所述电子设备在确定所述第二校验信息与所述第一校验信息相同的情况下,确定所述终端设备通过身份验证。When the electronic device determines that the second verification information is the same as the first verification information, it determines that the terminal device passes the identity verification.
  3. 如权利要求1所述的方法,其特征在于,在所述电子设备与终端设备建立无线连接之前,所述方法还包括:5. The method of claim 1, wherein before the electronic device establishes a wireless connection with the terminal device, the method further comprises:
    所述电子设备与所述终端设备建立临时连接;Establishing a temporary connection between the electronic device and the terminal device;
    所述电子设备通过所述临时连接向所述终端设备发送第一随机数;Sending, by the electronic device, a first random number to the terminal device through the temporary connection;
    所述电子设备通过所述NFC,获取保存在所述终端设备内的第二随机数;The electronic device obtains the second random number stored in the terminal device through the NFC;
    所述电子设备在确定所述第一随机数与所述第二随机数相同的情况下,确定所述终端设备通过身份验证。When the electronic device determines that the first random number is the same as the second random number, the electronic device determines that the terminal device passes the identity verification.
  4. 如权利要求1至3中任一项所述的方法,其特征在于,在所述电子设备广播包含所述连接标识的无线连接广播消息之前,所述方法还包括:The method according to any one of claims 1 to 3, wherein before the electronic device broadcasts a wireless connection broadcast message containing the connection identifier, the method further comprises:
    所述电子设备在获取到所述连接建立信息的情况下,确定开启无线连接功能。When the electronic device obtains the connection establishment information, it determines to enable the wireless connection function.
  5. 如权利要求1至4中任一项所述的方法,其特征在于,所述连接建立信息中还包括广播周期;The method according to any one of claims 1 to 4, wherein the connection establishment information further includes a broadcast period;
    所述电子设备广播包含所述连接标识的无线连接广播消息,包括:The electronic device broadcasting a wireless connection broadcast message including the connection identifier includes:
    所述电子设备周期性广播所述无线连接广播消息,其中所述电子设备广播所述无线连接广播消息的周期为所述广播周期。The electronic device periodically broadcasts the wireless connection broadcast message, wherein the period during which the electronic device broadcasts the wireless connection broadcast message is the broadcast period.
  6. 如权利要求1至5中任一项所述的方法,其特征在于,所述电子设备通过与终端设备进行近场通信NFC,获取保存在所述终端设备内的连接建立信息,包括:The method according to any one of claims 1 to 5, wherein the electronic device acquires the connection establishment information stored in the terminal device through near field communication (NFC) with the terminal device, comprising:
    所述电子设备读取所述终端设备内的NFC标签,获取保存在所述NFC标签中的所述连接建立信息。The electronic device reads the NFC tag in the terminal device, and obtains the connection establishment information stored in the NFC tag.
  7. 如权利要求1至6中任一项所述的方法,其特征在于,所述连接标识为蓝牙名称,所述电子设备根据所述连接标识与所述终端设备建立无线连接,包括:所述电子设备根据所述蓝牙名称与所述终端设备建立蓝牙连接。The method according to any one of claims 1 to 6, wherein the connection identifier is a Bluetooth name, and the electronic device establishing a wireless connection with the terminal device according to the connection identifier includes: the electronic device The device establishes a Bluetooth connection with the terminal device according to the Bluetooth name.
  8. 如权利要求1至6中任一项所述的方法,其特征在于,所述连接标识为服务集标识SSID,所述电子设备根据所述连接标识与所述终端设备建立无线连接,包括:所述电 子设备根据所述SSID与所述终端设备建立无线局域网络连接。The method according to any one of claims 1 to 6, wherein the connection identifier is a service set identifier SSID, and the electronic device establishes a wireless connection with the terminal device according to the connection identifier, comprising: The electronic device establishes a wireless local area network connection with the terminal device according to the SSID.
  9. 一种建立无线连接的方法,其特征在于,所述方法包括:A method for establishing a wireless connection, characterized in that the method includes:
    终端设备通过近场通信NFC将保存的连接建立信息发送至电子设备,其中所述连接建立信息包括连接标识;The terminal device sends the saved connection establishment information to the electronic device through the near field communication NFC, where the connection establishment information includes a connection identifier;
    所述终端设备扫描包含所述连接标识的无线连接广播消息;Scanning, by the terminal device, a wireless connection broadcast message that includes the connection identifier;
    所述终端设备在扫描到所述无线连接广播消息后,根据所述连接标识与所述电子设备建立无线连接。After scanning the wireless connection broadcast message, the terminal device establishes a wireless connection with the electronic device according to the connection identifier.
  10. 如权利要求9所述的方法,其特征在于,所述连接建立信息还包括:第一校验信息;The method according to claim 9, wherein the connection establishment information further comprises: first verification information;
    在所述与所述电子设备建立无线连接之前,所述方法还包括:Before the establishing a wireless connection with the electronic device, the method further includes:
    所述终端设备与所述电子设备建立临时连接;Establishing a temporary connection between the terminal device and the electronic device;
    所述终端设备通过所述临时连接向所述电子设备发送所述第一校验信息。The terminal device sends the first verification information to the electronic device through the temporary connection.
  11. 如权利要求9所述的方法,其特征在于,在所述电子设备建立无线连接之前,所述方法还包括:9. The method of claim 9, wherein before the electronic device establishes a wireless connection, the method further comprises:
    所述终端设备与所述电子设备建立临时连接;Establishing a temporary connection between the terminal device and the electronic device;
    所述终端设备接收所述电子设备通过所述临时连接发送的第一随机数;Receiving, by the terminal device, the first random number sent by the electronic device through the temporary connection;
    所述终端设备保存所述第一随机数。The terminal device saves the first random number.
  12. 如权利要求9至11中任一项所述的方法,其特征在于,所述连接建立信息还包括:广播周期;The method according to any one of claims 9 to 11, wherein the connection establishment information further comprises: a broadcast period;
    所述终端设备扫描包含所述连接标识的无线连接广播消息,包括:The terminal device scanning the wireless connection broadcast message containing the connection identifier includes:
    所述终端设备周期性扫描所述无线连接广播信息,其中所述终端设备扫描所述无线连接广播信息的周期为所述广播周期。The terminal device periodically scans the wireless connection broadcast information, wherein the period during which the terminal device scans the wireless connection broadcast information is the broadcast period.
  13. 如权利要求9至12中任一项所述的方法,其特征在于,所述连接建立信息保存在所述终端设备内的NFC标签中,所述终端设备扫描包含所述连接标识的无线连接广播消息,包括:The method according to any one of claims 9 to 12, wherein the connection establishment information is stored in an NFC tag in the terminal device, and the terminal device scans the wireless connection broadcast containing the connection identifier News, including:
    所述终端设备在确定所述NFC标签被所述电子设备读取的情况下,扫描所述无线连接广播消息。When it is determined that the NFC tag is read by the electronic device, the terminal device scans the wireless connection broadcast message.
  14. 如权利要求9至13中任一项所述的方法,其特征在于,所述连接标识为蓝牙名称,所述根据所述连接标识与所述电子设备建立无线连接,包括:根据所述蓝牙名称与所述电子设备建立蓝牙连接。The method according to any one of claims 9 to 13, wherein the connection identifier is a Bluetooth name, and the establishing a wireless connection with the electronic device according to the connection identifier includes: according to the Bluetooth name Establish a Bluetooth connection with the electronic device.
  15. 如权利要求9至13中任一项所述的方法,其特征在于,所述连接标识为服务集标识SSID,所述根据所述连接标识与所述电子设备建立无线连接,包括:根据所述SSID与所述电子设备建立无线局域网连接。The method according to any one of claims 9 to 13, wherein the connection identifier is a service set identifier SSID, and the establishing a wireless connection with the electronic device according to the connection identifier includes: The SSID establishes a wireless local area network connection with the electronic device.
  16. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, characterized in that, the electronic device includes:
    近场通信NFC单元,用于与终端设备进行NFC,获取保存在所述终端设备内的连接建立信息,所述连接建立信息中包括连接标识;The near field communication NFC unit is configured to perform NFC with a terminal device to obtain connection establishment information stored in the terminal device, and the connection establishment information includes a connection identifier;
    通信单元,用于广播包含所述连接标识的无线连接广播消息;A communication unit, configured to broadcast a wireless connection broadcast message including the connection identifier;
    所述通信单元,还用于根据所述连接标识与所述终端设备建立无线连接。The communication unit is further configured to establish a wireless connection with the terminal device according to the connection identifier.
  17. 如权利要求16所述的电子设备,其特征在于,所述连接建立信息还包括:第一 校验信息;The electronic device of claim 16, wherein the connection establishment information further comprises: first verification information;
    所述通信单元,还用与在于所述终端设备建立所述无线连接之前,与所述终端设备建立临时连接;接收所述终端设备通过所述临时连接发送的第二校验信息;在确定所述第二校验信息与所述第一校验信息相同的情况下,确定所述终端设备通过身份验证。The communication unit is also used to establish a temporary connection with the terminal device before the terminal device establishes the wireless connection; receive the second verification information sent by the terminal device through the temporary connection; If the second verification information is the same as the first verification information, it is determined that the terminal device passes the identity verification.
  18. 如权利要求16所述的电子设备,其特征在于,所述通信单元,还用于在所述电子设备与终端设备建立无线连接之前,与所述终端设备建立临时连接;通过所述临时连接向所述终端设备发送第一随机数;The electronic device according to claim 16, wherein the communication unit is further configured to establish a temporary connection with the terminal device before the electronic device establishes a wireless connection with the terminal device; Sending the first random number by the terminal device;
    所述NFC单元,还用于通过所述NFC获取保存在所述终端设备内的第二随机数;The NFC unit is further configured to obtain a second random number stored in the terminal device through the NFC;
    所述通信单元,还用于在确定所述第一随机数与所述第二随机数相同的情况下,确定所述终端设备通过身份验证。The communication unit is further configured to determine that the terminal device passes identity verification in a case where it is determined that the first random number is the same as the second random number.
  19. 如权利要求16至18中任一项所述的电子设备,其特征在于,所述通信单元,还用于在获取到所述连接建立信息的情况下,确定开启无线连接功能。The electronic device according to any one of claims 16 to 18, wherein the communication unit is further configured to determine to enable the wireless connection function when the connection establishment information is obtained.
  20. 如权利要求16至19中任一项所述的电子设备,其特征在于,所述连接建立信息中还包括广播周期;The electronic device according to any one of claims 16 to 19, wherein the connection establishment information further includes a broadcast period;
    所述通信单元,具体用于周期性广播所述无线连接广播消息,其中所述通信单元广播所述无线连接广播消息的周期为所述广播周期。The communication unit is specifically configured to periodically broadcast the wireless connection broadcast message, wherein the period during which the communication unit broadcasts the wireless connection broadcast message is the broadcast period.
  21. 如权利要求16至20中任一项所述的电子设备,其特征在于,所述NFC单元,具体用于读取所述终端设备内的NFC标签,获取保存在所述NFC标签中的所述连接建立信息。The electronic device according to any one of claims 16 to 20, wherein the NFC unit is specifically configured to read the NFC tag in the terminal device, and obtain the NFC tag stored in the NFC tag. Connection establishment information.
  22. 如权利要求16至21中任一项所述电子设备,其特征在于,所述连接标识为蓝牙名称,所述通信单元,具体用于根据所述蓝牙名称与所述终端设备建立蓝牙连接。The electronic device according to any one of claims 16 to 21, wherein the connection identifier is a Bluetooth name, and the communication unit is specifically configured to establish a Bluetooth connection with the terminal device according to the Bluetooth name.
  23. 如权利要求16至21中任一项所述的电子设备,其特征在于,所述连接标识为服务集标识SSID,所述通信单元,具体用于根据所述SSID与所述终端设备建立无线局域网连接。The electronic device according to any one of claims 16 to 21, wherein the connection identifier is a service set identifier SSID, and the communication unit is specifically configured to establish a wireless local area network with the terminal device according to the SSID connection.
  24. 一种终端设备,其特征在于,所述终端设备包括:A terminal device, characterized in that the terminal device includes:
    存储单元,用于保存连接建立信息,所述连接建立信息包括连接标识;The storage unit is configured to store connection establishment information, where the connection establishment information includes a connection identifier;
    所述存储单元,还用于通过近场通信NFC将所述存储单元保存的所述连接建立信息发送至电子设备;The storage unit is further configured to send the connection establishment information stored in the storage unit to an electronic device through near field communication NFC;
    通信单元,用于扫描包含所述连接标识的无线连接广播消息;The communication unit is configured to scan for wireless connection broadcast messages containing the connection identifier;
    所述通信单元,还用于在扫描到所述无线连接广播消息的情况下,根据所述连接标识与所述电子设备建立无线连接。The communication unit is further configured to establish a wireless connection with the electronic device according to the connection identifier when the wireless connection broadcast message is scanned.
  25. 如权利要求24所述的终端设备,其特征在于,所述连接建立信息还包括:第一校验信息;The terminal device of claim 24, wherein the connection establishment information further comprises: first verification information;
    所述通信单元,还用于在所述终端设备与所述电子设备建立无线连接之前,与所述电子设备建立临时连接;通过所述临时连接向所述电子设备发送所述第一校验信息。The communication unit is further configured to establish a temporary connection with the electronic device before the terminal device establishes a wireless connection with the electronic device; and send the first verification information to the electronic device through the temporary connection .
  26. 如权利要求24所述的终端设备,其特征在于,所述通信单元,还用于在所述终端设备与所述电子设备建立无线连接之前,与所述电子设备建立临时连接;接收所述电子设备通过所述临时连接发送的第一随机数;The terminal device according to claim 24, wherein the communication unit is further configured to establish a temporary connection with the electronic device before the terminal device establishes a wireless connection with the electronic device; The first random number sent by the device through the temporary connection;
    所述终端设备还包括处理单元,用于将所述通信单元接收到的所述第一随机数写入所 述存储单元。The terminal device further includes a processing unit configured to write the first random number received by the communication unit into the storage unit.
  27. 如权利要求24至26中任一项所述的终端设备,其特征在于,所述连接建立信息还包括:广播周期;The terminal device according to any one of claims 24 to 26, wherein the connection establishment information further comprises: a broadcast period;
    所述通信单元,具体用于周期性扫描所述无线连接广播信息,其中所述通信单元的扫描所述无线连接广播信息的周期为所述广播周期。The communication unit is specifically configured to periodically scan the wireless connection broadcast information, wherein the period for the communication unit to scan the wireless connection broadcast information is the broadcast period.
  28. 如权利要求24至26中任一项所述的终端设备,其特征在于,所述通信单元,具体用于在确定所述存储单元中保存连接建立信息被所述电子设备读取的情况下,扫描所述无线连接广播消息。The terminal device according to any one of claims 24 to 26, wherein the communication unit is specifically configured to, when it is determined that the connection establishment information stored in the storage unit is read by the electronic device, Scan the wireless connection broadcast message.
  29. 如权利要求24至28中任一项所述的终端设备,其特征在于,所述连接标识为蓝牙名称,所述通信单元,具体用于根据所述蓝牙名称与所述电子设备建立蓝牙连接。The terminal device according to any one of claims 24 to 28, wherein the connection identifier is a Bluetooth name, and the communication unit is specifically configured to establish a Bluetooth connection with the electronic device according to the Bluetooth name.
  30. 如权利要求24至28中任一项所述的终端设备,其特征在于,所述连接标识为服务集标识SSID,所述通信单元,具体用于根据所述SSID与所述电子设备建立无线局域网连接。The terminal device according to any one of claims 24 to 28, wherein the connection identifier is a service set identifier SSID, and the communication unit is specifically configured to establish a wireless local area network with the electronic device according to the SSID connection.
  31. 一种电子设备,其特征在于,所述电子设备包括处理器、存储器、近场通信NFC读取器和无线通信模块,An electronic device, characterized in that the electronic device includes a processor, a memory, a near field communication NFC reader and a wireless communication module,
    所述存储器用于存储指令,所述处理器用于读取所述存储器存储的指令,结合所述NFC读取器和所述无线通信模块,执行如权利要求1至8中任一项所述的方法。The memory is used to store instructions, and the processor is used to read instructions stored in the memory, and in combination with the NFC reader and the wireless communication module, execute the method according to any one of claims 1 to 8. method.
  32. 一种终端设备,其特征在于、所述终端设备包括处理器、存储器、近场通信NFC标签和无线通信模块,A terminal device, characterized in that the terminal device includes a processor, a memory, a near field communication NFC tag and a wireless communication module,
    所述存储器用于存储指令,所述处理器用于读取所述存储器存储的指令结合所述NFC标签和所述无线通信模块,执行如权利要求9至15中任一项所述的方法。The memory is used to store instructions, and the processor is used to read the instructions stored in the memory in combination with the NFC tag and the wireless communication module to execute the method according to any one of claims 9 to 15.
  33. 一种计算机存储介质,其特征在于,包括指令,当所述指令在电子设备上运行时,使得电子设备执行如权利要求1至8中任一项所述的方法。A computer storage medium, characterized by comprising instructions, which when run on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 8.
  34. 一种计算机存储介质,其特征在于,包括指令,当所述指令在终端设备上运行时,使得所述终端设备执行如9至15中任一项所述的方法。A computer storage medium, characterized in that it includes instructions, when the instructions run on a terminal device, the terminal device is made to execute the method according to any one of 9 to 15.
PCT/CN2019/079461 2019-03-25 2019-03-25 Method for establishing wireless communication connection, and related devices WO2020191570A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/079461 WO2020191570A1 (en) 2019-03-25 2019-03-25 Method for establishing wireless communication connection, and related devices
CN201980093314.1A CN113508635B (en) 2019-03-25 2019-03-25 Method for establishing wireless communication connection and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/079461 WO2020191570A1 (en) 2019-03-25 2019-03-25 Method for establishing wireless communication connection, and related devices

Publications (1)

Publication Number Publication Date
WO2020191570A1 true WO2020191570A1 (en) 2020-10-01

Family

ID=72608691

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/079461 WO2020191570A1 (en) 2019-03-25 2019-03-25 Method for establishing wireless communication connection, and related devices

Country Status (2)

Country Link
CN (1) CN113508635B (en)
WO (1) WO2020191570A1 (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112367367A (en) * 2020-10-27 2021-02-12 西安万像电子科技有限公司 Image management method, device and system
CN112491473A (en) * 2020-12-16 2021-03-12 支付宝(杭州)信息技术有限公司 Method and system for establishing wireless communication connection
CN112954659A (en) * 2021-02-09 2021-06-11 Oppo广东移动通信有限公司 Method and device for connecting Bluetooth devices, electronic device and storage medium
CN113365372A (en) * 2021-06-23 2021-09-07 Oppo广东移动通信有限公司 Ad hoc network method and device, computer readable medium and electronic equipment
CN113438638A (en) * 2021-07-07 2021-09-24 深圳市汇顶科技股份有限公司 Communication control method and electronic device
CN114143907A (en) * 2021-11-26 2022-03-04 阿波罗智联(北京)科技有限公司 Wireless connection establishing method and device, electronic equipment and storage medium
CN114245354A (en) * 2021-12-10 2022-03-25 北京思必拓科技有限责任公司 Installation-free interaction method and device and electronic equipment
CN114697942A (en) * 2022-04-14 2022-07-01 北京思必拓科技有限责任公司 Self-connection method, system, terminal equipment and storage medium
CN114924807A (en) * 2022-04-28 2022-08-19 支付宝(杭州)信息技术有限公司 Method and device for increasing running speed of small program
CN114980119A (en) * 2020-12-02 2022-08-30 支付宝(杭州)信息技术有限公司 Method, device and equipment for connecting equipment
CN115052020A (en) * 2022-06-23 2022-09-13 阿波罗智联(北京)科技有限公司 Device interconnection system, method, device and connecting device
CN115278551A (en) * 2022-06-14 2022-11-01 广东逸动科技有限公司 Control method, remote control terminal, intelligent terminal, communication system and storage medium
CN115701724A (en) * 2021-08-02 2023-02-10 华为技术有限公司 Method, electronic device and system for device connection
CN117156396A (en) * 2023-09-13 2023-12-01 中航信移动科技有限公司 Communication method of networking scene terminal equipment, electronic equipment and storage medium
CN117156396B (en) * 2023-09-13 2024-05-31 中航信移动科技有限公司 Communication method of networking scene terminal equipment, electronic equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115065952B (en) * 2022-08-19 2022-11-22 山东理工职业学院 Method and system for processing network facility data in sewer and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092768A (en) * 2014-07-21 2014-10-08 广东欧珀移动通信有限公司 Method and device for setting parameters of wireless router
CN106341782A (en) * 2016-09-27 2017-01-18 美的智慧家居科技有限公司 Mobile terminal and household electric appliance communication method and system
CN107888423A (en) * 2017-11-27 2018-04-06 上海斐讯数据通信技术有限公司 The control method and system of a kind of router
US20180206179A1 (en) * 2016-09-27 2018-07-19 Eero Inc. Methods for network configuration sharing

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101808049B (en) * 2010-03-25 2012-08-22 盈世信息科技(北京)有限公司 Mail transmission method and system
CN104375497B (en) * 2014-12-15 2017-09-29 广东美的厨房电器制造有限公司 Smart home and its control method, control system and electronic equipment
CN105392114A (en) * 2015-12-03 2016-03-09 北京握奇智能科技有限公司 NFC based rapid Bluetooth connection system and method
CN106358147A (en) * 2016-09-28 2017-01-25 美的智慧家居科技有限公司 Method and system for connecting wireless network, household electric appliance and user terminal
CN109286599A (en) * 2017-07-20 2019-01-29 北京展讯高科通信技术有限公司 Data security protection method, smart machine, server and readable storage medium storing program for executing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092768A (en) * 2014-07-21 2014-10-08 广东欧珀移动通信有限公司 Method and device for setting parameters of wireless router
CN106341782A (en) * 2016-09-27 2017-01-18 美的智慧家居科技有限公司 Mobile terminal and household electric appliance communication method and system
US20180206179A1 (en) * 2016-09-27 2018-07-19 Eero Inc. Methods for network configuration sharing
CN107888423A (en) * 2017-11-27 2018-04-06 上海斐讯数据通信技术有限公司 The control method and system of a kind of router

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112367367A (en) * 2020-10-27 2021-02-12 西安万像电子科技有限公司 Image management method, device and system
CN114980119A (en) * 2020-12-02 2022-08-30 支付宝(杭州)信息技术有限公司 Method, device and equipment for connecting equipment
CN112491473A (en) * 2020-12-16 2021-03-12 支付宝(杭州)信息技术有限公司 Method and system for establishing wireless communication connection
CN112954659A (en) * 2021-02-09 2021-06-11 Oppo广东移动通信有限公司 Method and device for connecting Bluetooth devices, electronic device and storage medium
CN113365372A (en) * 2021-06-23 2021-09-07 Oppo广东移动通信有限公司 Ad hoc network method and device, computer readable medium and electronic equipment
CN113438638A (en) * 2021-07-07 2021-09-24 深圳市汇顶科技股份有限公司 Communication control method and electronic device
CN113438638B (en) * 2021-07-07 2023-07-28 深圳市汇顶科技股份有限公司 Communication control method and electronic equipment
CN115701724B (en) * 2021-08-02 2024-05-03 华为技术有限公司 Method for device connection, electronic device and system
CN115701724A (en) * 2021-08-02 2023-02-10 华为技术有限公司 Method, electronic device and system for device connection
CN114143907A (en) * 2021-11-26 2022-03-04 阿波罗智联(北京)科技有限公司 Wireless connection establishing method and device, electronic equipment and storage medium
CN114143907B (en) * 2021-11-26 2023-05-12 阿波罗智联(北京)科技有限公司 Wireless connection establishment method, device, electronic equipment and storage medium
CN114245354B (en) * 2021-12-10 2022-12-16 北京思必拓科技有限责任公司 Installation-free interaction method and device and electronic equipment
CN114245354A (en) * 2021-12-10 2022-03-25 北京思必拓科技有限责任公司 Installation-free interaction method and device and electronic equipment
CN114697942A (en) * 2022-04-14 2022-07-01 北京思必拓科技有限责任公司 Self-connection method, system, terminal equipment and storage medium
CN114924807A (en) * 2022-04-28 2022-08-19 支付宝(杭州)信息技术有限公司 Method and device for increasing running speed of small program
CN114924807B (en) * 2022-04-28 2023-12-01 支付宝(杭州)信息技术有限公司 Method and device for improving running speed of applet
CN115278551A (en) * 2022-06-14 2022-11-01 广东逸动科技有限公司 Control method, remote control terminal, intelligent terminal, communication system and storage medium
CN115278551B (en) * 2022-06-14 2023-10-13 广东逸动科技有限公司 Control method, remote control end, intelligent terminal, communication system and storage medium
CN115052020A (en) * 2022-06-23 2022-09-13 阿波罗智联(北京)科技有限公司 Device interconnection system, method, device and connecting device
CN115052020B (en) * 2022-06-23 2024-02-02 阿波罗智联(北京)科技有限公司 Device interconnection system, method, device and connecting device
CN117156396A (en) * 2023-09-13 2023-12-01 中航信移动科技有限公司 Communication method of networking scene terminal equipment, electronic equipment and storage medium
CN117156396B (en) * 2023-09-13 2024-05-31 中航信移动科技有限公司 Communication method of networking scene terminal equipment, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113508635A (en) 2021-10-15
CN113508635B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
WO2020191570A1 (en) Method for establishing wireless communication connection, and related devices
CN109417758B (en) Bluetooth connection method and terminal
US10757755B2 (en) Method and apparatus for communication between wearable device and mobile terminal
CN102823320B (en) For the apparatus and method of the power management on mobile device
KR101094506B1 (en) Device and method for establishing connections and controlling application via physical contact between devices
EP3893109B1 (en) Method and device for connecting bluetooth devices
Decuir Bluetooth 4.0: low energy
US20180077572A1 (en) Dynamic beacon streaming network and associated systems and methods
US9900919B1 (en) Adaptive beacon rate system
CN106576112A (en) Peer-to-peer group re-formation
WO2018103380A1 (en) Method for accessing wireless network, and mobile terminal
TW201242281A (en) Electronic apparatus, proximity network system and connecting method thereof
CN105933960A (en) Processing device
JP2010245847A (en) Wireless communication device, communication system, communication method, and program
CN106649010B (en) terminal equipment test method and terminal equipment
CN105103623A (en) Intelligent beaconing by software-enabled access point
CN106604277B (en) Wireless network access method and mobile terminal
WO2018214744A1 (en) Information processing method and related product
EP3060012B1 (en) Power saving method in ad-hoc network, and electronic device performing the method
WO2016179900A1 (en) Routing device, power saving method and apparatus therefor, and storage medium
CN105808716A (en) Alarm clock reminding method and apparatus as well as terminal
CN106792434B (en) Hotspot establishing method and terminal equipment
JP2004094577A (en) Information terminal equipment
KR101212928B1 (en) Device and method for establishing connections and controlling application via physical contact between devices
CN117440350A (en) Method and related device for realizing low-power-consumption operation of Bluetooth equipment

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: 19921040

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19921040

Country of ref document: EP

Kind code of ref document: A1