WO2022063109A1 - 一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质 - Google Patents

一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2022063109A1
WO2022063109A1 PCT/CN2021/119554 CN2021119554W WO2022063109A1 WO 2022063109 A1 WO2022063109 A1 WO 2022063109A1 CN 2021119554 W CN2021119554 W CN 2021119554W WO 2022063109 A1 WO2022063109 A1 WO 2022063109A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
memory
preset
connection information
channel
Prior art date
Application number
PCT/CN2021/119554
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
Priority claimed from CN202011315060.4A external-priority patent/CN114286423A/zh
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022063109A1 publication Critical patent/WO2022063109A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • 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]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a Wi-Fi P2P connection method, an electronic device, and a computer-readable storage medium.
  • Wi-Fi P2P In the absence of a local area network or the Internet, Wi-Fi P2P still supports the interconnection between two devices and high-speed data transmission, so Wi-Fi P2P is widely used in areas such as wireless screen projection and file sharing.
  • the existing Wi-Fi P2P takes a long time and is unstable in the connection establishment stage of two devices, and the user experience is not good.
  • the present application provides a Wi-Fi P2P connection method, an electronic device and a computer-readable storage medium, which can reduce the time-consuming time in the connection establishment phase of the two devices and maintain the stability of the time-consuming time. , to improve the user experience.
  • an electronic device in a first aspect, includes: a processor; a memory; and a computer program, wherein the computer program is stored on the memory, and when the computer program is executed by the processor, causes the electronic device to perform: receiving one input; in response to the input, obtaining another The identification of the electronic device; after obtaining the Wi-Fi P2P connection information corresponding to the identification of another electronic device from a preset memory other than the memory according to the identification of the electronic device, based on the Wi-Fi P2P connection information , establishes a Wi-Fi P2P connection with another electronic device; wherein, the preset memory is located in the electronic device; or, the preset memory is located outside the electronic device and on a device associated with the electronic device.
  • the electronic device may be a mobile device.
  • the above-mentioned preset memory may also be the above-mentioned memory storing the above-mentioned computer program.
  • the above-mentioned memory for storing the above-mentioned computer program may be an area of a certain storage unit; the preset memory may be another area of the certain storage unit; for example, the above-mentioned memory for storing the above-mentioned computer program may be a hard disk.
  • the preset memory may be the D disk in the hard disk; wherein, the C disk and the D disk are only schematic examples.
  • the electronic device can acquire the identity of the other electronic device according to the identity of the other electronic device and its corresponding Wi-Fi P2P connection information pre-stored in the preset memory Corresponding Wi-Fi P2P connection information; thus, according to the Wi-Fi P2P connection information, quickly establish a Wi-Fi P2P connection with another electronic device.
  • the process of full-channel scanning is omitted, a lot of time is saved, the time-consuming Wi-Fi P2P connection between two devices is reduced, the efficiency of Wi-Fi P2P connection is improved, and the Wi-Fi P2P connection between the two devices is improved.
  • the time-consuming time of Fi P2P connection is also stable, which improves the user experience.
  • the electronic device further executes: after the Wi-Fi P2P connection information corresponding to the identification of another electronic device cannot be obtained from a preset memory other than the memory according to the identification of the electronic device, the electronic device can The frequency bands supported by the device perform full-channel scanning in sequence. In this way, even if the identifier of another electronic device and its corresponding Wi-Fi P2P connection information are not pre-stored in the preset memory, an all-channel scanning method is provided to ensure the Wi-Fi between the electronic device and the other electronic device. -Fi P2P connection.
  • the electronic device further performs: in the full-channel scan, a message of another electronic device is received on one channel; After the identification and the Wi-Fi P2P connection information, the identification of the other electronic device and the Wi-Fi P2P connection information are stored in the preset memory in a corresponding manner; based on the Wi-Fi P2P connection information, establish with another electronic device. Wi-Fi P2P connection.
  • the identification of another electronic device and its corresponding Wi-Fi P2P connection information are obtained through full-channel scanning, they are stored in the preset memory, which is convenient for the next time the electronic device and the other electronic device are established.
  • the Wi-Fi P2P connection there is no need to go through the full channel scanning method, but to obtain the Wi-Fi P2P connection information corresponding to another electronic device by querying from the preset memory, thereby saving a lot of time in the future.
  • the electronic device further performs: before receiving the input, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel; The initial setting message of another electronic device; after the initial setting message includes the identity of the other electronic device and the Wi-Fi P2P connection information, the identity of the other electronic device and the Wi-Fi P2P connection information are stored in a corresponding manner.
  • a preset memory wherein, the preset channel of the electronic device is associated with the preset channel of another electronic device.
  • the electronic device stores the identifier of another electronic device and its corresponding Wi-Fi P2P connection information in the preset memory through this step.
  • a foundation is laid for obtaining the Wi-Fi P2P connection information corresponding to the identification of another electronic device by querying the preset memory in the future.
  • the Wi-Fi P2P connection information corresponding to the identifier of another electronic device is obtained from a preset memory other than the memory; including: from the memory The preset memory other than the memory, obtains the Wi-Fi P2P connection information with the latest storage time among the multiple Wi-Fi P2P connection information corresponding to the identifier of another electronic device.
  • the Wi-Fi with the latest (latest) storage time can be selected by querying the storage time obtained. P2P connection information to avoid using previous Wi-Fi P2P connection information.
  • the identification of another electronic device and the Wi-Fi P2P connection information are stored in a preset memory in a corresponding manner; including: storing another electronic device
  • the identification of the electronic device, the Wi-Fi P2P connection information and the storage time are stored in the preset memory in a corresponding manner.
  • the storage time is a current time stored in a preset memory.
  • a Wi-Fi P2P connection method is provided.
  • the method is applied to an electronic device, and the method includes: receiving an input; in response to the input, obtaining an identification of another electronic device; After obtaining the Wi-Fi P2P connection information corresponding to the identification of another electronic device, based on the Wi-Fi P2P connection information, establish a Wi-Fi P2P connection with another electronic device; wherein, the preset memory is located in the electronic device; Alternatively, the preset memory is located outside the electronic device and on a device associated with the electronic device.
  • the electronic device may be a mobile device.
  • the above-mentioned preset memory may also be the above-mentioned memory storing the above-mentioned computer program.
  • the above-mentioned memory for storing the above-mentioned computer program may be an area of a certain storage unit; the preset memory may be another area of the certain storage unit; for example, the above-mentioned memory for storing the above-mentioned computer program may be a hard disk.
  • the preset memory may be the D disk in the hard disk; wherein, the C disk and the D disk are only schematic examples.
  • the method further includes: after the Wi-Fi P2P connection information corresponding to the identification of the other electronic device cannot be obtained from a preset memory other than the memory according to the identification of the other electronic device, the The electronic device sequentially scans the frequency bands supported by the electronic device on an all-channel basis.
  • the method further includes: in the full-channel scanning, receiving a message of another electronic device on one channel; After the identification and the Wi-Fi P2P connection information, the identification of the other electronic device and the Wi-Fi P2P connection information are stored in the preset memory in a corresponding manner; The device establishes a Wi-Fi P2P connection.
  • the method further includes: before receiving the input, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel; receiving The initial setting message to another electronic device; after the initial setting message contains the identity of the other electronic device and the Wi-Fi P2P connection information, the identity of the other electronic device and the Wi-Fi P2P connection information are stored in the corresponding manner.
  • the preset channel of the electronic device is associated with the preset channel of another electronic device.
  • the Wi-Fi P2P connection information corresponding to the identification of another electronic device is obtained; including: from the memory The preset memory other than the memory, obtains the Wi-Fi P2P connection information with the latest storage time among the multiple Wi-Fi P2P connection information corresponding to the identifier of another electronic device.
  • the Wi-Fi with the latest (latest) storage time can be selected by querying the storage time obtained. P2P connection information to avoid using previous Wi-Fi P2P connection information.
  • the identification of the other electronic device and the Wi-Fi P2P connection information are stored in a preset memory in a corresponding manner; including: storing another electronic device
  • the identification of the electronic device, the Wi-Fi P2P connection information and the storage time are stored in the preset memory in a corresponding manner.
  • the storage time is the current time stored in the preset memory.
  • the Wi-Fi P2P connection information includes: a channel, authentication information and a MAC address of another electronic device; the preset channel of the electronic device is related to the other electronic device.
  • the preset channels of an electronic device are the same.
  • the authentication information is a key or a certificate.
  • the second aspect and any implementation manner of the second aspect correspond to the first aspect and any implementation manner of the first aspect, respectively.
  • the technical effects corresponding to the second aspect and any implementation manner of the second aspect reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
  • a computer-readable storage medium includes a computer program, which when executed on an electronic device, causes the electronic device to perform the method of the second aspect and any one of the implementations of the second aspect.
  • a computer program product When running on a computer, the computer is caused to perform the method of the second aspect and any one of the implementations of the second aspect.
  • another electronic device includes: a processor; a memory; and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the other electronic device to perform: receiving an input; in response to the input , turn on Wi-Fi P2P, Bluetooth or ZigBee, and work on a preset channel; configure the other electronic device as a GO device; broadcast messages periodically; wherein, the preset channel of the other electronic device is associated with at least one The electronic device is associated with a preset channel.
  • the other electronic device stores the identifier of the other electronic device and its corresponding Wi-Fi P2P connection information in the preset memory through this step. Therefore, a foundation is laid for obtaining the Wi-Fi P2P connection information corresponding to the identifier of the other electronic device by querying the preset memory in the future.
  • the other electronic device further performs: after the broadcast duration of the other electronic device reaches a preset threshold duration, or after receiving another input, the other electronic device stops broadcasting the message; the Another electronic device still works on the preset channel.
  • these methods are all illustrative.
  • the present application may also include other methods that are not limited to the above-mentioned methods.
  • the other electronic device further performs: after receiving the Wi-Fi P2P connection request of the electronic device, based on the Wi-Fi P2P connection information, communicate with the electronic device.
  • the electronic device establishes a Wi-Fi P2P connection.
  • the identifier of the other electronic device is the service set identifier SSID of the electronic device, the basic service set identifier BSSID, and the SSID associated with the electronic device. ID, or the ID associated with the BSSID of the electronic device.
  • a chip system in a sixth aspect, includes: a memory for storing a computer program; a processor; after the processor calls and runs the computer program from the memory, the electronic device installed with the chip system executes any one of the second aspect and the second aspect method of implementation.
  • an electronic device comprising: a processor; a memory; and a computer program, wherein the computer program is stored on the memory, and when the computer program is executed by the processor, causes the electronic device to execute: receiving an input; in response to The input obtains the identity of another electronic device; from a preset memory other than the memory, obtains a piece of Wi-Fi P2P connection information corresponding to the identity of the other electronic device; based on the Wi-Fi P2P connection information, After a Wi-Fi P2P connection cannot be established with another electronic device, the electronic device performs a full-channel scan on the frequency bands supported by the electronic device in turn; the preset memory is located in the electronic device; or, the preset memory is located outside the electronic device, And on the device associated with the electronic device; the preset memory only stores a record about the identity of another electronic device, and the record reflects the identity of the other electronic device and its corresponding Wi-Fi P2P connection information.
  • the electronic device may be a mobile device.
  • the above-mentioned preset memory may also be the above-mentioned memory storing the above-mentioned computer program.
  • the above-mentioned memory for storing the above-mentioned computer program may be an area of a certain storage unit; the preset memory may be another area of the certain storage unit; for example, the above-mentioned memory for storing the above-mentioned computer program may be a hard disk.
  • the preset memory may be the D disk in the hard disk; wherein, the C disk and the D disk are only schematic examples.
  • the electronic device can detect and timely Obtain the changed Wi-Fi P2P connection information of the other electronic device; provide the functions of self-detection and self-acquisition.
  • the electronic device further performs: in the all-channel scan, a message of another electronic device is received on one channel; after the message includes the identifier of the other electronic device and another piece of Wi-Fi P2P connection information, Store the identification of another electronic device and another piece of Wi-Fi P2P connection information in a preset memory in a corresponding manner; establish a Wi-Fi P2P connection with another electronic device based on the other piece of Wi-Fi P2P connection information .
  • the identifier of another electronic device and another piece of Wi-Fi P2P connection information are stored in a preset memory in a corresponding manner, including:
  • the identifier of one electronic device and the other piece of Wi-Fi P2P connection information cover the identifier of the other electronic device and the Wi-Fi P2P connection information in a corresponding manner, and are stored in a preset memory.
  • only one piece of Wi-Fi P2P connection information or one corresponding relationship can be stored in the preset memory for one other electronic device by means of coverage; it is avoided to obtain the previous Wi-Fi P2P connection information through query. , resulting in an error situation.
  • the electronic device before receiving the input, turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel;
  • Initial setting message after the initial setting message includes the identity of the other electronic device and the Wi-Fi P2P connection information, the identity of the other electronic device and the Wi-Fi P2P connection information are stored in the preset memory in a corresponding manner;
  • the preset channel of the electronic device is associated with the preset channel of another electronic device.
  • the electronic device stores the identifier of another electronic device and its corresponding Wi-Fi P2P connection information in the preset memory through this step.
  • a foundation is laid for obtaining the Wi-Fi P2P connection information corresponding to the identification of another electronic device by querying the preset memory in the future.
  • a Wi-Fi P2P connection method is provided.
  • the method is applied to an electronic device, and the method includes: receiving an input; in response to the input, acquiring an identifier of another electronic device; and acquiring an identifier corresponding to the identifier of the other electronic device from a preset memory other than the memory.
  • the default memory is located in the electronic device; alternatively, the preset memory is located outside the electronic device and on the device associated with the electronic device; the preset memory only stores a record about the identification of the other electronic device, which record reflects the other electronic device.
  • the electronic device may be a mobile device.
  • the above-mentioned preset memory may also be the above-mentioned memory storing the above-mentioned computer program.
  • the above-mentioned memory for storing the above-mentioned computer program may be an area of a certain storage unit; the preset memory may be another area of the certain storage unit; for example, the above-mentioned memory for storing the above-mentioned computer program may be a hard disk.
  • the preset memory may be the D disk in the hard disk; wherein, the C disk and the D disk are only schematic examples.
  • the method further includes: in the full channel scan, receiving a message of another electronic device on one channel; after the message contains the identifier of the other electronic device and another piece of Wi-Fi P2P connection information, Store the identification of another electronic device and another piece of Wi-Fi P2P connection information in a preset memory in a corresponding manner; establish a Wi-Fi P2P connection with another electronic device based on the other piece of Wi-Fi P2P connection information .
  • the identifier of another electronic device and another piece of Wi-Fi P2P connection information are stored in a preset memory in a corresponding manner, including: storing another piece of Wi-Fi P2P connection information in a corresponding manner
  • the identifier of one electronic device and the other piece of Wi-Fi P2P connection information cover the identifier of the other electronic device and the Wi-Fi P2P connection information in a corresponding manner, and are stored in a preset memory.
  • the method further includes: before receiving the input, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel;
  • the initial setting message of another electronic device after the initial setting message includes the identity of the other electronic device and the Wi-Fi P2P connection information, the identity of the other electronic device and the Wi-Fi P2P connection information are stored in the preset in a corresponding manner.
  • the preset memory of the electronic device is associated with a preset channel of another electronic device.
  • the eighth aspect and any one implementation manner of the eighth aspect correspond to the seventh aspect and any one implementation manner of the seventh aspect, respectively.
  • the technical effects corresponding to the eighth aspect and any implementation manner of the eighth aspect reference may be made to the technical effects corresponding to the seventh aspect and any implementation manner of the seventh aspect, which will not be repeated here.
  • a computer-readable storage medium includes a computer program, which when executed on an electronic device, causes the electronic device to perform the eighth aspect and the method of any one of the implementations of the eighth aspect.
  • a computer program product When running on a computer, the computer is caused to perform the method of the eighth aspect and any one of the implementations of the eighth aspect.
  • a chip system in an eleventh aspect, includes: a memory for storing a computer program; a processor; after the processor calls and runs the computer program from the memory, the electronic device installed with the chip system executes any one of the eighth aspect and the eighth aspect method of implementation.
  • FIG. 1 is a schematic diagram of a scenario of a Wi-Fi P2P connection method provided by the present application
  • FIG. 2 is a schematic diagram of a hardware structure of a mobile device provided by the application.
  • FIG. 3 is a schematic diagram of a hardware structure of an electronic device provided by the application.
  • FIG. 4 is a schematic flowchart of a Wi-Fi P2P connection method provided by the present application.
  • FIG. 5 is a schematic flowchart of an electronic device in the initial setting step of the Wi-Fi P2P connection method provided by the present application;
  • FIG. 6 is a schematic flowchart of a mobile device in the initial setting step of the Wi-Fi P2P connection method provided by the present application;
  • FIG. 7A is a schematic flowchart of an embodiment of a mobile device in the steps of using the Wi-Fi P2P connection method provided by the present application;
  • FIG. 7B is a schematic flowchart of an embodiment of a mobile device in the use steps of the Wi-Fi P2P connection method provided by the application;
  • FIG. 8 is a schematic flowchart of establishing a Wi-Fi P2P connection between a mobile device and an electronic device based on the Wi-Fi P2P connection information in the Wi-Fi P2P connection method provided by the present application;
  • FIG. 9 is a schematic structural diagram of a mobile device provided by the present application.
  • FIG. 10 is a schematic structural diagram of a Wi-Fi P2P connection device provided by the present application.
  • one or more refers to one, two or more; "and/or”, which describes the association relationship of associated objects, indicates that there may be three kinds of relationships; for example, A and/or B can mean that A exists alone, A and B exist simultaneously, and B exists independently, wherein A and B can be singular or plural.
  • the character “/” generally indicates that the associated objects are an "or" relationship.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the channel refers to the channel through which the signal is transmitted in the communication system, and is composed of the transmission medium through which the signal is transmitted from the transmitting end to the receiving end.
  • the 2.4GHz Wi-Fi frequency band is divided into 13 overlapping channels, each with a width of 22MHz (the IEEE 802.11g and IEEE 802.11n standards have a width of 20MHz for each channel, and IEEE 802.10B The bandwidth of each channel in the standard is 22MHz); the 5GHz Wi-Fi band is divided into 201 channels.
  • Wi-Fi P2P is a Wi-Fi peer-to-peer (P2P) standard launched by the wireless fidelity (Wi-Fi) alliance. Wi-Fi P2P connections are created on demand when users initiate P2P services. Typically, this process takes 3.5 to 20 seconds.
  • the modes of Wi-Fi P2P connection can include:
  • Wi-Fi P2P connection initialization in standard mode includes four key processes: discovery, group owner (GO) negotiation, provisioning, and IP address initialization.
  • the discovered device can be displayed on the discovered device and wait for the user to select.
  • the discovery process includes two processes: scan and find.
  • the find process includes a search (search) and a listening (listen) process, and the search and listen cycle back and forth until the other device is found or discovered by the other device.
  • scan is a full channel scan.
  • the full-channel scan of scan usually takes 900 milliseconds (ms) to 2 seconds (s), and the search and listen processes usually take 200 ms to 10s.
  • the biggest limitation of the standard mode is that both scan and find use channel switching to send probe requests on different channels. Among them, in order for the other party to send a request response, the receiver and the sender need to be in the same channel. The two parties do not know the channel used by the other party before the negotiation, so at least one of the two parties will change the channel and send the probe request repeatedly. Therefore, the whole process is time-consuming and the overall time-consuming is unstable.
  • the channel on which the sender currently sends the negotiation request to the receiver is the a channel
  • the channel on which the receiver currently receives the negotiation request is the b channel. Since the channel currently used by the receiver and the sender is not the same channel, the negotiation request sent by the sender device through the a channel cannot be received by the receiver through the b channel, so the receiver cannot respond to the negotiation request.
  • the sender changes the channel, the receiver may also change the channel, and the two sides negotiate again. At least one of the sender and the receiver may change the channel multiple times, and so on, until the channels of both parties are finally the same, and the receiver receives the negotiation request sent by the sender. In this way, the whole process is time-consuming and the overall time-consuming is unstable.
  • the discovery in standard mode takes a long time and the duration is unstable.
  • the user can usually only select the device after the discovered device is discovered by the discovery device. Therefore, the initialization of the P2P service takes a long time and is unstable, and the user experience is not good.
  • the group configuration information can be persisted after the first connection, and the GO negotiation process can be omitted for subsequent connections.
  • the provisioning process is simplified.
  • the continuous mode adds invitation; and the discovery process of the continuous mode is the same as the discovery process of the standard mode, and it is not simplified; therefore, the initialization of the P2P service will take a long time and the duration is unstable, and the user experience will be poor.
  • both of the above two modes of Wi-Fi P2P connection cause or may cause the Wi-Fi P2P connection to take a long time, and the user experience is not good.
  • the present application provides a Wi-Fi P2P connection method, an electronic device and a computer-readable storage medium, which can reduce the time-consuming time in the connection establishment phase of the two devices and maintain the stability of the time-consuming time. , to improve the user experience.
  • the electronic device is replaced by a mobile device, and another electronic device is replaced by an electronic device. It should be noted that this is only used for the convenience of distinguishing names and avoiding confusion, and is not used to limit the specific type of the device.
  • the mobile device may also be a stationary electronic device (such as a desktop computer, etc.).
  • FIG. 1 is a schematic diagram of a scenario of a Wi-Fi P2P connection method provided by an embodiment of the present application.
  • the mobile device 100 establishes a Wi-Fi P2P wireless connection with the electronic device 200 .
  • the mobile device 100 can transmit data (such as screen projection, etc.) to the electronic device 200 through the Wi-Fi P2P wireless connection.
  • the working frequency band of the Wi-Fi P2P connection can be the 2.4GHz frequency band or the 5GHz frequency band.
  • the working frequency band of the Wi-Fi AP connection can be the 2.4GHz frequency band or the 5GHz frequency band.
  • the mobile device 100 in this embodiment of the present application includes, but is not limited to, a smart phone, a smart headset, a tablet computer, a wearable electronic device with a wireless communication function (such as a smart watch, a smart bracelet, a smart ring, and smart glasses), and the like.
  • exemplary embodiments of mobile devices include, but are not limited to, piggybacks Portable electronic devices with Windows, Linux, or other operating systems.
  • the above-mentioned mobile device may also be other portable electronic devices, such as a laptop computer (Laptop) or the like. It should also be understood that, in some other embodiments, the above-mentioned mobile device may not be a portable electronic device, but a stationary electronic device such as a desktop computer.
  • FIG. 2 shows a schematic diagram of a hardware structure of a mobile device provided by an embodiment of the present application.
  • the mobile 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 , and a battery 142 , Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Speaker 170A, Receiver 170B, Microphone 170C, Headphone Interface 170D, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193 , a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the mobile device 100 .
  • the mobile device 100 may include more or less components than shown, or some components may be combined, or some components may be split, or different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the charging management module 140 is used to receive charging input from the charger.
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the wireless communication function of the mobile device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in mobile device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the mobile device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the mobile device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
  • the antenna 1 of the mobile 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 mobile 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 (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS
  • SBAS satellite based augmentation systems
  • the mobile device 100 can realize the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile 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 to save files like music, video etc in external memory card.
  • the mobile device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • FIG. 3 shows a schematic diagram of the hardware structure of the electronic device 200 .
  • the electronic device 200 may include a processor 210 , an external memory interface 220 , an internal memory 221 , a universal serial bus (USB) interface 230 , a charging management module 240 , a power management module 241 , and a battery 242 , Antenna 3, Antenna 4, wireless communication module 250, sensor module 260, etc.
  • USB universal serial bus
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • Processor 210 may include one or more processing units.
  • the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video Codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc.
  • application processor application processor
  • AP application processor
  • modem processor graphics processor
  • image signal processor image signal processor
  • ISP image signal processor
  • controller a video Codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • NPU neural-network processing unit
  • different processing units may be independent components, or may be integrated in one or more processors.
  • electronic device 200 may also include one or more processors 210 .
  • the controller can generate an operation control signal according to the instruction operation code and
  • the processor 210 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM card interface, and/or USB interface, etc.
  • the USB interface 230 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 230 can be used to connect a charger to charge the electronic device 200, and can also be used to transmit data between the electronic device 200 and peripheral devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 200 .
  • the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the wireless communication function of the electronic device 200 may be implemented by the antenna 3 , the antenna 4 , the wireless communication module 250 and the like.
  • the wireless communication module 250 can provide Wi-Fi (including Wi-Fi perception and Wi-Fi AP), Bluetooth (Bluetooth, BT), and wireless data transmission modules (eg, 433MHz, 868MHz, 915MHz) applied on the electronic device 200 . and other wireless communication solutions.
  • the wireless communication module 250 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 250 receives electromagnetic waves via the antenna 3 and/or the antenna 4 , filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 250 may also receive the signal to be sent from the processor 210, perform frequency modulation on it, amplify the signal, and convert it into electromagnetic waves for radiation through the antenna 3 and/or the antenna 4.
  • the electronic device 200 may broadcast a message through a wireless communication module, or may send a message to a target device.
  • the broadcasted message or the message sent to the target device may carry the device identification or product identification of the electronic device 200 , which is used for the surrounding mobile devices to discover the electronic device 200 .
  • the electronic device 200 can also receive messages sent by the mobile device through the wireless communication module.
  • the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 221 may be used to store one or more computer programs including instructions.
  • the processor 210 may execute the above-mentioned instructions stored in the internal memory 221, thereby causing the electronic device 200 to execute the Wi-Fi P2P connection methods provided in some embodiments of the present application, as well as various applications and data processing.
  • the internal memory 221 may include a code storage area and a data storage area. Among them, the code storage area can store the operating system.
  • the data storage area may store data and the like created during the use of the electronic device 200 .
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage components, flash memory components, universal flash storage (UFS), and the like.
  • the processor 210 may cause the electronic device 200 to execute the instructions provided in the embodiments of the present application by executing the instructions stored in the internal memory 221 and/or the instructions stored in the memory provided in the processor 210 .
  • the electronic device 200 includes but is not limited to tablet computers, desktop computers, portable electronic devices (such as laptop computers, Laptop), smart TVs (such as smart screens), smart printers, in-vehicle devices (such as smart devices in driverless driving), Smart speakers, augmented reality (AR) devices, virtual reality (VR) devices, other smart devices with displays (such as smart grids, smart cities, smart homes, smart devices in industrial control, etc.) , and other smart devices with speakers.
  • Exemplary embodiments of electronic devices include, but are not limited to, onboard Portable or stationary electronic devices with Linux or other operating systems.
  • the Wi-Fi P2P connection method mainly enables the mobile device to obtain the stored identification (ID) of the electronic device and its corresponding by query when it needs to establish a Wi-Fi P2P connection with the electronic device. Based on the obtained Wi-Fi P2P connection information, it can quickly complete the Wi-Fi P2P connection with the electronic device, effectively shortening the time for establishing a Wi-Fi P2P connection between the mobile device and the electronic device; and the The duration is stable, there will be no major fluctuations, and the user experience is better.
  • ID stored identification
  • the Wi-Fi P2P connection information includes: service set identifier (SSID), channel, basic service set identifier (BSSID), frequency (frequency), authentication information, P2P of the electronic device At least one item of connection capability information, address information of the electronic device, and the like.
  • the P2P connection capability information of the electronic device may include information indicating whether the electronic device can establish a Wi-Fi P2P connection, and/or the application role of the electronic device, such as a group client (GC) role, etc.; Specific forms include, but are not limited to, keys (eg, shared keys, pre-shared key, PSK) or certificates.
  • the Wi-Fi P2P connection method provided by the embodiment of the present application may include: an initial setting step and a use step.
  • the electronic device and the mobile device can work on a preset channel (for example, both work on the A channel), so that the mobile device can receive the message sent by the electronic device; and the received message contains The ID and Wi-Fi P2P connection information of the electronic device are stored in the preset memory.
  • a preset channel for example, both work on the A channel
  • the Wi-Fi P2P connection information includes at least the channel, authentication information and address information of the electronic device; optionally, the address information may be a MAC address.
  • the electronic device can work on a preset channel (eg, A channel), and the mobile device can cyclically switch between multiple preset channels (eg, between the three channels A channel, B channel, and C channel). cyclic switching); after the channel of the mobile device is cyclically switched to one channel (for example, A channel), the message sent by the electronic device is received; the ID of the electronic device and the Wi-Fi P2P connection contained in the received message information, stored in the preset memory.
  • a preset channel eg, A channel
  • multiple preset channels eg, between the three channels A channel, B channel, and C channel.
  • the electronic device can rotate among a plurality of preset channels (for example, among three channels, A channel, B channel, and C channel), and the mobile device can work on a preset channel (for example, A channel, A channel, and C channel). channel); after the channel of the electronic device is rotated to a channel (for example, A channel), the mobile device receives the message sent by the electronic device; after that, the mobile device will receive the ID and Wi-Fi of the electronic device contained in the received message P2P connection information is stored in a preset memory.
  • a preset channels for example, among three channels, A channel, B channel, and C channel
  • a preset channel for example, A channel, A channel, and C channel
  • the ID of the electronic device corresponds to the Wi-Fi P2P connection information.
  • the mobile device may operate on a different channel than it did during the initial setup step.
  • the mobile device obtains the identification of the electronic device based on a received input; if based on the identification of the electronic device, the corresponding Wi-Fi P2P connection information is queried from the preset memory; based on the Wi-Fi P2P connection information, and Electronic devices quickly establish Wi-Fi P2P connections.
  • the mobile device will store the ID of the electronic device and the Wi-Fi P2P connection information in the preset and, based on the Wi-Fi P2P connection information, quickly establish a Wi-Fi P2P connection with the electronic device.
  • the Wi-Fi P2P connection method provided by the embodiment of the present application may include a use step, and no longer includes an initial setting step.
  • the usage steps please refer to the previous article, which will not be repeated here.
  • FIG. 5 is a schematic flowchart of an electronic device in an initial setting step of a Wi-Fi P2P connection method provided by an embodiment of the present application. As shown in Figure 5, the flow of the electronic device in the initial setting step may include:
  • the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel;
  • the electronic device after receiving an input, turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • At least one of the electronic device and the remote control device matched with the electronic device may be provided with a button for initial setting. After the user triggers the above button, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the electronic device has at least one of a voice recognition function and an AI recognition function.
  • a voice recognition function for example, a hovering gesture
  • the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the electronic device After the electronic device receives a specific message from the mobile device, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the electronic device After the electronic device connects to a network for the first time, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the electronic device After the electronic device is disconnected from a network and subsequently reconnected to the network, the electronic device enables Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the user may be prompted for confirmation by voice. After the user confirms, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on the preset channel.
  • the preset channel is not limited to one channel, but can also be multiple channels; in the case of multiple channels, the electronic device can work on each channel for a preset duration, and then switch to another channel. , and so on.
  • a specific message is sent to the mobile device; after the mobile device receives the specific message, S601 is performed.
  • the electronic device configures itself as a GO device
  • the electronic device After the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel, the electronic device configures itself as a GO device.
  • the electronic device periodically broadcasts a message.
  • the electronic device broadcasts messages on a preset channel in one cycle.
  • the message includes Wi-Fi P2P connection information of the electronic device.
  • the electronic device stops periodically broadcasting the message.
  • the preset channel on the electronic device is associated with the preset channel on the mobile device.
  • the preset channel on the electronic device may be the same as the preset channel on the mobile device, or the preset channel on the electronic device may be a part of the preset channel on the mobile device, or the preset channel on the mobile device may be The channel may be part of a preset channel on the electronic device.
  • the method of switching channels is as described above, which will not be repeated here.
  • the Wi-Fi P2P connection information may include at least one of an ID of the electronic device (eg, a service set identifier SSID, a basic service set identifier BSSID), a channel, address information, authentication information, and the like.
  • Authentication information can be a key (eg, shared key, pre-shared key, PSK) or a certificate.
  • the address information may be a MAC address.
  • the Wi-Fi P2P connection information may further include: frequency (frequency) and P2P connection capability information of the electronic device.
  • the P2P connection capability information of the electronic device may include: information indicating whether the electronic device can establish a Wi-Fi P2P connection, and/or an application role (eg, a GO role) of the electronic device, and the like.
  • the ID of the electronic device may be an SSID, a BSSID, an identifier associated with the SSID, or an identifier associated with the BSSID.
  • the electronic device After receiving another input (eg, voice input, touch input, etc.), the electronic device ends the flow of the initial setting step.
  • another input e.g, voice input, touch input, etc.
  • the electronic device works in the initial setting step shown in FIG. 5 , and may also work in the process performed by the electronic device side shown in FIG. 8 . .
  • FIG. 6 is a schematic flowchart of a mobile device in an initial setting step of a Wi-Fi P2P connection method provided by an embodiment of the present application. As shown in Figure 6, the flow of the initial setting step of the mobile device may include:
  • the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel;
  • the mobile device after receiving an input, turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the mobile device may be provided with keys for initial setup. After the user triggers the above button, the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the mobile device has at least one of a voice recognition function and an AI recognition function.
  • a voice recognition function for example, a hovering gesture
  • the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee, and works on a preset channel.
  • the mobile device Before the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee and works on a preset channel, the user can be prompted for confirmation by voice. After the user confirms, the mobile device is Wi-Fi P2P, Bluetooth or ZigBee, and works on the preset channel.
  • the preset channel is not limited to one channel, and can also be multiple channels; in the case of multiple channels, the mobile device can work on each channel for a preset duration, and then switch to another channel. , and so on.
  • the preset channel on the mobile device is associated with the preset channel on the electronic device.
  • the preset channel on the mobile device may be the same as the preset channel on the electronic device, or the preset channel on the mobile device may be a part of the preset channel on the electronic device, or the preset channel on the electronic device may be The channel may be part of a preset channel on the mobile device.
  • the method of switching channels is as described above, and details are not repeated here.
  • the mobile device After the mobile device turns on Wi-Fi P2P, Bluetooth or ZigBee and works on a preset channel, it sends a specific message to the electronic device; the electronic device performs S501 after receiving the specific message.
  • the mobile device works on a preset channel for receiving broadcast messages.
  • the mobile device can quickly receive the broadcasted information from the electronic device (GO device). information.
  • the broadcast message includes Wi-Fi P2P connection information sent by at least one electronic device.
  • the Wi-Fi P2P connection information may contain an ID of the electronic device (e.g., service set identifier SSID, basic service set identifier BSSID), channel, address information, authentication information, and the like.
  • Authentication information can be a key (eg, shared key, pre-shared key, PSK) or a certificate.
  • the address information may be a MAC address.
  • the Wi-Fi P2P connection information may further include: frequency (frequency) and P2P connection capability information of the electronic device.
  • the P2P connection capability information of the electronic device may include: information indicating whether the electronic device can establish a Wi-Fi P2P connection, and/or an application role (eg, a GO role) of the electronic device, and the like.
  • the mobile device can obtain the ID and Wi-Fi P2P connection information of the electronic device from the above-mentioned broadcast message.
  • the mobile device After acquiring the ID and Wi-Fi P2P connection information of the electronic device, the mobile device stores it in a preset memory.
  • the mobile device may establish a correspondence between the ID, channel, address information and authentication information of the electronic device in a preset memory.
  • the preset memory may be a local memory of the mobile device, or may be a memory other than the mobile device that is associated with the mobile device (for example, a third-party storage device).
  • the mobile device may store in a preset memory in a sequential order.
  • the preset memory when the preset memory is used to store the above-mentioned information (for example, the above-mentioned information includes at least the ID, channel, address information and authentication information of the electronic device) or the above-mentioned corresponding relationship (for example, the above-mentioned corresponding relationship includes at least the ID of the electronic device).
  • the mobile device when it wants to store the new above-mentioned information or the new above-mentioned correspondence, then the mobile device can delete the earliest stored above-mentioned information or the above correspondence.
  • the preset memory stores 100 pieces of the above information. If you want to store a new piece of the above information, you need to delete the oldest piece of the above 100 pieces of information first, and then store a new piece of the above information, so that the mobile The number of the above information stored by the device remains at 100.
  • the ID of the electronic device may be an SSID, a BSSID, an identifier associated with the SSID, or an identifier associated with the BSSID.
  • the mobile device establishes the correspondence between the ID, channel, address information and authentication information of the electronic device according to the received messages from a plurality of different electronic devices as shown in Table 1.
  • Table 1 is stored in a preset memory.
  • Table 1 Correspondence of ID, channel, address information and authentication information of electronic equipment
  • the mobile device displays the stored electronic Device icon. That is to say, the above-mentioned device display interface or other interface (such as a desktop) that can establish a Wi-Fi P2P connection will display the icon of the stored electronic device. For example, according to Table 1, the above-mentioned device display interface or other interface (such as desktop) that can establish a Wi-Fi P2P connection will display an icon of a smart TV, an icon of a smart printer, and an icon of a smart speaker.
  • Table 1 when Table 1 stores two or more electronic devices of the same type (for example, two smart TVs), the above-mentioned devices that can establish a Wi-Fi P2P connection display interface or other interfaces (such as desktops), except for displaying smart TVs.
  • a logo eg, name, etc.
  • the two smart TVs can also be displayed.
  • the ID of the electronic device may not be the SSID or the BSSID.
  • the ID of the electronic device is an identifier associated with the SSID or BSSID of the electronic device, and the SSID or BSSID of the electronic device can be queried through the ID of the electronic device.
  • the ID of the electronic device may also be an identification associated with the SSID and BSSID of the electronic device.
  • the mobile device After receiving another input (eg, voice input, touch input, etc.), the mobile device ends the flow of the initial setup step.
  • another input e.g, voice input, touch input, etc.
  • the flow of the initial setting step of the mobile device is ended.
  • FIG. 7A is a schematic flowchart of an embodiment of a mobile device in the steps of using the Wi-Fi P2P connection method provided by the present application. As shown in Figure 7A, the process may include:
  • the mobile device receives an input
  • a mobile device receives an input. For example, on the display interface of the mobile device that can establish a Wi-Fi P2P connection, the user selects an icon of an electronic device (for example, clicks, long presses, etc.), and the mobile device receives an input at this time; or, the user A speech is entered into the mobile device, at which point the mobile device receives an input.
  • an icon of an electronic device for example, clicks, long presses, etc.
  • an NFC tag may be provided on the surface of the electronic device, or an NFC tag may be provided on a remote control device matched with the electronic device (such as a smart TV); after the mobile device is close to the NFC tag on the electronic device, or the mobile device The mobile device also receives an input after approaching the NFC tag on the remote control device.
  • the mobile device After the mobile device receives the input, the mobile device acquires the ID of the electronic device.
  • the ID of the electronic device may be an identifier such as the SSID, BSSID, etc. of the electronic device, or an identifier associated with the SSID, BSSID, etc. of the electronic device (that is, according to the ID of the electronic device, the electronic device can be queried. SSID, BSSID, etc.).
  • the mobile device inquires in a preset memory whether the ID of the electronic device is found. If the ID of the electronic device is queried, execute S704a. If the ID of the electronic device cannot be queried, execute S706a.
  • the channel, authentication information, address information and the like corresponding to the ID of the electronic device are acquired from Table 1 in the preset memory.
  • S705a configure its own channel as the channel corresponding to the ID of the electronic device, configure itself as a GC device, and establish a Wi-Fi P2P connection with the electronic device according to the authentication information and address information in the Wi-Fi P2P connection information.
  • the mobile device configures itself as a GC device, configures its own channel as a channel corresponding to the ID of the electronic device, and establishes with the electronic device (GO device) according to the authentication information and address information in the Wi-Fi P2P connection information. Wi-Fi P2P connection.
  • the mobile device can also first configure its own channel as a channel corresponding to the ID of the electronic device, then configure itself as a GC device, and then communicate with the electronic device according to the authentication information and address information in the Wi-Fi P2P connection information. (GO device) Establish a Wi-Fi P2P connection.
  • the mobile device scans each channel in turn.
  • the mobile device If the mobile device does not find the ID of the electronic device in the preset memory, the mobile device scans each channel of the working frequency band of the mobile device in turn.
  • the mobile device sequentially scans each channel on each operating frequency band supported by the mobile device.
  • the mobile device sequentially scans all channels on the first working frequency band—the Mth working frequency band. For example, if the mobile device supports 2 working frequency bands, the number of channels on the first working frequency band is N1, and the number of channels on the second working frequency band is N2, then the mobile device can first use the N1 channels in the first working frequency band Each channel scan is performed on the 2nd operating frequency band, and then each channel scan is performed on the N2 channels of the second working frequency band.
  • the mobile device can first perform full-channel scanning on the 2.4GHz frequency band, and then perform full-channel scanning on the 5GHz frequency band; the mobile device can also perform full-channel scanning on the 5GHz frequency band first.
  • a channel scan followed by a full channel scan on the 2.4GHz band That is, the mobile device can scan each channel in turn on each frequency band on all the frequency bands it supports.
  • the mobile device can also perform an all-channel scan on the currently working frequency band first, and then perform an all-channel scan on another frequency band.
  • the mobile device During the scanning process, if the mobile device receives a message sent by the electronic device, execute S708a; if the mobile device does not receive a message sent by the electronic device, execute S710a. During the scanning process, if the mobile device receives a message sent by the electronic device, it indicates that the current channel of the mobile device is the channel used by the electronic device.
  • S709a is executed.
  • S709a Acquire the ID of the electronic device and the Wi-Fi P2P connection information of the electronic device, and store the acquired information in a preset memory.
  • the mobile device acquires the ID of the electronic device and the Wi-Fi P2P connection information of the electronic device from the message, and stores the acquired information in a preset memory.
  • the preset memory may be a local memory of the mobile device, or may be a memory other than the mobile device that is associated with the mobile device (for example, a third-party storage device).
  • S708a if the mobile device determines that the message includes the ID of the electronic device and the Wi-Fi P2P connection information of the electronic device, firstly execute S705a; then, execute S709a. That is, in S708a, if the mobile device determines that the message contains the ID of the electronic device and the Wi-Fi P2P connection information of the electronic device, it first configures itself and establishes a Wi-Fi P2P connection with the electronic device; ID and Wi-Fi P2P connection information are stored in the preset memory.
  • the mobile device determines whether all channels have been scanned.
  • the mobile device determines whether all channels on all operating frequency bands supported by the mobile device have been scanned. Optionally, if the mobile device supports two working frequency bands, after all channels on one working frequency band are scanned, all channels can be scanned on the other working frequency band.
  • the above two operating frequency bands are only illustrative examples. If the mobile device supports M working frequency bands (M is a positive integer greater than or equal to 2), it can scan all the channels on one working frequency band, and after scanning all the channels on the M working frequency bands, it can scan all the channels on the M working frequency bands. Perform full-channel scanning on another working frequency band in the working frequency band, and so on until all channels under all working frequency bands are scanned.
  • the mobile device determines that the Wi-Fi P2P connection fails this time.
  • the electronic device may execute according to the flow shown in FIG. 5 .
  • the electronic device executes S706a
  • the electronic device executes S503. If the electronic device is not powered on (for example, the power is turned off), or no longer broadcasts messages, the mobile device will not receive a message from the electronic device on which channel in the full-channel scan started in S706a; thus, the mobile device determines The Wi-Fi P2P connection failed this time.
  • the mobile device after receiving an input, the mobile device obtains the ID of the electronic device, and searches for the Wi-Fi corresponding to the ID of the electronic device from the preset memory P2P connection information, so that the mobile device can obtain the channel, authentication information, and address information in the Wi-Fi P2P connection information, configure its own channel as the channel corresponding to the ID of the electronic device, and follow the authentication in the Wi-Fi P2P connection information.
  • information, address information, and quickly complete Wi-Fi P2P connection with electronic devices effectively shortening the time for establishing Wi-Fi P2P connections between mobile devices and electronic devices.
  • FIG. 7B is a schematic flowchart of an embodiment of a mobile device in the steps of using the Wi-Fi P2P connection method provided by the present application. As shown in Figure 7B, the process may include:
  • S701b-S703b same as S701a-S703a respectively, please refer to the description of S701a-S703a;
  • S706b-S710b same as S706a-S710a respectively, please refer to the description of S706a-S710a;
  • the Wi-Fi P2P connection information corresponding to the ID of the electronic device is obtained, and the channel, authentication information, address information, etc. are obtained therefrom.
  • the mobile device configures itself as a GC device, configures its own channel as a channel corresponding to the ID of the electronic device, and prepares to communicate with the electronic device according to the authentication information and address information in the obtained Wi-Fi P2P connection information.
  • (GO device) Establish a Wi-Fi P2P connection.
  • the mobile device can also first configure its own channel as the channel corresponding to the ID of the electronic device, and then configure itself as the GC device, and according to the obtained Wi-Fi P2P connection information
  • the authentication information and address information Prepare to establish a Wi-Fi P2P connection with an electronic device (GO device).
  • the reason why S705b is set, and S706b is executed after the judgment result of S705b is no; mainly considering that some electronic devices or a certain electronic device may change at least one of the channel, authentication information and address information after a period of time; In this way, the Wi-Fi P2P connection information of these electronic devices or an electronic device can be obtained and stored by means of full-channel scanning. And, the changed Wi-Fi P2P connection information will overwrite the previous Wi-Fi P2P connection information.
  • the ID of electronic device A is ID1
  • the channel, authentication information and address information in the previous Wi-Fi P2P connection information are: channel 1, authentication information 1 and address information 1 respectively; later, for some reason (such as For security reasons), the Wi-Fi P2P connection information of electronic device A has been changed; the channel, authentication information and address information in the changed Wi-Fi P2P connection information are: channel 2, authentication information 2 and address information 2 respectively.
  • the changed Wi-Fi P2P connection information can be stored in the preset memory by this method.
  • the changed Wi-Fi P2P connection information will overwrite the previous Wi-Fi P2P connection information.
  • the Wi-Fi P2P connection information corresponding to the ID of the electronic device A only has the changed Wi-Fi P2P connection information. In this way, an efficient automatic change method is provided.
  • the Wi-Fi P2P connection information can also be changed through the initial setting steps; the same technical effect can be achieved.
  • the method of this embodiment not only achieves the technical effect shown in FIG. 7A , but also further considers the situation that the Wi-Fi P2P connection information stored in the preset memory is changed.
  • the changed Wi-Fi P2P connection information can be obtained through full-channel scanning. , and store it in the preset memory by overwriting the previous Wi-Fi P2P connection information. In this way, in the face of changing the Wi-Fi P2P connection information of the electronic device, it can self-judgment, actively acquire and store it, so as to facilitate the subsequent acquisition of the latest Wi-Fi P2P connection information from the preset memory.
  • the content not described in the embodiment corresponding to FIG. 7B is the same as the relevant content in the embodiment corresponding to FIG. 7A . It will not be repeated here.
  • the storage location of Table 1 in the embodiment corresponding to FIG. 7B is not described, so it is the same as the relevant content in the embodiment corresponding to FIG. 7A ; therefore, in the embodiment corresponding to FIG. 7B , Table 1 is also stored in the preset in the memory.
  • the flow method shown in FIG. 7B may not be adopted.
  • the storage time is also stored in a preset memory.
  • the corresponding relationship with the latest storage time (ie the latest) or the Wi-Fi P2P connection information in the storage record is selected. In this way, the changed Wi-Fi P2P connection information of another electronic device can also be obtained. It is well known to those skilled in the art that this scheme is also in the method shown in Figure 7A.
  • the process of establishing a Wi-Fi P2P connection between a mobile device and an electronic device may include:
  • the mobile device sends a Wi-Fi P2P access request to the electronic device.
  • the Wi-Fi P2P access request includes a key for Wi-Fi P2P access.
  • the number of verifications is recorded as 1, and after waiting for a predetermined period of time, the verification is performed again; if the verification is incorrect again, the number of verifications is increased by 1. This cycle is repeated, and if the verification is still incorrect after the number of verifications reaches the preset number of verifications, the verification is stopped.
  • the verification is performed again after waiting for a predetermined period of time; if the verification is incorrect again, a message is sent to the mobile device to inform the mobile device of the key for Wi-Fi P2P access. error; or, the electronic device informs the wrong key for Wi-Fi P2P access through voice output or message display.
  • the electronic device sends a confirmation message to the mobile device to confirm that the Wi-Fi P2P connection is established.
  • the mobile device receives the confirmation message sent by the electronic device.
  • the Wi-Fi P2P connection channel is established.
  • the methods provided in the embodiments of the present application are applicable to the following mobile devices and Wi-Fi P2P connection devices.
  • FIG. 9 shows a mobile device 900 provided by the present application.
  • mobile device 900 includes at least one processor 910 , memory 920 and display screen 930 .
  • the processor 910 is coupled with the memory 920 and the display screen 930 .
  • the coupling in this embodiment of the present application may be a communication connection, an electrical connection, or other forms.
  • the memory 920 is used to store program instructions.
  • Display screen 930 is used to display a user interface.
  • the processor 910 is configured to invoke the program instructions stored in the memory 920, so that the mobile device 900 executes the steps performed by the mobile device in the Wi-Fi P2P connection method provided by the embodiments of the present application.
  • the mobile device 900 can be used to implement the Wi-Fi P2P connection method provided by the embodiments of the present application, and the relevant features can be referred to above, and details are not repeated here.
  • the display screen when the display screen has a touch function, the display screen is also referred to as a touch display screen.
  • the operation on the touch screen can be realized by virtual keys.
  • the display When the display does not have a touch function, the display is also called a non-touch display. Operations on the non-touch display can be achieved through physical buttons.
  • the present application provides a computer program product containing instructions, when the computer program product is run on a mobile device, the mobile device is made to execute the Wi-Fi P2P connection method provided by the embodiments of the present application performed by the mobile device. step.
  • the present application provides a computer-readable storage medium, including instructions, which, when the instructions are executed on a mobile device, cause the electronic device to execute the Wi-Fi P2P connection method performed by the mobile device in the Wi-Fi P2P connection method provided by the embodiments of the present application. step.
  • the embodiments of the present application may be implemented in hardware, or in a manner of hardware and software.
  • the above-described functions can be stored in a computer-readable medium.
  • the medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
  • the above-mentioned devices include corresponding hardware structures and/or software modules for executing the various functions.
  • the embodiments of the present application can be implemented in hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
  • an embodiment of the present application provides a Wi-Fi P2P connection device.
  • the apparatus may be a chip applied in a mobile device and/or an electronic device, or other combined devices, components, etc. that can realize the functions of the above-mentioned mobile device and/or electronic device.
  • the Wi-Fi P2P connection device is a component having the functions of the above-mentioned mobile device and/or electronic device
  • the transceiver may be a radio frequency unit
  • the processing module may be a processor.
  • the transceiver unit may be an input/output interface of the chip system
  • the processing unit may be a processor of the chip system, such as a central processing unit (central processing unit, CPU).
  • a chip system can be one chip, a collection of chips and their circuits, multiple chips, or a collection of multiple chips and their circuits.
  • the processor 1010 is responsible for managing the bus architecture and general processing, and the memory 1030 may store data used by the processor 1010 in performing operations.
  • the transceiver communication interface 1040 is used to receive and transmit data under the control of the processor 1010 for data communication with the memory 1030 .
  • the processor 1010 may be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP.
  • the processor 1010 may further include a hardware chip.
  • the above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general-purpose array logic (generic array logic, GAL) or any combination thereof.
  • the memory 1030 may include: a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and other media that can store program codes.
  • the processor 1010, the memory 1030 and the communication interface 1040 are connected to each other.
  • the processor 1010, the memory 1030 and the communication interface 1040 can be connected to each other through a bus 1020;
  • the bus 1020 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, etc.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in FIG. 10, but it does not mean that there is only one bus or one type of bus.
  • the program product may employ any combination of one or more readable media.
  • the readable medium may be a readable storage medium.
  • Illustrative examples (non-exhaustive list) of readable storage media include: portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory) , a portable compact disc read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
  • the program product for Wi-Fi P2P connection may adopt a portable compact disk read only memory (CD-ROM) and include program codes, and may run on a server device.
  • CD-ROM portable compact disk read only memory
  • the program products of the embodiments of the present application are not limited thereto.
  • a readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with a Wi-Fi P2P connection device or device.
  • the embodiments of the present application also provide a storage medium readable by a computing device for the Wi-Fi P2P connection method, that is, the content is not lost after the power is turned off.
  • Software programs are stored in the storage medium, including program codes. When the program codes are run on a computing device, the software programs can implement any of the above embodiments of the present application when read and executed by one or more processors. Wi-Fi P2P connection scheme.

Landscapes

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

Abstract

本申请涉及一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质。电子设备,包括:处理器;存储器;以及存储在存储器上的计算机程序,当计算机程序被处理器执行时,使得电子设备执行:接收到一个输入;响应于该输入,获取到另一电子设备的标识;在从存储器以外的预设的存储器中,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息;基于该Wi-Fi P2P连接信息,与另一电子设备建立Wi-Fi P2P连接;其中,预设的存储器位于电子设备内;或者,预设的存储器位于电子设备以外,且与电子设备关联的设备上。这样,能够缩减两个设备的连接建立阶段的耗时时长,保持该耗时时长的稳定性,提升用户体验。

Description

一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质
相关申请的交叉引用
本申请要求在2020年09月28日提交中国专利局、申请号为202011042864.1、申请名称为“一种P2P连接方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中;本申请要求在2020年11月20日提交中国专利局、申请号为202011315060.4、申请名称为“一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质。
背景技术
在没有局域网或互联网的情况下,Wi-Fi P2P仍支持两个设备之间的互连及数据的高速传输,因此Wi-Fi P2P在诸如无线投屏、文件共享等方面得到广泛应用。但现有的Wi-Fi P2P在两个设备的连接建立阶段耗时较长且耗时时长不稳定,用户体验不好。
发明内容
为了解决上述技术问题,本申请提供了一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质;能够缩减两个设备的连接建立阶段的耗时时长,保持该耗时时长的稳定性,提升用户体验。
第一方面,提供一种电子设备。该电子设备包括:处理器;存储器;以及计算机程序,其中计算机程序存储在存储器上,当计算机程序被处理器执行时,使得电子设备执行:接收到一个输入;响应于该输入,获取到另一电子设备的标识;在根据所述电子设备的标识,从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息后,基于该Wi-Fi P2P连接信息,与另一电子设备建立Wi-Fi P2P连接;其中,预设的存储器位于该电子设备内;或者,预设的存储器位于该电子设备以外,且与该电子设备关联的设备上。示例性的,该电子设备可以为移动设备。可替换地,上述预设的存储器也可以为存储上述计算机程序的上述存储器。示例性的,存储上述计算机程序的上述存储器可以为某一个存储单元的一个区域;预设的存储器可以为该某一个存储单元的另一个区域;比如,存储上述计算机程序的上述存储器可以为硬盘中的C盘,预设的存储器可以为该硬盘中的D盘;其中,C盘、D盘仅为示意性举例。这样,电子设备可以在获取到另一电子设备的标识后,根据预设的存储器中预先存储的另一电子设备的标识及其对应的Wi-Fi P2P连接信息,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息;从而,根据该Wi-Fi P2P连接信息,与另一电子设备快速建立Wi-Fi P2P连接。如此,就省去了全信道扫描的过程,节省了大量时间,缩减了两个设备的Wi-Fi P2P连接的耗时时长,提高了Wi-Fi P2P连接的效率,并且两个设备的Wi-Fi P2P连接的耗时时长也稳定,提升了用户体验。
根据第一方面,电子设备还执行:在根据电子设备的标识,从存储器以外的预设的存储器中,获取不到另一电子设备的标识对应的Wi-Fi P2P连接信息后,电子设备对电子设 备支持的频段依次进行全信道扫描。这样,即使预设的存储器中没有预先存储另一电子设备的标识及其对应的Wi-Fi P2P连接信息,也提供了全信道扫描的方式,用于保证该电子设备与另一电子设备的Wi-Fi P2P连接。
根据第一方面,或者以上第一方面的任意一种实现方式,电子设备还执行:在全信道扫描中,在一个信道上接收到另一电子设备的消息;在该消息包含另一电子设备的标识以及Wi-Fi P2P连接信息后,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;基于Wi-Fi P2P连接信息,与另一电子设备建立Wi-Fi P2P连接。这样,经过全信道扫描的方式,获取到另一电子设备的标识及其对应的Wi-Fi P2P连接信息后,存储在预设的存储器中,便于下次该电子设备与该另一电子设备建立Wi-Fi P2P连接后,无需再经过全信道扫描的方式,而是通过从预设的存储器中查询,来获取另一电子设备对应的Wi-Fi P2P连接信息,从而为以后节约大量时间。
根据第一方面,或者以上第一方面的任意一种实现方式,电子设备还执行:在接收到该输入之前,电子设备开启Wi-Fi P2P、蓝牙或ZigBee,工作在预设的信道;接收到另一电子设备的初始设置消息;在该初始设置消息包含另一电子设备的标识以及Wi-Fi P2P连接信息后,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;其中,该电子设备的预设的信道与另一电子设备的预设的信道相关联。这样,电子设备是在之前通过该步骤,实现在预设的存储器中存储另一电子设备的标识及其对应的Wi-Fi P2P连接信息。从而,为以后通过查询预设的存储器,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息,打下基础。
根据第一方面,或者以上第一方面的任意一种实现方式,其中,从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息;包括:从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的多个Wi-Fi P2P连接信息中存储时间最晚的一条Wi-Fi P2P连接信息。这样,对于在预设的存储器中存储有与另一电子设备对应的多条Wi-Fi P2P连接信息来说,可以通过查询获取到的存储时间,选择存储时间最晚(最新)的Wi-Fi P2P连接信息,从而避免使用之前的Wi-Fi P2P连接信息。
根据第一方面,或者以上第一方面的任意一种实现方式,其中,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;包括:将另一电子设备的标识、Wi-Fi P2P连接信息和存储时间以对应的方式存储在预设的存储器中。
根据第一方面,或者以上第一方面的任意一种实现方式,其中,存储时间为存储在预设的存储器中的当前时间。
第二方面,提供一种Wi-Fi P2P连接方法。该方法应用于电子设备,该方法包括:接收到一个输入;响应于该输入,获取到一个另一电子设备的标识;在根据所述电子设备的标识,从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息后,基于该Wi-Fi P2P连接信息,与另一电子设备建立Wi-Fi P2P连接;其中,预设的存储器位于电子设备内;或者,预设的存储器位于电子设备以外,且与电子设备关联的设备上。示例性的,该电子设备可以为移动设备。可替换地,上述预设的存储器也可以为存储上述计算机程序的上述存储器。示例性的,存储上述计算机程序的上述存储器可以为某一个存储单元的一个区域;预设的存储器可以为该某一个存储单元的另一个区域;比如,存储上述计算机程序的上述存储器可以为硬盘中的C盘,预设的存储器可以为该硬盘中的D盘;其中,C盘、D盘仅为示意性举例。
根据第二方面,该方法还包括:在根据另一电子设备的标识,从该存储器以外的预设的存储器中,获取不到另一电子设备的标识对应的Wi-Fi P2P连接信息后,该电子设备对该电子设备支持的频段依次进行全信道扫描。
根据第二方面,或者以上第二方面的任意一种实现方式,该方法还包括:在全信道扫描中,在一个信道上接收到另一电子设备的消息;在该消息包含另一电子设备的标识以及Wi-Fi P2P连接信息后,将另一电子设备的标识和该Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;基于该Wi-Fi P2P连接信息,与另一电子设备建立Wi-Fi P2P连接。
根据第二方面,或者以上第二方面的任意一种实现方式,该方法还包括:在接收到该输入之前,该电子设备开启Wi-Fi P2P、蓝牙或ZigBee,工作在预设的信道;接收到另一电子设备的初始设置消息;在初始设置消息包含另一电子设备的标识以及Wi-Fi P2P连接信息后,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;其中,电子设备的预设的信道与另一电子设备的预设的信道相关联。
根据第二方面,或者以上第二方面的任意一种实现方式,其中,从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息;包括:从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的多个Wi-Fi P2P连接信息中存储时间最晚的一条Wi-Fi P2P连接信息。这样,对于在预设的存储器中存储有与另一电子设备对应的多条Wi-Fi P2P连接信息来说,可以通过查询获取到的存储时间,选择存储时间最晚(最新)的Wi-Fi P2P连接信息,从而避免使用之前的Wi-Fi P2P连接信息。
根据第二方面,或者以上第二方面的任意一种实现方式,其中,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;包括:将另一电子设备的标识、Wi-Fi P2P连接信息和存储时间以对应的方式存储在预设的存储器中。
根据第二方面,或者以上第二方面的任意一种实现方式,其中,存储时间为存储在预设的存储器中的当前时间。
根据第二方面,或者以上第二方面的任意一种实现方式,该Wi-Fi P2P连接信息包括:另一电子设备的信道、认证信息和MAC地址;该电子设备的预设的信道与该另一电子设备的预设的信道相同。
根据第二方面,或者以上第二方面的任意一种实现方式,该认证信息为密钥或证书。
第二方面及第二方面的任意一种实现方式分别与第一方面及第一方面的任意一种实现方式相对应。第二方面以及第二方面中任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第三方面,提供一种计算机可读存储介质。该计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行如第二方面以及第二方面的任意一种实现方式的方法。
第三方面以及第三方面中任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第四方面,提供一种计算机程序产品。当其在计算机上运行时,使得计算机执行如第二方面以及第二方面的任意一种实现方式的方法。
第四方面以及第四方面中任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第五方面,提供一种另一电子设备。该另一电子设备包括:处理器;存储器;以及计 算机程序,其中计算机程序存储在存储器上,当计算机程序被处理器执行时,使得该另一电子设备执行:接收到一个输入;响应于该输入,开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道;将该另一电子设备配置为GO设备;周期性地广播消息;其中,该另一电子设备预设的信道与至少一个电子设备预设的信道相关联。这样,另一电子设备是在之前通过该步骤,实现在预设的存储器中存储另一电子设备的标识及其对应的Wi-Fi P2P连接信息。从而,为以后通过查询预设的存储器,获取到该另一电子设备的标识对应的Wi-Fi P2P连接信息,打下基础。
根据第五方面,该另一电子设备还执行:在该另一电子设备广播的时长达到预设的阈值时长后,或者,在接收到另一个输入后,该另一电子设备停止广播消息;该另一电子设备仍工作在预设的信道。这样,就提供了另一电子设备停止广播消息的几种方式。需要说明的是,这几种方式均为示意性的。本申请还可包括不限于上述几种方式以外的其他方式。
根据第五方面,或者以上第五方面的任意一种实现方式,该另一电子设备还执行:在接收到该电子设备的Wi-Fi P2P连接请求后,基于Wi-Fi P2P连接信息,与该电子设备建立Wi-Fi P2P连接。
根据第五方面,或者以上第五方面的任意一种实现方式,该另一电子设备的标识为电子设备的服务集标识符SSID,基本服务集标识符BSSID,与该电子设备的SSID相关联的标识,或者与该电子设备的BSSID相关联的标识。
第六方面,提供一种芯片系统。该芯片系统包括:存储器,用于存储计算机程序;处理器;当处理器从存储器中调用并运行计算机程序后,使得安装有该芯片系统的电子设备执行如第二方面以及第二方面的任意一种实现方式的方法。
第六方面以及第六方面中任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第七方面,提供一种电子设备,包括:处理器;存储器;以及计算机程序,其中计算机程序存储在存储器上,当计算机程序被处理器执行时,使得电子设备执行:接收到一个输入;响应于该输入,获取到另一电子设备的标识;从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的一条Wi-Fi P2P连接信息;在基于该Wi-Fi P2P连接信息,不能与另一电子设备建立Wi-Fi P2P连接后,电子设备对电子设备支持的频段依次进行全信道扫描;其中,预设的存储器位于电子设备内;或者,预设的存储器位于电子设备以外,且与电子设备关联的设备上;预设的存储器只存储有关另一电子设备的标识的一条记录,该记录反映另一电子设备的标识及其对应的Wi-Fi P2P连接信息。示例性的,该电子设备可以为移动设备。可替换地,上述预设的存储器也可以为存储上述计算机程序的上述存储器。示例性的,存储上述计算机程序的上述存储器可以为某一个存储单元的一个区域;预设的存储器可以为该某一个存储单元的另一个区域;比如,存储上述计算机程序的上述存储器可以为硬盘中的C盘,预设的存储器可以为该硬盘中的D盘;其中,C盘、D盘仅为示意性举例。这样,对于已经在预设的存储器中存储Wi-Fi P2P连接信息的另一电子设备来说,即使该另一电子设备的Wi-Fi P2P连接信息有更改,电子设备也可及时检测到、及时获取到该另一电子设备更改后的Wi-Fi P2P连接信息;提供了自我检测、自我获取的功能。
根据第七方面,电子设备还执行:在全信道扫描中,在一个信道上接收到另一电子设备的消息;在该消息包含另一电子设备的标识以及另一条Wi-Fi P2P连接信息后,将另一 电子设备的标识和另一条Wi-Fi P2P连接信息以对应的方式,存储在预设的存储器中;基于另一条Wi-Fi P2P连接信息,与另一电子设备建立Wi-Fi P2P连接。这样,对于已经在预设的存储器中存储Wi-Fi P2P连接信息的另一电子设备来说,即使该另一电子设备的Wi-Fi P2P连接信息有更改,电子设备在自我检测、自我获取之后,还能将该另一电子设备更改后的Wi-Fi P2P连接信息,及时地存储在预设的存储器中,便于以后使用更改后的Wi-Fi P2P连接信息;提供了自我存储的功能。
根据第七方面,或者以上第七方面的任意一种实现方式,将另一电子设备的标识和另一条Wi-Fi P2P连接信息以对应的方式,存储在预设的存储器中,包括:将另一电子设备的标识和另一条Wi-Fi P2P连接信息以对应的方式,覆盖另一电子设备的标识和Wi-Fi P2P连接信息,存储在预设的存储器中。这样,通过覆盖的方式,针对一个另一电子设备,只能有一条Wi-Fi P2P连接信息或一条对应关系存储在预设的存储器中;避免通过查询,获取到之前的Wi-Fi P2P连接信息,从而出现错误的情形。
根据第七方面,或者以上第七方面的任意一种实现方式,在接收到该输入之前,电子设备开启Wi-Fi P2P、蓝牙或ZigBee,工作在预设的信道;接收到另一电子设备的初始设置消息;在初始设置消息包含另一电子设备的标识以及Wi-Fi P2P连接信息后,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;其中,电子设备的预设的信道与另一电子设备的预设的信道相关联。这样,电子设备是在之前通过该步骤,实现在预设的存储器中存储另一电子设备的标识及其对应的Wi-Fi P2P连接信息。从而,为以后通过查询预设的存储器,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息,打下基础。
第八方面,提供一种Wi-Fi P2P连接方法。该方法应用于电子设备,该方法包括:接收到一个输入;响应于该输入,获取到另一电子设备的标识;从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的一条Wi-Fi P2P连接信息;在基于该Wi-Fi P2P连接信息,不能与另一电子设备建立Wi-Fi P2P连接后,电子设备对电子设备支持的频段依次进行全信道扫描;其中,预设的存储器位于电子设备内;或者,预设的存储器位于电子设备以外,且与电子设备关联的设备上;预设的存储器只存储有关另一电子设备的标识的一条记录,该记录反映另一电子设备的标识及其对应的Wi-Fi P2P连接信息。示例性的,该电子设备可以为移动设备。可替换地,上述预设的存储器也可以为存储上述计算机程序的上述存储器。示例性的,存储上述计算机程序的上述存储器可以为某一个存储单元的一个区域;预设的存储器可以为该某一个存储单元的另一个区域;比如,存储上述计算机程序的上述存储器可以为硬盘中的C盘,预设的存储器可以为该硬盘中的D盘;其中,C盘、D盘仅为示意性举例。
根据第八方面,该方法还包括:在全信道扫描中,在一个信道上接收到另一电子设备的消息;在该消息包含另一电子设备的标识以及另一条Wi-Fi P2P连接信息后,将另一电子设备的标识和另一条Wi-Fi P2P连接信息以对应的方式,存储在预设的存储器中;基于另一条Wi-Fi P2P连接信息,与另一电子设备建立Wi-Fi P2P连接。
根据第八方面,或者以上第八方面的任意一种实现方式,将另一电子设备的标识和另一条Wi-Fi P2P连接信息以对应的方式,存储在预设的存储器中,包括:将另一电子设备的标识和另一条Wi-Fi P2P连接信息以对应的方式,覆盖另一电子设备的标识和Wi-Fi P2P连接信息,存储在预设的存储器中。
根据第八方面,或者以上第八方面的任意一种实现方式,该方法还包括:在接收到该输入之前,电子设备开启Wi-Fi P2P、蓝牙或ZigBee,工作在预设的信道;接收到另一电子设备的初始设置消息;在初始设置消息包含另一电子设备的标识以及Wi-Fi P2P连接信息后,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;其中,电子设备的预设的信道与另一电子设备的预设的信道相关联。
第八方面及第八方面的任意一种实现方式分别与第七方面及第七方面的任意一种实现方式相对应。第八方面以及第八方面中任意一种实现方式所对应的技术效果可参见上述第七方面以及第七方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第九方面,提供一种计算机可读存储介质。该计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行如第八方面以及第八方面的任意一种实现方式的方法。
第九方面以及第九方面中任意一种实现方式所对应的技术效果可参见上述第八方面以及第八方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十方面,提供一种计算机程序产品。当其在计算机上运行时,使得计算机执行如第八方面以及第八方面的任意一种实现方式的方法。
第十方面以及第十方面中任意一种实现方式所对应的技术效果可参见上述第八方面以及第八方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十一方面,提供一种芯片系统。该芯片系统包括:存储器,用于存储计算机程序;处理器;当处理器从存储器中调用并运行计算机程序后,使得安装有该芯片系统的电子设备执行如第八方面以及第八方面的任意一种实现方式的方法。
第十一方面以及第十一方面中任意一种实现方式所对应的技术效果可参见上述第八方面以及第八方面中任意一种实现方式所对应的技术效果,此处不再赘述。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本申请的一些实施例。对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1为本申请提供的Wi-Fi P2P连接方法的场景示意图;
图2为本申请提供的移动设备的硬件结构示意图;
图3为本申请提供的电子设备的硬件结构示意图;
图4为本申请提供的Wi-Fi P2P连接方法的流程示意图;
图5为本申请提供的Wi-Fi P2P连接方法的初始设置步骤中电子设备的流程示意图;
图6为本申请提供的Wi-Fi P2P连接方法的初始设置步骤中移动设备的流程示意图;
图7A为本申请提供的Wi-Fi P2P连接方法的使用步骤中移动设备的一种实施例的流程示意图;
图7B为本申请提供的Wi-Fi P2P连接方法的使用步骤中移动设备的一种实施例的流程示意图;
图8为本申请提供的Wi-Fi P2P连接方法中,基于Wi-Fi P2P连接信息,移动设备与电子设备建立Wi-Fi P2P连接的流程示意图;
图9为本申请提供的移动设备的结构示意图;
图10为本申请提供的Wi-Fi P2P连接装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请实施例中,“一个或多个”是指一个、两个或两个以上;“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
本申请实施例涉及的多个,是指大于或等于两个。需要说明的是,在本申请实施例的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。
为了更清楚地阐明本申请技术方案,下面对本申请涉及的相关概念进行解释。
信道,是指信号在通信系统中传输的通道,由信号从发射端传输到接收端所经过的传输媒质所构成。根据IEEE 802.11协议,2.4GHz Wi-Fi频段被划分为13个交叠的信道,每个信道的宽度是22MHz(IEEE 802.11g标准和IEEE 802.11n标准中每个信道频宽是20MHz,IEEE 802.10B标准中每个信道频宽是22MHz);5GHz Wi-Fi频段被划分了201个信道。
Wi-Fi P2P是无线保真(wireless fidelity,Wi-Fi)联盟(alliance)推出的Wi-Fi端对端(peer-to-peer,P2P)标准。Wi-Fi P2P连接都是在用户发起P2P业务时才按需创建的,典型情况下该过程耗时3.5~20s。Wi-Fi P2P连接的模式可包括:
方式一、标准模式(standard)
标准模式下的Wi-Fi P2P连接初始化包含发现(discovery)、组所有者(group owner,GO)协商、供应(provisioning)以及IP地址初始化4个关键过程。其中,完成discovery过程后,被发现设备即可显示在发现设备上,并等待用户选择。具体的,discovery过程包含扫描(scan)和发现(find)2个过程。find过程包含搜索(search)和侦听(listen)过程,search和listen来回循环,直至发现对方设备,或被对方设备发现。通常来说,scan是全信道扫描。scan的全信道扫描通常耗时900毫秒(ms)~2秒(s),search和listen过程通常耗时200ms~10s。search和listen过程的最短耗时和最长耗时相差较大,主要是因为Wi-Fi P2P双方采用时分机制,search的耗时不稳定。
标准模式的最大局限性是scan和find都采用信道切换方式在不同信道发送探查请求(probe request)。其中,要想让对方发送请求响应,需要接收方与发送方处于相同信道。而双方在协商之前并不知晓对方使用的信道,因此会导致双方中的至少一方更换信道重复 发送probe request,如此循环,直至发现对方设备或被对方设备发现。因此,整个过程耗时较长且整体耗时不稳定。
示例性的,若发送方当前向接收方发送协商请求的信道为a信道,接收方当前接收协商请求的信道为b信道。由于接收方与发送方当前所使用的信道不是同一个信道,因此发送方设备通过a信道发送的协商请求,接收方无法通过b信道接收到,从而接收方无法响应该协商请求。发送方更换信道,接收方也可能更换信道,双方再次协商。发送方和接收方中的至少一个,可能多次更换信道,如此重复,直至最终双方信道相同,接收方接收到发送方发送的协商请求。这样,导致整个过程耗时较长且整体耗时不稳定。
由上可知,标准模式的discovery耗时较长,且时长不稳定。另外,用户通常只能在发现设备经discovery发现被发现设备之后,才能进行设备选择。因此P2P业务的初始化耗时较长且时长不稳定,用户体验不好。
方式二、持续模式(persistent)
持续模式中首次连接之后可以持久化组(group)配置信息,后续连接可以省去GO协商过程。并且,Provisioning过程也得以简化。但是,持续模式增加了Invitation;并且持续模式的discovery过程与标准模式的discovery过程相同,并未简化;因而也会导致P2P业务的初始化耗时较长且时长不稳定,用户体验不好。
也就是说,Wi-Fi P2P连接的上述两种模式,都导致或可能导致Wi-Fi P2P连接的耗时较长,用户体验不好。
为了解决上述技术问题,本申请提供了一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质;能够缩减两个设备的连接建立阶段的耗时时长,保持该耗时时长的稳定性,提升用户体验。
接下来介绍,一个电子设备与另一电子设备之间的Wi-Fi P2P连接方法。为了易于区分电子设备和另一电子设备,避免名称上的混淆,在下面的介绍中,以移动设备替代电子设备,以电子设备替代另一电子设备。需要说明的是,这仅是为了便于区分名称,避免混淆所采用的,并不是用于限定设备的具体类型。比如,移动设备也可以为固定式的电子设备(如台式计算机等)。
图1为本申请实施例提供的Wi-Fi P2P连接方法的场景示意图。如图1所示,移动设备100与电子设备200建立Wi-Fi P2P的无线连接。移动设备100可以通过该Wi-Fi P2P的无线连接向电子设备200传输数据(比如投屏等)。可选地,Wi-Fi P2P连接的工作频段可以为2.4GHz频段或5GHz频段。可选地,Wi-Fi AP连接的工作频段可以为2.4GHz频段或5GHz频段。
本申请实施例中移动设备100包括但不限于智能手机、智能耳机、平板电脑、具备无线通讯功能的可穿戴电子设备(如智能手表、智能手环、智能戒指、智能眼镜)等。移动设备的示例性实施例包括但不限于搭载
Figure PCTCN2021119554-appb-000001
Windows、Linux或者其它操作系统的便携式电子设备。上述移动设备也可为其它便携式电子设备,诸如膝上型计算机(Laptop)等。还应当理解的是,在其他一些实施例中,上述移动设备也可以不是便携式电子设备,而是诸如台式计算机的固定式电子设备。
示例性地,图2示出了本申请实施例提供的移动设备的硬件结构示意图。如图2所示,移动设备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等。
可以理解的是,本申请实施例示意的结构并不构成对移动设备100的具体限定。在本申请另一些实施例中,移动设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。移动设备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中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器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可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展移动设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
移动设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
示例性地,图3示出了电子设备200的硬件结构示意图。如图3所示,电子设备200可包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线3,天线4,无线通信模块250,传感器模块260等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器210可以包括一个或多个处理单元。例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的部件,也可以集成在一个或多个处理器中。在一些实施例中,电子设备200也可以包括一个或多个处理器210。其中,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路间(inter-integrated circuit,I2C)接口,集成电路间音频(integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,SIM卡接口,和/或USB接口等。其中,USB接口230是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口230可以用于连接充电器为电子设备200充电,也可以用于电子设备200与外围设备之间传输数据。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备200的结构限定。在本申请另一些实施例中,电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电子设备200的无线通信功能可以通过天线3,天线4以及无线通信模块250等实现。
无线通信模块250可以提供应用在电子设备200上的包括Wi-Fi(包括Wi-Fi感知和Wi-Fi AP),蓝牙(bluetooth,BT),无线数传模块(例如,433MHz,868MHz,915MHz)等无线通信的解决方案。无线通信模块250可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块250经由天线3和/或天线4接收电磁波,将电磁波信号滤波以及调频处理,将处理后的信号发送到处理器210。无线通信模块250还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线3和/或天线4转为电磁波辐射出去。
本申请实施例中,电子设备200可以通过无线通信模块广播消息,也可以向目标设备发送消息。广播的消息或向目标设备发送的消息,可以携带电子设备200的设备标识或者产品标识,用于周围的移动设备发现电子设备200。电子设备200还可以通过无线通信模块接收移动设备发送的消息。
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器221可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器210可以通过运行存储在内部存储器221的上述指令,从而使得电子设备200执行本申请一些实施例中所提供的Wi-Fi P2P连接方法,以及各种应用以及数据处理等。内部存储器221可以包括代码存储区和数据存储区。其中,代码存储区可存储操作系统。数据存储区可存储电子设备200使用过程中所创建的数据等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储部件,闪存部件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器210可以通过运行存储在内部存储器221的指令,和/或存储在设置于处理器210中的存储器的指令,来使得电子设备200执行本申请实施例中所提供的Wi-Fi P2P连接方法,以及其他应用及数据处理。
电子设备200包括但不限于平板电脑、台式计算机、便携式电子设备(如膝上型计算机,Laptop)、智能电视(如智慧屏)、智能打印机、车载设备(如无人驾驶中的智能设备)、智能音箱、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、其他带有显示屏的智能设备(如智能电网、智慧城市、智慧家庭、工业控制中的智能设备等)、以及其他带有扬声器的智能设备等。电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2021119554-appb-000002
Figure PCTCN2021119554-appb-000003
Linux或者其它操作系统的便携式电子设备或固定式电子设备。
具体的,本申请实施例提供的Wi-Fi P2P连接方法,主要使移动设备在需要与电子设备建立Wi-Fi P2P连接时,可以通过查询获取已存储的电子设备的标识(ID)及其对应的Wi-Fi P2P连接信息,基于查询到的Wi-Fi P2P连接信息,快速与电子设备完成Wi-Fi P2P连接,有效缩短移动设备与电子设备之间建立Wi-Fi P2P连接的时长;且该时长稳定,不会出现较大的波动,用户体验更好。
其中,Wi-Fi P2P连接信息包含:服务集标识符(service set identifier,SSID)、信道、基本服务集标识符(basic service set identifier,BSSID)、频率(frequency)、认证信息、电子设备的P2P连接能力信息、电子设备的地址信息等的至少一项。其中,电子设备的P2P连接能力信息可包括电子设备能否建立Wi-Fi P2P连接的指示信息,和/或电子设备的申请 角色,如组客户端(group client,GC)角色等;认证信息的具体形式包括但不限于密钥(比如,共享密钥,pre-shared key,PSK)或证书。
示例性地,如图4的(a)所示,本申请实施例提供的Wi-Fi P2P连接方法,可以包括:初始设置步骤和使用步骤。
在初始设置步骤中,电子设备和移动设备可工作在预先设置好的信道(比如,都工作在A信道)上,这样移动设备可以接收到电子设备发送的消息;并将接收到的消息中包含的电子设备的ID及Wi-Fi P2P连接信息,存储在预设的存储器中。
在一种示例中,Wi-Fi P2P连接信息至少包含电子设备的信道、认证信息和地址信息;可选地,地址信息可为MAC地址。
可选地,电子设备可工作在预先设置好的信道(比如,A信道),移动设备可在预先设置好的多个信道循环切换(比如,在A信道,B信道,C信道三个信道之间循环切换);在移动设备的信道循环切换至一个信道(比如,A信道)后,接收到电子设备发送的消息;并将接收到的消息中包含的电子设备的ID及Wi-Fi P2P连接信息,存储在预设的存储器中。
可选地,电子设备可在预先设置好的多个信道轮换(比如,在A信道,B信道,C信道三个信道之间轮换),移动设备可工作在预先设置好的信道(比如,A信道);在电子设备的信道轮换至一个信道(比如,A信道)后,移动设备接收到电子设备发送的消息;之后,移动设备将接收到的消息中包含的电子设备的ID及Wi-Fi P2P连接信息,存储在预设的存储器中。
其中,电子设备的ID与Wi-Fi P2P连接信息相对应。
在使用步骤中,移动设备工作的信道可能不同于其在初始设置步骤中的信道。移动设备基于接收到的一个输入,获取到电子设备的标识;若基于电子设备的标识,从预设的存储器中查询到对应的Wi-Fi P2P连接信息;基于该Wi-Fi P2P连接信息,与电子设备快捷地建立Wi-Fi P2P连接。
可选地,在使用步骤中,若基于电子设备的标识,从预设的存储器中查询不到对应的Wi-Fi P2P连接信息,则进行全信道扫描。在扫描的过程中,若接收到电子设备发送的一个消息,且该消息包含电子设备的ID及Wi-Fi P2P连接信息,则移动设备将电子设备的ID及Wi-Fi P2P连接信息存储在预设的存储器中;并且,基于该Wi-Fi P2P连接信息,与电子设备快捷地建立Wi-Fi P2P连接。
示例性地,如图4的(b)所示,本申请实施例提供的Wi-Fi P2P连接方法,可以包括使用步骤,不再包括初始设置步骤。有关使用步骤的介绍,请参见前文,此处不再赘述。
图5为本申请实施例提供的Wi-Fi P2P连接方法的初始设置步骤中电子设备的流程示意图。如图5所示,电子设备在初始设置步骤中的流程,可以包括:
S501、电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道;
在一种实施方式中,电子设备接收到一个输入后,开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,电子设备及与电子设备配套的遥控设备中的至少一个,可设有用于进行初始设置的按键。在用户触发上述按键后,该电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,电子设备具有语音识别功能和AI识别功能中的至少一种功能。在用户发出 预设的语音后,和/或,在用户输出预设的动作手势(比如,悬空手势)后,该电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在电子设备接收到来自移动设备的特定消息后,该电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
在一种实施方式中,在电子设备连接网络后,电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在电子设备首次连接一个网络后,电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在电子设备与一个网络断开连接,后续再次连接该网络后,电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道之前,可以通过语音提示用户确认。在用户确认后,电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,预设的信道并不限于一个信道,也可以为多个信道;在多个信道的情形下,电子设备可以在每个信道上工作一预设的时长,之后切换至另一信道,如此循环切换。
可选地,在电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道之后,向移动设备发送一个特定消息;移动设备在接收到该特定消息后,执行S601。
S502、电子设备将自身配置为GO设备;
在电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道之后,电子设备将自身配置为GO设备。
S503、电子设备周期性地广播消息。
具体地,电子设备以GO设备的角色,在预设的信道上,以一个周期广播消息。该消息包括电子设备的Wi-Fi P2P连接信息。
可选地,在该消息广播的时长达到预设的阈值时长后,电子设备停止周期性地广播消息。
可选地,电子设备上预设的信道与移动设备上预设的信道相关联。具体地,电子设备上预设的信道可以与移动设备上预设的信道相同,或者,电子设备上预设的信道可以为移动设备上预设的信道的一部分,或者,移动设备上预设的信道可以为电子设备上预设的信道的一部分。预设的信道较多的电子设备或移动设备上,切换信道的方式如前文所述,此处不再赘述。
该Wi-Fi P2P连接信息可以包含电子设备的ID(比如,服务集标识符SSID、基本服务集标识符BSSID)、信道、地址信息和认证信息等中的至少一项。认证信息可以为密钥(比如,共享密钥,pre-shared key,PSK)或者证书。地址信息可以为MAC地址。
可选地,该Wi-Fi P2P连接信息还可以包含:频率(frequency)、电子设备的P2P连接能力信息。电子设备的P2P连接能力信息可以包括:电子设备能否建立Wi-Fi P2P连接的指示信息,和/或电子设备的申请角色(比如,GO角色)等。
示例性地,电子设备的ID可以为SSID、BSSID、与该SSID相关联的标识、或与该BSSID相关联的标识。
可选地,在接收到另一个输入(比如,语音输入、触摸输入等)后,电子设备结束初始设置步骤的流程。
可选地,在本申请实施例的Wi-Fi P2P连接方法中,电子设备工作在图5示出的初始设置步骤,以及还可能工作在图8示出的由电子设备一侧执行的流程中。
图6为本申请实施例提供的Wi-Fi P2P连接方法的初始设置步骤中移动设备的流程示意图。如图6所示,移动设备在初始设置步骤的流程,可以包括:
S601、移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道;
在一种实施方式中,移动设备接收到一个输入后,开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,移动设备可设有用于进行初始设置的按键。在用户触发上述按键后,该移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,移动设备具有语音识别功能和AI识别功能中的至少一种功能。在用户发出预设的语音后,和/或,在用户输出预设的动作手势(比如,悬空手势)后,该移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在移动设备接收到来自电子设备的特定消息后,该电子设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
在一种实施方式中,在移动设备连接网络后,移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在移动设备首次连接一个网络后,移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在移动设备与一个网络断开连接,后续再次连接该网络后,移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,在移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道之前,可以通过语音提示用户确认。在用户确认后,移动设备Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道。
可选地,预设的信道并不限于一个信道,也可以为多个信道;在多个信道的情形下,移动设备可以在每个信道上工作一预设的时长,之后切换至另一信道,如此循环切换。
可选地,移动设备上预设的信道与电子设备上预设的信道相关联。具体地,移动设备上预设的信道可以与电子设备上预设的信道相同,或者,移动设备上预设的信道可以为电子设备上预设的信道的一部分,或者,电子设备上预设的信道可以为移动设备上预设的信道的一部分。预设的信道较多的移动设备或电子设备上,切换信道的方式如前文所述,此处不再赘述。
可选地,在移动设备开启Wi-Fi P2P、蓝牙或ZigBee,并工作在预设的信道之后,向电子设备发送一个特定消息;电子设备在接收到该特定消息后,执行S501。
S602、接收到广播消息;
具体地,移动设备工作在预先设置的信道上,用于接收广播消息。
在一种实施方式中,由于移动设备和电子设备(GO设备)各自工作的信道为相关联的信道(比如,相同的信道),所以移动设备可以迅速地接收到电子设备(GO设备)广播的消息。
示例性地,该广播消息包括至少一个电子设备发送的Wi-Fi P2P连接信息。
该Wi-Fi P2P连接信息可以包含电子设备的ID(比如,服务集标识符SSID、基本服务 集标识符BSSID)、信道、地址信息和认证信息等。认证信息可以为密钥(比如,共享密钥,pre-shared key,PSK)或者证书。地址信息可以为MAC地址。
可选地,该Wi-Fi P2P连接信息还可以包含:频率(frequency)、电子设备的P2P连接能力信息。电子设备的P2P连接能力信息可以包括:电子设备能否建立Wi-Fi P2P连接的指示信息,和/或电子设备的申请角色(比如,GO角色)等。
S603、获取到电子设备的ID和Wi-Fi P2P连接信息,并存储在预设的存储器中。
在一种实施方式中,移动设备可以从上述的广播消息中,获取到电子设备的ID和Wi-Fi P2P连接信息。
在获取到电子设备的ID和Wi-Fi P2P连接信息之后,移动设备将其存储在预设的存储器中。移动设备可以在预设的存储器中,建立电子设备的ID、信道、地址信息和认证信息之间的对应关系。其中,预设的存储器可以为移动设备本地的存储器,也可以为移动设备以外的,与移动设备关联的存储器(比如,第三方存储设备)。
可选地,移动设备可以按照先后顺序在预设的存储器上存储。
进一步地,当预设的存储器中用于存储上述信息(比如,上述信息至少包括电子设备的ID、信道、地址信息和认证信息)或上述对应关系(比如,上述对应关系至少包括电子设备的ID、信道、地址信息和认证信息之间的对应关系)的存储量达到第一存储阈值后,欲再存储新的上述信息或新的上述对应关系时,则移动设备可以删除最早存储的上述信息或上述对应关系。比如,预设的存储器存储了100条上述信息,此时欲再存储新的一条上述信息,则需要先删除100条上述信息中的最早的一条信息,之后再存储新的一条上述信息,使得移动设备存储的上述信息的数量仍保持在100条。
示例性地,电子设备的ID可以为SSID、BSSID、与SSID相关联的标识、或者与BSSID相关联的标识。
示例性地,以电子设备的ID为SSID为例,移动设备根据接收到的来自多个不同电子设备广播的消息,建立电子设备的ID、信道、地址信息和认证信息的对应关系如表1所示。表1存储在预设的存储器中。
表1电子设备的ID、信道、地址信息和认证信息的对应关系
Figure PCTCN2021119554-appb-000004
在一种实施方式中,移动设备在存储一条上述信息或上述对应关系后,所述移动设备在可建立Wi-Fi P2P连接的设备显示界面或者其他界面(比如桌面)上,显示已存储的电子设备的图标。也就是说,上述可建立Wi-Fi P2P连接的设备显示界面或者其他界面(比如桌面),会显示有已存储的电子设备的图标。比如,按照表1,上述可建立Wi-Fi P2P连接的设备显示界面或者其他界面(比如桌面),会显示有智能电视的图标、智能打印机的图标和智能音箱的图标。
可选地,在表1存储有两个以上同类型的电子设备(比如,两个智能电视)时,上述 可建立Wi-Fi P2P连接的设备显示界面或者其他界面(比如桌面),除了显示智能电视的图标以外,还可以显示用于区分两个智能电视的标识(比如,名称等)。
需要说明的是,电子设备的ID可以不为SSID,也可以不为BSSID。比如,电子设备的ID为与电子设备的SSID或BSSID关联的标识,通过电子设备的ID能够查询到电子设备的SSID或BSSID。电子设备的ID也可以为与电子设备的SSID和BSSID关联的标识。
可选地,在接收到另一个输入(比如,语音输入、触摸输入等)后,移动设备结束初始设置步骤的流程。
可选地,若在一个预设时长(比如,1分钟)内,移动设备仍未接收到广播消息,则结束移动设备的初始设置步骤的流程。
图7A为本申请提供的Wi-Fi P2P连接方法的使用步骤中移动设备的一种实施例的流程示意图。如图7A所示,该流程可以包括:
S701a、移动设备接收到一个输入;
移动设备接收到一个输入的方式有多种。比如,在移动设备的可建立Wi-Fi P2P连接的设备显示界面上,用户对一个电子设备的图标进行选择(比如,点击,长按等),此时移动设备接收到一个输入;或者,用户对着移动设备输入一个语音,此时移动设备接收到一个输入。
另外,电子设备的表面可设有NFC标签,或者与电子设备(比如,智能电视)配套的遥控设备上可设有NFC标签;在移动设备靠近电子设备上的NFC标签后,或者,在移动设备靠近遥控设备上的NFC标签后,移动设备也接收到一个输入。
S702a、响应于该输入,获取到电子设备的ID;
在移动设备接收到该输入后,移动设备获取到电子设备的ID。
示例性地,该电子设备的ID可以为电子设备的SSID、BSSID等标识,也可以为与电子设备的SSID、BSSID等标识关联的标识(即,根据该电子设备的ID,可查询到电子设备的SSID、BSSID等标识)。
S703a、在预设的存储器中,是否查询到电子设备的ID。
示例性地,移动设备在获取到电子设备的ID后,在预设的存储器中去查询,是否查询到电子设备的ID。若查询到电子设备的ID,则执行S704a。若查询不到电子设备的ID,则执行S706a。
S704a、从预设的存储器中,获取到该电子设备的Wi-Fi P2P连接信息;
示例性地,从预设的存储器的表1中,获取到电子设备的ID对应的信道、认证信息、地址信息等。
S705a、将自身的信道配置为电子设备的ID对应的信道,将自身配置为GC设备,按照Wi-Fi P2P连接信息中的认证信息、地址信息,与电子设备建立Wi-Fi P2P连接。
示例性地,移动设备将自身配置为GC设备,将自身的信道配置为电子设备的ID对应的信道,根据Wi-Fi P2P连接信息中的认证信息、地址信息,与电子设备(GO设备)建立Wi-Fi P2P连接。
示例性地,移动设备也可以先将自身的信道配置为电子设备的ID对应的信道,然后将自身配置为GC设备,之后根据Wi-Fi P2P连接信息中的认证信息、地址信息,与电子设备(GO设备)建立Wi-Fi P2P连接。
S706a、移动设备依次在每个信道上扫描。
若移动设备在预设的存储器中,没有查询到电子设备的ID,则移动设备依次在移动设备工作频段的每个信道上扫描。
示例性地,移动设备依次在移动设备支持的每个工作频段上的每个信道上扫描。
可选地,若移动设备支持M个工作频段,移动设备在第1个工作频段——第M个工作频段上的所有信道依次扫描。比如,移动设备支持2个工作频段,第1个工作频段上的信道数为N1个,第二个工作频段上的信道数为N2,则移动设备可以先在第1个工作频段的N1个信道上进行每个信道扫描,之后在第2个工作频段的N2个信道上进行每个信道扫描。
具体地,若移动设备支持2.4GHz频段和5GHz频段,移动设备可以先在2.4GHz频段上进行全信道扫描,之后再在5GHz频段上进行全信道扫描;移动设备也可以先在5GHz频段上进行全信道扫描,之后再在2.4GHz频段上进行全信道扫描。即移动设备可在其支持的所有频段上,依次对每个频段,进行每个信道的扫描。
可选地,若移动设备支持2.4GHz频段和5GHz频段,移动设备也可以先在当前工作的频段上进行全信道扫描,之后在另一频段上进行全信道扫描。
S707a、移动设备是否接收到电子设备发送的一个消息。
在扫描的过程中,若移动设备接收到电子设备发送的一个消息,则执行S708a;若移动设备没有接收到电子设备发送的一个消息,则执行S710a。在扫描的过程中,若移动设备接收到电子设备发送的一个消息,则说明移动设备当前的信道为电子设备使用的信道。
S708a、该消息是否包含电子设备的ID及电子设备的Wi-Fi P2P连接信息。
若移动设备确定该消息包含电子设备的ID及电子设备的Wi-Fi P2P连接信息,则执行S709a。
S709a、获取到电子设备的ID及电子设备的Wi-Fi P2P连接信息,并将获取到的上述信息存储在预设的存储器中。
移动设备从该消息中获取到电子设备的ID及电子设备的Wi-Fi P2P连接信息,并将获取到的上述信息存储在预设的存储器中。该预设的存储器可以为移动设备本地的存储器,也可以为移动设备以外的,与移动设备关联的存储器(比如,第三方存储设备)。
在S709a之后,执行S705a。
可选地,也可在S708a中,若移动设备确定该消息包含电子设备的ID及电子设备的Wi-Fi P2P连接信息,先执行S705a;之后,再执行S709a。即在S708a中,若移动设备确定该消息包含电子设备的ID及电子设备的Wi-Fi P2P连接信息,先将自身进行配置,与电子设备建立Wi-Fi P2P连接;之后,再将电子设备的ID及Wi-Fi P2P连接信息存储在预设的存储器中。
S710a,所有的信道是否都扫描完成。
若移动设备在S707a中没有接收到电子设备发送的消息,则移动设备确定所有的信道是否都扫描完成。
移动设备确定移动设备支持的所有工作频段上的所有信道是否都扫描完成。可选地,若移动设备支持两个工作频段,在一个工作频段上的所有信道都扫描完成后,可在另一个工作频段上扫描所有信道。上述两个工作频段只是示意性的举例。若移动设备支持M个工作频段(M为大于等于2的正整数),可以在一个工作频段上的所有信道都扫描完成,且 未扫描完M个工作频段上的所有信道后,可在M个工作频段中的另外一个工作频段上进行全信道扫描,如此直至扫描完所有工作频段下的所有信道。
若所有的信道未扫描完成,则执行S706a。
可选地,还可在S710a中,若所有的信道都扫描完成后,移动设备确定此次Wi-Fi P2P连接失败。
可选地,在移动设备按照图7A示出的流程执行时,电子设备可按照图5示出的流程执行。比如,在移动设备执行S706a时,电子设备可执行S503。若电子设备未开机(比如,电源断开),或者不再广播消息,则移动设备在S706a开始的全信道扫描,则不会在哪一个信道接收到该电子设备的一个消息;从而移动设备确定此次Wi-Fi P2P连接失败。
通过该方法,本申请实施例移动设备与电子设备在使用步骤中,移动设备在接收到一个输入后,获取到电子设备的ID,从预设的存储器中查找电子设备的ID对应的Wi-Fi P2P连接信息,从而移动设备可以获取Wi-Fi P2P连接信息中的信道、认证信息、地址信息,将自身的信道配置为该电子设备的ID对应的信道,按照Wi-Fi P2P连接信息中的认证信息、地址信息,与电子设备快速地完成Wi-Fi P2P连接,有效缩短移动设备与电子设备之间Wi-Fi P2P建立连接的时长。
图7B为本申请提供的Wi-Fi P2P连接方法的使用步骤中移动设备的一种实施例的流程示意图。如图7B所示,该流程可以包括:
S701b-S703b:分别与S701a-S703a相同,请参见S701a-S703a的描述;
S706b-S710b:分别与S706a-S710a相同,请参见S706a-S710a的描述;
S704b、从预设的存储器中,获取到该ID对应的Wi-Fi P2P连接信息,将自身的信道配置为Wi-Fi P2P连接信息中的信道,将自身配置为GC设备,并获取到Wi-Fi P2P连接信息中的认证信息和地址信息;
示例性地,从预设的存储器的表1中,获取到电子设备的ID对应的Wi-Fi P2P连接信息,并从中获取到信道、认证信息、地址信息等。
示例性地,移动设备将自身配置为GC设备,将自身的信道配置为电子设备的ID对应的信道,并根据获取到的Wi-Fi P2P连接信息中的认证信息、地址信息,准备与电子设备(GO设备)建立Wi-Fi P2P连接。
示例性地,移动设备也可以先将自身的信道配置为电子设备的ID对应的信道,然后将自身配置为GC设备,并根据获取到的Wi-Fi P2P连接信息中的认证信息、地址信息,准备与电子设备(GO设备)建立Wi-Fi P2P连接。
S705b、是否能与电子设备建立Wi-Fi P2P连接;
之后,判断能否与电子设备建立Wi-Fi P2P连接;若能,则执行S711b;若不能,则执行S706b。
之所以设置S705b,以及在S705b判断结果为否后,执行S706b;主要是考虑到有些电子设备或某个电子设备在一段时间后,可能会更改信道、认证信息和地址信息中的至少一项;这样,这些电子设备或某个电子设备的Wi-Fi P2P连接信息,可以通过全信道扫描的方式获取,并进行存储。并且,更改后的Wi-Fi P2P连接信息会覆盖之前的Wi-Fi P2P连接信息。
比如,电子设备A的ID为ID1,之前的Wi-Fi P2P连接信息中的信道、认证信息和地 址信息分别为:信道1、认证信息1和地址信息1;后来,出于某种原因(比如安全原因),电子设备A的Wi-Fi P2P连接信息进行了更改;更改后的Wi-Fi P2P连接信息中的信道、认证信息和地址信息分别为:信道2、认证信息2和地址信息2。这样,就可以通过该方法,将更改后的Wi-Fi P2P连接信息存储在预设的存储器中。并且,更改后的Wi-Fi P2P连接信息会覆盖之前的Wi-Fi P2P连接信息。这样,在预设的存储器中,电子设备A的ID对应的Wi-Fi P2P连接信息就只有更改后的Wi-Fi P2P连接信息。这样,就提供了一种有效的自动更改方式。
可选地,也可以通过初始设置步骤,来进行Wi-Fi P2P连接信息的更改;达到同样的技术效果。
S711b、与电子设备建立Wi-Fi P2P连接。
该实施例的方法不仅实现了图7A中的技术效果,还进一步考虑了预设的存储器中存储的Wi-Fi P2P连接信息有更改的情况。针对移动设备获取到电子设备的ID对应的Wi-Fi P2P连接信息后,不能与电子设备建立Wi-Fi P2P连接的情形,通过全信道扫描的方式,获取到更改后的Wi-Fi P2P连接信息,并以覆盖之前Wi-Fi P2P连接信息的方式,存储在预设的存储器中。这样,在面对电子设备的Wi-Fi P2P连接信息更改的情形,可以自我判断、主动获取和存储,从而便于后续从预设的存储器中获取到最新的Wi-Fi P2P连接信息。
在未有特别说明的情况下,图7B对应的实施例中未阐述的内容与图7A对应的实施例中的相关内容相同。此处不再赘述。比如,图7B对应的实施例中表1的存储位置未有阐述,因此与图7A对应的实施例中的相关内容相同;因此,在图7B对应的实施例中,表1也是存储在预设的存储器中。
可替换地,也可不采用图7B所示的流程方法。比如,在图7A中的S709a中,在存储电子设备的ID及其对应的Wi-Fi P2P连接信息的时候,还将存储时间存储在预设的存储器中。在S703a和S704a中,在查询到多个该ID后,选取存储时间最晚(即最新)的对应关系或存储记录中的Wi-Fi P2P连接信息。这样,也能获取到另一电子设备更改后的Wi-Fi P2P连接信息。本领域技术人员熟知,该方案也在图7A所示的方法中。
示例性地,如图8所示,本申请实施例的Wi-Fi P2P连接方法中,基于Wi-Fi P2P连接信息,移动设备与电子设备建立Wi-Fi P2P连接的流程,可以包括:
S810、移动设备向电子设备发送Wi-Fi P2P接入请求。
在一种示例中,所述Wi-Fi P2P接入请求包含Wi-Fi P2P接入的密钥。
S820、电子设备验证是否正确。
若验证正确,则执行S830。
在一种实施方式中,若验证不正确,记录验证次数为1,并在等待一预定时长后,再次验证;若再次验证不正确,则验证次数加1。如此循环,若验证次数达到预设验证次数后,仍验证不正确,则停止验证。
在另外一种实施方式中,若验证不正确,则在等待一预定时长后,再次验证;若再次验证不正确,则向移动设备发送一个消息,告知移动设备Wi-Fi P2P接入的密钥错误;或者,电子设备通过语音输出或消息显示的方式,告知Wi-Fi P2P接入的密钥错误。
S830、电子设备向移动设备发送确认消息,确认Wi-Fi P2P建立连接。
移动设备接收到电子设备发送的确认消息。Wi-Fi P2P连接通道建立完毕。
需要说明的是,上述的S810-S830只是一种示意性说明。在移动设备与电子设备的Wi-Fi P2P通道建立过程中,可能存在多次类似上述S810-S830的循环过程。只是,移动设备向电子设备发送的消息,以及电子设备向移动设备发送的消息有所替换或变化。此处不再一一展开。
本申请提供的上述各个实施例的全部或部分可以任意地、相互地结合使用。
本申请实施例提供的方法适用于以下的移动设备和Wi-Fi P2P连接装置。
图9示出了本申请提供的一种移动设备900。示例的,移动设备900包括至少一个处理器910、存储器920和显示屏930。其中,处理器910与存储器920和显示屏930耦合。本申请实施例中的耦合可以是通信连接,可以是电性,或其它的形式。具体的,存储器920用于存储程序指令。显示屏930用于显示用户界面。处理器910用于调用存储器920中存储的程序指令,使得移动设备900执行本申请实施例提供的Wi-Fi P2P连接方法中由移动设备所执行的步骤。应理解,该移动设备900可以用于实现本申请实施例提供的Wi-Fi P2P连接方法,相关特征可以参照上文,此处不再赘述。
在一些实施例中,在显示屏具有触摸功能时,显示屏又称为触摸显示屏。在触摸显示屏上的操作可以通过虚拟按键实现。在显示屏不具有触摸功能时,显示屏又称为非触摸显示屏。在非触摸显示屏上的操作可以通过物理按键实现。
本申请提供一种包含指令的计算机程序产品,当所述计算机程序产品在移动设备上运行时,使得所述移动设备执行本申请实施例提供的Wi-Fi P2P连接方法中由移动设备所执行的步骤。
本申请提供一种计算机可读存储介质,包括指令,当所述指令在移动设备上运行时,使得所述电子设备执行本申请实施例提供的Wi-Fi P2P连接方法中由移动设备所执行的步骤。
所属领域的技术人员可以清楚地了解到本申请实施例可以用硬件实现,或硬件与软件的方式实现。当使用硬件与软件实现,可以将上述功能存储在计算机可读介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。
可以理解的是,上述各设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的内容,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现 不应认为超出本申请的范围。
示例性地,如图10所示,本申请实施例提供一种Wi-Fi P2P连接装置。该装置可以是应用于移动设备和/或电子设备中的芯片或者其他可实现上述移动设备和/或电子设备功能的组合器件、部件等。当Wi-Fi P2P连接装置是具有上述移动设备和/或电子设备功能的部件时,收发可以是射频单元,处理模块可以是处理器。当通信装置是芯片系统时,收发单元可以是芯片系统的输入输出接口、处理单元可以是芯片系统的处理器,例如:中央处理单元(central processing unit,CPU)。芯片系统可以为一个芯片,一个芯片及其电路的集合,多个芯片,或者多个芯片及其电路的集合。
处理器1010负责管理总线架构和通常的处理,存储器1030可以存储处理器1010在执行操作时所使用的数据。收发机通信接口1040用于在处理器1010的控制下接收和发送数据与存储器1030进行数据通信。
处理器1010可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。处理器1010还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。存储器1030可以包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
处理器1010、存储器1030以及通信接口1040之间相互连接。可选地,处理器1010、存储器1030以及通信接口1040可以通过总线1020相互连接;总线1020可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读存储介质。可读存储介质的示意性举例(非穷举的列表)包括:便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
本申请实施例的用于Wi-Fi P2P连接的程序产品,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在服务器设备上运行。然而,本申请实施例的程序产品不限于此。在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被Wi-Fi P2P连接装置或者器件使用或者与其结合使用。
本申请实施例针对Wi-Fi P2P连接的方法还提供一种计算设备可读存储介质,即断电后内容不丢失。该存储介质中存储软件程序,包括程序代码,当所述程序代码在计算设备上运行时,该软件程序在被一个或多个处理器读取并执行时可实现本申请实施例上面任何一种Wi-Fi P2P连接的方案。
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、 组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。

Claims (15)

  1. 一种电子设备,其特征在于,包括:
    处理器;
    存储器;
    以及计算机程序,
    其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述电子设备执行以下步骤:
    接收到一个输入;
    响应于所述输入,获取到另一电子设备的标识;
    在根据所述电子设备的标识,从所述存储器以外的预设的存储器,获取到所述另一电子设备的标识对应的Wi-Fi P2P连接信息后,基于所述Wi-Fi P2P连接信息,与所述另一电子设备建立Wi-Fi P2P连接;
    其中,所述预设的存储器位于所述电子设备内;或者,所述预设的存储器位于所述电子设备以外,且与所述电子设备关联的设备上。
  2. 根据权利要求1所述的电子设备,其特征在于,所述电子设备还执行以下步骤:
    在根据所述电子设备的标识,从所述存储器以外的预设的存储器中,获取不到所述另一电子设备的标识对应的Wi-Fi P2P连接信息后,所述电子设备对所述电子设备支持的频段依次进行全信道扫描。
  3. 根据权利要求2所述的电子设备,其特征在于,所述电子设备还执行以下步骤:
    在全信道扫描中,在一个信道上接收到所述另一电子设备的消息;
    在所述消息包含所述另一电子设备的标识以及Wi-Fi P2P连接信息后,将所述另一电子设备的标识和所述Wi-Fi P2P连接信息以对应的方式存储在所述预设的存储器中;
    基于所述Wi-Fi P2P连接信息,与所述另一电子设备建立Wi-Fi P2P连接。
  4. 根据权利要求1-3中任意一项所述的电子设备,其特征在于,所述电子设备还执行以下步骤:
    在接收到所述输入之前,所述电子设备开启Wi-Fi P2P、蓝牙或ZigBee,工作在预设的信道;
    接收到所述另一电子设备的初始设置消息;
    在所述初始设置消息包含所述另一电子设备的标识以及Wi-Fi P2P连接信息后,将所述另一电子设备的标识和所述Wi-Fi P2P连接信息以对应的方式存储在所述预设的存储器中;
    其中,所述电子设备的预设的信道与所述另一电子设备的预设的信道相关联。
  5. 根据权利要求1-4中任意一项所述的电子设备,其特征在于,从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的Wi-Fi P2P连接信息;包括:从该存储器以外的预设的存储器,获取到另一电子设备的标识对应的多个Wi-Fi P2P连接信息中存储时间最晚的一条Wi-Fi P2P连接信息。
  6. 根据权利要求1-5中任意一项所述的电子设备,其特征在于,将另一电子设备的标识和Wi-Fi P2P连接信息以对应的方式存储在预设的存储器中;包括:将另一电子设备的标识、Wi-Fi P2P连接信息和存储时间以对应的方式存储在预设的存储器中。
  7. 根据权利要求1-6中任意一项所述的电子设备,其特征在于,存储时间为存储在预设的存储器中的当前时间。
  8. 一种Wi-Fi P2P连接方法,应用于电子设备,其特征在于,所述方法包括:
    接收到一个输入;
    响应于所述输入,获取到一个另一电子设备的标识;
    在根据所述电子设备的标识,从所述存储器以外的预设的存储器,获取到所述另一电子设备的标识对应的Wi-Fi P2P连接信息后,基于所述Wi-Fi P2P连接信息,与所述另一电子设备建立Wi-Fi P2P连接;
    其中,所述预设的存储器位于所述电子设备内;或者,所述预设的存储器位于所述电子设备以外,且与所述电子设备关联的设备上。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    在根据所述另一电子设备的标识,从所述存储器以外的预设的存储器中,获取不到所述另一电子设备的标识对应的Wi-Fi P2P连接信息后,所述电子设备对所述电子设备支持的频段依次进行全信道扫描。
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:
    在全信道扫描中,在一个信道上接收到所述另一电子设备的消息;
    在所述消息包含所述另一电子设备的标识以及Wi-Fi P2P连接信息后,将所述另一电子设备的标识和所述Wi-Fi P2P连接信息以对应的方式存储在所述预设的存储器中;
    基于所述Wi-Fi P2P连接信息,与所述另一电子设备建立Wi-Fi P2P连接。
  11. 根据权利要求8-10中任意一项所述的方法,其特征在于,所述方法还包括:
    在接收到所述输入之前,所述电子设备开启Wi-Fi P2P、蓝牙或ZigBee,工作在预设的信道;
    接收到所述另一电子设备的初始设置消息;
    在所述初始设置消息包含所述另一电子设备的标识以及Wi-Fi P2P连接信息后,将所述另一电子设备的标识和所述Wi-Fi P2P连接信息以对应的方式存储在所述预设的存储器中;
    其中,所述电子设备的预设的信道与所述另一电子设备的预设的信道相关联。
  12. 根据权利要求11所述的方法,其特征在于,所述Wi-Fi P2P连接信息包括:所述另一电子设备的信道、认证信息和MAC地址;所述电子设备的预设的信道与所述另一电子设备的预设的信道相同。
  13. 一种计算机可读存储介质,其特征在于,包括计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求8-12中任意一项所述的方法。
  14. 一种计算机程序产品,其特征在于,当其在电子设备上运行时,使得所述电子设备执行如权利要求8-12中任意一项所述的方法。
  15. 一种芯片系统,其特征在于,包括:存储器,用于存储计算机程序;处理器;当处理器从存储器中调用并运行计算机程序后,使得安装有该芯片系统的电子设备执行如权利要求8-12中任意一项所述的方法。
PCT/CN2021/119554 2020-09-28 2021-09-22 一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质 WO2022063109A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202011042864.1 2020-09-28
CN202011042864 2020-09-28
CN202011315060.4A CN114286423A (zh) 2020-09-28 2020-11-20 一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质
CN202011315060.4 2020-11-20

Publications (1)

Publication Number Publication Date
WO2022063109A1 true WO2022063109A1 (zh) 2022-03-31

Family

ID=75351162

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/119554 WO2022063109A1 (zh) 2020-09-28 2021-09-22 一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN112654074B (zh)
WO (1) WO2022063109A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056052A (zh) * 2022-08-17 2023-05-02 荣耀终端有限公司 消息处理方法、装置、电子设备和存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115348563A (zh) * 2021-04-28 2022-11-15 华为技术有限公司 建立Wi-Fi P2P连接的方法和电子设备
CN115022982B (zh) * 2021-12-31 2023-04-11 荣耀终端有限公司 多屏协同无感接入方法、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833795A (zh) * 2011-06-17 2012-12-19 联想(新加坡)私人有限公司 设置对等模式下的数据传输的速率
CN106550487A (zh) * 2016-10-19 2017-03-29 乐视控股(北京)有限公司 Wi‑fi 直连的方法及系统
CN111107605A (zh) * 2018-10-26 2020-05-05 九阳股份有限公司 一种家电设备的配网方法和家电设备
CN111182512A (zh) * 2018-11-09 2020-05-19 中国电信股份有限公司 终端的连接方法、装置、终端和计算机可读存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015002385A1 (ko) * 2013-07-03 2015-01-08 엘지전자(주) 무선 통신시스템에서 디바이스들 간에 커뮤니케이션을 위한 방법 및 장치
CN104519595B (zh) * 2013-09-29 2018-10-12 联想(北京)有限公司 无线连接方法及装置
CN105874871B (zh) * 2013-12-18 2020-10-16 英特尔公司 减少直接无线交互中的连接时间
CN103813473B (zh) * 2014-01-17 2017-08-25 深圳市金立通信设备有限公司 一种通信方法、终端及系统
US9585180B2 (en) * 2014-10-30 2017-02-28 Blackberry Limited Communication device, method and system for establishing wireless peer-to-peer connections
US9986492B2 (en) * 2015-09-02 2018-05-29 Qualcomm Incorporated Dynamic Wi-Fi roaming thresholds for dense access point environments
CN110446276B (zh) * 2018-05-04 2022-12-27 展讯通信(上海)有限公司 建立WiFi P2P连接的方法及装置
CN111372325B (zh) * 2020-02-21 2022-04-26 华为技术有限公司 建立Wi-Fi点对点连接的方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833795A (zh) * 2011-06-17 2012-12-19 联想(新加坡)私人有限公司 设置对等模式下的数据传输的速率
CN106550487A (zh) * 2016-10-19 2017-03-29 乐视控股(北京)有限公司 Wi‑fi 直连的方法及系统
CN111107605A (zh) * 2018-10-26 2020-05-05 九阳股份有限公司 一种家电设备的配网方法和家电设备
CN111182512A (zh) * 2018-11-09 2020-05-19 中国电信股份有限公司 终端的连接方法、装置、终端和计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056052A (zh) * 2022-08-17 2023-05-02 荣耀终端有限公司 消息处理方法、装置、电子设备和存储介质
CN116056052B (zh) * 2022-08-17 2023-10-31 荣耀终端有限公司 消息处理方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN112654074B (zh) 2022-08-09
CN112654074A (zh) 2021-04-13

Similar Documents

Publication Publication Date Title
WO2022063109A1 (zh) 一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质
US20220256626A1 (en) Device Control Method and Terminal
US9479224B2 (en) Apparatus and method for connecting to device in wireless terminal
EP3893109B1 (en) Method and device for connecting bluetooth devices
WO2022143071A1 (zh) 连接建立方法及电子设备
EP4247031A1 (en) Access method and system and electronic device
WO2022135341A1 (zh) 通信方法、系统及电子设备
WO2021138914A1 (zh) 传输数据的指示方法、装置、通信设备及存储介质
WO2022068513A1 (zh) 无线通信方法和终端设备
CN114390501B (zh) 数据传输的方法及电子设备
CN114499587B (zh) 音频同步的通信方法、系统、无线耳机、终端及存储介质
EP4311282A1 (en) Method for establishing connection between multiple devices, and device
CN114390491A (zh) 一种组网方法、装置和系统
CN113038627B (zh) 一种文件分享方法、移动设备、计算机存储介质
WO2022160967A1 (zh) 通信方法、移动设备、电子设备和计算机可读存储介质
CN113114798B (zh) 一种互联网协议ip地址的获取方法及电子设备
CN114286423A (zh) 一种Wi-Fi P2P连接方法、电子设备及计算机可读存储介质
CN115022872B (zh) 数据传输的方法及电子设备、可读存储介质
WO2014169798A1 (zh) 一种信息交互方法、终端及信息交互系统
CN116133161B (zh) 数据传输方法及电子设备
WO2023029938A1 (zh) Tws耳机解耦分享方法、装置、设备及存储介质
WO2023010432A1 (zh) 一种带宽配置方法、装置、用户设备、基站及存储介质
WO2022228207A1 (zh) 建立Wi-Fi P2P连接的方法和电子设备
WO2022252032A1 (zh) 终端能力上报方法及装置、存储介质
CN118102272A (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: 21871479

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21871479

Country of ref document: EP

Kind code of ref document: A1