CN112654074B - Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium - Google Patents

Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
CN112654074B
CN112654074B CN202011335445.7A CN202011335445A CN112654074B CN 112654074 B CN112654074 B CN 112654074B CN 202011335445 A CN202011335445 A CN 202011335445A CN 112654074 B CN112654074 B CN 112654074B
Authority
CN
China
Prior art keywords
electronic device
connection information
channel
preset
memory
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202011335445.7A
Other languages
Chinese (zh)
Other versions
CN112654074A (en
Inventor
卢峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011335445.7A priority Critical patent/CN112654074B/en
Priority claimed from CN202011315060.4A external-priority patent/CN114286423A/en
Publication of CN112654074A publication Critical patent/CN112654074A/en
Application granted granted Critical
Publication of CN112654074B publication Critical patent/CN112654074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The present application relates to electronic devices. An electronic device, comprising: a processor; a memory; and a computer program on the memory, which when executed by the processor, causes the electronic device to perform: receiving an input; acquiring an identifier of another electronic device; acquiring Wi-Fi P2P connection information corresponding to the identifier of another electronic device from a preset memory outside the memory; after the Wi-Fi P2P connection cannot be established with another electronic device based on the Wi-Fi P2P connection information, the electronic device sequentially performs full-channel scanning on the frequency bands supported by the electronic device; the predetermined memory is located in the electronic device or located outside the mobile device and on a device associated with the mobile device. Therefore, even if the Wi-Fi P2P connection information of another electronic device is changed, the electronic device can timely self-detect and self-acquire the changed Wi-Fi P2P connection information of another electronic device.

Description

Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a Wi-Fi P2P connection method, an electronic device, and a computer-readable storage medium.
Background
Without a local area network or the internet, the Wi-Fi P2P still supports interconnection between two devices and high-speed transmission of data, so the Wi-Fi P2P is widely applied to aspects such as wireless screen projection, file sharing and the like. However, the existing Wi-Fi P2P takes a long time and is unstable in the time-consuming period of the connection establishment phase of the two devices, and the user experience is not good.
Disclosure of Invention
In order to solve the technical problem, the application provides a Wi-Fi P2P connection method, an electronic device and a computer-readable storage medium; the time-consuming duration of the connection establishment phase of the two devices can be shortened, the stability of the time-consuming duration is kept, and the user experience is improved.
In a first aspect, an electronic device is provided. The electronic device includes: a processor; a memory; and a computer program, wherein the computer program is stored on the memory, which when executed by the processor, causes the electronic device to perform: receiving an input; acquiring an identification of another electronic device in response to the input; after acquiring Wi-Fi P2P connection information corresponding to the identifier of another electronic device from a preset memory except the memory according to the identifier of the electronic device, establishing Wi-Fi P2P connection with the other electronic device based on the Wi-Fi P2P connection information; wherein, the preset memory is positioned in the electronic equipment; alternatively, the predetermined memory is located outside the electronic device and on a device associated with the electronic device. Illustratively, the electronic device may be a mobile device. Alternatively, the preset memory may be the memory storing the computer program. For example, the memory storing the computer program may be an area of a certain storage unit; the preset memory can be another area of the certain memory unit; for example, the memory storing the computer program may be a C disk in a hard disk, and the preset memory may be a D disk in the hard disk; wherein, the C disc and the D disc are only schematic examples. In this way, after acquiring the identifier of another electronic device, the electronic device may acquire the Wi-Fi P2P connection information corresponding to the identifier of the another electronic device according to the identifier of the another electronic device and the Wi-Fi P2P connection information corresponding to the identifier of the another electronic device, which are pre-stored in the preset memory; thus, a Wi-Fi P2P connection is quickly established with another electronic device according to the Wi-Fi P2P connection information. Therefore, the process of full channel scanning is omitted, a large amount of time is saved, the time-consuming duration of connection of Wi-Fi P2P of the two devices is shortened, the efficiency of connection of Wi-Fi P2P is improved, the time-consuming duration of connection of Wi-Fi P2P of the two devices is stable, and user experience is improved.
According to the first aspect, the electronic device further performs: after the Wi-Fi P2P connection information corresponding to the identifier of another electronic device is not acquired from a preset memory outside the memory according to the identifier of the electronic device, the electronic device sequentially performs full-channel scanning on the frequency bands supported by the electronic device. Thus, even if the preset memory does not store the identification of another electronic device and the corresponding Wi-Fi P2P connection information in advance, a full-channel scanning mode is provided for ensuring that the electronic device is connected with the Wi-Fi P2P of another electronic device.
According to the first aspect, or any implementation manner of the first aspect above, the electronic device further performs: in full channel scanning, a message of another electronic device is received on one channel; after the message contains the identification of the other electronic equipment and the Wi-Fi P2P connection information, storing the identification of the other electronic equipment and the Wi-Fi P2P connection information in a preset memory in a corresponding mode; establish a Wi-Fi P2P connection with another electronic device based on the Wi-Fi P2P connection information. In this way, after the identification of the other electronic device and the Wi-Fi P2P connection information corresponding to the identification are acquired in the full channel scanning mode, the identification is stored in the preset memory, so that the Wi-Fi P2P connection information corresponding to the other electronic device is acquired by querying from the preset memory without the full channel scanning mode after the Wi-Fi P2P connection is established between the electronic device and the other electronic device next time, and a large amount of time is saved in the future.
According to the first aspect, or any implementation manner of the first aspect above, the electronic device further performs: before receiving the input, the electronic equipment starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel; receiving an initial setting message of another electronic device; after the initial setting message contains the identification of the other electronic equipment and the Wi-Fi P2P connection information, storing the identification of the other electronic equipment and the Wi-Fi P2P connection information in a corresponding mode in a preset memory; wherein the preset channel of the electronic device is associated with the preset channel of another electronic device. Thus, the electronic device realizes that the identification of another electronic device and the corresponding Wi-Fi P2P connection information are stored in the preset memory by the step before. Therefore, a foundation is laid for acquiring the Wi-Fi P2P connection information corresponding to the identification of the other electronic equipment by inquiring the preset memory at a later time.
According to the first aspect, or any implementation manner of the first aspect, the Wi-Fi P2P connection information corresponding to the identifier of another electronic device is acquired from a preset memory other than the memory; the method comprises the following steps: and acquiring one piece of Wi-Fi P2P connection information with the latest storage time from a plurality of pieces of Wi-Fi P2P connection information corresponding to the identifier of the other electronic equipment from a preset memory other than the memory. In this way, for storing a plurality of pieces of Wi-Fi P2P connection information corresponding to another electronic device in a preset memory, the last (latest) Wi-Fi P2P connection information can be selected by inquiring the acquired storage time, so that the previous Wi-Fi P2P connection information is not used.
According to a first aspect or any one of the above implementation manners of the first aspect, an identifier of another electronic device and Wi-Fi P2P connection information are stored in a preset memory in a corresponding manner; the method comprises the following steps: the identification of the other electronic device, the Wi-Fi P2P connection information, and the storage time are stored in a preset memory in a corresponding manner.
According to a first aspect, or any implementation manner of the first aspect above, the storage time is a current time stored in a preset memory.
In a second aspect, a Wi-Fi P2P connection method is provided. The method is applied to the electronic equipment and comprises the following steps: receiving an input; acquiring an identification of another electronic device in response to the input; after acquiring Wi-Fi P2P connection information corresponding to the identifier of another electronic device from a preset memory except the memory according to the identifier of the electronic device, establishing Wi-Fi P2P connection with the other electronic device based on the Wi-Fi P2P connection information; the preset memory is positioned in the electronic equipment; alternatively, the predetermined memory is located outside the electronic device and on a device associated with the electronic device. Illustratively, the electronic device may be a mobile device. Alternatively, the preset memory may be the memory storing the computer program. For example, the memory storing the computer program may be an area of a certain storage unit; the preset memory can be another area of the certain memory unit; for example, the memory storing the computer program may be a C disk in a hard disk, and the preset memory may be a D disk in the hard disk; wherein, the C disc and the D disc are only schematic examples.
According to a second aspect, the method further comprises: after the Wi-Fi P2P connection information corresponding to the identifier of the other electronic device is not acquired from a preset memory other than the memory according to the identifier of the other electronic device, the electronic device sequentially performs full channel scanning on the frequency bands supported by the electronic device.
According to a second aspect, or any implementation form of the second aspect above, the method further comprises: in full channel scanning, a message of another electronic device is received on one channel; after the message contains the identification of the other electronic equipment and the Wi-Fi P2P connection information, storing the identification of the other electronic equipment and the Wi-Fi P2P connection information in a preset memory in a corresponding mode; establishing a Wi-Fi P2P connection with another electronic device based on the Wi-Fi P2P connection information.
According to a second aspect, or any implementation manner of the second aspect above, the method further comprises: before receiving the input, the electronic equipment starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel; receiving an initial setting message of another electronic device; after the initial setting message contains the identification of the other electronic equipment and the Wi-Fi P2P connection information, storing the identification of the other electronic equipment and the Wi-Fi P2P connection information in a corresponding mode in a preset memory; wherein the preset channel of the electronic device is associated with a preset channel of another electronic device.
According to a second aspect, or any implementation manner of the second aspect, the Wi-Fi P2P connection information corresponding to the identifier of another electronic device is acquired from a preset memory other than the memory; the method comprises the following steps: and acquiring one piece of Wi-Fi P2P connection information with the latest storage time from a plurality of pieces of Wi-Fi P2P connection information corresponding to the identifier of the other electronic equipment from a preset memory other than the memory. In this way, for the case that a plurality of pieces of Wi-Fi P2P connection information corresponding to another electronic device are stored in the preset memory, the Wi-Fi P2P connection information with the latest (latest) storage time can be selected by querying the acquired storage time, so that the previous Wi-Fi P2P connection information is avoided.
According to a second aspect or any one of the above implementation manners of the second aspect, an identifier of another electronic device and Wi-Fi P2P connection information are stored in a preset memory in a corresponding manner; the method comprises the following steps: the identification of the other electronic device, the Wi-Fi P2P connection information, and the storage time are stored in a preset memory in a corresponding manner.
The second aspect, or any implementation manner of the second aspect, wherein the storage time is a current time stored in a preset memory.
According to a second aspect, or any implementation form of the second aspect above, the Wi-Fi P2P connection information includes: a channel, authentication information, and MAC address of another electronic device; the preset channel of the electronic device is the same as the preset channel of the other electronic device.
According to a second aspect, or any implementation manner of the second aspect above, the authentication information is a key or a certificate.
Any one implementation manner of the second aspect and the second aspect corresponds to any one implementation manner of the first aspect and the first aspect, respectively. For technical effects corresponding to any one implementation manner of the second aspect and the second aspect, reference may be made to the technical effects corresponding to any one implementation manner of the first aspect and the first aspect, and details are not repeated here.
In a third aspect, a computer-readable storage medium is provided. The computer readable storage medium comprises a computer program which, when run on an electronic device, causes the electronic device to perform the method as described in the second aspect and any one of the implementations of the second aspect.
For technical effects corresponding to any one implementation manner of the third aspect and the third aspect, reference may be made to the technical effects corresponding to any one implementation manner of the second aspect and the second aspect, which are not described herein again.
In a fourth aspect, a computer program product is provided. When run on a computer, cause the computer to perform a method as described in the second aspect and any one implementation of the second aspect.
For technical effects corresponding to any one implementation manner of the fourth aspect and the fourth aspect, reference may be made to the technical effects corresponding to any one implementation manner of the second aspect and the second aspect, and details are not repeated here.
In a fifth aspect, another electronic device is provided. The other electronic device includes: a processor; a memory; and a computer program, wherein the computer program is stored on the memory, which when executed by the processor causes the further electronic device to perform: receiving an input; responding to the input, starting Wi-Fi P2P, Bluetooth or ZigBee, and working in a preset channel; configuring the other electronic device as a GO device; periodically broadcasting a message; wherein the channel preset by the other electronic device is associated with the channel preset by at least one electronic device. Thus, the other electronic device realizes that the identification of the other electronic device and the corresponding Wi-Fi P2P connection information are stored in the preset memory by the step before. Therefore, a foundation is laid for acquiring the Wi-Fi P2P connection information corresponding to the identifier of the other electronic equipment by querying a preset memory later.
According to a fifth aspect, the another electronic device further performs: after the time length of the broadcast of the other electronic equipment reaches a preset threshold time length, or after another input is received, the other electronic equipment stops broadcasting the message; the other electronic device is still operating on the predetermined channel. Thus, several ways of stopping the broadcast message by another electronic device are provided. It should be noted that these ways are illustrative. The present application may also include other ways than the above-described ones.
According to a fifth aspect or any implementation manner of the above fifth aspect, the another electronic device further performs: after receiving the Wi-Fi P2P connection request of the electronic device, establishing Wi-Fi P2P connection with the electronic device based on the Wi-Fi P2P connection information.
According to a fifth aspect, or any implementation form of the above fifth aspect, the identification of the further electronic device is a service set identifier SSID of the electronic device, a basic service set identifier BSSID, an identification associated with the SSID of the electronic device, or an identification associated with the BSSID of the electronic device.
In a sixth aspect, a chip system is provided. The chip system includes: a memory for storing a computer program; a processor; when the processor calls and runs the computer program from the memory, the electronic device with the chip system installed therein is caused to execute the method according to the second aspect and any one of the implementation manners of the second aspect.
For technical effects corresponding to any one implementation manner of the sixth aspect and the sixth aspect, reference may be made to the technical effects corresponding to any one implementation manner of the second aspect and the second aspect, and details are not repeated here.
In a seventh aspect, an electronic device is provided, including: a processor; a memory; and a computer program, wherein the computer program is stored on the memory, which when executed by the processor, causes the electronic device to perform: receiving an input; acquiring an identification of another electronic device in response to the input; acquiring Wi-Fi P2P connection information corresponding to the identifier of another electronic device from a preset memory except the memory; after the Wi-Fi P2P connection cannot be established with another electronic device based on the Wi-Fi P2P connection information, the electronic device sequentially performs full-channel scanning on frequency bands supported by the electronic device; the preset memory is positioned in the electronic equipment; or the preset memory is positioned outside the electronic equipment and on equipment associated with the electronic equipment; the preset memory stores only one record about the identity of the other electronic device reflecting the identity of the other electronic device and its corresponding Wi-Fi P2P connection information. Illustratively, the electronic device may be a mobile device. Alternatively, the preset memory may be the memory storing the computer program. For example, the memory storing the computer program may be an area of a certain storage unit; the preset memory can be another area of the certain memory unit; for example, the memory storing the computer program may be a C disk in a hard disk, and the preset memory may be a D disk in the hard disk; wherein, the C disc and the D disc are only schematic examples. In this way, for another electronic device which stores Wi-Fi P2P connection information in a preset memory, even if the Wi-Fi P2P connection information of the other electronic device is changed, the electronic device can timely detect and timely acquire the changed Wi-Fi P2P connection information of the other electronic device; provides the functions of self detection and self acquisition.
According to a seventh aspect, the electronic device further performs: in full channel scanning, a message of another electronic device is received on one channel; after the message contains the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P, storing the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P in a corresponding mode in a preset memory; establish a Wi-Fi P2P connection with another electronic device based on another Wi-Fi P2P connection information. In this way, for another electronic device which already stores Wi-Fi P2P connection information in a preset memory, even if the Wi-Fi P2P connection information of the other electronic device is changed, the electronic device can store the changed Wi-Fi P2P connection information of the other electronic device in the preset memory in time after self-detection and self-acquisition, so as to facilitate the later use of the changed Wi-Fi P2P connection information; providing a self-storing function.
According to the seventh aspect, or any implementation manner of the seventh aspect above, storing the identifier of the other electronic device and the other piece of Wi-Fi P2P connection information in a corresponding manner in a preset memory includes: and storing the identification of the other electronic equipment and the other piece of Wi-Fi P2P connection information in a corresponding mode to cover the identification of the other electronic equipment and the Wi-Fi P2P connection information in a preset memory. In this way, only one piece of Wi-Fi P2P connection information or one corresponding relation can be stored in a preset memory for one other electronic device in an overlay manner; the situation that the previous Wi-Fi P2P connection information is acquired through inquiry, so that errors occur is avoided.
According to a seventh aspect, or any implementation manner of the seventh aspect above, the electronic device further performs: after establishing the Wi-Fi P2P connection with the other electronic device based on the Wi-Fi P2P connection information, the electronic device establishes a Wi-Fi P2P connection with the other electronic device. In this way, after acquiring the identifier of another electronic device, the electronic device may acquire the Wi-Fi P2P connection information corresponding to the identifier of the another electronic device according to the identifier of the another electronic device and the Wi-Fi P2P connection information corresponding to the identifier of the another electronic device, which are pre-stored in the preset memory; thus, a Wi-Fi P2P connection is quickly established with another electronic device according to the Wi-Fi P2P connection information. Therefore, the process of full channel scanning is omitted, a large amount of time is saved, the time-consuming duration of connection of Wi-Fi P2P of the two devices is shortened, the efficiency of connection of Wi-Fi P2P is improved, the time-consuming duration of connection of Wi-Fi P2P of the two devices is stable, and user experience is improved.
According to a seventh aspect, or any implementation manner of the seventh aspect, before receiving the input, the electronic device turns on Wi-Fi P2P, bluetooth, or ZigBee to operate on a preset channel; receiving an initial setting message of another electronic device; after the initial setting message contains the identification of the other electronic equipment and the Wi-Fi P2P connection information, storing the identification of the other electronic equipment and the Wi-Fi P2P connection information in a corresponding mode in a preset memory; wherein the preset channel of the electronic device is associated with a preset channel of another electronic device. Thus, the electronic device realizes that the identification of another electronic device and the corresponding Wi-Fi P2P connection information are stored in the preset memory by the step before. Therefore, a foundation is laid for acquiring the Wi-Fi P2P connection information corresponding to the identification of the other electronic equipment by inquiring the preset memory at a later time.
In an eighth aspect, a Wi-Fi P2P connection method is provided. The method is applied to the electronic equipment and comprises the following steps: receiving an input; acquiring an identification of another electronic device in response to the input; acquiring Wi-Fi P2P connection information corresponding to the identifier of another electronic device from a preset memory except the memory; after the Wi-Fi P2P connection cannot be established with another electronic device based on the Wi-Fi P2P connection information, the electronic device sequentially performs full-channel scanning on frequency bands supported by the electronic device; the preset memory is positioned in the electronic equipment; or the preset memory is positioned outside the electronic equipment and on equipment associated with the electronic equipment; the preset memory stores only one record about the identity of the other electronic device reflecting the identity of the other electronic device and its corresponding Wi-Fi P2P connection information. Illustratively, the electronic device may be a mobile device. Alternatively, the preset memory may be the memory storing the computer program. For example, the memory storing the computer program may be an area of a certain storage unit; the preset memory can be another area of the certain memory unit; for example, the memory storing the computer program may be a C disk in a hard disk, and the preset memory may be a D disk in the hard disk; wherein, the C disc and the D disc are only schematic examples.
According to an eighth aspect, the method further comprises: in full channel scanning, a message of another electronic device is received on one channel; after the message contains the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P, storing the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P in a corresponding mode in a preset memory; establish a Wi-Fi P2P connection with another electronic device based on another Wi-Fi P2P connection information.
According to an eighth aspect, or any implementation manner of the above eighth aspect, the storing the identification of the other electronic device and the other piece of Wi-Fi P2P connection information in a corresponding manner in a preset memory includes: and storing the identification of the other electronic equipment and the other piece of Wi-Fi P2P connection information in a corresponding mode to cover the identification of the other electronic equipment and the Wi-Fi P2P connection information in a preset memory.
According to an eighth aspect, or any implementation manner of the above eighth aspect, the method further comprises: after establishing the Wi-Fi P2P connection with the other electronic device based on the Wi-Fi P2P connection information, the electronic device establishes a Wi-Fi P2P connection with the other electronic device.
According to an eighth aspect, or any implementation manner of the above eighth aspect, the method further comprises: before receiving the input, the electronic equipment starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel; receiving an initial setting message of another electronic device; after the initial setting message contains the identification of the other electronic equipment and the Wi-Fi P2P connection information, storing the identification of the other electronic equipment and the Wi-Fi P2P connection information in a corresponding mode in a preset memory; wherein the preset channel of the electronic device is associated with a preset channel of another electronic device.
Any one implementation manner of the eighth aspect and the eighth aspect corresponds to any one implementation manner of the seventh aspect and the seventh aspect, respectively. For technical effects corresponding to any one implementation manner of the eighth aspect and the eighth aspect, reference may be made to the technical effects corresponding to any one implementation manner of the seventh aspect and the seventh aspect, and details are not repeated here.
In a ninth aspect, a computer-readable storage medium is provided. The computer readable storage medium comprises a computer program which, when run on an electronic device, causes the electronic device to perform the method as any one of the implementations of the eighth aspect and the eighth aspect.
For technical effects corresponding to any one of the implementations in the ninth aspect and the ninth aspect, reference may be made to the technical effects corresponding to any one of the implementations in the eighth aspect and the eighth aspect, and details are not described here again.
In a tenth aspect, a computer program product is provided. When run on a computer, cause the computer to perform a method as any one implementation of the eighth aspect and the eighth aspect.
For technical effects corresponding to any one implementation manner of the tenth aspect and the tenth aspect, reference may be made to the technical effects corresponding to any one implementation manner of the eighth aspect and the eighth aspect, and details are not described here.
In an eleventh aspect, a chip system is provided. The chip system includes: a memory for storing a computer program; a processor; when the processor calls and runs the computer program from the memory, the electronic device installed with the chip system is caused to execute the method according to any one of the implementation manners of the eighth aspect and the eighth aspect.
For technical effects corresponding to any one implementation manner of the eleventh aspect and the eleventh aspect, reference may be made to the technical effects corresponding to any one implementation manner of the eighth aspect and the eighth aspect, and details are not repeated here.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below. It is to be understood that the drawings in the following description are of some embodiments of the application only. For a person skilled in the art, other figures can also be derived from these figures without inventive exercise.
FIG. 1 is a schematic view of a Wi-Fi P2P connection method provided in the present application;
fig. 2 is a schematic hardware structure diagram of a mobile device provided in the present application;
fig. 3 is a schematic diagram of a hardware structure of an electronic device provided in the present application;
FIG. 4 is a schematic flow chart of a Wi-Fi P2P connection method provided herein;
FIG. 5 is a schematic flow chart of an electronic device in an initial setup step of a Wi-Fi P2P connection method provided by the present application;
FIG. 6 is a schematic flow chart of a mobile device in an initial setup step of a Wi-Fi P2P connection method provided by the present application;
FIG. 7A is a schematic flow chart diagram illustrating one embodiment of a mobile device in steps of using the Wi-Fi P2P connection method provided herein;
FIG. 7B is a schematic flow chart diagram illustrating one embodiment of a mobile device in steps of using the Wi-Fi P2P connection method provided herein;
fig. 8 is a schematic flowchart of a process of establishing a Wi-Fi P2P connection between a mobile device and an electronic device based on Wi-Fi P2P connection information in a Wi-Fi P2P connection method provided by the present application;
fig. 9 is a schematic structural diagram of a mobile device provided in the present application;
fig. 10 is a schematic structural diagram of a Wi-Fi P2P connection device provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the embodiments of the present application, "one or more" means one, two, or more than two; "and/or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, a and/or B, may represent: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The embodiments of the present application relate to a plurality of numbers greater than or equal to two. It should be noted that, in the description of the embodiments of the present application, the terms "first", "second", and the like are used for distinguishing the description, and are not to be construed as indicating or implying relative importance or order.
In order to clarify the technical solution of the present application more clearly, the following explains the related concepts related to the present application.
A channel, which is a channel through which a signal is transmitted in a communication system, is formed by a transmission medium through which the signal is transmitted from a transmitting end to a receiving end. According to the IEEE 802.11 protocol, the 2.4GHz Wi-Fi band is divided into 13 overlapping channels, each channel is 22MHz wide (each channel bandwidth in the IEEE 802.11g standard and the IEEE 802.11n standard is 20MHz, and each channel bandwidth in the IEEE 802.10B standard is 22 MHz); the 5GHz Wi-Fi band is divided into 201 channels.
Wi-Fi P2P is the Wi-Fi peer-to-peer (P2P) standard promulgated by the Wireless Fidelity (Wi-Fi) alliance (alliance). Wi-Fi P2P connections are created on demand when a user initiates a P2P service, typically taking 3.5-20 s. The modes of Wi-Fi P2P connection may include:
mode one, standard mode (standard)
Wi-Fi P2P connection initialization in standard mode includes 4 key processes of discovery (discovery), Group Owner (GO) negotiation, provisioning (provisioning), and IP address initialization. After the discovery process is completed, the discovered device can be displayed on the discovered device and waits for the user to select. Specifically, the discovery process includes 2 processes of scanning (scan) and finding (find). The find process comprises a search (search) and a listen (listen) process, and the search and listen cycle back and forth until, or discovered by, the peer device. Generally, scan is a full channel scan. A scan's full channel scan typically takes 900 milliseconds (ms) to 2 seconds(s), and the search and listen process typically takes 200ms to 10 s. The shortest time consumption and the longest time consumption of the search process are greatly different, mainly because the Wi-Fi P2P adopts a time division mechanism and the search time consumption is unstable.
The biggest limitation of the standard mode is that scan and find use channel switching to send probe requests (probe requests) on different channels. In order for the receiver to send a request response, the receiver and the sender need to be in the same channel. And the two parties do not know the channel used by the other party before negotiation, so that at least one of the two parties changes the channel to repeatedly send the probe request, and the process is circulated until the opposite party equipment is found or the opposite party equipment is found. Therefore, the whole process takes a long time and is unstable in overall time.
For example, if the channel through which the sender currently sends the negotiation request to the receiver is the a channel, the channel through which the receiver currently receives the negotiation request is the b channel. Because the current channels used by the receiver and the sender are not the same channel, the receiver cannot receive the negotiation request sent by the sender device through the channel a and cannot respond to the negotiation request through the channel b. The sender changes the channel, the receiver may also change the channel, and both parties negotiate again. At least one of the sender and the receiver may change the channel for multiple times, and the process is repeated until the channels of the two parties are the same finally, and the receiver receives the negotiation request sent by the sender. This results in a long overall process time and overall time consuming instability.
As can be seen from the above, discovery in the standard mode takes a long time and is not stable for a long time. In addition, the user can typically only make device selections after the discovered device discovers the discovered device via discovery. Therefore, the initialization of the P2P service is time-consuming and unstable in duration, and the user experience is not good.
Mode two, persistent mode (persistent)
Group (group) configuration information may be persisted after the first connection in the persistent mode, and GO negotiation procedures may be omitted for subsequent connections. Also, the Provisioning process is simplified. However, persistent mode increases invocation; the discovery process of the continuous mode is the same as that of the standard mode, and is not simplified; therefore, the initialization of the P2P service is time-consuming and unstable, and the user experience is not good.
That is, both of the above modes of Wi-Fi P2P connection result or may result in a Wi-Fi P2P connection that is time consuming and has a poor user experience.
In order to solve the technical problem, the application provides a Wi-Fi P2P connection method, an electronic device and a computer-readable storage medium; the time-consuming duration of the connection establishment phase of the two devices can be shortened, the stability of the time-consuming duration is kept, and the user experience is improved.
Next, a Wi-Fi P2P connection method between one electronic device and another electronic device will be described. In order to easily distinguish the electronic device from another electronic device and avoid confusion in names, in the following description, the electronic device is replaced with a mobile device and the electronic device is replaced with another electronic device. It should be noted that this is merely for convenience of distinguishing names and avoiding confusion, and is not intended to limit the specific type of device. For example, the mobile device may be a stationary electronic device (e.g., a desktop computer, etc.).
Fig. 1 is a schematic view of a scenario of a Wi-Fi P2P connection method according to an embodiment of the present application. As shown in FIG. 1, mobile device 100 establishes a wireless connection with electronic device 200 for Wi-Fi P2P. The mobile device 100 may transmit data (e.g., screen-shot, etc.) to the electronic device 200 via the Wi-Fi P2P wireless connection. Optionally, the working frequency band of the Wi-Fi P2P connection may be a 2.4GHz frequency band or a 5GHz frequency band. Optionally, the working frequency band of the Wi-Fi AP connection may be a 2.4GHz frequency band or a 5GHz frequency band.
In the embodiment of the present application, the mobile device 100 includes, but is not limited to, a smart phone, a smart headset, a tablet computer, a wearable electronic device with a wireless communication function (e.g., a smart watch, a smart bracelet, a smart ring, and smart glasses), and the like. Examples of Mobile devicesExemplary embodiments include, but are not limited to, piggybacking
Figure BDA0002797011620000091
Windows, Linux, or other operating systems. The 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 other embodiments, the mobile device may not be a portable electronic device, but may be a stationary electronic device such as a desktop computer.
Exemplarily, fig. 2 shows a hardware structure diagram of a mobile device provided in an embodiment of the present application. As shown in fig. 2, 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, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like.
It is to be understood that the illustrated structure of the embodiments of the present application does not constitute a specific limitation to the mobile device 100. In other embodiments of the present application, the mobile device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The charging management module 140 is configured to receive charging input from a charger. The power management module 141 is used to connect 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, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in mobile device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied on the mobile device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the mobile device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. 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, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of mobile device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that mobile device 100 can communicate with networks and other devices via wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The mobile device 100 may implement a camera function via the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the mobile device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The mobile device 100 may implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headset interface 170D, and the application processor, etc. Such as music playing, recording, etc.
Exemplarily, fig. 3 shows a hardware structure diagram of the electronic device 200. As shown in fig. 3, 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, a battery 242, an antenna 3, an antenna 4, a wireless communication module 250, a sensor module 260, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of 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. For example: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processor (NPU), among others. Wherein the different processing units may be separate components or may be integrated in one or more processors. In some embodiments, the 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 time sequence signal to complete the control of instruction fetching and instruction execution.
In some embodiments, processor 210 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a SIM card interface, and/or a USB interface, etc. The USB interface 230 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 230 may be used to connect a charger to charge the electronic device 200, and may also be used to transmit data between the electronic device 200 and a peripheral device.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
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 may provide a solution for wireless communication applied on the electronic device 200, including Wi-Fi (including Wi-Fi aware and Wi-Fi AP), Bluetooth (BT), wireless data transmission module (e.g., 433MHz, 868MHz, 915MHz), and the like. 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 transmits the processed signals to the processor 210. The wireless communication module 250 may also receive a signal to be transmitted from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves via the antenna 3 and/or the antenna 4 to radiate it.
In this embodiment, the electronic device 200 may broadcast a message through the wireless communication module, or may send a message to the target device. The broadcast message or the message sent to the target device may carry a device identifier or a product identifier of the electronic device 200, which is used for surrounding mobile devices to discover the electronic device 200. The electronic device 200 may also receive messages sent by the mobile device through the wireless communication module.
The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 221 may be used to store one or more computer programs comprising instructions. The processor 210 may cause the electronic device 200 to perform the Wi-Fi P2P connection method provided in some embodiments of the present application, as well as various applications and data processing, etc., by executing the above-described instructions stored in the internal memory 221. The internal memory 221 may include a code storage area and a data storage area. Wherein the code storage area may store an operating system. The data storage area may store data created during use of the electronic device 200, and the like. Further, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage components, flash memory components, Universal Flash Storage (UFS), and the like. In some embodiments, processor 210 may cause electronic device 200 to perform the Wi-Fi P2P connection method provided in embodiments of the present application, as well as other applications and data processing, by executing instructions stored in internal memory 221 and/or instructions stored in a memory disposed in processor 210.
The electronic device 200 includes, but is not limited to, a tablet computer, a desktop computer, a portable electronic device (e.g., Laptop), a smart television (e.g., smart screen), a smart printer, a vehicle-mounted device (e.g., smart device in unmanned), a smart speaker, an Augmented Reality (AR) device, a Virtual Reality (VR) device, other smart devices with a display screen (e.g., smart devices in smart grid, smart city, smart home, industrial control, etc.), and other smart devices with a speaker, etc. Exemplary embodiments of the electronic device include, but are not limited toCarry on
Figure BDA0002797011620000121
Figure BDA0002797011620000122
Linux or other operating system portable or fixed electronic devices.
Specifically, the Wi-Fi P2P connection method provided by the embodiment of the application mainly enables the mobile device to acquire the stored Identification (ID) of the electronic device and the corresponding Wi-Fi P2P connection information thereof through inquiry when the mobile device needs to establish Wi-Fi P2P connection with the electronic device, and to quickly complete Wi-Fi P2P connection with the electronic device based on the inquired Wi-Fi P2P connection information, thereby effectively shortening the time length for establishing Wi-Fi P2P connection between the mobile device and the electronic device; the duration is stable, large fluctuation can not occur, and user experience is better.
Wherein, the Wi-Fi P2P connection information comprises: at least one of a Service Set Identifier (SSID), a channel, a Basic Service Set Identifier (BSSID), a frequency (frequency), authentication information, P2P connection capability information of the electronic device, address information of the electronic device, and the like. The P2P connection capability information of the electronic device may include indication information indicating whether the electronic device can establish Wi-Fi P2P connection, and/or an application role of the electronic device, such as a Group Client (GC) role; specific forms of authentication information include, but are not limited to, keys (e.g., shared keys, pre-shared keys, PSK) or certificates.
Exemplarily, as shown in fig. 4 (a), the Wi-Fi P2P connection method provided by the embodiment of the present application may include: an initial setting step and a using step.
In the initial setting step, the electronic device and the mobile device may operate on a preset channel (for example, both operate on the a channel), so that the mobile device may receive a message sent by the electronic device; and stores the ID of the electronic device and the Wi-Fi P2P connection information included in the received message in a preset memory.
In one example, the Wi-Fi P2P connection information includes at least channel, authentication information, and address information for the electronic device; alternatively, the address information may be a MAC address.
Alternatively, the electronic device may operate on a preset channel (e.g., a channel), and the mobile device may cycle through a preset plurality of channels (e.g., cycle through three channels, i.e., a channel, B channel, and C channel); after the channel of the mobile device is circularly switched to a channel (for example, an A channel), receiving a message sent by the electronic device; and stores the ID of the electronic device and the Wi-Fi P2P connection information included in the received message in a preset memory.
Alternatively, the electronic device may rotate among a plurality of preset channels (for example, rotate among three channels of a channel, B channel and C channel), and the mobile device may operate on the preset channel (for example, a channel); after the channel of the electronic device is rotated to a channel (for example, a channel), the mobile device receives a message sent by the electronic device; then, the mobile device stores the ID of the electronic device and the Wi-Fi P2P connection information included in the received message in a preset memory.
Wherein the ID of the electronic device corresponds to the Wi-Fi P2P connection information.
In the using step, the mobile device may operate on a different channel than it did in the initial setting step. The mobile equipment acquires an identifier of the electronic equipment based on the received input; if the connection information is based on the identification of the electronic equipment, inquiring corresponding Wi-Fi P2P connection information from a preset memory; and quickly establishing Wi-Fi P2P connection with the electronic equipment based on the Wi-Fi P2P connection information.
Optionally, in the using step, if the corresponding Wi-Fi P2P connection information is not queried from the preset memory based on the identifier of the electronic device, performing full channel scanning. In the scanning process, if a message sent by the electronic equipment is received and the message contains the ID of the electronic equipment and the Wi-Fi P2P connection information, the mobile equipment stores the ID of the electronic equipment and the Wi-Fi P2P connection information in a preset memory; and, based on the Wi-Fi P2P connection information, quickly establishing a Wi-Fi P2P connection with the electronic device.
Illustratively, as shown in fig. 4 (b), the Wi-Fi P2P connection method provided by the embodiment of the present application may include a use step and no longer include an initial setup step. For a description of the usage steps, please refer to the foregoing, and the description is omitted here.
Fig. 5 is a schematic flowchart of an electronic device in an initial setting step of a Wi-Fi P2P connection method provided in an embodiment of the present application. As shown in fig. 5, the process of the electronic device in the initial setting step may include:
s501, the electronic equipment starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel;
in one embodiment, after receiving an input, the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel.
Optionally, at least one of the electronic device and a remote control device associated with the electronic device may be provided with a key for initial setting. After the user triggers the key, the electronic equipment starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel.
Alternatively, the electronic device has at least one of a voice recognition function and an AI recognition function. After the user sends a preset voice and/or outputs a preset action gesture (such as a hover gesture), the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee and works on a preset channel.
Optionally, after the electronic device receives a specific message from the mobile device, the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel.
In one embodiment, after the electronic device is connected to the network, the electronic device turns on Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel.
Optionally, after the electronic device is connected to a network for the first time, the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel.
Optionally, after the electronic device is disconnected from a network and subsequently connected to the network again, the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee and operates on a preset channel.
Optionally, the user may be prompted for confirmation by voice before the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee and operates on a preset channel. After the user confirms, the electronic equipment turns on Wi-Fi P2P, Bluetooth or ZigBee and works on a preset channel.
Optionally, the preset channel is not limited to one channel, and may be a plurality of channels; in the case of multiple channels, the electronic device may operate on each channel for a predetermined duration before switching to another channel, and so on in a cyclic manner.
Optionally, after the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee and works in a preset channel, sending a specific message to the mobile device; the mobile device executes S601 after receiving the specific message.
S502, the electronic equipment configures the electronic equipment into GO equipment;
after the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel, the electronic device configures itself as a GO device.
S503, the electronic equipment broadcasts the message periodically.
Specifically, the electronic device broadcasts the message in the role of the GO device on a preset channel in one cycle. The message includes Wi-Fi P2P connection information for the electronic device.
Optionally, after the time length of the message broadcast reaches a preset threshold time length, the electronic device stops periodically broadcasting the message.
Optionally, the channel preset on the electronic device is associated with a channel preset on the mobile device. Specifically, 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 a part of the preset channel on the electronic device. The channel switching manner in the electronic device or the mobile device with more preset channels is as described above, and is not described herein again.
The Wi-Fi P2P connection information may include at least one of an ID (e.g., service set identifier SSID, basic service set identifier BSSID), a channel, address information, authentication information, etc. of the electronic device. The authentication information may be a key (e.g., a shared key, a pre-shared key, PSK) or a certificate. The address information may be a MAC address.
Optionally, the Wi-Fi P2P connection information may further include: frequency (frequency), P2P connection capability information of the electronic device. The P2P connection capability information of the electronic device may include: an indication of whether the electronic device can establish a Wi-Fi P2P connection, and/or an application role (e.g., a GO role) of the electronic device, and/or the like.
Illustratively, the ID of the electronic device may be an SSID, a BSSID, an identification associated with the SSID, or an identification associated with the BSSID.
Alternatively, after receiving another input (e.g., a voice input, a touch input, etc.), the electronic device ends the flow of the initial setting step.
Optionally, in the Wi-Fi P2P connection method of the embodiment of the present application, the electronic device operates in the initial setting step shown in fig. 5, and possibly also operates in the flow shown in fig. 8 executed by the electronic device side.
Fig. 6 is a schematic flowchart of a mobile device in an initial setup step of a Wi-Fi P2P connection method according to an embodiment of the present application. As shown in fig. 6, the flow of the mobile device in the initial setup step may include:
s601, the mobile device starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel;
in one embodiment, the mobile device receives an input, turns on Wi-Fi P2P, Bluetooth or ZigBee, and operates on a preset channel.
Alternatively, the mobile device may be provided with a key for initial setup. After the user triggers the key, the mobile device starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel.
Optionally, the mobile device has at least one of a voice recognition function and an AI recognition function. After the user sends a preset voice and/or outputs a preset action gesture (such as a hover gesture), the mobile device turns on Wi-Fi P2P, bluetooth or ZigBee and works on a preset channel.
Optionally, after the mobile device receives a specific message from the electronic device, the electronic device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel.
In one embodiment, after the mobile device connects to the network, the mobile device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel.
Optionally, after the mobile device connects to a network for the first time, the mobile device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel.
Optionally, after the mobile device disconnects from a network and subsequently connects to the network again, the mobile device turns on Wi-Fi P2P, bluetooth or ZigBee and operates on a preset channel.
Optionally, the user may be prompted for confirmation by voice before the mobile device turns on Wi-Fi P2P, bluetooth or ZigBee, and operates on a preset channel. After the user confirms, the mobile device Wi-Fi P2P, Bluetooth or ZigBee works in a preset channel.
Optionally, the preset channel is not limited to one channel, and may be a plurality of channels; in the case of multiple channels, the mobile device may operate on each channel for a predetermined duration before switching to another channel, and so on in a cyclic manner.
Optionally, the preset channel on the mobile device is associated with the preset channel on the electronic device. Specifically, 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 a part of the preset channel on the mobile device. The channel switching method for a mobile device or an electronic device with more preset channels is as described above, and is not described herein again.
Optionally, after the mobile device turns on Wi-Fi P2P, bluetooth or ZigBee and works in a preset channel, sending a specific message to the electronic device; the electronic device executes S501 after receiving the specific message.
S602, receiving a broadcast message;
specifically, the mobile device operates on a preset channel for receiving broadcast messages.
In one embodiment, since the channel on which the mobile device and the electronic device (GO device) each operate is an associated channel (e.g., the same channel), the mobile device may quickly receive messages broadcast by the electronic device (GO device).
Illustratively, the broadcast message includes Wi-Fi P2P connection information sent by the at least one electronic device.
The Wi-Fi P2P connection information may include an ID of the electronic device (e.g., service set identifier SSID, basic service set identifier BSSID), a channel, address information, authentication information, and the like. The authentication information may be a key (e.g., a shared key, a pre-shared key, PSK) or a certificate. The address information may be a MAC address.
Optionally, the Wi-Fi P2P connection information may further include: frequency (frequency), P2P connection capability information of the electronic device. The P2P connection capability information of the electronic device may include: an indication of whether the electronic device can establish a Wi-Fi P2P connection, and/or an application role (e.g., a GO role) of the electronic device, and/or the like.
And S603, acquiring the ID of the electronic equipment and the Wi-Fi P2P connection information, and storing the ID and the Wi-Fi P2P connection information in a preset memory.
In one embodiment, the mobile device may obtain the ID of the electronic device and the Wi-Fi P2P connection information from the broadcast message.
After acquiring the ID and Wi-Fi P2P connection information of the electronic device, the mobile device stores them in a preset memory. The mobile device may establish a correspondence relationship between the ID, the channel, the address information, and the authentication information of the electronic device in a preset memory. The preset memory may be a memory local to the mobile device, or may be a memory (e.g., a third-party storage device) associated with the mobile device, other than the mobile device.
Alternatively, the mobile device may be stored on a preset memory in a chronological order.
Further, when the new information or the new correspondence is to be stored again after the storage amount in the preset memory for storing the information (for example, the information at least includes the ID, the channel, the address information, and the authentication information of the electronic device) or the correspondence (for example, the correspondence at least includes the correspondence between the ID, the channel, the address information, and the authentication information of the electronic device) reaches a first storage threshold, the mobile device may delete the oldest stored information or the correspondence. For example, a preset memory stores 100 pieces of information, and at this time, to store a new piece of information again, it is necessary to delete the oldest one of the 100 pieces of information first, and then store the new piece of information, so that the number of pieces of information stored in the mobile device is still maintained at 100.
Illustratively, the ID of the electronic device may be an SSID, a BSSID, an identification associated with an SSID, or an identification associated with a BSSID.
Exemplarily, taking the ID of the electronic device as an SSID as an example, the mobile device establishes a correspondence relationship among the ID, the channel, the address information, and the authentication information of the electronic device according to received messages broadcasted 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 devices
Figure BDA0002797011620000161
In one embodiment, after the mobile device stores one piece of information or the corresponding relationship, the mobile device displays the stored icon of the electronic device on a device display interface or other interface (such as a desktop) capable of establishing Wi-Fi P2P connection. That is, the device display interface or other interfaces (such as a desktop) that can establish the Wi-Fi P2P connection may display the stored icon of the electronic device. For example, according to table 1, the device display interface or other interface (e.g., desktop) that can establish the Wi-Fi P2P connection may display an icon of a smart tv, an icon of a smart printer, and an icon of a smart speaker.
Optionally, when more than two electronic devices of the same type (e.g., two smart tvs) are stored in table 1, the device display interface or other interface (e.g., a desktop) that can establish the Wi-Fi P2P connection may display, in addition to an icon of the smart tv, an identifier (e.g., a name, etc.) for distinguishing the two smart tvs.
The ID of the electronic device may not be an SSID, or may not be a BSSID. For example, 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.
Optionally, after receiving another input (e.g., a voice input, a touch input, etc.), the mobile device ends the flow of the initial setup step.
Alternatively, if the mobile device does not receive the broadcast message within a preset time period (e.g., 1 minute), the process of the initial setting step of the mobile device is ended.
Fig. 7A is a flowchart illustrating an embodiment of a mobile device in the using step of the Wi-Fi P2P connection method provided in the present application. As shown in fig. 7A, the process may include:
s701a, the mobile device receives an input;
there are a variety of ways in which a mobile device receives an input. For example, on a device display interface of the mobile device that can establish a Wi-Fi P2P connection, the user selects (e.g., clicks, long presses, etc.) an icon of an electronic device, and the mobile device receives an input; alternatively, the user inputs a voice against the mobile device, and the mobile device receives an input.
In addition, an NFC tag may be disposed on the surface of the electronic device, or an NFC tag may be disposed on a remote control device that is configured with the electronic device (e.g., a smart television); an input is also received by the mobile device after the mobile device is proximate to the NFC tag on the electronic device or, alternatively, after the mobile device is proximate to the NFC tag on the remote control device.
S702a, responding to the input, and acquiring the ID of the electronic equipment;
after the mobile device receives the input, the mobile device obtains the ID of the electronic device.
For example, the ID of the electronic device may be an SSID, BSSID, or the like of the electronic device, or may be an identifier associated with the SSID, BSSID, or the like of the electronic device (that is, the SSID, BSSID, or the like of the electronic device may be queried according to the ID of the electronic device).
S703a, whether the ID of the electronic device is queried in a preset memory.
For example, after acquiring the ID of the electronic device, the mobile device queries in a preset memory whether to query the ID of the electronic device. If the ID of the electronic device is queried, S704a is executed. If the ID of the electronic device is not found, S706a is executed.
S704a, acquiring Wi-Fi P2P connection information of the electronic equipment from a preset memory;
illustratively, from table 1 of the preset memory, a channel, authentication information, address information, and the like corresponding to the ID of the electronic device are acquired.
S705a, configuring the channel as a channel corresponding to the ID of the electronic equipment, configuring the channel as a GC equipment, and establishing Wi-Fi P2P connection with the electronic equipment according to the authentication information and the address information in the Wi-Fi P2P connection information.
Illustratively, the mobile device configures itself as a GC device, configures its channel as a channel corresponding to the ID of the electronic device, and establishes a Wi-Fi P2P connection with the electronic device (GO device) according to authentication information and address information in the Wi-Fi P2P connection information.
For example, the mobile device may also configure its own channel as a channel corresponding to the ID of the electronic device, then configure itself as a GC device, and then establish a Wi-Fi P2P connection with the electronic device (GO device) according to the authentication information and the address information in the Wi-Fi P2P connection information.
S706a, the mobile device scans on each channel in turn.
If the mobile device does not inquire the ID of the electronic device in a preset memory, the mobile device scans each channel of the working frequency band of the mobile device in sequence.
Illustratively, the mobile device scans in turn on each channel on each operating frequency band supported by the mobile device.
Optionally, if the mobile device supports M operating frequency bands, the mobile device sequentially scans all channels on the 1 st operating frequency band — the mth operating frequency band. For example, the mobile device supports 2 operating bands, the number of channels on the 1 st operating band is N1, and the number of channels on the second operating band is N2, then the mobile device may perform each channel scan on N1 channels of the 1 st operating band first, and then perform each channel scan on N2 channels of the 2 nd operating band.
Specifically, if the mobile device supports the 2.4GHz band and the 5GHz band, the mobile device may perform full channel scanning on the 2.4GHz band first, and then perform full channel scanning on the 5GHz band; the mobile device may also perform full channel scanning on the 5GHz band first, and then perform full channel scanning on the 2.4GHz band. That is, the mobile device may perform a scan of each channel for each frequency band in turn over all frequency bands supported by the mobile device.
Optionally, if the mobile device supports the 2.4GHz band and the 5GHz band, the mobile device may perform full channel scanning on the currently operating band first, and then perform full channel scanning on another band.
S707a, whether the mobile device receives a message sent by the electronic device.
In the scanning process, if the mobile device receives a message sent by the electronic device, S708a is executed; if the mobile device does not receive a message sent by the electronic device, S710a is performed. In 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.
S708a, whether the message contains the ID of the electronic device and the Wi-Fi P2P connection information of the electronic device.
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, S709a is performed.
S709a, acquiring the ID of the electronic device and the Wi-Fi P2P connection information of the electronic device, and storing 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 predetermined memory may be a memory local to the mobile device, or may be a memory (e.g., a third-party storage device) associated with the mobile device, other than the mobile device.
After S709a, S705a is performed.
Optionally, in 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, S705a is performed first; thereafter, S709a is executed again. That is, in 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, the mobile device configures itself first and establishes Wi-Fi P2P connection with the electronic device; and then, storing the ID of the electronic equipment and the Wi-Fi P2P connection information in a preset memory.
S710a, whether all channels are scanned is complete.
If the mobile device does not receive the message sent by the electronic device in S707a, the mobile device determines whether all channels are completely scanned.
The mobile device determines whether all channels on all operating frequency bands supported by the mobile device have been scanned. Alternatively, if the mobile device supports two operating bands, after all channels on one operating band are scanned, all channels may be scanned on the other operating band. The two operating bands are only illustrative examples. If the mobile device supports M operating frequency bands (M is a positive integer greater than or equal to 2), all channels on one operating frequency band can be scanned, and after all channels on the M operating frequency bands are not scanned, full channel scanning can be performed on another operating frequency band of the M operating frequency bands, so that all channels under all operating frequency bands are scanned.
If all channels are not scanned, S706a is executed.
Optionally, in S710a, if all channels are scanned, the mobile device determines that the Wi-Fi P2P connection fails this time.
Alternatively, when the mobile device executes according to the flow illustrated in fig. 7A, the electronic device may execute according to the flow illustrated in fig. 5. For example, when the mobile device performs S706a, the electronic device may perform S503. If the electronic device is not powered on (e.g., power off), or no longer broadcasts messages, the mobile device does not receive a message from the electronic device on which channel if the full channel scan started at S706 a; so that the mobile device determines that this Wi-Fi P2P connection failed.
By the method, in the using steps of the mobile device and the electronic device, after the mobile device receives an input, the mobile device acquires the ID of the electronic device, and searches the Wi-Fi P2P connection information corresponding to the ID of the electronic device from the preset memory, so that the mobile device can acquire the channel, the authentication information, and the address information in the Wi-Fi P2P connection information, configure the channel thereof as the channel corresponding to the ID of the electronic device, and quickly complete Wi-Fi P2P connection with the electronic device according to the authentication information and the address information in the Wi-Fi P2P connection information, thereby effectively shortening the time length for establishing connection between the mobile device and the electronic device through the Wi-Fi P2P.
Fig. 7B is a flowchart illustrating an embodiment of a mobile device in the using step of the Wi-Fi P2P connection method provided in the present application. As shown in fig. 7B, the process may include:
s701b-S703 b: see the description of S701a-S703a, which are identical to S701a-S703a, respectively;
s706b-S710 b: respectively identical to S706a-S710a, please refer to the descriptions of S706a-S710 a;
s704b, acquiring Wi-Fi P2P connection information corresponding to the ID from a preset memory, configuring a channel of the terminal as a channel in Wi-Fi P2P connection information, configuring the terminal as a GC device, and acquiring authentication information and address information in the Wi-Fi P2P connection information;
illustratively, Wi-Fi P2P connection information corresponding to the ID of the electronic device is acquired from table 1 of a preset memory, and a channel, authentication information, address information, and the like are acquired therefrom.
Illustratively, the mobile device configures itself as a GC device, configures its channel as a channel corresponding to the ID of the electronic device, and prepares to establish a Wi-Fi P2P connection with the electronic device (GO device) according to the authentication information and the address information in the obtained Wi-Fi P2P connection information.
For example, the mobile device may also configure its own channel as a channel corresponding to the ID of the electronic device, then configure itself as a GC device, and prepare to establish a Wi-Fi P2P connection with the electronic device (GO device) according to the authentication information and the address information in the obtained Wi-Fi P2P connection information.
S705b, whether the Wi-Fi P2P connection can be established with the electronic equipment or not;
then, judging whether the Wi-Fi P2P connection can be established with the electronic equipment or not; if so, then S711b is performed; if not, execution proceeds to S706 b.
S705b is set, and after the judgment result of S705b is NO, S706b is executed; mainly considering that some electronic devices or some electronic device may change at least one of the channel, the authentication information and the address information after a period of time; in this way, the Wi-Fi P2P connection information of these electronic devices or one electronic device can be acquired and stored in a full channel scanning manner. And, the changed Wi-Fi P2P connection information would overwrite the previous Wi-Fi P2P connection information.
For example, the ID of the electronic device a is ID1, and the channel, the authentication information, and the address information in the previous Wi-Fi P2P connection information are: channel 1, authentication information 1, and address information 1; later, for some reason (e.g., security reasons), Wi-Fi P2P connection information for electronic device a was changed; the channel, authentication information and address information in the changed Wi-Fi P2P connection information are respectively: channel 2, authentication information 2, and address information 2. Thus, the changed Wi-Fi P2P connection information can be stored in the preset memory by the method. And, the changed Wi-Fi P2P connection information would overwrite the previous Wi-Fi P2P connection information. Thus, in the preset memory, 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 effective automatic change is provided.
Optionally, the Wi-Fi P2P connection information may be changed through an initial setting step; the same technical effect is achieved.
And S711b, establishing the Wi-Fi P2P connection with the electronic equipment.
The method of this embodiment not only achieves the technical effect of fig. 7A, but also further considers the case where there is a change in Wi-Fi P2P connection information stored in the preset memory. Aiming at the situation that after the mobile device acquires the Wi-Fi P2P connection information corresponding to the ID of the electronic device, the mobile device cannot establish Wi-Fi P2P connection with the electronic device, the changed Wi-Fi P2P connection information is acquired in a full-channel scanning mode, and is stored in a preset memory in a mode of covering the previous Wi-Fi P2P connection information. In this way, when the Wi-Fi P2P connection information of the electronic device is changed, the connection information can be judged by self, actively acquired and stored, so that the latest Wi-Fi P2P connection information can be acquired from a preset memory later.
Unless otherwise specified, the content not described in the embodiment corresponding to fig. 7B is the same as the related content in the embodiment corresponding to fig. 7A. And will not be described in detail herein. For example, the storage locations in table 1 in the embodiment corresponding to fig. 7B are not illustrated, and thus the relevant contents are the same as those in the embodiment corresponding to fig. 7A; therefore, in the embodiment corresponding to fig. 7B, table 1 is also stored in the preset memory.
Alternatively, the flow method shown in fig. 7B may not be employed. For example, in S709a in fig. 7A, when the ID of the electronic device and the corresponding Wi-Fi P2P connection information are stored, the storage time is also stored in the preset memory. In S703a and S704a, after querying a plurality of IDs, the latest (i.e., latest) correspondence of the storage time 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 be acquired. This scheme is also well known to those skilled in the art in the method shown in FIG. 7A.
For example, as shown in fig. 8, in the Wi-Fi P2P connection method according to the embodiment of the present application, based on the Wi-Fi P2P connection information, the process of the mobile device establishing a Wi-Fi P2P connection with the electronic device may include:
and S810, the mobile device sends a Wi-Fi P2P access request to the electronic device.
In one example, the Wi-Fi P2P access request contains a key for Wi-Fi P2P access.
And S820, the electronic equipment verifies whether the verification is correct.
If the verification is correct, S830 is performed.
In one embodiment, if the verification is incorrect, the number of times of verification is recorded as 1, and the verification is performed again after waiting for a preset time; if the verification is incorrect again, the verification times are increased by 1. And circulating the steps, and stopping verification if the verification times are still incorrect after reaching the preset verification times.
In another embodiment, if the verification is incorrect, the verification is performed again after waiting for a predetermined time period; if the authentication is incorrect again, a message is sent to the mobile device to inform the mobile device that the Wi-Fi P2P access key is wrong; or the electronic equipment informs the Wi-Fi P2P that the accessed key is wrong through a voice output or message display mode.
S830, the electronic device sends a confirmation message to the mobile device to confirm that the Wi-Fi P2P establishes connection.
The mobile device receives the confirmation message sent by the electronic device. And the Wi-Fi P2P connection channel is established.
It should be noted that the above-mentioned S810-S830 are only schematic illustrations. During the Wi-Fi P2P channel establishment procedure between the mobile device and the electronic device, there may be a number of loop procedures similar to those described above at S810-S830. Only, the messages sent by the mobile device to the electronic device, and the messages sent by the electronic device to the mobile device, are replaced or changed. There is no further expansion.
All or a portion of the various embodiments provided herein above may be used in any combination with one another.
The method provided by the embodiment of the application is suitable for the following mobile equipment and Wi-Fi P2P connection devices.
Fig. 9 illustrates a mobile device 900 provided herein. By way of example, the mobile device 900 includes at least one processor 910, memory 920, and a display 930. Wherein the processor 910 is coupled to a memory 920 and a display 930. The coupling in the embodiments of the present application may be a communication connection, may be electrical, or in other forms. In particular, memory 920 is used to store program instructions. The display screen 930 is used to display a user interface. Processor 910 is configured to invoke program instructions stored in memory 920 to cause mobile device 900 to perform the steps performed by the mobile device in the Wi-Fi P2P connection method provided by embodiments of the present application. It should be understood that the mobile device 900 may be used to implement the Wi-Fi P2P connection method provided in the embodiments of the present application, and reference may be made to the above for related features, which are not described herein again.
In some embodiments, 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 display screen can be realized by virtual keys. When the display screen does not have a touch function, the display screen is also called a non-touch display screen. The operation on the non-touch display screen can be realized by physical keys.
The present application provides a computer program product containing instructions that, when run on a mobile device, cause the mobile device to perform the steps performed by the mobile device in the Wi-Fi P2P connection method provided by embodiments of the present application.
The application provides a computer-readable storage medium, which includes instructions that, when executed on a mobile device, cause the electronic device to perform the steps performed by the mobile device in the Wi-Fi P2P connection method provided in the embodiment of the application.
Those skilled in the art will clearly understand that the embodiments of the present application can be implemented in hardware, or in hardware and software. When implemented using hardware and software, the functions described above may be stored on a computer-readable medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.
It is understood that each device described above, in order to implement the above functions, includes a corresponding hardware structure and/or software module for performing each function. Those skilled in the art will readily appreciate that the embodiments of the present application, described in connection with the embodiments disclosed herein, may be implemented as hardware or a combination of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Illustratively, as shown in fig. 10, the 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 and the like which can realize the functions of the mobile device and/or the electronic device. When the Wi-Fi P2P connection means is a component having the functions of the mobile device and/or the electronic device as described above, the transceiver may be a radio frequency unit and the processing module may be a processor. When the communication device is a chip system, the transceiving unit may be an input/output interface of the chip system, and the processing unit may be a processor of the chip system, for example: a Central Processing Unit (CPU). The system-on-chip may be a single chip, a collection of chips and their circuits, a plurality of chips, or a collection of 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 for receiving and transmitting data under the control of the processor 1010 in data communication with the memory 1030.
Processor 1010 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. The processor 1010 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof. The memory 1030 may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Processor 1010, memory 1030, and communications interface 1040 are coupled to one another. Alternatively, the processor 1010, memory 1030, and communication interface 1040 may be interconnected by a bus 1020; the bus 1020 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 10, but this is not intended to represent only one bus or 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 (a non-exhaustive list) of readable storage media include: a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an 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 of the embodiments of the present application can employ a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a server device. However, the program product of the embodiments of the present application is not limited thereto. In the context of this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with a Wi-Fi P2P connection device or apparatus.
The method for Wi-Fi P2P connection in the embodiment of the application also provides a storage medium readable by the computing device, namely, the content is not lost after power failure. The storage medium stores therein a software program comprising program code which, when read and executed by one or more processors, implements any of the above aspects of the embodiments of the present application for Wi-Fi P2P connectivity when the program code runs on a computing device.
Although the present application has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the application. Accordingly, the specification and figures are merely exemplary of the present application as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the present application. It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the scope of the application.

Claims (11)

1. An electronic device, comprising:
a processor;
a memory;
and a computer program, wherein the computer program is stored on the memory, which when executed by the processor causes the electronic device to perform the steps of:
receiving an input;
acquiring an identification of another electronic device in response to the input;
acquiring Wi-Fi P2P connection information corresponding to the identifier of the other electronic device from a preset memory other than the memory;
after the Wi-Fi P2P connection cannot be established with the other electronic device based on the Wi-Fi P2P connection information, the electronic device sequentially performs full-channel scanning on the frequency bands supported by the electronic device;
the preset memory is positioned outside the electronic equipment and on equipment associated with the electronic equipment; the preset memory only stores a record related to the identifier of the other electronic equipment, and the record reflects the identifier of the other electronic equipment and the corresponding Wi-Fi P2P connection information thereof;
the electronic device further performs the steps of:
before receiving the input, the electronic equipment starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel;
receiving an initial setting message of the other electronic device;
after the initial setup message contains the identification of the other electronic device and the Wi-Fi P2P connection information, storing the identification of the other electronic device and the Wi-Fi P2P connection information in the preset memory in a corresponding manner;
wherein the preset channel of the electronic device is associated with the preset channel of the other electronic device; the preset channel of the electronic device is associated with the preset channel of the other electronic device, including: the preset channel of the electronic equipment is the same as the preset channel of the other electronic equipment; or the preset channel of the electronic device is a part of the preset channel of the other electronic device; or the preset channel of the other electronic device is a part of the preset channel of the electronic device.
2. The electronic device of claim 1, further performing the steps of:
receiving a message of the other electronic device on one channel in a full channel scan;
after the message contains the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P, storing the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P in the preset memory in a corresponding mode;
establishing a Wi-Fi P2P connection with the other electronic device based on the other Wi-Fi P2P connection information.
3. The electronic device of claim 2,
storing the identification of the other electronic device and the other piece of Wi-Fi P2P connection information in the preset memory in a corresponding manner, including:
and storing the identification of the other electronic equipment and the other Wi-Fi P2P connection information in a corresponding mode to cover the identification of the other electronic equipment and the Wi-Fi P2P connection information in the preset memory.
4. The electronic device according to any of claims 1-3, characterized in that the electronic device further performs the steps of:
after establishing the Wi-Fi P2P connection with the other electronic device based on the Wi-Fi P2P connection information, the electronic device establishes a Wi-Fi P2P connection with the other electronic device.
5. A Wi-Fi P2P connection method, applied to an electronic device comprising a memory, the method comprising:
receiving an input;
acquiring an identification of another electronic device in response to the input;
acquiring Wi-Fi P2P connection information corresponding to the identifier of the other electronic device from a preset memory other than the memory;
after the Wi-Fi P2P connection cannot be established with the other electronic device based on the Wi-Fi P2P connection information, the electronic device sequentially performs full-channel scanning on the frequency bands supported by the electronic device;
the preset memory is positioned outside the electronic equipment and on equipment associated with the electronic equipment; the preset memory only stores a record related to the identifier of the other electronic equipment, and the record reflects the identifier of the other electronic equipment and the corresponding Wi-Fi P2P connection information thereof;
the method further comprises the following steps:
before receiving the input, the electronic equipment starts Wi-Fi P2P, Bluetooth or ZigBee and works in a preset channel;
receiving an initial setting message of the other electronic device;
after the initial setup message contains the identification of the other electronic device and the Wi-Fi P2P connection information, storing the identification of the other electronic device and the Wi-Fi P2P connection information in the preset memory in a corresponding manner;
wherein the preset channel of the electronic device is associated with the preset channel of the other electronic device; the preset channel of the electronic device is associated with the preset channel of the other electronic device, including: the preset channel of the electronic equipment is the same as the preset channel of the other electronic equipment; or the preset channel of the electronic device is a part of the preset channel of the other electronic device; or the preset channel of the other electronic device is a part of the preset channel of the electronic device.
6. The method of claim 5, further comprising:
receiving a message of the other electronic device on one channel in a full channel scan;
after the message contains the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P, storing the identification of the other electronic equipment and the connection information of the other Wi-Fi P2P in the preset memory in a corresponding mode;
establishing a Wi-Fi P2P connection with the other electronic device based on the other Wi-Fi P2P connection information.
7. The method of claim 6, further comprising:
storing the identification of the other electronic device and the other piece of Wi-Fi P2P connection information in the preset memory in a corresponding manner, including:
and storing the identification of the other electronic equipment and the other Wi-Fi P2P connection information in a corresponding mode to cover the identification of the other electronic equipment and the Wi-Fi P2P connection information in the preset memory.
8. The method according to any one of claims 5-7, further comprising: after establishing the Wi-Fi P2P connection with the other electronic device based on the Wi-Fi P2P connection information, the electronic device establishes a Wi-Fi P2P connection with the other electronic device.
9. The method of claim 8, wherein the Wi-Fi P2P connection information comprises: a channel, authentication information, and address information of the another electronic device; the preset channel of the electronic device is the same as the preset channel of the other electronic device.
10. A computer-readable storage medium, comprising a computer program which, when run on an electronic device, causes the electronic device to perform the method of any of claims 5-9.
11. A chip system, comprising: a memory for storing a computer program; a processor; when the processor calls and runs the computer program from the memory, the electronic device with the chip system installed is caused to execute the method according to any one of claims 5 to 9.
CN202011335445.7A 2020-09-28 2020-11-20 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium Active CN112654074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011335445.7A CN112654074B (en) 2020-09-28 2020-11-20 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202011042864 2020-09-28
CN2020110428641 2020-09-28
CN202011315060.4A CN114286423A (en) 2020-09-28 2020-11-20 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium
CN202011335445.7A CN112654074B (en) 2020-09-28 2020-11-20 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202011315060.4A Division CN114286423A (en) 2020-09-28 2020-11-20 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN112654074A CN112654074A (en) 2021-04-13
CN112654074B true CN112654074B (en) 2022-08-09

Family

ID=75351162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011335445.7A Active CN112654074B (en) 2020-09-28 2020-11-20 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium

Country Status (2)

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

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115348563A (en) * 2021-04-28 2022-11-15 华为技术有限公司 Method and electronic equipment for establishing Wi-Fi P2P connection
CN115022982B (en) * 2021-12-31 2023-04-11 荣耀终端有限公司 Multi-screen cooperative non-inductive access method, electronic equipment and storage medium
CN116056052B (en) * 2022-08-17 2023-10-31 荣耀终端有限公司 Message processing method, device, electronic equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9021121B2 (en) * 2011-06-17 2015-04-28 Lenovo (Singapore) Pte. Ltd. Setting a rate of data transmission in a peer-to-peer mode
WO2015002385A1 (en) * 2013-07-03 2015-01-08 엘지전자(주) Method and device for communication between devices in wireless communication system
CN104519595B (en) * 2013-09-29 2018-10-12 联想(北京)有限公司 wireless connection method and device
CN105874871B (en) * 2013-12-18 2020-10-16 英特尔公司 Reducing connection time in direct wireless interaction
CN103813473B (en) * 2014-01-17 2017-08-25 深圳市金立通信设备有限公司 A kind of communication means, terminal and system
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
CN106550487A (en) * 2016-10-19 2017-03-29 乐视控股(北京)有限公司 WI FI direct-connected method and system
CN110446276B (en) * 2018-05-04 2022-12-27 展讯通信(上海)有限公司 Method and device for establishing WiFi P2P connection
CN111107605A (en) * 2018-10-26 2020-05-05 九阳股份有限公司 Network distribution method of household electrical appliance and household electrical appliance
CN111182512B (en) * 2018-11-09 2023-09-01 中国电信股份有限公司 Terminal connection method, device, terminal and computer readable storage medium
CN111372325B (en) * 2020-02-21 2022-04-26 华为技术有限公司 Method and device for establishing Wi-Fi point-to-point connection

Also Published As

Publication number Publication date
WO2022063109A1 (en) 2022-03-31
CN112654074A (en) 2021-04-13

Similar Documents

Publication Publication Date Title
CN112654074B (en) Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium
US11297666B2 (en) Electronic device and method for forming Wi-Fi direct group thereof
EP3979571A1 (en) Method for controlling device and terminal
EP2914047A1 (en) Wi-fi direct service method using nfc and device therefor
EP2995128B1 (en) Delegating wifi network discovery and traffic monitoring
US9894616B2 (en) Delegating WiFi network discovery and traffic monitoring
CN110582109A (en) Wireless Local Area Network (WLAN) network access method and device
WO2022143071A1 (en) Connection establishment method and electronic device
EP4247031A1 (en) Access method and system and electronic device
CN110602682A (en) Network management system and method based on Bluetooth BLE and mesh mixing
CN114390501B (en) Data transmission method and electronic equipment
US11089481B2 (en) Communication apparatus communicating with external apparatus in a selected procedure from among a plurality of procedures to establish wireless connection, control method for communication apparatus, and recording medium
CN113170383A (en) Mobile and electronic devices for wireless communication and methods of operating the same
CN114679708A (en) Communication method, system and electronic equipment
CN113038627B (en) File sharing method, mobile device and computer storage medium
EP3585132B1 (en) Mobile terminal and data transmission method
CN110290585B (en) Method and electronic equipment for reporting CA combination
CN114390491A (en) Networking method, device and system
CN114286423A (en) Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium
CN113114798B (en) Method for acquiring Internet protocol IP address and electronic equipment
WO2022226707A1 (en) Rescue method and device, storage medium, and chip system
CN114827687B (en) Communication method, mobile device, electronic device, and computer-readable storage medium
CN115022872B (en) Data transmission method, electronic equipment and readable storage medium
WO2014169798A1 (en) Information interaction method, terminal and information interaction system
CN114844974B (en) Method for sharing address book, mobile device, electronic device and communication system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant