WO2021185141A1 - Wi-Fi Aware的建链方法、系统、电子设备和存储介质 - Google Patents

Wi-Fi Aware的建链方法、系统、电子设备和存储介质 Download PDF

Info

Publication number
WO2021185141A1
WO2021185141A1 PCT/CN2021/080097 CN2021080097W WO2021185141A1 WO 2021185141 A1 WO2021185141 A1 WO 2021185141A1 CN 2021080097 W CN2021080097 W CN 2021080097W WO 2021185141 A1 WO2021185141 A1 WO 2021185141A1
Authority
WO
WIPO (PCT)
Prior art keywords
aware
slave device
master device
data path
master
Prior art date
Application number
PCT/CN2021/080097
Other languages
English (en)
French (fr)
Inventor
张燊
凌波
李丽
蒋钟寅
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21771161.3A priority Critical patent/EP4110004A4/en
Priority to US17/906,518 priority patent/US20230129780A1/en
Publication of WO2021185141A1 publication Critical patent/WO2021185141A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/06Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals

Definitions

  • This application relates to the field of communication technology, and in particular to a Wi-Fi Aware chain establishment method, system, and electronic device
  • Wi-Fi Aware Wi-Fi Neighborhood Aware Network, also known as Wi-Fi Neighborhood Aware Network, NAN for short
  • Wi-Fi Neighborhood Aware Network NAN for short
  • this technology can bypass network infrastructure (such as AP (Access Point, access point) or cellular network), to achieve one-to-one, one-to-many or many-to-many connection and communication between devices.
  • network infrastructure such as AP (Access Point, access point) or cellular network
  • each Wi-Fi Aware device can perform Service Discovery Frame (Service Discovery Frame), NDP Request Frame (NAN Data Path Request Frame, or Wi-Fi Aware Data Path Request Frame, among which, NDP is NAN Data Path, which means NAN data transmission path), NDP Response Frame (NAN data path reply frame), NDP Confirm Frame (NAN data path confirmation frame), NDP Key Installation Frame (NAN data path key installation frame), etc.
  • NDP Service Discovery Frame
  • NAN Data Path Request Frame which means NAN data transmission path
  • NDP Response Frame NAN data path reply frame
  • NDP Confirm Frame NAN data path confirmation frame
  • NDP Key Installation Frame NAN data path key installation frame
  • the embodiments of the present application provide a method, system, electronic device, and storage medium for establishing a Wi-Fi Aware link, so as to solve the problem of a long time required to establish a link between Wi-Fi Aware devices.
  • an embodiment of the present application provides a method for establishing a Wi-Fi Aware link, including:
  • the master device receives the first connection information sent by the slave device, where the first connection information includes the Wi-Fi Aware service name required by the slave device, and the first connection information also includes the pre-configured Wi-Fi Aware service name of the slave device.
  • Wi-Fi Aware parameters where the Wi-Fi Aware parameters pre-configured by the slave device include parameters exchanged in the service discovery subscription frame in the Wi-Fi Aware protocol;
  • the master device sends second connection information to the slave device according to the Wi-Fi Aware service name required by the slave device, where the second connection information includes confirmation information, and the confirmation information is the master
  • the device confirms that the notification information of the Wi-Fi Aware service name required by the slave device exists, and the slave device confirms that the master device has the Wi-Fi Aware service name required by the slave device according to the confirmation information, so
  • the second connection information also includes Wi-Fi Aware parameters pre-configured by the main device, where the Wi-Fi Aware parameters pre-configured by the main device include parameters for interaction in the service discovery release frame in the Wi-Fi Aware protocol;
  • the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame.
  • the receiving, by the master device, the first connection information sent by the slave device includes:
  • the master device receives the first connection information sent by the slave device based on the function broadcast by the BLE Bluetooth module.
  • the second connection information further includes the Wi-Fi Aware timestamp of the master device, which is used to synchronize the clock of the slave device.
  • an implementation manner is further provided, and the method further includes:
  • the master device adjusts the time stamp of the slave device clock to be consistent with the Wi-Fi Aware time stamp of the master device according to the Wi-Fi Aware time stamp sent to the slave device.
  • the parameters of the service discovery subscription frame interaction in the Wi-Fi Aware protocol include the MAC address of the Wi-Fi Aware management port of the slave device , The Wi-Fi Aware identifier of the slave device, and the data encryption pre-configuration information of the slave device, and the parameters that are exchanged in the service discovery release frame in the Wi-Fi Aware protocol include the Wi-Fi Aware of the master device The management port MAC address, the Wi-Fi Aware identifier of the main device, and the data encryption pre-configuration information of the main device.
  • an implementation manner is further provided, wherein the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, including:
  • the master device determines whether the Wi-Fi Aware data path request frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device, and if so, sends Wi-Fi to the slave device in the next active time window.
  • -Fi Aware data path reply frame
  • the slave device After the slave device receives the Wi-Fi Aware data path reply frame, the master device and the slave device complete the link establishment.
  • an implementation manner is further provided, wherein the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, including:
  • the master device determines whether the Wi-Fi Aware data path request frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device, and if so, sends Wi-Fi to the slave device in the next active time window.
  • -Fi Aware data path reply frame
  • the master device determines whether the Wi-Fi Aware parameters pre-configured by the slave device include the data encryption pre-configuration information of the slave device, and if so, the master device obtains the Wi-Fi Aware data sent by the slave device Channel confirmation frame;
  • the master device determines whether the Wi-Fi Aware data path confirmation frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device. If so, the master device sends Wi-Fi to the slave device.
  • Aware data path key installation frame
  • the slave device After the slave device receives the Wi-Fi Aware data path key installation frame, the master device and the slave device complete the link establishment.
  • an embodiment of the present application also provides a method for establishing a Wi-Fi Aware link, including:
  • the slave device sends first connection information to the master device, where the first connection information includes the Wi-Fi Aware service name required by the slave device, and the first connection information also includes the Wi-Fi Aware service name pre-configured by the slave device.
  • -Fi Aware parameters where the Wi-Fi Aware parameters pre-configured by the slave device include parameters exchanged in the service discovery subscription frame in the Wi-Fi Aware protocol;
  • the slave device receives the second connection information sent by the master device, where the second connection information includes confirmation information, and the confirmation information is that the master device confirms that there is Wi-Fi Aware required by the slave device
  • the notification information of the service name, the second connection information also includes Wi-Fi Aware parameters pre-configured by the main device, wherein the Wi-Fi Aware parameters pre-configured by the main device include the Wi-Fi Aware parameters in the Wi-Fi Aware protocol. Discover the parameters of the release frame interaction;
  • the slave device confirms, according to the confirmation information, that the master device has the Wi-Fi Aware service name required by the slave device;
  • the slave device sends a Wi-Fi Aware data path request frame to the master device, and establishes a link with the master device based on the Wi-Fi Aware data path request frame.
  • the sending of the first connection information from the slave device to the master device includes:
  • the slave device sends the first connection information to the master device based on the function broadcast by the BLE Bluetooth module.
  • the second connection information further includes the Wi-Fi Aware timestamp of the master device, which is used to synchronize the clock of the slave device.
  • an implementation manner is further provided, and the method further includes:
  • the slave device adjusts the time stamp of the clock to be consistent with the Wi-Fi Aware time stamp of the master device according to the received Wi-Fi Aware time stamp of the master device.
  • the parameters of the service discovery subscription frame interaction in the Wi-Fi Aware protocol include the MAC address of the Wi-Fi Aware management port of the slave device , The Wi-Fi Aware identifier of the slave device, and the data encryption pre-configuration information of the slave device, and the parameters that are exchanged in the service discovery release frame in the Wi-Fi Aware protocol include the Wi-Fi Aware of the master device The management port MAC address, the Wi-Fi Aware identifier of the main device, and the data encryption pre-configuration information of the main device.
  • the completion of link establishment with the master device based on the Wi-Fi Aware data path request frame includes:
  • the slave device sends a Wi-Fi Aware data path request frame to the master device;
  • the slave device After the master device determines that the Wi-Fi Aware data path request frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device, in the next active time window, the slave device receives the master The Wi-Fi Aware data path reply frame sent by the device completes the link establishment with the master device.
  • the completion of link establishment with the master device based on the Wi-Fi Aware data path request frame includes:
  • the slave device sends a Wi-Fi Aware data path request frame to the master device;
  • the slave device After the master device determines that the Wi-Fi Aware data path request frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device, in the next active time window, the slave device receives the master Wi-Fi Aware data path reply frame sent by the device;
  • the slave device determines whether the Wi-Fi Aware parameters pre-configured by the master device include data encryption pre-configuration information, and if so, the slave device receives the Wi-Fi Aware data path reply frame sent by the master device , Sending a Wi-Fi Aware data path confirmation frame to the master device;
  • the slave device After the master device determines that the Wi-Fi Aware data path confirmation frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device, the slave device receives the Wi-Fi Aware data sent by the master device The path key installation frame completes the link establishment with the master device.
  • an embodiment of the present application provides a method for establishing a Wi-Fi Aware link, including:
  • the slave device sends first connection information to the master device, where the first connection information includes the Wi-Fi Aware service name required by the slave device, and the first connection information also includes the Wi-Fi Aware service name pre-configured by the slave device.
  • -Fi Aware parameters where the Wi-Fi Aware parameters pre-configured by the slave device include parameters exchanged in the service discovery subscription frame in the Wi-Fi Aware protocol;
  • the master device sends second connection information to the slave device according to the Wi-Fi Aware service name required by the slave device, where the second connection information includes confirmation information, and the confirmation information is the master
  • the device confirms that the notification information of the Wi-Fi Aware service name required by the slave device exists, and the second connection information also includes Wi-Fi Aware parameters pre-configured by the master device, where the master device pre-configured Wi-Fi Aware parameters include the parameters of the Wi-Fi Aware protocol in the service discovery release frame interaction;
  • the slave device sends a Wi-Fi Aware data path request frame to the master device;
  • the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame.
  • the sending of the first connection information from the slave device to the master device includes:
  • the slave device sends the first connection information to the master device based on the function broadcast by the BLE Bluetooth module.
  • the second connection information further includes the Wi-Fi Aware timestamp of the master device, which is used to synchronize the clock of the slave device.
  • an implementation manner is further provided, and the method further includes:
  • the master device sends a Wi-Fi Aware timestamp to the slave device;
  • the slave device adjusts the time stamp of the clock to be consistent with the Wi-Fi Aware time stamp of the master device according to the received Wi-Fi Aware time stamp of the master device.
  • the parameters of the service discovery subscription frame interaction in the Wi-Fi Aware protocol include the MAC address of the Wi-Fi Aware management port of the slave device , The Wi-Fi Aware identifier of the slave device, and the data encryption pre-configuration information of the slave device, and the parameters that are exchanged in the service discovery release frame in the Wi-Fi Aware protocol include the Wi-Fi Aware of the master device The management port MAC address, the Wi-Fi Aware identifier of the main device, and the data encryption pre-configuration information of the main device.
  • an implementation manner is further provided, wherein the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, including:
  • the master device determines whether the Wi-Fi Aware data path request frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device, and if so, sends Wi-Fi to the slave device in the next active time window.
  • -Fi Aware data path reply frame
  • the slave device receives a Wi-Fi Aware data path reply frame, and the master device completes the link establishment with the slave device.
  • an implementation manner is further provided, wherein the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, including:
  • the master device determines whether the Wi-Fi Aware data path request frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device, and if so, sends Wi-Fi to the slave device in the next active time window.
  • -Fi Aware data path reply frame
  • the master device determines whether the Wi-Fi Aware parameters pre-configured by the slave device include the data encryption pre-configuration information of the slave device, and if so, the master device waits to obtain the Wi-Fi Aware sent by the slave device Data path confirmation frame;
  • the slave device determines whether the Wi-Fi Aware parameters pre-configured by the master device include data encryption pre-configuration information, and if so, the slave device sends a Wi-Fi Aware data path confirmation frame to the master device;
  • the master device determines whether the Wi-Fi Aware data path confirmation frame comes from the slave device according to the Wi-Fi Aware parameters pre-configured by the slave device. If so, the master device sends Wi-Fi to the slave device.
  • Aware data path key installation frame
  • the slave device receives the Wi-Fi Aware data path key installation frame, and the master device and the slave device complete the link establishment.
  • an embodiment of the present application provides a Wi-Fi Aware link building system, including: a master device and a slave device, wherein the master device is used to execute the method of the first aspect, and the slave device uses To implement the method of the second aspect described above.
  • an embodiment of the present application provides an electronic device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes the computer When the instructions are readable, the steps of the method described in the first aspect or the second aspect are implemented.
  • an embodiment of the present application provides a computer-readable storage medium, including: computer-readable instructions, which, when executed by a processor, implement the steps of the method described in the first aspect or the second aspect .
  • the master device interacts with the slave device for device discovery to determine whether the master device can provide the Wi-Fi Aware service required by the slave device.
  • the master device can provide the Wi-Fi Aware service required by the slave device Only when the slave device and the master device perform the next step of establishing a link; among them, in the interaction process of Wi-Fi Aware device discovery, the interaction between the first connection information and the second connection information is used to facilitate the device discovery process.
  • the master device and the slave device can skip the steps of service discovery subscription and service discovery publishing , To complete the Wi-Fi Aware chain building faster, and effectively improve the speed of Wi-Fi Aware chain building.
  • FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 2 is a software structure block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of a method for establishing a Wi-Fi Aware link provided by an embodiment of the present application
  • FIG. 4 is a flowchart of another Wi-Fi Aware chain establishment method provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of Wi-Fi Aware completing chain establishment through an application program according to an embodiment of the present application
  • FIG. 6 is another flow chart of Wi-Fi Aware completing chain establishment through an application program provided by an embodiment of the present application
  • Fig. 7 is a scene diagram of a Wi-Fi Aware link establishment method provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more.
  • words such as “exemplary” or “for example” are used as examples, illustrations, or illustrations. Any embodiment or design solution described as “exemplary” or “for example” in the embodiments of the present 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.
  • FIG. 1 shows a schematic diagram of the structure of an electronic device 100.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface can include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, and the like.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and apply to applications such as horizontal and vertical screen switching, pedometers, and so on.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal.
  • the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations applied to different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
  • the electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 may also be compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present application takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 by way of example.
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes touch operations into original input events (including touch coordinates, time stamps of touch operations, etc.).
  • the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer.
  • the camera 193 captures still images or videos.
  • data communication between Wi-Fi Aware devices generally includes the following four steps:
  • Step 1 Cluster discovery.
  • Wi-Fi Aware devices including but not limited to devices such as mobile phones, smart watches, tablets, and servers
  • discover other Wi-Fi Aware devices within reach before the two Wi-Fi Aware devices complete the chain establishment, use "Discovery Beacon Frame" is used to exchange information and confirm the existence of other Wi-Fi Aware devices within reach.
  • Step 2 Clock synchronization.
  • the Wi-Fi Aware device joins a device group (cluster) composed of other Wi-Fi Aware devices, and synchronously discovers the timestamp carried by the beacon. Then, according to the timestamp, the specific time when the active time window occurs is calculated, and during the active time window, the Wi-Fi Aware data transmission path is used for communication.
  • Step 3 Service discovery.
  • Wi-Fi Aware uses the "Publish” and “Subscribe” Wi-Fi Aware (NAN) service discovery frames (including service discovery release frames and service Discover the subscription frame) to exchange information.
  • Wi-Fi Aware devices can discover services by subscribing (searching) during the active time window, and Wi-Fi Aware devices can also publish (send) broadcast information indicating their existence and the service content that can be provided during the active time window. .
  • Step 4 Data link establishment.
  • the device that sends the search can send a data link establishment request to the detected Wi-Fi Aware device within the active time window.
  • the specific Wi-Fi Aware data can be used
  • the information exchange of the path request frame is realized.
  • the device that receives the service request frame will reply to the Wi-Fi Aware data path reply frame within the next active time window.
  • additional information exchange between the Wi-Fi Aware data path confirmation frame and the Wi-Fi Aware data path key installation frame is required within the active time window.
  • Wi-Fi Aware stipulates that every 512 TU interval, there will be an activity time window of 16 TU. During the active time window, each Wi-Fi Aware device can perform service discovery frames and Wi-Fi Aware (NAN) data path request frames. , Wi-Fi Aware data path reply frame, Wi-Fi Aware data path confirmation frame, Wi-Fi Aware data path key installation frame and other Wi-Fi Aware protocol data frame interaction.
  • NAN Wi-Fi Aware
  • the master device will broadcast a discovery beacon frame on a predetermined channel to allow other devices to discover the cluster it has created.
  • the slave device wakes up and monitors the discovery beacon frame on a predetermined channel.
  • the discovery beacon frame is monitored, it synchronizes its own Wi-Fi Aware clock to the Wi-Fi Aware timestamp carried in the discovery beacon frame.
  • each Wi-Fi Aware device has a clock with an accuracy of "1 microsecond", and the timestamp is incremented by 1 every microsecond.
  • the master device carries its own time stamp in the discovery beacon frame sent by it. After receiving the discovery beacon frame sent by the master device, the slave device changes the time stamp of its own clock to the discovery beacon frame sent by the master device The time stamps carried are consistent, which can achieve clock synchronization between the master device and the slave device.
  • each active time window lasts 16TU.
  • the slave device sends the Service Discovery Subscription Frame in the service discovery frame to actively query devices that can provide the required Wi-Fi Aware service.
  • the master device receives the service discovery subscription frame sent by the slave device, if it determines that it can provide the Wi-Fi Aware service required by the slave device, it will reply and send the Service Discovery Publish Frame in the service discovery frame in the next active time window. Found the release frame).
  • Wi-Fi Aware data path request frame Wi-Fi Aware data path reply frame
  • Wi-Fi Aware data path confirmation frame Wi-Fi data path in the next two active time windows in sequence.
  • the Aware data path key installation frame completes the data link establishment.
  • Wi-Fi Aware is designed for low power consumption, if the slave device expects to subscribe to a certain Wi-Fi Aware service, and there is no master device that can provide the corresponding service in the surrounding, it will cause the slave device to regularly Wake up its own Wi-Fi module to perform passive monitoring, send service discovery subscription frames and other operations. Obviously, frequently waking up the Wi-Fi module for Wi-Fi Aware device discovery will consume more battery resources.
  • BLE Bluetooth Low Energy, Bluetooth Low Energy
  • BLE has the characteristics of low power consumption and low throughput, and Wi-Fi Aware devices communicate through BLE broadcasting. If the first connection information sent by the master device includes the Wi-Fi Aware service name required by the slave device, the slave device will wake up its Wi-Fi module to establish a data link with the master device.
  • the slave device before waking up the Wi-Fi module for passive monitoring, uses BLE to broadcast periodically, and carries the Wi-Fi Aware service name of the required Wi-Fi Aware service in the first connection information; If the master device can provide the Wi-Fi Aware service, after receiving the BLE first connection information, the master device also informs the slave device that it can provide the service by means of BLE broadcast. Then, the slave device wakes up the Wi-Fi module to perform passive monitoring to monitor the discovery beacon frame sent by the master device, and then complete the data link with the master device in the same steps as in Figure 3.
  • the above-mentioned BLE is an ultra-low-power short-range wireless communication scheme for mobile terminals launched by the Bluetooth Special Interest Group in 2016. It can be seen from Table 1 below that whether it is during sleep or during sleep When receiving and transmitting messages, the power consumption of BLE is less than that of Wi-Fi. According to the power consumption of interacting with 10 messages per day, the power consumption of BLE is only one tenth of the power consumption of Wi-Fi. , Its working power consumption is much less than Wi-Fi.
  • the BLE can be used for mutual discovery between devices.
  • BLE Wi-Fi Aware device discovery and data link establishment.
  • the slave device sends first connection information to the master device based on the function broadcast by the BLE Bluetooth module, where the first connection information includes the Wi-Fi Aware service name required by the slave device, and the first connection information also includes the slave device pre-configuration Wi-Fi Aware parameters, where the Wi-Fi Aware parameters pre-configured from the device include the parameters that are exchanged in the service discovery subscription frame in the Wi-Fi Aware protocol.
  • the master device receives the first connection information sent by the slave device based on the function broadcast by the BLE Bluetooth module.
  • the master device sends the second connection information to the slave device according to the Wi-Fi Aware service name required by the slave device.
  • the second connection information includes confirmation information. Fi Aware service name notification information, the slave device confirms that the master device has the Wi-Fi Aware service name required by the slave device according to the confirmation information, and the second connection information also includes the Wi-Fi Aware parameter pre-configured by the master device, among which, The Wi-Fi Aware parameters pre-configured by the master device include the parameters of the Wi-Fi Aware protocol in the service discovery release frame interaction.
  • the Wi-Fi Aware parameter pre-configured by the slave device in the first connection information and the Wi-Fi Aware parameter pre-configured by the master device in the second connection information are used to skip
  • the steps of service discovery subscription and service discovery push in the prior art directly execute the following steps:
  • the master device obtains the Wi-Fi Aware data path request frame sent by the slave device;
  • S15 The master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame.
  • the interaction process of Wi-Fi Aware device discovery between the master device and the slave device in steps S11-S13 can be implemented by using a Bluetooth module. Specifically, it can be implemented by using a Bluetooth low energy Bluetooth module. Bluetooth low power consumption has the characteristics of low power consumption and low throughput. Whether it is during sleep, or when receiving and transmitting messages, the working power consumption of low-power Bluetooth is much less than Wi-Fi.
  • the master device and the slave device are not fixed to the device.
  • the same device can be used as the master device or the slave device.
  • the device whose clock is synchronized is the slave device.
  • the Wi-Fi Aware service can specifically refer to services such as file sharing, photo transfer, and provision of game battles.
  • the slave device uses the Bluetooth low energy Bluetooth module to interact with the master device for Wi-Fi Aware device discovery. Compared with the original wake-up Wi-Fi module for passive monitoring, it consumes less power , And does not need Wi-Fi module to wake up continuously, which can effectively reduce the battery resources consumed by the device.
  • the first connection information broadcast by the BLE Bluetooth module is carried in a message.
  • it includes two types of messages: broadcast messages and data messages. Understandably, devices use broadcast messages to discover and connect to other devices.
  • the data message is started.
  • the Wi-Fi Aware service name required by the slave device is carried in the data message.
  • the data structure of the data message includes a header structure, a data payload structure (payload), and a message integrity check structure (Messages Integrity Check, MIC), and the Wi-Fi Aware service name is specifically stored in the data payload structure.
  • the Wi-Fi Aware service name refers to the identification of the service.
  • the Wi-Fi Aware service name can be used to uniquely determine the Wi-Fi Aware service.
  • the Wi-Fi Aware service name can be shared with files, shared photos or joined games Names related to the battle situation and other identifiers that can uniquely identify Wi-Fi Aware services can be referred to as Wi-Fi Aware service names. This is not only a limitation on the displayed name, but can also be other uniquely identifying Wi-Fi Aware services. Of the logo.
  • the slave device has carried the required Wi-Fi Aware service name in the first connection information when broadcasting, so that the master device can receive through the BLE Bluetooth module, and learn the information carried in the first connection information Wi-Fi Aware service name.
  • the master device and the slave device will first determine whether the master device can provide the Wi-Fi Aware service required by the slave device before establishing the device link. If the master device does not have the Wi-Fi Aware service that can be provided, Then the slave device does not need to wake up the Wi-Fi module every once in a while to achieve passive monitoring. You can wake up the Wi-Fi module for passive monitoring when it is determined that the master device has the Wi-Fi Aware service required by the slave device. , Thereby effectively reducing power consumption.
  • the master device After the master device receives the first connection information of the slave device, it will determine whether it can provide the required first connection information service for the slave device according to the Wi-Fi Aware service name in the first connection information If not, the BLE Bluetooth module can choose to enter the dormant state to reduce the consumption of device battery resources.
  • the master device will determine whether it can provide the required first connection information service for the slave device by means of string comparison.
  • the Wi-Fi Aware service name refers to the identification of the Wi-Fi Aware service.
  • the Wi-Fi Aware service name can be used to uniquely determine the Wi-Fi Aware service. For example, in the scenario of joining a game battle, Wi-Fi Aware
  • the service name includes the game name, the game version number, and the service identifier used to indicate the provision of Wi-Fi Aware services.
  • the slave device will send the Wi-Fi Aware service name according to the required first connection information service. If the master device passes the string comparison If it is found that the Wi-Fi Aware service that it can provide can match the Wi-Fi Aware service required by the slave device, the master device has the Wi-Fi Aware service required by the slave device.
  • steps S11-S13 by using the BLE Bluetooth module to interact with the Wi-Fi Aware device discovery between the master device and the slave device, the battery resources consumed by the device can be effectively reduced, and before the device builds the link, it is determined in advance whether the master device is There is a Wi-Fi Aware service required by the slave device, which allows the BLE Bluetooth module to not be in an active state all the time, effectively reducing the battery resources consumed by the device.
  • the first connection information also includes Wi-Fi Aware parameters pre-configured from the device, where the Wi-Fi Aware parameters pre-configured from the device include In the Wi-Fi Aware protocol, the parameters of the service discovery subscription frame interaction;
  • the second connection information also includes the Wi-Fi Aware parameters pre-configured by the master device, where the Wi-Fi Aware parameters pre-configured by the master device include the Wi-Fi Aware protocol
  • the parameters of the frame interaction are published.
  • the parameters of the service discovery subscription frame interaction in the Wi-Fi Aware protocol include the MAC address of the Wi-Fi Aware management port of the slave device, the Wi-Fi Aware identification of the slave device, and the data encryption pre-configuration information of the slave device.
  • the parameters of the service discovery release frame interaction include the main device's Wi-Fi Aware management port MAC address, the main device's Wi-Fi Aware identification, and the main device's data encryption pre-configuration information.
  • MAC address Media Access Control Address
  • LAN address Physical address
  • Physical Address Physical Address
  • Wi-Fi Aware identifier refers to an identifier that can uniquely identify an object used by Wi-Fi Aware, for example, it can be represented by an ID.
  • Data encryption pre-configuration information refers to the pre-configured data encryption method (such as data encryption algorithm). If the master device knows the data encryption pre-configuration information of the slave device, it can decrypt the data obtained from the slave device according to the data encryption pre-configuration information data.
  • both the master device and the slave device may include information such as the Wi-Fi Aware management port MAC address, Wi-Fi Aware identification, and data encryption pre-configuration information.
  • the master device and the slave device can build a data link based on this information to realize information interaction.
  • the second connection information also includes the Wi-Fi Aware timestamp of the master device, which is used to synchronize the clock of the slave device.
  • the length of the Wi-Fi Aware timestamp may specifically be 8 bytes in length. Every 1 microsecond, the timestamp will increase by 1.
  • the slave device determines that the master device can provide the required Wi-Fi Aware service, it still needs to undergo a passive monitoring process to achieve clock synchronization.
  • the second connection information of the interaction also includes the Wi-Fi Aware timestamp of the master device, and the slave device can use the Wi-Fi Aware time stamp of the master device.
  • -Fi Aware timestamp synchronizes its own clock with the clock of the master device. Understandably, only when the clocks of the master device and the slave device are consistent, information can be exchanged within the same active time window.
  • a device when a device performs a Wi-Fi Aware link building protocol in the prior art, it includes the following fixed steps: the service discovery subscription of the slave device and the service discovery publication of the master device (the service discovery subscription uses the service discovery subscription frame The data is transmitted in the method of service discovery, and the service discovery release uses the service discovery release frame to transmit data. These two steps are for the master device and the slave device to establish the basis for information interaction, through such as the device’s Wi-Fi Aware management port MAC address, Wi-Fi -Fi Aware identification and other information to determine the information with the connected device, so that the devices can interact with each other based on this information. It should be noted that the service discovery subscription and service discovery release are different from Wi-Fi Aware device discovery. Wi-Fi Aware device discovery is to confirm whether the master device has the Wi-Fi Aware service required by the slave device. It is only for advance Determine the available Wi-Fi Aware services and whether the corresponding service-providing equipment exists.
  • the process of establishing a chain adopts the steps of service discovery subscription and service discovery publishing, so that the time for establishing a chain is relatively long, and it takes at least two active time windows to complete.
  • the Wi-Fi Aware protocol that links the master device and the slave device is included in the service discovery subscription frame interaction parameters, and the Wi-Fi Aware protocol is included in the service
  • the parameters of the discovery frame interaction are also interacted, so that when the slave device determines whether the master device can provide the required Wi-Fi Aware service, it has already performed the Wi-Fi Aware protocol in the service discovery subscription frame interaction parameter, Wi-Fi -Fi Aware protocol in the service discovery release frame interaction parameter interaction, you can skip the service discovery subscription and service discovery release steps, and directly proceed to the subsequent link building steps (steps S14-S15), thereby improving the link building between devices efficient.
  • the master device and the slave device can directly perform the subsequent link establishment operation based on the first connection information and the second connection information, and there is no need to separate at least two activities.
  • the time window is used to interact the parameters of the service discovery subscription frame interaction in the Wi-Fi Aware protocol, and the service discovery release frame interaction parameters of the Wi-Fi Aware protocol.
  • the master device and the slave device can complete the chain establishment based on information such as the Wi-Fi Aware management port MAC address, Wi-Fi Aware identification, etc., eliminating the need for service discovery subscription and service discovery publishing steps.
  • the method also specifically includes the following steps:
  • the time stamp of the slave device clock is adjusted to be consistent with the Wi-Fi Aware time stamp of the master device.
  • the way to synchronize the clock may specifically be to synchronize the Wi-Fi Aware timestamp of the slave device with the Wi-Fi Aware timestamp of the master device, so that the Wi-Fi Aware timestamp of the slave device and the master device’s The Wi-Fi Aware timestamps are consistent.
  • step S15 that is, the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, which specifically includes:
  • the master device judges whether the Wi-Fi Aware data path request frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device, and if so, sends a Wi-Fi Aware data path reply frame to the slave device in the next active time window.
  • the master device needs to determine the source of the Wi-Fi Aware data path request frame, and if the determination is passed, it will reply to the slave device, specifically by sending a Wi-Fi Aware data path reply frame to the slave device.
  • the master device determines that the Wi-Fi Aware data path request frame comes from the slave device, it can also refuse to reply to the slave device according to the preset processing method. For example, the master device presets "Reject Wi-Fi with any device" The processing method of "Aware build link” means that even if it is confirmed that the Wi-Fi Aware data path request frame comes from the slave device, it will not reply to the slave device.
  • S211-S212 a specific implementation method for the master device to complete the link establishment based on the Wi-Fi Aware data path request frame and the slave device is provided, through the Wi-Fi Aware data path request frame and the Wi-Fi Aware data path reply frame. Data link building.
  • the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, which specifically includes:
  • the master device determines whether the Wi-Fi Aware data path request frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device, and if so, sends a Wi-Fi Aware data path reply frame to the slave device in the next active time window.
  • S222 The master device judges whether the pre-configured Wi-Fi Aware parameters of the slave device include the data encryption pre-configuration information of the slave device. If it exists, the master device waits to obtain the Wi-Fi Aware data path confirmation frame sent by the slave device.
  • the slave device determines whether the pre-configured Wi-Fi Aware parameters of the master device include data encryption pre-configuration information, and if so, the slave device sends a Wi-Fi Aware data path confirmation frame to the master device.
  • S224 The master device judges whether the Wi-Fi Aware data path confirmation frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device. If so, the master device sends a Wi-Fi Aware data path key installation frame to the slave device.
  • the slave device receives the Wi-Fi Aware data path key installation frame, and completes the link establishment with the master device.
  • the master device will provide the slave device with a secret key installation during the link establishment process, which is implemented by sending a Wi-Fi Aware data path key installation frame.
  • the master device and the slave device can exchange data in accordance with the encryption method agreed by the two.
  • steps S221-S225 a specific implementation method for the master device to complete the link establishment based on the Wi-Fi Aware data path request frame and the slave device is provided, through the Wi-Fi Aware data path request frame and Wi-Fi Aware data path reply Frame, Wi-Fi Aware data path confirmation frame and Wi-Fi Aware data path key installation frame complete the data link establishment.
  • FIG. 5 shows a flow chart of Wi-Fi Aware completing link establishment through an application program.
  • this application interacts with the pre-configured Wi-Fi Aware parameters of the master device and the slave device in the process of Wi-Fi Aware device discovery (first obtain the Wi-Fi Aware interface in the Wi-Fi module) Parameters, the interface parameters and the Wi-Fi Aware parameters of the device itself are sent to the BLE module as the first connection information or the second connection information), skipping the steps of service discovery subscription and service discovery publishing in the dotted box, Directly interact with data frames in Wi-Fi Aware protocols such as Wi-Fi Aware data path request frames, Wi-Fi Aware data path reply frames, Wi-Fi Aware data path confirmation frames, Wi-Fi Aware data path key installation frames, etc. , Complete data link building, effectively improving the efficiency of link building.
  • Wi-Fi Aware protocols such as Wi-Fi Aware data path request frames, Wi-Fi Aware data path reply frames, Wi-Fi Aware data path confirmation frames, Wi-Fi Aware data path key installation frames, etc.
  • FIG. 6 shows another flowchart of Wi-Fi Aware completing link establishment through an application program. The steps shown in FIG. 6 are specifically as follows:
  • Wi-Fi Aware since the specific technology involved in this application is Wi-Fi Aware, it is a simple representation.
  • a Wi-Fi Aware (NAN) data path request frame can be simply expressed as a data path request frame, omitting the prefix.
  • the main device obtains Wi-Fi Aware parameters from the Wi-Fi module based on Wi-Fi Aware APK (Android application package, Android application package), including: Wi-Fi Aware management port MAC address, Wi-Fi Aware timestamp.
  • Wi-Fi Aware APK Android application package, Android application package
  • the Wi-Fi Aware APK of the main device delivers the following first connection information to the BLE Bluetooth module: serviceable Wi-Fi Aware service name, Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters, Wi-Fi Aware timestamp.
  • the BLE Bluetooth module of the master device passively monitors the surrounding broadcast BLE messages according to the first connection information issued in step S302, and identifies whether there is a matching Wi-Fi Aware device that can provide services.
  • S303 Obtain Wi-Fi Aware parameters from the Wi-Fi module from the Wi-Fi Aware APK of the device, including: Wi-Fi Aware management port MAC address.
  • S305 Send the following second connection information from the Wi-Fi Aware APK of the device to the BLE Bluetooth module: Wi-Fi Aware service name, Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Fi Aware security pre-configuration parameters.
  • the slave device turns on its own BLE module, and at the same time actively broadcasts the BLE message to the peripheral device according to the second connection information issued in step S305, declares that it expects to obtain the specified service, and carries its own Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters.
  • the BLE module of the master device receives the broadcast BLE message sent by the slave device in step S306, matches that the Wi-Fi Aware service name of both parties is the same, and will manage the Wi-Fi Aware ID and Wi-Fi Aware carried in the device message from the device.
  • the port MAC address and Wi-Fi Aware security pre-configuration parameters are reported to the Wi-Fi Aware APK of the main device, and the Wi-Fi Aware APK of the main device will determine whether to respond to the received BLE message according to its own policy. If it is decided to respond, proceed to step S308, otherwise, return to step S303.
  • the main device’s Wi-Fi Aware APK’s own policies include the rejection response to the blacklist and the whitelist response. If any of the Wi-Fi Aware ID and Wi-Fi Aware management port MAC address carried in the message from the device If the item is in the blacklist, the master device decides not to respond and returns to step S303; if the Wi-Fi Aware ID and Wi-Fi Aware management port MAC address carried in the slave device message are in the whitelist, it will decide to respond and proceed to step S308.
  • the master device replies to the broadcast of the slave device through the BLE Bluetooth module, and carries its own Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters, and Wi-Fi Aware timestamp.
  • the slave device receives the reply message from the master device through the BLE broadcast, and then carries the Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters, and Wi-Fi Aware of the master device in the message. -Fi Aware timestamp is reported to the Wi-Fi Aware APK of the slave device.
  • Wi-Fi Aware APK of the master device informs the Wi-Fi module that in the next active time window, there will be the Wi-Fi Aware service name, Wi-Fi Aware ID, and Wi-Fi Aware management port MAC carried in the message from the slave device.
  • Wi-Fi Aware devices with the same address and Wi-Fi Aware security pre-configuration parameters are used to establish a Wi-Fi Aware chain.
  • the Wi-Fi Aware APK of the slave device notifies the Wi-Fi module, calculates the next activity time window based on the Wi-Fi Aware timestamp issued by the master device, and uses the issued Wi-Fi Aware service name and Wi-Fi Aware ID and Wi-Fi Aware security pre-configuration parameters are sent to the Wi-Fi Aware device with the issued Wi-Fi Aware management port MAC address to establish a Wi-Fi Aware data link.
  • S312 The Wi-Fi module of the main device wakes up in the calculated next activity time window according to the Wi-Fi Aware clock to perform passive monitoring.
  • Wi-Fi module of the slave device wakes up at the next calculated activity time window according to the Wi-Fi Aware clock, and sends a data path request frame to the master device according to the pre-configured Wi-Fi Aware parameters in step S311. Data link request.
  • step S314 After the master device receives the data path request frame from the slave device, it judges whether the sender of the data path request frame is the Wi-Fi Aware device for Wi-Fi Aware chain establishment in step S310, and if so, it returns the data path reply Frame, otherwise, return to step S312 to continue passive monitoring.
  • S315 If the slave device receives the data path reply frame from the master device, it continues to send the data path confirmation frame.
  • step S316 If the master device receives the data path confirmation frame from the slave device, and the slave device is a matched device in step S314, it will reply with the data path key installation frame, and the Wi-Fi Aware data link establishment is completed at this time.
  • steps S311-S316 a specific implementation method for the master device and the slave device to complete the data link establishment through the application program is provided.
  • the slave device After determining that the main device can provide the required Wi-Fi Aware service, reduce the battery resource consumption that was originally passively monitored, eliminate the process of service discovery subscription and service discovery release, and effectively improve the speed of linking between Wi-Fi Aware devices .
  • a device with Wi-Fi Aware function can complete data interaction without Wi-Fi, AP, or cellular network.
  • mobile terminal A and mobile terminal B can achieve communication between devices within a limited distance through the Wi-Fi Aware function, where the use of the Wi-Fi Aware function includes but is not limited to the following Way:
  • Wi-Fi Aware data linking through mobile terminal A and mobile terminal B so that users can use mobile terminal B to obtain document files, picture files, video files, etc. through mobile terminal A Sent over.
  • the Wi-Fi Aware can be used to complete the chain establishment and realize the connection and communication between devices.
  • the time to establish a link between devices is faster, and battery resource consumption is lower.
  • Wi-Fi Aware parameters from the Wi-Fi module, including: Wi-Fi Aware management port MAC address and Wi-Fi Aware timestamp.
  • Mobile terminal A delivers the following pre-configured Wi-Fi Aware parameters to the BLE Bluetooth module: Wi-Fi Aware service name for file sharing (documents, pictures, videos, etc.), Wi-Fi Aware ID, Wi-Fi Aware management port MAC Address, Wi-Fi Aware security pre-configuration parameters, Wi-Fi Aware timestamp.
  • the BLE Bluetooth module of mobile terminal A passively monitors the surrounding broadcast BLE messages according to the issued pre-configured Wi-Fi Aware parameters, and identifies whether there is a matching Wi-Fi Aware device that can provide services.
  • Mobile terminal B obtains Wi-Fi Aware parameters from the Wi-Fi module, including: Wi-Fi Aware management port MAC address.
  • Mobile terminal B delivers the following pre-configured Wi-Fi Aware parameters to the BLE Bluetooth module: file sharing service name, Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters.
  • Mobile terminal B turns on its own BLE module, and at the same time actively broadcasts BLE messages to peripheral devices according to the pre-configured Wi-Fi Aware parameters issued in the steps, declares that it expects to obtain file sharing services, and carries its own Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters.
  • the BLE module of mobile terminal A receives the broadcast BLE message sent by mobile terminal B, and matches the file sharing service name of both parties to the same service name.
  • the Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters are reported to mobile terminal A, and mobile terminal A will decide whether to respond to the received BLE message according to its own policy. If you decide to respond, continue to perform the remaining steps below, otherwise, return to the step of passively listening to the surrounding broadcast BLE messages and identifying whether there is a matching Wi-Fi Aware device that can provide services.
  • Mobile terminal A replies to the broadcast of mobile terminal B through the BLE Bluetooth module, and carries its own Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters, and Wi-Fi Aware timestamp.
  • Mobile terminal B receives the reply message from mobile terminal A via BLE broadcast, and then adds the Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-configuration parameters, and Wi-Fi Aware security ID of mobile terminal A in the message.
  • the Wi-Fi Aware timestamp is reported to mobile terminal B.
  • Mobile terminal A informs the Wi-Fi module that in the next active time window, there will be the service name, Wi-Fi Aware ID, Wi-Fi Aware management port MAC address, Wi-Fi Aware security pre-shared with the file carried in the device message.
  • Wi-Fi Aware devices with the same configuration parameters can build a Wi-Fi Aware data link.
  • Mobile terminal B notifies the Wi-Fi module, calculates the next activity time window based on the Wi-Fi Aware timestamp issued by mobile terminal A, and uses the issued file sharing service name, Wi-Fi Aware ID, Wi-Fi Aware
  • the security pre-configuration parameters are sent to the Wi-Fi Aware device with the MAC address of the Wi-Fi Aware management port, and the Wi-Fi Aware data link is established.
  • the Wi-Fi module of mobile terminal A wakes up in the calculated next activity time window according to the Wi-Fi Aware clock to perform passive monitoring.
  • the Wi-Fi module of mobile terminal B wakes up in the next calculated activity time window according to the Wi-Fi Aware clock, sends a data path request frame to mobile terminal A, and requests data link establishment.
  • mobile terminal A After mobile terminal A receives the data path request frame from mobile terminal B, it judges whether the sender of the data path request frame is mobile terminal B. If so, it returns the data path reply frame; otherwise, the Wi-Fi module of mobile terminal A is based on Wi-Fi -Fi Aware clock, wake up in the calculated next active time window, and perform passive monitoring steps.
  • the mobile terminal B If the mobile terminal B receives the data path reply frame from the mobile terminal A, it continues to send the data path confirmation frame.
  • mobile terminal A receives the data path confirmation frame sent by mobile terminal B, and mobile terminal B confirms that the match is successful, it will reply with the data path key installation frame, and the Wi-Fi Aware data link is completed at this time.
  • the Wi-Fi Aware function also includes ways to join the game battle. Understandably, some games need to be connected to the Internet. In the absence of Wi-Fi and other networks, the Wi-Fi Aware function can be used to achieve networking. Specifically, providing a game game to join is also a service that can be provided, and joining a game game is a Wi-Fi Aware service expected by a device. For example, mobile terminal A provides services to join the game through Wi-Fi Aware. If the user of mobile terminal B wants to play games online with the user of mobile terminal A, they can use Wi-Fi Aware to indicate that mobile terminal B expects Service-join the game war.
  • Wi-Fi Aware chain establishment steps are similar to the Wi-Fi Aware chain establishment steps shared by the above document, and will not be repeated here.
  • the original information about the interaction between the service discovery subscription and the service discovery publishing step and the clock synchronization information can be obtained during the process of service discovery, so that in the process of Wi-Fi Aware chain establishment, the establishment of inter-device The duration of the chain is faster and the battery resource consumption is lower.
  • the master device interacts with the slave device for device discovery to determine whether the master device can provide the Wi-Fi Aware service required by the slave device.
  • the master device can provide the Wi-Fi Aware service required by the slave device Only when the slave device and the master device perform the next step of establishing a link; among them, in the interaction process of Wi-Fi Aware device discovery, the interaction between the first connection information and the second connection information is used to facilitate the device discovery process.
  • the master device and the slave device can skip the steps of service discovery subscription and service discovery publishing , To complete the Wi-Fi Aware chain building faster, and effectively improve the speed of Wi-Fi Aware chain building.
  • the embodiment of the present application further provides a system that implements each step and method in the above method embodiment.
  • the Wi-Fi Aware link building system includes a master device and a slave device.
  • the master device is used to perform the following steps:
  • the master device receives the first connection information sent by the slave device, where the first connection information includes the Wi-Fi Aware service name required by the slave device, and the first connection information also includes Wi-Fi Aware parameters pre-configured by the slave device, where: The Wi-Fi Aware parameters pre-configured from the device include the parameters that are exchanged in the service discovery subscription frame in the Wi-Fi Aware protocol;
  • the master device sends the second connection information to the slave device according to the Wi-Fi Aware service name required by the slave device, where the second connection information includes confirmation information, and the confirmation information is confirmed by the master device that there is the Wi-Fi Aware required by the slave device The notification information of the service name.
  • the slave device confirms that the master device has the Wi-Fi Aware service name required by the slave device according to the confirmation information.
  • the second connection information also includes the Wi-Fi Aware parameters pre-configured by the master device, where the master device is pre-configured
  • the Wi-Fi Aware parameters include the parameters of the Wi-Fi Aware protocol in the service discovery release frame interaction;
  • the master device obtains the Wi-Fi Aware data path request frame sent by the slave device;
  • the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame.
  • receiving the first connection information sent by the slave device by the master device includes:
  • the master device receives the first connection information sent by the slave device based on the function broadcast by the BLE Bluetooth module.
  • the second connection information also includes the Wi-Fi Aware timestamp of the master device, which is used to synchronize the clock of the slave device.
  • the method also includes:
  • the master device adjusts the time stamp of the slave device clock to be consistent with the Wi-Fi Aware time stamp of the master device.
  • the parameters of the service discovery subscription frame interaction in the Wi-Fi Aware protocol include the MAC address of the Wi-Fi Aware management port of the slave device, the Wi-Fi Aware identification of the slave device, and the data encryption pre-configuration information of the slave device.
  • the parameters of the service discovery release frame interaction include the main device's Wi-Fi Aware management port MAC address, the main device's Wi-Fi Aware identification, and the main device's data encryption pre-configuration information.
  • the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, including:
  • the master device judges whether the Wi-Fi Aware data path request frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device. If so, it sends a Wi-Fi Aware data path reply frame to the slave device in the next active time window;
  • the slave device After the slave device receives the Wi-Fi Aware data path reply frame, the master device and the slave device complete the link establishment.
  • the master device completes the link establishment with the slave device based on the Wi-Fi Aware data path request frame, including:
  • the master device judges whether the Wi-Fi Aware data path request frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device. If so, it sends a Wi-Fi Aware data path reply frame to the slave device in the next active time window;
  • the master device determines whether the pre-configured Wi-Fi Aware parameters of the slave device include the data encryption pre-configuration information of the slave device. If it exists, the master device obtains the Wi-Fi Aware data path confirmation frame sent by the slave device;
  • the master device judges whether the Wi-Fi Aware data path confirmation frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device. If so, the master device sends the Wi-Fi Aware data path key installation frame to the slave device;
  • the slave device After the slave device receives the Wi-Fi Aware data path key installation frame, the master device and the slave device complete the link establishment.
  • the slave device is used to perform the following steps:
  • the slave device sends first connection information to the master device, where the first connection information includes the Wi-Fi Aware service name required by the slave device, and the first connection information also includes Wi-Fi Aware parameters pre-configured by the slave device.
  • the Wi-Fi Aware parameters pre-configured by the device include the parameters exchanged in the service discovery subscription frame in the Wi-Fi Aware protocol;
  • the slave device receives the second connection information sent by the master device, where the second connection information includes confirmation information, and the confirmation information is the notification information that the master device confirms that there is a Wi-Fi Aware service name required by the slave device, and the second connection information also includes Wi-Fi Aware parameters pre-configured by the master device, where the Wi-Fi Aware parameters pre-configured by the master device include the parameters of the Wi-Fi Aware protocol in the service discovery release frame interaction;
  • the slave device confirms that the master device has the Wi-Fi Aware service name required by the slave device according to the confirmation information;
  • the slave device sends a Wi-Fi Aware data path request frame to the master device, and establishes a link with the master device based on the Wi-Fi Aware data path request frame.
  • sending the first connection information from the slave device to the master device includes:
  • the slave device sends the first connection information to the master device based on the function broadcast by the BLE Bluetooth module.
  • the second connection information also includes the Wi-Fi Aware timestamp of the master device, which is used to synchronize the clock of the slave device.
  • the method also includes:
  • the slave device adjusts the time stamp of the clock to be consistent with the Wi-Fi Aware time stamp of the master device according to the received Wi-Fi Aware time stamp of the master device.
  • the parameters of the service discovery subscription frame interaction in the Wi-Fi Aware protocol include the MAC address of the Wi-Fi Aware management port of the slave device, the Wi-Fi Aware identification of the slave device, and the data encryption pre-configuration information of the slave device.
  • the parameters of the service discovery release frame interaction include the main device's Wi-Fi Aware management port MAC address, the main device's Wi-Fi Aware identification, and the main device's data encryption pre-configuration information.
  • Wi-Fi Aware data path request frame to complete the link establishment with the master device, it includes:
  • the slave device sends a Wi-Fi Aware data path request frame to the master device;
  • the slave device After the master device judges that the Wi-Fi Aware data path request frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device, in the next active time window, the slave device receives the Wi-Fi Aware data path reply frame sent by the master device. Complete the chain establishment with the main equipment.
  • Wi-Fi Aware data path request frame to complete the link establishment with the master device, it includes:
  • the slave device sends a Wi-Fi Aware data path request frame to the master device;
  • the slave device After the master device judges that the Wi-Fi Aware data path request frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device, in the next active time window, the slave device receives the Wi-Fi Aware data path reply frame sent by the master device;
  • the slave device determines whether the pre-configured Wi-Fi Aware parameters of the master device include data encryption pre-configuration information. If it exists, the slave device sends Wi-Fi to the master device after receiving the Wi-Fi Aware data path reply frame sent by the master device. Aware data path confirmation frame;
  • the slave device After the master device judges that the Wi-Fi Aware data path confirmation frame comes from the slave device according to the pre-configured Wi-Fi Aware parameters of the slave device, the slave device receives the Wi-Fi Aware data path key installation frame sent by the master device, and completes with the master device Build a chain.
  • the parameters exchanged in the service discovery subscription frame in the Wi-Fi Aware protocol, and the parameters exchanged in the service discovery publishing frame in the Wi-Fi Aware protocol need to pass through the service discovery subscription in the Wi-Fi Aware protocol.
  • the steps of interacting with the service discovery and publishing are obtained.
  • the parameters of the Wi-Fi Aware protocol in the service discovery subscription frame interaction, and the Wi-Fi Aware protocol in the service discovery publishing frame interaction parameters are set in the Wi-Fi Aware protocol.
  • Fi Aware interacts during device discovery, allowing the master device and the slave device to skip the steps of service discovery subscription and service discovery publishing interaction, and directly establish a data link based on the first connection information and the second connection information, which effectively improves The speed of chain building.
  • the master device interacts with the slave device for device discovery to determine whether the master device can provide the Wi-Fi Aware service required by the slave device.
  • the master device can provide the Wi-Fi Aware service required by the slave device Only when the slave device and the master device perform the next step of establishing a link; among them, in the interaction process of Wi-Fi Aware device discovery, the interaction between the first connection information and the second connection information is used to facilitate the device discovery process.
  • the master device and the slave device can skip the steps of service discovery subscription and service discovery publishing , To complete the Wi-Fi Aware chain building faster, and effectively improve the speed of Wi-Fi Aware chain building.
  • This embodiment provides a computer-readable storage medium with computer-readable instructions stored on the computer-readable storage medium.
  • the computer-readable instructions When executed by a processor, the method for establishing a link in the embodiment is implemented. In order to avoid repetition, this is not Go into details one by one.
  • the computer-readable instruction realizes the function of each module/unit in the link building device in the embodiment when it is executed by the processor. To avoid repetition, it will not be repeated here.

Landscapes

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

Abstract

本申请公开了一种Wi-Fi Aware的建链方法、系统、电子设备和存储介质。该Wi-FiAware的建链方法包括:主设备接收从设备发送的第一连接信息,其中,第一连接信息包括从设备所需的Wi-Fi Aware服务名;主设备根据从设备所需的Wi-Fi Aware服务名,发送第二连接信息给从设备,其中,第二连接信息包括确认信息,确认信息为主设备确认存在从设备所需的Wi-Fi Aware服务名的通知信息,从设备根据该确认信息确认主设备存在从设备所需的Wi-Fi Aware服务名;主设备获取从设备发送的Wi-Fi Aware数据通路请求帧;主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链。采用该Wi-Fi Aware的建链方法能够有效提高设备间建链的速度。

Description

Wi-Fi Aware的建链方法、系统、电子设备和存储介质 技术领域
本申请涉及通信技术领域,尤其涉及一种Wi-Fi Aware的建链方法、系统、电子设
备和存储介质。
背景技术
Wi-Fi Aware(Wi-Fi Neighborhood Aware Network,Wi-Fi邻居发现网络,又称为Wi-Fi Neighborhood Aware Network,简称NAN)是一种新型的低功耗点对点互连互通的Wi-Fi Mesh通信技术,该技术能够绕开网络基础设施(如AP(Access Point,接入点)或蜂窝网),实现一对一、一对多或多对多的设备间的连接通信。
在Wi-Fi Aware建链过程中,Wi-Fi Aware规定每间隔512TU(Time Unit,时间单位,1TU=1024微秒),会有一个16TU的活动时间窗DW(Discovery Window)。在该活动时间窗期限内,各个Wi-Fi Aware设备方可进行Service Discovery Frame(服务发现帧)、NDP Request Frame(NAN数据通路请求帧,或称为Wi-Fi Aware数据通路请求帧,其中,NDP为NAN Data Path,表示NAN数据传输通路)、NDP Response Frame(NAN数据通路回复帧)、NDP Confirm Frame(NAN数据通路确认帧)、NDP Key Installment Frame(NAN数据通路秘钥安装帧)等Wi-Fi Aware协议中数据帧的交互。两台Wi-Fi Aware设备间若要建链成功,起码要经历4个活动时间窗,间隔耗时在1536TU以上,设备间建链所需的时长较长。
申请内容
有鉴于此,本申请实施例提供了一种Wi-Fi Aware的建链方法、系统、电子设备和存储介质,用以解决Wi-Fi Aware设备间建链所需时长较长的问题。
第一方面,本申请实施例提供了一种Wi-Fi Aware的建链方法,包括:
主设备接收从设备发送的第一连接信息,其中,所述第一连接信息包括所述从设备所需的Wi-Fi Aware服务名,所述第一连接信息还包括所述从设备预配置的Wi-Fi Aware参数,其中,所述从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
所述主设备根据所述从设备所需的Wi-Fi Aware服务名,发送第二连接信息给所述从设备,其中,所述第二连接信息包括确认信息,所述确认信息为所述主设备确认存在所述从设备所需的Wi-Fi Aware服务名的通知信息,所述从设备根据所述确认信息确认所述主设备存在所述从设备所需的Wi-Fi Aware服务名,所述第二连接信息还包括所述主设备预配置的Wi-Fi Aware参数,其中,所述主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
所述主设备获取所述从设备发送的Wi-Fi Aware数据通路请求帧;
所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述主设备接收所述从设备发送的第一连接信息,包括:
所述主设备基于BLE蓝牙模块广播的功能,接收所述从设备发送的第一连接信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述第二连接信息还包括所述主设备的Wi-Fi Aware时间戳,用于同步从设备的时钟。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述方法还包括:
所述主设备根据发送到所述从设备的Wi-Fi Aware时间戳,将所述从设备时钟的时间戳调整为和所述主设备的Wi-Fi Aware时间戳一致。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括所述从设备的Wi-Fi Aware管理口MAC地址、所述从设备的Wi-Fi Aware标识,以及所述从设备的数据加密预配置信息,所述Wi-Fi Aware协议中在服务发现发布帧交互的参数包括所述主设备的Wi-Fi Aware管理口MAC地址、所述主设备的Wi-Fi Aware标识,以及所述主设备的数据加密预配置信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
在所述从设备接收Wi-Fi Aware数据通路回复帧后,所述主设备与所述从设备完成建链。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
所述主设备判断所述从设备预配置的Wi-Fi Aware参数中是否包括所述从设备的数据加密预配置信息,若存在,所述主设备获取所述从设备发送的Wi-Fi Aware数据通路确认帧;
所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路确认帧是否来自所述从设备,若是,所述主设备向所述从设备发送Wi-Fi Aware数据通路秘钥安装帧;
在所述从设备接收Wi-Fi Aware数据通路秘钥安装帧后,所述主设备与所述从设备完成建链。
第二方面,本申请实施例还提供了一种Wi-Fi Aware的建链方法,包括:
从设备向主设备发送第一连接信息,其中,所述第一连接信息包括所述从设备所需的Wi-Fi Aware服务名,所述第一连接信息还包括所述从设备预配置的Wi-Fi Aware参数,其中,所述从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
所述从设备接收所述主设备发送的第二连接信息,其中,所述第二连接信息包括确认信息,所述确认信息为所述主设备确认存在所述从设备所需的Wi-Fi Aware服务名的通知信息,所述第二连接信息还包括所述主设备预配置的Wi-Fi Aware参数,其中,所述主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
从设备根据所述确认信息确认所述主设备存在所述从设备所需的Wi-Fi Aware服务名;
所述从设备向所述主设备发送Wi-Fi Aware数据通路请求帧,并基于所述Wi-Fi Aware数据通路请求帧与所述主设备完成建链。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述从设备向所述主设备发送第一连接信息,包括:
所述从设备基于BLE蓝牙模块广播的功能,向所述主设备发送第一连接信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述第二连接信息还包括所述主设备的Wi-Fi Aware时间戳,用于同步所述从设备的时钟。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述方法还包括:
所述从设备根据接收的所述主设备的Wi-Fi Aware时间戳,将时钟的时间戳调整为和所述主设备的Wi-Fi Aware时间戳一致。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括所述从设备的Wi-Fi Aware管理口MAC地址、所述从设备的Wi-Fi Aware标识,以及所述从设备的数据加密预配置信息,所述Wi-Fi Aware协议中在服务发现发布帧交互的参数包括所述主设备的Wi-Fi Aware管理口MAC地址、所述主设备的Wi-Fi Aware标识,以及所述主设备的数据加密预配置信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述基于所述Wi-Fi Aware数据通路请求帧与所述主设备完成建链,包括:
所述从设备向所述主设备发送Wi-Fi Aware数据通路请求帧;
在所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧来自所述从设备后,在下一个活动时间窗,所述从设备接收所述主设备发送的Wi-Fi Aware数据通路回复帧,与所述主设备完成建链。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述基于所述Wi-Fi Aware数据通路请求帧与所述主设备完成建链,包括:
所述从设备向所述主设备发送Wi-Fi Aware数据通路请求帧;
在所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧来自所述从设备后,在下一个活动时间窗,所述从设备接收所述主设备发送的Wi-Fi Aware数据通路回复帧;
所述从设备判断所述主设备预配置的Wi-Fi Aware参数中是否包括数据加密预配置信息,若存在,所述从设备在接收所述主设备发送的Wi-Fi Aware数据通路回复帧后,向所述主设备发送Wi-Fi Aware数据通路确认帧;
在所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路确认帧来自所述从设备后,从设备接收所述主设备发送的Wi-Fi Aware数据通路秘钥安装帧,与所述主设备完成建链。
第三方面,本申请实施例提供了一种Wi-Fi Aware的建链方法,包括:
从设备向主设备发送第一连接信息,其中,所述第一连接信息包括所述从设备所需的Wi-Fi Aware服务名,所述第一连接信息还包括所述从设备预配置的Wi-Fi Aware参数,其中,所述从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
所述主设备接收所述从设备发送的第一连接信息;
所述主设备根据所述从设备所需的Wi-Fi Aware服务名,发送第二连接信息给所述从设备,其中,所述第二连接信息包括确认信息,所述确认信息为所述主设备确认存在所述从设备所需的Wi-Fi Aware服务名的通知信息,所述第二连接信息还包括所述主设备预配置的Wi-Fi Aware参数,其中,所述主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
所述从设备接收所述主设备发送的第二连接信息,根据所述确认信息确认所述主设备存在所述从设备所需的Wi-Fi Aware服务名;
所述从设备向所述主设备发送Wi-Fi Aware数据通路请求帧;
所述主设备获取所述从设备发送的Wi-Fi Aware数据通路请求帧;
所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述从设备向所述主设备发送第一连接信息,包括:
所述从设备基于BLE蓝牙模块广播的功能,向所述主设备发送第一连接信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述第二连接信息还包括所述主设备的Wi-Fi Aware时间戳,用于同步所述从设备的时钟。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述方法还包括:
所述主设备发送Wi-Fi Aware时间戳给所述从设备;
所述从设备根据接收的所述主设备的Wi-Fi Aware时间戳,将时钟的时间戳调整为和所述主设备的Wi-Fi Aware时间戳一致。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括所述从设备的Wi-Fi Aware管理口MAC地址、所述从设备的Wi-Fi Aware标识,以及所述从设备的数据加密预配置信息,所述Wi-Fi Aware协议中在服务发现发布帧交互的参数包括所述主设备的Wi-Fi Aware管理口MAC地址、所述主设备的Wi-Fi Aware标识,以及所述主设备的数据加密预配置信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
所述从设备接收Wi-Fi Aware数据通路回复帧,所述主设备与所述从设备完成建链。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
所述主设备判断所述从设备预配置的Wi-Fi Aware参数中是否包括所述从设备的数据加密预配置信息,若存在,所述主设备等待获取所述从设备发送的Wi-Fi Aware数据通路确认帧;
所述从设备判断所述主设备预配置的Wi-Fi Aware参数中是否包括数据加密预配置信息,若存在,所述从设备向所述主设备发送Wi-Fi Aware数据通路确认帧;
所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路确认帧是否来自所述从设备,若是,所述主设备向所述从设备发送Wi-Fi Aware数据通路秘钥安装帧;
所述从设备接收Wi-Fi Aware数据通路秘钥安装帧,所述主设备与所述从设备完成建链。
第四方面,本申请实施例提供了一种Wi-Fi Aware的建链系统,包括:主设备和从设备,其中,所述主设备用于执行上述第一方面的方法,所述从设备用于执行上述第二方面的方法。
第五方面,本申请实施例提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述第一方面或第二方面所述方法的步骤。
第六方面,本申请实施例提供了一种计算机可读存储介质,包括:计算机可读指令,所述计算机可读指令被处理器执行时实现上述第一方面或第二方面所述方法的步骤。
在本申请实施例中,主设备与从设备进行设备发现的交互,以确定主设备是否能提供从设备所需的Wi-Fi Aware服务,当主设备能够提供从设备所需的Wi-Fi Aware服务时,从设备才会与主设备进行下一步的建链步骤;其中,在Wi-Fi Aware设备发现的交互过程中,利用第一连接信息和第二连接信息的交互,在设备发现过程中便得到主设备和从设备在现有技术建链步骤中,Wi-Fi Aware协议中在服务发现订阅帧和服务发现发布帧交互的参数。在Wi-Fi Aware设备发现阶段已得到Wi-Fi Aware协议中在服务发现订阅帧和服务发现发布帧交互的参数的情况下,主设备和从设备能够跳过服务发现订阅和服务发现发布的步骤,更快地完成Wi-Fi Aware的建链,有效提高Wi-Fi Aware设备间建链的速度。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1是本申请一实施例提供的一种电子设备的结构示意图;
图2是本申请一实施例提供的一种电子设备的软件结构框图;
图3是本申请一实施例提供的一种Wi-Fi Aware建链方法的流程图;
图4是本申请一实施例提供的又一种Wi-Fi Aware建链方法的流程图;
图5是本申请一实施例提供的一种Wi-Fi Aware通过应用程序完成建链的流程图;
图6是本申请一实施例提供的又一种Wi-Fi Aware通过应用程序完成建链的流程图;
图7是本申请一实施例提供的一种Wi-Fi Aware建链方法的场景图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
图1示出了电子设备100的结构示意图。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器 (neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B 等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。 ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可 以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2是本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。
当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头193捕获静态图像或视频。
现有技术中,Wi-Fi Aware设备之间进行的数据通信,一般包括如下四步:
步骤一:集群发现。
对于Wi-Fi Aware设备(包括但不限于手机、智能手表、平板电脑和服务器等设备)发现可及范围内的其他Wi-Fi Aware设备,在两个Wi-Fi Aware设备完成建链之前,采用“发现信标帧(Discovery Beacon Frame)”来交互信息,确认可及范围内的其他Wi-Fi Aware设备的存在。
步骤二:时钟同步。
Wi-Fi Aware设备加入其他Wi-Fi Aware设备组成的设备群(集群),同步发现信标所携带的时间戳。然后,根据该时间戳,计算出活动时间窗发生的具体时间,并在该活动时间窗期间,采用Wi-Fi Aware数据传输通路进行通信。
步骤三:服务发现。
Wi-Fi Aware设备上的应用程序(application,简称APP)利用“发布型(Publish)”和“订阅型(Subscribe)”的Wi-Fi Aware(NAN)服务发现帧(包括服务发现发布帧和服务发现订阅帧)交换信息。Wi-Fi Aware设备可以通过在活动时间窗时期内订阅(搜 索)发现服务,Wi-Fi Aware设备也可以通过在活动时间窗时期内发布(发送)广播表示其存在的信息以及可提供的服务内容。
步骤四:数据建链。
当Wi-Fi Aware设备搜索所需的Wi-Fi Aware服务时,发出搜索的设备可在活动时间窗时期内向检测到的Wi-Fi Aware设备发送数据建链请求,具体可采用Wi-Fi Aware数据通路请求帧的信息交互实现。收到服务请求帧的设备,将在下一活动时间窗期限内回复Wi-Fi Aware数据通路回复帧。其中,若数据建链涉及安全加密,则还需额外在活动时间窗期限内进行Wi-Fi Aware数据通路确认帧和Wi-Fi Aware数据通路秘钥安装帧的信息交互。
Wi-Fi Aware规定每间隔512TU,都会有一个16TU的活动时间窗,在该活动时间窗期限内,各个Wi-Fi Aware设备才可进行服务发现帧、Wi-Fi Aware(NAN)数据通路请求帧、Wi-Fi Aware数据通路回复帧、Wi-Fi Aware数据通路确认帧、Wi-Fi Aware数据通路秘钥安装帧等Wi-Fi Aware协议中数据帧的交互。
如图3所示:主设备将在预定信道上通过广播发现信标帧来让其他设备能够发现其已经创建完成的集群。从设备唤醒并在预定信道上监听发现信标帧,当监听到发现信标帧后,同步自身的Wi-Fi Aware时钟为发现信标帧所携带的Wi-Fi Aware时间戳。
需要说明的是,每个Wi-Fi Aware设备都持有一个精度为“1微秒”的时钟,每微秒该时间戳都自增1。主设备在其发出的发现信标帧时携带自身的时间戳,从设备在收到该主设备发出的发现信标帧后,将自身时钟的时间戳改为与主设备发出的发现信标帧所携带的时间戳一致,可达到主设备和从设备的时钟同步。
可以理解地,每个活动时间窗的开始时间,都是时间戳整除512TU为零的时刻,即每次Value(时间戳)mod512*1024=0的时刻,都是一个活动时间窗的开始时间,其中,每个活动时间窗持续16TU。进一步地,从设备在活动时间窗期限内,通过发送服务发现帧中的Service Discovery Subscribe Frame(服务发现订阅帧),主动查询能够提供所需的Wi-Fi Aware服务的设备。主设备在接收从设备发出的服务发现订阅帧后,若判断自身可以提供从设备所需的Wi-Fi Aware服务,则将在下一个活动时间窗回复发送服务发现帧中的Service Discovery Publish Frame(服务发现发布帧)。之后,主设备和从设备之间,将在下两个活动时间窗通过依次交互Wi-Fi Aware数据通路请求帧、Wi-Fi Aware数据通路回复帧、Wi-Fi Aware数据通路确认帧和Wi-Fi Aware数据通路秘钥安装帧完成数据建链。
可以理解地,尽管Wi-Fi Aware进行了低功耗方面的设计,但是如果从设备期望订阅某个Wi-Fi Aware服务,而周边并没有可以提供相应服务的主设备时,将导致从设备定期唤醒自身的Wi-Fi模块,来进行被动监听、发送服务发现订阅帧等操作。显然,频繁唤醒Wi-Fi模块来进行Wi-Fi Aware设备发现,会消耗较多的电池资源。
同时,因为Wi-Fi Aware规定每512TU才有16TU可以进行Wi-Fi Aware数据通路请求帧、Wi-Fi Aware数据通路回复帧、Wi-Fi Aware数据通路确认帧和Wi-Fi Aware数据通路秘钥安装帧等的信息交互,使得两台Wi-Fi Aware设备若要建链成功,起码需要经历4个活动时间窗,间隔耗时在512TU*3=1536TU以上。
现有技术中,为了解决从设备频繁唤醒Wi-Fi模块来进行Wi-Fi Aware设备发现,会消耗较多电池资源的这个问题,可利用BLE(Bluetooth Low Energy,低功耗蓝牙)实现Wi-Fi Aware设备间的相互发现。具体地,利用BLE具有低功耗、吞吐量较低的特点,Wi-Fi Aware设备间通过BLE广播的方式进行通信。若主设备发送的第一连接信息中包括从设备所需的Wi-Fi Aware服务名,则从设备将唤醒自身的Wi-Fi模块来与主设备进行数据建链。
具体地,如图4所示,从设备在唤醒Wi-Fi模块进行被动监听前,先使用BLE定期广播,在第一连接信息中携带所需Wi-Fi Aware服务的Wi-Fi Aware服务名;若主设备能够提供该Wi-Fi Aware服务,则主设备在接收到该BLE第一连接信息后,也通过BLE广播的方式,告知从设备其能够提供该服务。接着,从设备再唤醒Wi-Fi模块进行被动监听,以监听主设备发出的发现信标帧,然后与图3的步骤相同,完成与主设备的数据建链。
其中,上述BLE是由蓝牙特别兴趣小组于2016年推出的一种超低功耗的用于移动终端的近距离无线通信方案,从下表1中可以看出,无论是在睡眠期间、还是在接收、传输消息时,BLE的工作功耗均小于Wi-Fi,按每天交互10条消息所消耗的功耗来看,BLE的工作功耗仅是Wi-Fi的工作功耗的十分之一,其工作功耗远小于Wi-Fi。
鉴于BLE具有超低功耗,但吞吐量较低的特点,可利用该BLE用于设备间的相互发现。
Figure PCTCN2021080097-appb-000001
表1
可以理解地,尽管采用BLE解决了从设备频繁唤醒Wi-Fi模块来进行Wi-Fi Aware设备发现,会消耗较多电池资源的问题。但是从设备在唤醒Wi-Fi模块后,还是要经过一段时间的被动监听来接收主设备发出的发现信标帧,才能同步到主设备所在集群的时钟,然后再正确地进入活动时间窗来进行Wi-Fi Aware设备发现和数据建链。
可以理解地,采用该BLE也尚未解决Wi-Fi Aware设备发现和数据建链时间较长,超过1536TU的问题。
具体地,可采用如下实施方式解决上述存在的问题。
首先,进行主设备与从设备之间的设备发现。
S11:从设备基于BLE蓝牙模块广播的功能,向主设备发送第一连接信息,其中,第一连接信息包括从设备所需的Wi-Fi Aware服务名,第一连接信息还包括从设备预配置的Wi-Fi Aware参数,其中,从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数。
S12:主设备基于BLE蓝牙模块广播的功能,接收从设备发送的第一连接信息。
S13:主设备根据从设备所需的Wi-Fi Aware服务名,发送第二连接信息给从设备,其中,第二连接信息包括确认信息,确认信息为主设备确认存在从设备所需的Wi-Fi Aware 服务名的通知信息,从设备根据该确认信息确认主设备存在从设备所需的Wi-Fi Aware服务名,该第二连接信息还包括主设备预配置的Wi-Fi Aware参数,其中,主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数。
在主设备与从设备之间的设备发现完后,通过利用第一连接信息的从设备预配置的Wi-Fi Aware参数、第二连接信息的主设备预配置的Wi-Fi Aware参数,跳过现有技术中服务发现订阅和服务发现推送的步骤,直接执行以下步骤:
S14:主设备获取从设备发送的Wi-Fi Aware数据通路请求帧;
S15:主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链。
可以理解地,在步骤S11-S13的主设备和从设备间进行Wi-Fi Aware设备发现的交互过程,可采用蓝牙模块实现,具体地,可以采用低功耗蓝牙的蓝牙模块来实现,该低功耗蓝牙具有功耗低、吞吐量低的特点,无论是在休眠期间、还是在接收、传输消息时,低功耗蓝牙的工作功耗远小于Wi-Fi。
其中,主设备和从设备对于设备而言并不是固定不变的,同一台设备既可以作为主设备,也可以作为从设备,具体地,时钟被同步的设备为从设备。
其中,Wi-Fi Aware服务具体可以是指文件共享、照片互传、提供游戏战局加入等服务。
在一实施例中,从设备采用低功耗蓝牙的蓝牙模块与主设备进行Wi-Fi Aware设备发现的交互,相比于原有的唤醒Wi-Fi模块进行被动监听,其消耗的功率更低,且无需Wi-Fi模块不间断地唤醒,能够有效降低设备消耗的电池资源。
其中,BLE蓝牙模块进行广播的第一连接信息通过报文携带。具体地,包括两类报文:广播报文和数据报文。可以理解地,设备利用广播报文发现、连接其它设备。一旦设备连接建立之后,则开始使用数据报文,在一实施例中,从设备所需的Wi-Fi Aware服务名通过数据报文携带。进一步地,数据报文的数据结构为报头结构、数据负载结构(payload)和消息完整性检查结构(Messages Integrity Check,检测MIC),Wi-Fi Aware服务名具体存储在数据负载结构中。
其中,Wi-Fi Aware服务名是指服务的标识,通过该Wi-Fi Aware服务名能够唯一确定Wi-Fi Aware服务,例如Wi-Fi Aware服务名可以是与文件分享、照片互传或者加入游戏战局相关的名称,其他可唯一确定Wi-Fi Aware服务的标识均可称为Wi-Fi Aware服务名,在这里不仅是对展示的名称的限定,也可以是其他能够唯一确定Wi-Fi Aware服务的标识。
在一实施例中,从设备在广播时已将所需的Wi-Fi Aware服务名携带在第一连接信息中,以让主设备能够通过BLE蓝牙模块接收,获知携带在第一连接信息中的Wi-Fi Aware服务名。
可以理解地,主设备与从设备在进行设备建链之前,将先确定主设备是否能够提供给从设备所需的Wi-Fi Aware服务,若主设备不存在能够提供的Wi-Fi Aware服务,则从设备也不必采用每隔一段时间便唤醒Wi-Fi模块一次的方式实现来被动监听,可以在确定主设备存在从设备所需的Wi-Fi Aware服务时再唤醒Wi-Fi模块进行被动监听,从而有效地减少电源的消耗。
在一实施例中,在主设备接收从设备的第一连接信息后,将根据第一连接信息中的Wi-Fi Aware服务名来确定自身是否能够为从设备提供所需的第一连接信息服务,若不能,BLE蓝牙模块可选择进入休眠状态,减少设备电池资源的消耗。
具体地,主设备将通过字符串比对的方式确定是否能够为从设备提供所需的第一连接信息服务。可以理解地,Wi-Fi Aware服务名是指Wi-Fi Aware服务的标识,通过该Wi-Fi Aware服务名能够唯一确定Wi-Fi Aware服务,例如在加入游戏战局的场景中,Wi-Fi Aware服务名包括游戏名称、游戏版本号和用于表示提供Wi-Fi Aware服务的服务标识,从设备将根据所需的第一连接信息服务发送Wi-Fi Aware服务名,若主设备通过字符串比对发现自身能够提供的Wi-Fi Aware服务与从设备所需的Wi-Fi Aware服务能够匹配上的,则主设备存在从设备所需的Wi-Fi Aware服务。
在步骤S11-S13中,通过利用BLE蓝牙模块进行主设备和从设备间Wi-Fi Aware设备发现的交互,能够有效降低设备消耗的电池资源,并在设备进行建链之前,预先确定主设备是否存在从设备所需的Wi-Fi Aware服务,可让BLE蓝牙模块无需一直处于激活的状态,有效降低设备消耗的电池资源。
其中,在Wi-Fi Aware设备发现的交互过程中(步骤S11-S13),第一连接信息还包括从设备预配置的Wi-Fi Aware参数,其中,从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;第二连接信息还包括主设备预配置的Wi-Fi Aware参数,其中,主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数。
进一步地,Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括从设备的Wi-Fi Aware管理口MAC地址、从设备的Wi-Fi Aware标识,以及从设备的数据加密预配置信息,Wi-Fi Aware协议中在服务发现发布帧交互的参数包括主设备的Wi-Fi Aware管理口MAC地址、主设备的Wi-Fi Aware标识,以及主设备的数据加密预配置信息。
其中MAC地址(Media Access Control Address)称为局域网地址或物理地址(Physical Address),是一个用来确认网络设备位置的位址。Wi-Fi Aware标识是指能够唯一识别Wi-Fi Aware使用对象的标识,例如可以采用ID的方式表示。数据加密预配置信息是指预先配置的数据加密方式(如数据的加密算法),如主设备获知从设备的数据加密预配置信息,则可根据该数据加密预配置信息解密从从设备获取得到的数据。
可以理解地,主设备和从设备均可包括Wi-Fi Aware管理口MAC地址、Wi-Fi Aware标识、以及数据加密预配置信息等的信息。主设备和从设备可根据这些信息进行数据建链,实现信息交互。
进一步地,第二连接信息还包括主设备的Wi-Fi Aware时间戳,用于同步从设备的时钟。
其中,Wi-Fi Aware时间戳的长度具体可以是8字节长度。每过1微秒,时间戳将自增1。
从图4中可以看出,在从设备确定主设备能够提供所需的Wi-Fi Aware服务后,仍需经历被动监听的过程,来实现时钟同步。在一实施例中,在主设备和从设备间进行Wi-Fi Aware设备发现的交互过程中,其交互的第二连接信息还包括主设备的Wi-Fi Aware时间 戳,从设备可根据该Wi-Fi Aware时间戳将自身的时钟同步为主设备的时钟。可以理解地,当主设备和从设备的时钟一致后,才能够在相同的活动时间窗内进行信息交互。
可以理解地,在现有技术中设备进行Wi-Fi Aware建链的协议时,包括固定的以下步骤:从设备的服务发现订阅和主设备的服务发现发布(服务发现订阅采用服务发现订阅帧的方式传输数据,服务发现发布采用服务发现发布帧的方式传输数据),该两个步骤是为了主设备和从设备建立起信息交互的基础,通过如设备的Wi-Fi Aware管理口MAC地址、Wi-Fi Aware标识等确定与连接设备的信息,使得设备之间能够根据这些信息进行信息交互。需要说明的是,该服务发现订阅和服务发现发布与Wi-Fi Aware设备发现不同,Wi-Fi Aware设备发现是为了确认主设备是否存在从设备所需的Wi-Fi Aware服务,仅是为了预先确定可提供的Wi-Fi Aware服务,以及对应的提供服务的设备是否存在。
可以理解地,在现有技术中由于建链过程采用服务发现订阅和服务发现发布步骤的缘故,使得建链的时长较长,需要经历至少两个活动时间窗才能完成。
在一实施例中,在Wi-Fi Aware设备发现的交互过程中,将主设备和从设备建链的Wi-Fi Aware协议中在服务发现订阅帧交互的参数、Wi-Fi Aware协议中在服务发现发布帧交互的参数也进行了交互,使得从设备在确定主设备是否能提供所需的Wi-Fi Aware服务时,已预先进行Wi-Fi Aware协议中在服务发现订阅帧交互的参数、Wi-Fi Aware协议中在服务发现发布帧交互的参数的交互,可跳过服务发现订阅和服务发现发布的步骤,直接进行后续的建链步骤(步骤S14-S15),从而提高设备间的建链效率。
可以理解地,当主设备存在从设备所需的Wi-Fi Aware服务时,主设备可与从设备直接根据第一连接信息和第二连接信息进行后续的建链操作,无需再间隔至少两个活动时间窗来交互Wi-Fi Aware协议中在服务发现订阅帧交互的参数、Wi-Fi Aware协议中在服务发现发布帧交互的参数。主设备可与从设备,根据如Wi-Fi Aware管理口MAC地址、Wi-Fi Aware标识等的信息完成建链,省去服务发现订阅和服务发现发布的步骤。
进一步地,本方法还具体包括如下步骤:
根据主设备发送到从设备的Wi-Fi Aware时间戳,将从设备时钟的时间戳调整为和主设备的Wi-Fi Aware时间戳一致。
在一实施例中,同步时钟的方式具体可以是将从设备的Wi-Fi Aware时间戳与主设备的Wi-Fi Aware时间戳同步更新,使得从设备的Wi-Fi Aware时间戳和主设备的Wi-Fi Aware时间戳一致。
进一步地,在步骤S15中,即主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链,具体包括:
S211:主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路请求帧是否来自从设备,若是,在下一个活动时间窗,向从设备发送Wi-Fi Aware数据通路回复帧。
S212:从设备接收Wi-Fi Aware数据通路回复帧后,主设备与从设备完成建链。
在一实施例中,主设备需要对Wi-Fi Aware数据通路请求帧的来源进行判断,若判断通过,则回复从设备,具体为向从设备发送Wi-Fi Aware数据通路回复帧。
进一步地,主设备在判断Wi-Fi Aware数据通路请求帧来自从设备之后,还可以根据预设的处理方式,拒绝回复从设备,例如,主设备预先设置了“拒绝与任何设备进行 Wi-Fi Aware建链”的处理方式,则即使确认Wi-Fi Aware数据通路请求帧来自从设备,也不会回复从设备。
S211-S212中,提供了一种主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链的具体实施方式,通过Wi-Fi Aware数据通路请求帧和Wi-Fi Aware数据通路回复帧完成数据建链。
进一步地,如果建链后数据交互的过程中要求进行数据加密,则主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链,具体包括:
S221:主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路请求帧是否来自从设备,若是,在下一个活动时间窗,向从设备发送Wi-Fi Aware数据通路回复帧。
S222:主设备判断从设备预配置的Wi-Fi Aware参数中是否包括从设备的数据加密预配置信息,若存在,主设备等待获取从设备发送的Wi-Fi Aware数据通路确认帧。
S223:从设备判断主设备预配置的Wi-Fi Aware参数中是否包括数据加密预配置信息,若存在,从设备向主设备发送Wi-Fi Aware数据通路确认帧。
S224:主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路确认帧是否来自从设备,若是,主设备向从设备发送Wi-Fi Aware数据通路秘钥安装帧。
S225:从设备接收Wi-Fi Aware数据通路秘钥安装帧,与主设备完成建链。
可以理解地,如果建链后数据交互的过程中要求进行数据加密,则在建链过程中主设备将为从设备提供秘钥安装,具体采用发送Wi-Fi Aware数据通路秘钥安装帧实现,以使从设备能够根据该Wi-Fi Aware数据通路秘钥安装帧完成秘钥安装,主设备和从设备之间可按照两者约定的加密方式进行数据交互。
在步骤S221-S225中,提供了一种主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链的具体实施方式,通过Wi-Fi Aware数据通路请求帧、Wi-Fi Aware数据通路回复帧、Wi-Fi Aware数据通路确认帧和Wi-Fi Aware数据通路秘钥安装帧完成数据建链。
在一实施例中,图5示出了Wi-Fi Aware通过应用程序完成建链的一流程图。
从图5可以看出,本申请通过在Wi-Fi Aware设备发现的过程中,预先交互了主设备和从设备预配置的Wi-Fi Aware参数(先在Wi-Fi模块获取Wi-Fi Aware接口参数,再将接口参数、和设备本身具有的Wi-Fi Aware参数作为第一连接信息或者第二连接信息下发到BLE模块),跳过了虚线框中服务发现订阅和服务发现发布的步骤,直接进行Wi-Fi Aware数据通路请求帧、Wi-Fi Aware数据通路回复帧、Wi-Fi Aware数据通路确认帧、Wi-Fi Aware数据通路秘钥安装帧等Wi-Fi Aware协议中数据帧的交互,完成数据建链,有效提高了的建链效率。
在一实施例中,图6示出了Wi-Fi Aware通过应用程序完成建链的又一流程图,图6中示出的步骤具体如下:
其中,由于本申请涉及的具体技术为Wi-Fi Aware,为简便表示,例如Wi-Fi Aware(NAN)数据通路请求帧可简洁表示为数据通路请求帧,省去前缀。
S301:主设备基于Wi-Fi Aware APK(Android application package,Android应用程序包)在开启应用程序后,从Wi-Fi模块中获取Wi-Fi Aware参数,包括:Wi-Fi Aware管理口MAC地址,Wi-Fi Aware时间戳。
S302:主设备的Wi-Fi Aware APK下发如下第一连接信息到BLE蓝牙模块:可服务的Wi-Fi Aware服务名、Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址,Wi-Fi Aware安全预配置参数,Wi-Fi Aware时间戳。
S303:主设备的BLE蓝牙模块,根据步骤S302下发的第一连接信息,被动监听周边的广播BLE消息,识别是否有匹配可进行服务的Wi-Fi Aware设备。
S303:从设备的Wi-Fi Aware APK从Wi-Fi模块中获取Wi-Fi Aware参数,包括:Wi-Fi Aware管理口MAC地址。
S305:从设备的Wi-Fi Aware APK下发如下第二连接信息到BLE蓝牙模块:期望得到服务的Wi-Fi Aware服务名、Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数。
S306:从设备开启自身的BLE模块,同时根据步骤S305下发的第二连接信息,主动向周边设备广播BLE消息,声明期望获得指定的服务,同时携带自身的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数。
S307:主设备的BLE模块接收到从设备在步骤S306发出的广播BLE报文,匹配到双方的Wi-Fi Aware服务名相同,将从设备消息携带的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数上报到主设备的Wi-Fi Aware APK,主设备的Wi-Fi Aware APK将根据自身策略决定是否响应收到的BLE报文。如果决定响应,则进行步骤S308,否则,返回步骤S303。
其中,主设备的Wi-Fi Aware APK的自身策略包括对黑名单的拒绝响应,以及白名单的响应,若从设备消息携带的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址中任一项存在黑名单中,则主设备决定不响应,返回步骤S303;若从设备消息携带的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址中均存在白名单中,将决定响应,进行步骤S308。
S308:主设备通过BLE蓝牙模块回复从设备的广播,同时携带自身的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数、Wi-Fi Aware时间戳。
S309:从设备收到主设备通过BLE广播回复的报文,然后将报文携带的主设备的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数、Wi-Fi Aware时间戳上报到从设备的Wi-Fi Aware APK。
S310:主设备的Wi-Fi Aware APK通知Wi-Fi模块,在下一个活动时间窗,会有与从设备消息携带的Wi-Fi Aware服务名、Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数均相同的的Wi-Fi Aware设备,来进行Wi-Fi Aware建链。
S311:从设备的Wi-Fi Aware APK通知Wi-Fi模块,根据主设备下发的Wi-Fi Aware时间戳计算出下一个活动时间窗,使用下发的Wi-Fi Aware服务名、Wi-Fi Aware ID、Wi-Fi Aware安全预配置参数,到下发的Wi-Fi Aware管理口MAC地址的Wi-Fi Aware设备,进行Wi-Fi Aware数据建链。
S312:主设备的Wi-Fi模块根据Wi-Fi Aware时钟,在计算出的下一个活动时间窗唤醒,进行被动监听。
S313:从设备的Wi-Fi模块根据Wi-Fi Aware时钟,在计算出的下一个活动时间窗唤醒,根据步骤S311的预配置的Wi-Fi Aware参数,发送数据通路请求帧到主设备,进行数据建链请求。
S314:主设备收到从设备的数据通路请求帧后,判断该数据通路请求帧发出者是否为步骤S310来进行Wi-Fi Aware建链的Wi-Fi Aware设备,如果是,则回复数据通路回复帧,否则返回步骤S312,继续被动监听。
S315:如果从设备接收到主设备回复的数据通路回复帧,则继续发送数据通路确认帧。
S316:如果主设备接收到从设备发来的数据通路确认帧,同时从设备是步骤S314匹配的设备,则回复数据通路秘钥安装帧,此时完成Wi-Fi Aware数据建链。
在步骤S311-S316提供了一种主设备和从设备通过应用程序完成数据建链的具体实施方式,通过在Wi-Fi Aware设备发现的过程中交互预配置的Wi-Fi Aware参数,使得从设备在确定主设备能够提供所需的Wi-Fi Aware服务后,减少原先在被动监听的电池资源消耗,省去服务发现订阅和服务发现发布的过程,有效提高Wi-Fi Aware设备间建链的速度。
在一实施例中,具有Wi-Fi Aware功能的设备可以在没有Wi-Fi、AP或蜂窝网的情况下完成数据交互。
具体地,如图7所示,移动终端A和移动终端B在有限距离内可通过Wi-Fi Aware功能实现设备之间的通信,其中,该Wi-Fi Aware功能的使用包括但不限于以下的方式:
文件分享:可以理解地,用户可以通过移动终端A与移动终端B完成Wi-Fi Aware的数据建链,使得用户可将移动终端B所要获取的文档文件、图片文件、视频文件等通过移动终端A发送过去。具体地,在没有Wi-Fi或者Wi-Fi信号差的地方、如演唱会现场、篮球馆、音乐厅等可采用该Wi-Fi Aware完成建链,实现设备间的连接通信。此外,设备间建链的时长较快,且电池资源消耗较低。
具体地,包括如下步骤:
移动终端A在开启文件分享的相关应用程序后,从Wi-Fi模块中获取Wi-Fi Aware参数,包括:Wi-Fi Aware管理口MAC地址,Wi-Fi Aware时间戳。
移动终端A下发如下预配置的Wi-Fi Aware参数到BLE蓝牙模块:文件分享(文档、图片和视频等)的Wi-Fi Aware服务名、Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址,Wi-Fi Aware安全预配置参数,Wi-Fi Aware时间戳。
移动终端A的BLE蓝牙模块,根据下发的预配置的Wi-Fi Aware参数,被动监听周边的广播BLE消息,识别是否有匹配可进行服务的Wi-Fi Aware设备。
移动终端B从Wi-Fi模块中获取Wi-Fi Aware参数,包括:Wi-Fi Aware管理口MAC地址。
移动终端B下发如下预配置的Wi-Fi Aware参数到BLE蓝牙模块:文件分享的服务名、Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数。
移动终端B开启自身的BLE模块,同时根据步骤下发的预配置的Wi-Fi Aware参数,主动向周边设备广播BLE消息,声明期望获得文件分享的服务,同时携带自身的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数。
移动终端A的BLE模块接收到移动终端B发出的广播BLE报文,匹配到双方文件分享的服务名相同,将移动终端B消息携带的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数上报到移动终端A,移动终端A将根据自身策略决定是 否响应收到的BLE报文。如果决定响应,则继续执行以下剩余步骤,否则,返回被动监听周边的广播BLE消息,识别是否有匹配可进行服务的Wi-Fi Aware设备的步骤。
移动终端A通过BLE蓝牙模块回复移动终端B的广播,同时携带自身的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数、Wi-Fi Aware时间戳。
移动终端B收到移动终端A通过BLE广播回复的报文,然后将报文携带的移动终端A的Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数、Wi-Fi Aware时间戳上报到移动终端B。
移动终端A通知Wi-Fi模块,在下一个活动时间窗,会有与从设备消息携带的文件分享的服务名、Wi-Fi Aware ID、Wi-Fi Aware管理口MAC地址、Wi-Fi Aware安全预配置参数均相同的Wi-Fi Aware设备,来进行Wi-Fi Aware数据建链。
移动终端B通知Wi-Fi模块,根据移动终端A下发的Wi-Fi Aware时间戳计算出下一个活动时间窗,使用下发的文件分享的服务名、Wi-Fi Aware ID、Wi-Fi Aware安全预配置参数,到下发的Wi-Fi Aware管理口MAC地址的Wi-Fi Aware设备,进行Wi-Fi Aware数据建链。
移动终端A的Wi-Fi模块根据Wi-Fi Aware时钟,在计算出的下一个活动时间窗唤醒,进行被动监听。
移动终端B的Wi-Fi模块根据Wi-Fi Aware时钟,在计算出的下一个活动时间窗唤醒,发送数据通路请求帧到移动终端A,进行数据建链请求。
移动终端A收到移动终端B的数据通路请求帧后,判断该数据通路请求帧发出者是否为移动终端B,如果是,则回复数据通路回复帧,否则移动终端A的Wi-Fi模块根据Wi-Fi Aware时钟,在计算出的下一个活动时间窗唤醒,进行被动监听的步骤。
如果移动终端B接收到移动终端A回复的数据通路回复帧,则继续发送数据通路确认帧。
如果移动终端A接收到移动终端B发来的数据通路确认帧,同时移动终端B确认匹配成功,则回复数据通路秘钥安装帧,此时完成Wi-Fi Aware数据建链。
进一步地,Wi-Fi Aware功能的使用还包括如加入游戏战局的方式。可以理解地,有些游戏是需要联网对战的,在没有Wi-Fi等网络的情况下,可以采用Wi-Fi Aware功能实现联网。具体地,提供游戏战局加入也是一种可提供的服务,而加入游戏战局则为一种设备所期望的Wi-Fi Aware服务。例如,移动终端A通过Wi-Fi Aware提供了加入游戏战局的服务,则移动终端B的用户若要与移动终端A的用户一同联网玩游戏,则可通过Wi-Fi Aware表明移动终端B所期望的服务-加入游戏战局。具体Wi-Fi Aware建链的步骤与上述文件分享的Wi-Fi Aware建链步骤类似,在此不再赘述。同样地,在本实施例中可在服务发现的过程中便获取原本服务发现订阅和服务发现发布步骤交互的信息、时钟同步信息,使得在实现Wi-Fi Aware建链的过程中,设备间建链的时长较快,且电池资源消耗较低。
在本申请实施例中,主设备与从设备进行设备发现的交互,以确定主设备是否能提供从设备所需的Wi-Fi Aware服务,当主设备能够提供从设备所需的Wi-Fi Aware服务时,从设备才会与主设备进行下一步的建链步骤;其中,在Wi-Fi Aware设备发现的交互过程中,利用第一连接信息和第二连接信息的交互,在设备发现过程中便得到主设备和从设备 在现有技术建链步骤中,Wi-Fi Aware协议中在服务发现订阅帧和服务发现发布帧交互的参数。在Wi-Fi Aware设备发现阶段已得到Wi-Fi Aware协议中在服务发现订阅帧和服务发现发布帧交互的参数的情况下,主设备和从设备能够跳过服务发现订阅和服务发现发布的步骤,更快地完成Wi-Fi Aware的建链,有效提高Wi-Fi Aware设备间建链的速度。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
基于实施例中所提供的Wi-Fi Aware的建链方法,本申请实施例进一步给出实现上述方法实施例中各步骤及方法的系统。该Wi-Fi Aware的建链系统包括主设备和从设备,其中,主设备用于执行如下步骤:
主设备接收从设备发送的第一连接信息,其中,第一连接信息包括从设备所需的Wi-Fi Aware服务名,第一连接信息还包括从设备预配置的Wi-Fi Aware参数,其中,从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
主设备根据从设备所需的Wi-Fi Aware服务名,发送第二连接信息给从设备,其中,第二连接信息包括确认信息,确认信息为主设备确认存在从设备所需的Wi-Fi Aware服务名的通知信息,从设备根据确认信息确认主设备存在从设备所需的Wi-Fi Aware服务名,第二连接信息还包括主设备预配置的Wi-Fi Aware参数,其中,主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
主设备获取从设备发送的Wi-Fi Aware数据通路请求帧;
主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链。
进一步地,主设备接收从设备发送的第一连接信息,包括:
主设备基于BLE蓝牙模块广播的功能,接收从设备发送的第一连接信息。
进一步地,第二连接信息还包括主设备的Wi-Fi Aware时间戳,用于同步从设备的时钟。
进一步地,该方法还包括:
主设备根据发送到从设备的Wi-Fi Aware时间戳,将从设备时钟的时间戳调整为和主设备的Wi-Fi Aware时间戳一致。
进一步地,Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括从设备的Wi-Fi Aware管理口MAC地址、从设备的Wi-Fi Aware标识,以及从设备的数据加密预配置信息,Wi-Fi Aware协议中在服务发现发布帧交互的参数包括主设备的Wi-Fi Aware管理口MAC地址、主设备的Wi-Fi Aware标识,以及主设备的数据加密预配置信息。
进一步地,主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链,包括:
主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路请求帧是否来自从设备,若是,在下一个活动时间窗,向从设备发送Wi-Fi Aware数据通路回复帧;
在从设备接收Wi-Fi Aware数据通路回复帧后,主设备与从设备完成建链。
进一步地,主设备基于Wi-Fi Aware数据通路请求帧与从设备完成建链,包括:
主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路请求帧是否来自从设备,若是,在下一个活动时间窗,向从设备发送Wi-Fi Aware数据通路回复帧;
主设备判断从设备预配置的Wi-Fi Aware参数中是否包括从设备的数据加密预配置信息,若存在,主设备获取从设备发送的Wi-Fi Aware数据通路确认帧;
主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路确认帧是否来自从设备,若是,主设备向从设备发送Wi-Fi Aware数据通路秘钥安装帧;
在从设备接收Wi-Fi Aware数据通路秘钥安装帧后,主设备与从设备完成建链。
从设备用于执行如下步骤:
从设备向主设备发送第一连接信息,其中,第一连接信息包括从设备所需的Wi-Fi Aware服务名,第一连接信息还包括从设备预配置的Wi-Fi Aware参数,其中,从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
从设备接收主设备发送的第二连接信息,其中,第二连接信息包括确认信息,确认信息为主设备确认存在从设备所需的Wi-Fi Aware服务名的通知信息,第二连接信息还包括主设备预配置的Wi-Fi Aware参数,其中,主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
从设备根据确认信息确认主设备存在从设备所需的Wi-Fi Aware服务名;
从设备向主设备发送Wi-Fi Aware数据通路请求帧,并基于Wi-Fi Aware数据通路请求帧与主设备完成建链。
进一步地,从设备向主设备发送第一连接信息,包括:
从设备基于BLE蓝牙模块广播的功能,向主设备发送第一连接信息。
进一步地,第二连接信息还包括主设备的Wi-Fi Aware时间戳,用于同步从设备的时钟。
进一步地,该方法还包括:
从设备根据接收的主设备的Wi-Fi Aware时间戳,将时钟的时间戳调整为和主设备的Wi-Fi Aware时间戳一致。
进一步地,Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括从设备的Wi-Fi Aware管理口MAC地址、从设备的Wi-Fi Aware标识,以及从设备的数据加密预配置信息,Wi-Fi Aware协议中在服务发现发布帧交互的参数包括主设备的Wi-Fi Aware管理口MAC地址、主设备的Wi-Fi Aware标识,以及主设备的数据加密预配置信息。
进一步地,基于Wi-Fi Aware数据通路请求帧与主设备完成建链,包括:
从设备向主设备发送Wi-Fi Aware数据通路请求帧;
在主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路请求帧来自从设备后,在下一个活动时间窗,从设备接收主设备发送的Wi-Fi Aware数据通路回复帧,与主设备完成建链。
进一步地,基于Wi-Fi Aware数据通路请求帧与主设备完成建链,包括:
从设备向主设备发送Wi-Fi Aware数据通路请求帧;
在主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路请求帧来自从设备后,在下一个活动时间窗,从设备接收主设备发送的Wi-Fi Aware数据通路回复帧;
从设备判断主设备预配置的Wi-Fi Aware参数中是否包括数据加密预配置信息,若存在,从设备在接收主设备发送的Wi-Fi Aware数据通路回复帧后,向主设备发送Wi-Fi Aware数据通路确认帧;
在主设备根据从设备预配置的Wi-Fi Aware参数判断Wi-Fi Aware数据通路确认帧来自从设备后,从设备接收主设备发送的Wi-Fi Aware数据通路秘钥安装帧,与主设备完成建链。
可以理解地,在现有技术中,Wi-Fi Aware协议中在服务发现订阅帧交互的参数、Wi-Fi Aware协议中在服务发现发布帧交互的参数需通过Wi-Fi Aware协议中服务发现订阅和服务发现发布交互的步骤得到,而在本申请实施例中,将Wi-Fi Aware协议中在服务发现订阅帧交互的参数、Wi-Fi Aware协议中在服务发现发布帧交互的参数在Wi-Fi Aware设备发现的过程中便进行交互,可令主设备和从设备跳过服务发现订阅和服务发现发布交互的步骤,直接根据第一连接信息和第二连接信息进行数据建链,有效提高了建链的速度。
在本申请实施例中,主设备与从设备进行设备发现的交互,以确定主设备是否能提供从设备所需的Wi-Fi Aware服务,当主设备能够提供从设备所需的Wi-Fi Aware服务时,从设备才会与主设备进行下一步的建链步骤;其中,在Wi-Fi Aware设备发现的交互过程中,利用第一连接信息和第二连接信息的交互,在设备发现过程中便得到主设备和从设备在现有技术建链步骤中,Wi-Fi Aware协议中在服务发现订阅帧和服务发现发布帧交互的参数。在Wi-Fi Aware设备发现阶段已得到Wi-Fi Aware协议中在服务发现订阅帧和服务发现发布帧交互的参数的情况下,主设备和从设备能够跳过服务发现订阅和服务发现发布的步骤,更快地完成Wi-Fi Aware的建链,有效提高Wi-Fi Aware设备间建链的速度。
本实施例提供一计算机可读存储介质,该计算机可读存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现实施例中建链方法,为避免重复,此处不一一赘述。或者,该计算机可读指令被处理器执行时实现实施例中建链装置中各模块/单元的功能,为避免重复,此处不一一赘述。
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可对前述各实施例所存储的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围内。

Claims (24)

  1. 一种Wi-Fi Aware的建链方法,包括:
    主设备接收从设备发送的第一连接信息,其中,所述第一连接信息包括所述从设备所需的Wi-Fi Aware服务名,所述第一连接信息还包括所述从设备预配置的Wi-Fi Aware参数,其中,所述从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
    所述主设备根据所述从设备所需的Wi-Fi Aware服务名,发送第二连接信息给所述从设备,其中,所述第二连接信息包括确认信息,所述确认信息为所述主设备确认存在所述从设备所需的Wi-Fi Aware服务名的通知信息,所述从设备根据所述确认信息确认所述主设备存在所述从设备所需的Wi-Fi Aware服务名,所述第二连接信息还包括所述主设备预配置的Wi-Fi Aware参数,其中,所述主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
    所述主设备获取所述从设备发送的Wi-Fi Aware数据通路请求帧;
    所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链。
  2. 根据权利要求1所述的方法,其特征在于,所述主设备接收所述从设备发送的第一连接信息,包括:
    所述主设备基于BLE蓝牙模块广播的功能,接收所述从设备发送的第一连接信息。
  3. 根据权利要求1所述的方法,其特征在于,所述第二连接信息还包括所述主设备的Wi-Fi Aware时间戳,用于同步从设备的时钟。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    所述主设备根据发送到所述从设备的Wi-Fi Aware时间戳,将所述从设备时钟的时间戳调整为和所述主设备的Wi-Fi Aware时间戳一致。
  5. 根据权利要求1所述的方法,其特征在于,所述Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括所述从设备的Wi-Fi Aware管理口MAC地址、所述从设备的Wi-Fi Aware标识,以及所述从设备的数据加密预配置信息,所述Wi-Fi Aware协议中在服务发现发布帧交互的参数包括所述主设备的Wi-Fi Aware管理口MAC地址、所述主设备的Wi-Fi Aware标识,以及所述主设备的数据加密预配置信息。
  6. 根据权利要求1所述的方法,其特征在于,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
    所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
    在所述从设备接收Wi-Fi Aware数据通路回复帧后,所述主设备与所述从设备完成建链。
  7. 根据权利要求1-5任一项所述的方法,其特征在于,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
    所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
    所述主设备判断所述从设备预配置的Wi-Fi Aware参数中是否包括所述从设备的数据加密预配置信息,若存在,所述主设备获取所述从设备发送的Wi-Fi Aware数据通路确认帧;
    所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路确认帧是否来自所述从设备,若是,所述主设备向所述从设备发送Wi-Fi Aware数据通路秘钥安装帧;
    在所述从设备接收Wi-Fi Aware数据通路秘钥安装帧后,所述主设备与所述从设备完成建链。
  8. 一种Wi-Fi Aware的建链方法,包括:
    从设备向主设备发送第一连接信息,其中,所述第一连接信息包括所述从设备所需的Wi-Fi Aware服务名,所述第一连接信息还包括所述从设备预配置的Wi-Fi Aware参数,其中,所述从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
    所述从设备接收所述主设备发送的第二连接信息,其中,所述第二连接信息包括确认信息,所述确认信息为所述主设备确认存在所述从设备所需的Wi-Fi Aware服务名的通知信息,所述第二连接信息还包括所述主设备预配置的Wi-Fi Aware参数,其中,所述主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
    从设备根据所述确认信息确认所述主设备存在所述从设备所需的Wi-Fi Aware服务名;
    从设备向所述主设备发送Wi-Fi Aware数据通路请求帧,并基于所述Wi-Fi Aware数据通路请求帧与所述主设备完成建链。
  9. 根据权利要求8所述的方法,其特征在于,所述从设备向所述主设备发送第一连接信息,包括:
    所述从设备基于BLE蓝牙模块广播的功能,向所述主设备发送第一连接信息。
  10. 根据权利要求8所述的方法,其特征在于,所述第二连接信息还包括所述主设备的Wi-Fi Aware时间戳,用于同步所述从设备的时钟。
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:
    所述从设备根据接收的所述主设备的Wi-Fi Aware时间戳,将时钟的时间戳调整为和所述主设备的Wi-Fi Aware时间戳一致。
  12. 根据权利要求8所述的方法,其特征在于,所述Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括所述从设备的Wi-Fi Aware管理口MAC地址、所述从设备的Wi-Fi Aware标识,以及所述从设备的数据加密预配置信息,所述Wi-Fi Aware协议中在服务发现发布帧交互的参数包括所述主设备的Wi-Fi Aware管理口MAC地址、所述主设备的Wi-Fi Aware标识,以及所述主设备的数据加密预配置信息。
  13. 根据权利要求8所述的方法,其特征在于,所述基于所述Wi-Fi Aware数据通路请求帧与所述主设备完成建链,包括:
    所述从设备向所述主设备发送Wi-Fi Aware数据通路请求帧;
    在所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧来自所述从设备后,在下一个活动时间窗,所述从设备接收所述主设备发送的Wi-Fi Aware数据通路回复帧,与所述主设备完成建链。
  14. 根据权利要求8-13任一项所述的方法,其特征在于,所述基于所述Wi-Fi Aware数据通路请求帧与所述主设备完成建链,包括:
    所述从设备向所述主设备发送Wi-Fi Aware数据通路请求帧;
    在所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧来自所述从设备后,在下一个活动时间窗,所述从设备接收所述主设备发送的Wi-Fi Aware数据通路回复帧;
    所述从设备判断所述主设备预配置的Wi-Fi Aware参数中是否包括数据加密预配置信息,若存在,所述从设备在接收所述主设备发送的Wi-Fi Aware数据通路回复帧后,向所述主设备发送Wi-Fi Aware数据通路确认帧;
    在所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路确认帧来自所述从设备后,从设备接收所述主设备发送的Wi-Fi Aware数据通路秘钥安装帧,与所述主设备完成建链。
  15. 一种Wi-Fi Aware的建链方法,包括:
    从设备向主设备发送第一连接信息,其中,所述第一连接信息包括所述从设备所需的Wi-Fi Aware服务名,所述第一连接信息还包括所述从设备预配置的Wi-Fi Aware参数,其中,所述从设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现订阅帧交互的参数;
    所述主设备接收所述从设备发送的第一连接信息;
    所述主设备根据所述从设备所需的Wi-Fi Aware服务名,发送第二连接信息给所述从设备,其中,所述第二连接信息包括确认信息,所述确认信息为所述主设备确认存在所述从设备所需的Wi-Fi Aware服务名的通知信息,所述第二连接信息还包括所述主设备预配置的Wi-Fi Aware参数,其中,所述主设备预配置的Wi-Fi Aware参数包括Wi-Fi Aware协议中在服务发现发布帧交互的参数;
    所述从设备接收所述主设备发送的第二连接信息,根据所述确认信息确认所述主设备存在所述从设备所需的Wi-Fi Aware服务名;
    所述从设备向所述主设备发送Wi-Fi Aware数据通路请求帧;
    所述主设备获取所述从设备发送的Wi-Fi Aware数据通路请求帧;
    所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链。
  16. 根据权利要求15所述的方法,其特征在于,所述从设备向所述主设备发送第一连接信息,包括:
    所述从设备基于BLE蓝牙模块广播的功能,向所述主设备发送第一连接信息。
  17. 根据权利要求15所述的方法,其特征在于,所述第二连接信息还包括所述主设备的Wi-Fi Aware时间戳,用于同步所述从设备的时钟。
  18. 根据权利要求17所述的方法,其特征在于,所述方法还包括:
    所述主设备发送Wi-Fi Aware时间戳给所述从设备;
    所述从设备根据接收的所述主设备的Wi-Fi Aware时间戳,将时钟的时间戳调整为和所述主设备的Wi-Fi Aware时间戳一致。
  19. 根据权利要求15所述的方法,其特征在于,所述Wi-Fi Aware协议中在服务发现订阅帧交互的参数包括所述从设备的Wi-Fi Aware管理口MAC地址、所述从设备的Wi-Fi Aware标识,以及所述从设备的数据加密预配置信息,所述Wi-Fi Aware协议中在服务发现发布帧交互的参数包括所述主设备的Wi-Fi Aware管理口MAC地址、所述主设备的Wi-Fi Aware标识,以及所述主设备的数据加密预配置信息。
  20. 根据权利要求15所述的方法,其特征在于,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
    所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
    所述从设备接收Wi-Fi Aware数据通路回复帧,所述主设备与所述从设备完成建链。
  21. 根据权利要求15所述的方法,其特征在于,所述主设备基于所述Wi-Fi Aware数据通路请求帧与所述从设备完成建链,包括:
    所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路请求帧是否来自所述从设备,若是,在下一个活动时间窗,向所述从设备发送Wi-Fi Aware数据通路回复帧;
    所述主设备判断所述从设备预配置的Wi-Fi Aware参数中是否包括所述从设备的数据加密预配置信息,若存在,所述主设备等待获取所述从设备发送的Wi-Fi Aware数据通路确认帧;
    所述从设备判断所述主设备预配置的Wi-Fi Aware参数中是否包括数据加密预配置信息,若存在,所述从设备向所述主设备发送Wi-Fi Aware数据通路确认帧;
    所述主设备根据所述从设备预配置的Wi-Fi Aware参数判断所述Wi-Fi Aware数据通路确认帧是否来自所述从设备,若是,所述主设备向所述从设备发送Wi-Fi Aware数据通路秘钥安装帧;
    所述从设备接收Wi-Fi Aware数据通路秘钥安装帧,所述主设备与所述从设备完成建链。
  22. 一种Wi-Fi Aware的建链系统,包括主设备和从设备,其中,所述主设备用于执行权利要求1-7任一项所述的方法,所述从设备用于执行权利要求8-14任一项所述的方法。
  23. 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如权利要求1至7任一项所述方法的步骤,或者,所述处理器执行所述计算机可读指令时实现如权利要求8至14任一项所述方法的步骤。
  24. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如权利要求1至7任一项所述方法的步骤,或者,所述计算机可读指令被处理器执行时实现如权利要求8至14任一项所述方法的步骤。
PCT/CN2021/080097 2020-03-18 2021-03-11 Wi-Fi Aware的建链方法、系统、电子设备和存储介质 WO2021185141A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21771161.3A EP4110004A4 (en) 2020-03-18 2021-03-11 WI-FI AWARENESS CONNECTIVITY METHOD AND SYSTEM, ELECTRONIC DEVICE AND STORAGE MEDIA
US17/906,518 US20230129780A1 (en) 2020-03-18 2021-03-11 Wi-Fi Aware Link Establishment Method and System, Electronic Device, and Storage Medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010191809.2 2020-03-18
CN202010191809.2A CN111405681B (zh) 2020-03-18 2020-03-18 Wi-Fi Aware的建链方法、系统、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2021185141A1 true WO2021185141A1 (zh) 2021-09-23

Family

ID=71413385

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080097 WO2021185141A1 (zh) 2020-03-18 2021-03-11 Wi-Fi Aware的建链方法、系统、电子设备和存储介质

Country Status (4)

Country Link
US (1) US20230129780A1 (zh)
EP (1) EP4110004A4 (zh)
CN (1) CN111405681B (zh)
WO (1) WO2021185141A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604694A (zh) * 2022-11-30 2023-01-13 深圳开鸿数字产业发展有限公司(Cn) 基于WiFi-Aware协议的通信方法、轻设备及可读存储介质

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111405681B (zh) * 2020-03-18 2023-11-21 华为技术有限公司 Wi-Fi Aware的建链方法、系统、电子设备和存储介质
CN111935887A (zh) * 2020-08-11 2020-11-13 Tcl通讯(宁波)有限公司 路灯控制方法、装置、存储介质及系统
JP2023543182A (ja) * 2020-09-19 2023-10-13 華為技術有限公司 通信リンク開始方法及び装置
CN112888029B (zh) * 2021-02-03 2022-08-09 惠州Tcl移动通信有限公司 一种通信方法、计算机设备及计算机可读存储介质
CN112788700A (zh) * 2021-02-25 2021-05-11 芜湖美的厨卫电器制造有限公司 通信方法、终端和可读存储介质
CN115801398A (zh) * 2022-11-15 2023-03-14 联想(北京)有限公司 一种数据处理方法及设备
CN118102272A (zh) * 2022-11-28 2024-05-28 华为技术有限公司 一种设备发现方法、设备及系统
CN116471707B (zh) * 2023-02-21 2024-03-29 荣耀终端有限公司 一种路由器的连接方法、装置及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150319092A1 (en) * 2014-05-02 2015-11-05 Benu Networks, Inc. CONTENT AWARE WI-FI QoS
CN106233700A (zh) * 2014-05-02 2016-12-14 高通股份有限公司 用于将蓝牙设备集成到邻居感知网络中的方法和装置
WO2017113176A1 (zh) * 2015-12-30 2017-07-06 华为技术有限公司 临近感知网络nan中用于服务发现的方法和终端设备
CN108260188A (zh) * 2018-02-28 2018-07-06 惠州Tcl移动通信有限公司 一种Wi-Fi连接控制方法及系统
CN111405681A (zh) * 2020-03-18 2020-07-10 华为技术有限公司 Wi-Fi Aware的建链方法、系统、电子设备和存储介质

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104144465B (zh) * 2013-05-08 2017-12-15 华为终端有限公司 一种服务发现方法及装置
US20160234301A1 (en) * 2015-02-11 2016-08-11 Emily H. Qi Methods, Systems, and Devices for Bluetooth Low Energy Discovery
US10681152B2 (en) * 2015-03-16 2020-06-09 Lg Electronics Inc. Method and device for supporting service by using application service platform in wireless communication system
US20160323925A1 (en) * 2015-04-30 2016-11-03 Nokia Technologies Oy Method, apparatus, and computer program product for inter-ap communication in neighbor awareness networking environment
US10111260B2 (en) * 2015-06-19 2018-10-23 Intel IP Corporation Radio resource allocation in Wi-Fi aware neighborhood area network data links
US10218797B2 (en) * 2016-06-06 2019-02-26 Intel IP Corporation Communicating routing messages using service discovery in neighbor awareness networks
US10375562B2 (en) * 2016-08-31 2019-08-06 Qualcomm Incorporated Exchanging a recommendation of a set of D2D rat types for a proximity-based service and searching for a binary code that identifies a proximity-based service on at least one D2D rat type in accordance with a D2D rat sequence
CN106851775A (zh) * 2017-02-03 2017-06-13 惠州Tcl移动通信有限公司 基于Wi‑FiAware协议的互连方法及系统
WO2018186919A1 (en) * 2017-04-07 2018-10-11 Intel Corporation Neighbor awareness networking services indication
CN109246658B (zh) * 2017-06-30 2021-09-10 上海掌门科技有限公司 一种无流量数据传输的方法及设备
US20190098483A1 (en) * 2017-11-27 2019-03-28 Intel IP Corporation Enhanced bluetooth mechanism for triggering wi-fi radios
CN109068370A (zh) * 2018-06-27 2018-12-21 努比亚技术有限公司 通信方法、移动终端及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150319092A1 (en) * 2014-05-02 2015-11-05 Benu Networks, Inc. CONTENT AWARE WI-FI QoS
CN106233700A (zh) * 2014-05-02 2016-12-14 高通股份有限公司 用于将蓝牙设备集成到邻居感知网络中的方法和装置
WO2017113176A1 (zh) * 2015-12-30 2017-07-06 华为技术有限公司 临近感知网络nan中用于服务发现的方法和终端设备
CN108260188A (zh) * 2018-02-28 2018-07-06 惠州Tcl移动通信有限公司 一种Wi-Fi连接控制方法及系统
CN111405681A (zh) * 2020-03-18 2020-07-10 华为技术有限公司 Wi-Fi Aware的建链方法、系统、电子设备和存储介质

Non-Patent Citations (1)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604694A (zh) * 2022-11-30 2023-01-13 深圳开鸿数字产业发展有限公司(Cn) 基于WiFi-Aware协议的通信方法、轻设备及可读存储介质
CN115604694B (zh) * 2022-11-30 2023-05-16 深圳开鸿数字产业发展有限公司 基于WiFi-Aware协议的通信方法、轻设备及可读存储介质

Also Published As

Publication number Publication date
EP4110004A4 (en) 2023-08-02
EP4110004A1 (en) 2022-12-28
US20230129780A1 (en) 2023-04-27
CN111405681A (zh) 2020-07-10
CN111405681B (zh) 2023-11-21

Similar Documents

Publication Publication Date Title
WO2021185141A1 (zh) Wi-Fi Aware的建链方法、系统、电子设备和存储介质
WO2020133183A1 (zh) 音频数据的同步方法及设备
WO2022257977A1 (zh) 电子设备的投屏方法和电子设备
WO2021027666A1 (zh) 一种蓝牙回连的方法及相关装置
EP4084486B1 (en) Cross-device content projection method, and electronic device
CN113923230B (zh) 数据同步方法、电子设备和计算机可读存储介质
WO2021043046A1 (zh) 一种资源管控方法及设备
WO2021175300A1 (zh) 数据传输方法、装置、电子设备和可读存储介质
WO2022033320A1 (zh) 蓝牙通信方法、终端设备及计算机可读存储介质
WO2021043219A1 (zh) 一种蓝牙回连方法及相关装置
WO2021017909A1 (zh) 一种通过nfc标签实现功能的方法、电子设备及系统
WO2021043198A1 (zh) 一种蓝牙配对方法及相关装置
US20230297414A1 (en) Task Processing Method and Related Apparatus
EP3923617A1 (en) Method for reducing power consumption of mobile terminal and mobile terminal
WO2021197071A1 (zh) 无线通信系统及方法
WO2022042637A1 (zh) 一种蓝牙数据传输方法及相关装置
WO2020134868A1 (zh) 一种连接建立方法及终端设备
CN113676339A (zh) 组播方法、装置、终端设备及计算机可读存储介质
WO2021043250A1 (zh) 一种蓝牙通信方法及相关装置
WO2021239144A1 (zh) 定位方法和相关装置
WO2024093614A1 (zh) 设备输入方法、系统、电子设备及存储介质
WO2023138533A1 (zh) 业务协同方法、电子设备、可读存储介质和芯片系统
WO2023160177A1 (zh) 测距方法、装置、系统及可读存储介质
WO2023226881A1 (zh) 一种设备注册方法、系统和设备
WO2024055881A1 (zh) 时钟同步方法、电子设备、系统及存储介质

Legal Events

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

Ref document number: 21771161

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021771161

Country of ref document: EP

Effective date: 20220921

NENP Non-entry into the national phase

Ref country code: DE