CN116367123A - Wi-Fi P2P-based data transmission method and electronic equipment - Google Patents

Wi-Fi P2P-based data transmission method and electronic equipment Download PDF

Info

Publication number
CN116367123A
CN116367123A CN202310369125.0A CN202310369125A CN116367123A CN 116367123 A CN116367123 A CN 116367123A CN 202310369125 A CN202310369125 A CN 202310369125A CN 116367123 A CN116367123 A CN 116367123A
Authority
CN
China
Prior art keywords
electronic device
data
channel
electronic
access point
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.)
Pending
Application number
CN202310369125.0A
Other languages
Chinese (zh)
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310369125.0A priority Critical patent/CN116367123A/en
Publication of CN116367123A publication Critical patent/CN116367123A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video stream to a specific local network, e.g. a Bluetooth® network
    • H04N21/43637Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wireless protocol, e.g. Bluetooth, RF or wireless LAN [IEEE 802.11]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • H04W12/068Authentication using credential vaults, e.g. password manager applications or one time password [OTP] applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • 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

Landscapes

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

Abstract

The application provides a Wi-Fi P2P-based data transmission method and electronic equipment, and relates to the technical field of communication. According to the scheme, in a scene that Wi-Fi direct connection is needed between two electronic devices applying Windows systems to transmit data, the networked electronic devices can create a virtual AP as a wireless hot spot, and the other electronic device can be connected to the wireless hot spot as an STA role, so that a Wi-Fi P2P direct connection channel is established between a sending end device and a receiving end device. The Wi-Fi P2P direct connection channel not only can transmit shared data, but also can transmit internet data, so that two-end equipment can still have internet surfing capability while transmitting data. Therefore, the problem that after a Wi-Fi P2P direct channel is established between two Windows system devices, the devices cannot be connected with a hot spot to surf the Internet is solved.

Description

Wi-Fi P2P-based data transmission method and electronic equipment
The application is a divisional application of China patent application which is submitted to the national intellectual property agency, the application number is 202111276093.7 and the application name is Wi-Fi P2P-based data transmission method and electronic equipment at the day of 10 months and 29 days in 2021.
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a Wi-Fi P2P-based data transmission method and an electronic device.
Background
With the popularity of smart devices and the rapid development of internet of things (Internet of things, ioT), there are more and more devices supporting Wi-Fi P2P technology. Two or more devices may be interconnected by Wi-Fi P2P technology to form a small-scale peer-to-peer network architecture for communication with each other.
In some scenarios, multiple devices need to directly connect with Wi-Fi P2P, and one or more devices need to communicate with a Wi-Fi Access Point (AP) to implement Wi-Fi internet service. As IoT evolves, applications for this scenario will increase, so it is important that an electronic device has the ability to connect to an AP and other electronic devices simultaneously.
However, in the prior art, when the electronic device communicates with the AP, if the electronic device is connected with other electronic devices through Wi-Fi P2P, the communication between the electronic device and the AP will be greatly affected, so that the Wi-Fi internet service will be blocked, even the phenomenon of network disconnection will occur, which greatly affects the user experience.
Disclosure of Invention
The application provides a Wi-Fi P2P-based data transmission method and electronic equipment, and aims to solve the problem that Wi-Fi Internet surfing business of the electronic equipment is blocked or interrupted in a scene that the electronic equipment is connected with other electronic equipment through Wi-Fi P2P while communication exists between the electronic equipment and an AP.
In a first aspect, an embodiment of the present application provides a Wi-Fi P2P-based data transmission method, where the method includes:
the method comprises the steps that a first electronic device receives a sharing operation of a user, and the sharing operation is used for triggering the first electronic device to send first data to be shared to a second electronic device in a point-to-point P2P transmission mode; the first electronic device is connected to the first access point, and the second electronic device is connected to the second access point;
responding to the sharing operation, and creating a virtual access point by the first electronic equipment;
the first electronic device establishes a P2P channel with the second electronic device based on the virtual access point;
the first data and the Internet surfing data of the second electronic equipment are transmitted between the first electronic equipment and the second electronic equipment through the P2P channel;
the first electronic device and the second electronic device are electronic devices which do not support double-frequency double-transmission but support Wi-Fi P2P functions.
According to the scheme, in a scene that Wi-Fi direct connection is needed between two electronic devices to transmit data, the networked electronic devices can create a virtual AP as a wireless hot spot, and the other electronic device can be connected to the wireless hot spot as an STA role, so that a Wi-Fi P2P direct connection channel is established between the sending end device and the receiving end device. The Wi-Fi P2P direct connection channel not only can transmit shared data, but also can transmit internet data, so that two-end equipment can still have internet surfing capability while transmitting data. Therefore, the problem that after a Wi-Fi P2P direct channel is established between two electronic devices, the devices cannot be connected with a hot spot to surf the Internet is solved.
It should be noted that, in the embodiment of the present application, the virtual AP created by the electronic device (i.e., softAP) may be understood as a part of the electronic device, and the softAP may be a functional module implemented by software and/or a module implemented by combining software and hardware in the electronic device, which is not another physical hardware independent from the electronic device.
In a possible implementation manner of the first aspect, the first electronic device and the second electronic device are devices installed with a Windows system.
In some possible implementations of the first aspect, the P2P channel may include a first Socket channel and a second Socket channel. The first Socket channel is used for transmitting the first data, and the second Socket channel is used for transmitting internet data of the second electronic device.
According to the scheme provided by the embodiment of the application, in a scene that Wi-Fi direct connection is needed between two electronic devices applying Windows systems to transmit data, the networked electronic devices can create a virtual AP as a wireless hot spot, and the other electronic device can be connected to the wireless hot spot as an STA role, so that a Wi-Fi P2P direct connection channel is established between the sending end device and the receiving end device. The Wi-Fi P2P direct connection channel not only can transmit shared data, but also can transmit internet data, so that two-end equipment can still have internet surfing capability while transmitting data. Therefore, the problem that after a Wi-Fi P2P direct channel is established between two Windows system devices, the devices cannot be connected with a hot spot to surf the Internet is solved.
In a possible implementation manner of the first aspect, the method may further include: the first electronic equipment interacts the Internet surfing data of the first electronic equipment and the Internet surfing data of the second electronic equipment with the network side through the first access point.
In a possible implementation manner of the first aspect, the establishing, by the first electronic device, a P2P channel with the second electronic device based on the virtual access point includes:
the first electronic equipment sends hot spot information of a virtual access point to the second electronic equipment, wherein the hot spot information of the virtual access point comprises a service set identifier SSID and a password;
The second electronic equipment is connected to the virtual access point according to the received hot spot information of the virtual access point;
the first electronic device and the second electronic device successfully establish a P2P channel.
In a possible implementation manner of the first aspect, the method may further include: in the case that the second electronic device is connected to the virtual access point, the second electronic device disconnects from the second access point.
In a possible implementation manner of the first aspect, after the first electronic device receives the sharing operation of the user, the method further includes: in response to the sharing operation, the first electronic device displays first prompt information, wherein the first prompt information is used for prompting: when the first electronic device and the second electronic device perform data transmission, the second electronic device is connected to the wireless local area network of the first electronic device.
In a possible implementation manner of the first aspect, the creating, by the first electronic device, a virtual access point includes:
the first electronic equipment receives a confirmation operation of a user on the first prompt information;
in response to a confirmation operation by the user, the first electronic device creates a virtual access point.
In a possible implementation manner of the first aspect, the receiving, by the first electronic device, a sharing operation of a user includes:
The method comprises the steps that first electronic equipment receives first operation of a user, wherein the first operation is to select first data and trigger sharing operation;
responsive to the first operation, the first electronic device scans for nearby connectable devices;
the first electronic device displays an identification of the connectable device found by the scanning, the identification of the connectable device including an identification of the second electronic device;
the first electronic device receives a second operation of a user on the identifier of the second electronic device;
the sharing operation may include the first operation and the second operation.
In a possible implementation manner of the first aspect, after the first electronic device receives the sharing operation of the user, the method may further include:
the method comprises the steps that Bluetooth connection is established between a first electronic device and a second electronic device;
the first electronic device sends a first request message to the second electronic device based on the Bluetooth connection;
the second electronic equipment receives a first request message sent by the first electronic equipment based on the Bluetooth connection;
the second electronic device displays the first request message;
wherein, the first request message may be used for prompting: the first electronic device will send data to the second electronic device and the second electronic device will be connected to the wireless local area network of the first electronic device during the data transmission.
In a possible implementation manner of the first aspect, after the second electronic device displays the first request message, the method may further include:
the second electronic equipment receives the confirmation operation of the user on the first request message;
the second electronic device sends a first message to the first electronic device, the first message being usable to prompt: the second electronic device has agreed to receive the first data sent by the first electronic device.
In a possible implementation manner of the first aspect, the method may further include:
after the second electronic device successfully receives the first data, the second electronic device disconnects the virtual access point;
the second electronic device is reconnected to the second access point.
In a possible implementation manner of the first aspect, the method may further include:
the first electronic device receives a second response message sent by the second electronic device, wherein the second response message can be used for indicating that the first data has been successfully received;
the first electronic device deletes the virtual access point.
In a second aspect, an embodiment of the present application provides a Wi-Fi P2P-based data transmission method, including:
the method comprises the steps that a first electronic device receives a sharing operation of a user, and the sharing operation is used for triggering the first electronic device to send first data to be shared to a second electronic device in a point-to-point P2P transmission mode; wherein the second electronic device is connected to the second access point;
Responding to the sharing operation, the first electronic equipment sends a second request message to the second electronic equipment, wherein the second request message is used for requesting the second electronic equipment to create a virtual access point;
the first electronic device establishes a P2P channel with the second electronic device based on the virtual access point;
the first data and the Internet surfing data of the first electronic equipment are transmitted between the first electronic equipment and the second electronic equipment through a P2P channel;
the first electronic device and the second electronic device are electronic devices which do not support double-frequency double-transmission but support Wi-Fi P2P functions.
In a possible implementation manner of the second aspect, the first electronic device and the second electronic device are devices installed with a Windows system.
According to the scheme provided by the embodiment of the application, in a scene that Wi-Fi direct connection is needed between two electronic devices applying Windows systems to transmit data, the networked electronic devices can create a virtual AP as a wireless hot spot, and the other electronic device can be connected to the wireless hot spot as an STA role, so that a Wi-Fi P2P direct connection channel is established between the sending end device and the receiving end device. The Wi-Fi P2P direct connection channel not only can transmit shared data, but also can transmit internet data, so that two-end equipment can still have internet surfing capability while transmitting data. Therefore, the problem that after a Wi-Fi P2P direct channel is established between two Windows system devices, the devices cannot be connected with a hot spot to surf the Internet is solved.
In a possible implementation manner of the second aspect, the P2P channel may include a first Socket channel and a second Socket channel; the first Socket channel is used for transmitting first data, and the second Socket channel is used for transmitting internet data of the first electronic device.
In a possible implementation manner of the second aspect, the method may further include:
the second electronic equipment interacts the Internet surfing data of the second electronic equipment with the network side through the second access point and the Internet surfing data of the first equipment.
In a possible implementation manner of the second aspect, the establishing, by the first electronic device, a P2P channel with the second electronic device based on the virtual access point includes:
the first electronic equipment receives hot spot information of a virtual access point sent by the second electronic equipment, wherein the hot spot information of the virtual access point comprises a service set identifier SSID and a password;
the first electronic equipment is connected to the virtual access point according to the received hot spot information of the virtual access point;
the first electronic device and the second electronic device successfully establish a P2P channel.
In a possible implementation manner of the second aspect, after the first electronic device receives the sharing operation of the user, the method may further include:
in response to the sharing operation, the first electronic device displays a second hint information, which may be used to hint: when the first electronic device and the second electronic device perform data transmission, the first electronic device is connected to the wireless local area network of the second electronic device.
In a possible implementation manner of the second aspect, the first electronic device sends a second request message to the second electronic device, including:
the first electronic equipment receives the confirmation operation of the user on the second prompt information;
in response to the confirmation operation of the user, the first electronic device transmits a second request message to the second electronic device.
In a possible implementation manner of the second aspect, the first electronic device sends a second request message to the second electronic device, including:
the method comprises the steps that Bluetooth connection is established between a first electronic device and a second electronic device;
the first electronic device sends a second request message to the second electronic device based on the Bluetooth connection;
the second electronic equipment receives a second request message sent by the first electronic equipment based on the Bluetooth connection;
the second electronic equipment displays third prompt information according to the second request message;
wherein, the third prompt message is used for prompting: the first electronic device will send data to the second electronic device and the first electronic device will be connected to the wireless local area network of the second electronic device during the data transmission.
In a possible implementation manner of the second aspect, after the second electronic device displays the third prompt information according to the second request message, the method may further include:
The second electronic equipment receives confirmation operation of the user on the third prompt information;
the second electronic device sends a second response message to the first electronic device, wherein the second response message is used for prompting: the second electronic device has agreed to receive the first data sent by the first electronic device.
In a possible implementation manner of the second aspect, the receiving, by the first electronic device, a sharing operation of a user includes:
the method comprises the steps that first electronic equipment receives first operation of a user, wherein the first operation is to select first data and trigger sharing operation;
responsive to a first operation, the first electronic device scans for nearby connectable devices;
the first electronic device displays an identification of the connectable device found by the scanning, the identification of the connectable device including an identification of the second electronic device;
the first electronic device receives a second operation of a user on the identifier of the second electronic device;
the sharing operation includes the first operation and the second operation.
In a possible implementation manner of the second aspect, the method may further include:
the first electronic device receives a second message sent by the second electronic device, wherein the second message is used for indicating that the first data is successfully received;
The first electronic device disconnects from the virtual access point.
In a possible implementation manner of the second aspect, the method may further include: after the second electronic device successfully receives the first data, the second electronic device deletes the virtual access point.
In a third aspect, embodiments of the present application provide a Wi-Fi P2P-based data transmission apparatus comprising means for performing the method of the first aspect described above. The apparatus may correspond to performing the method described in the first aspect, and the relevant descriptions of the units in the apparatus are referred to the description of the first aspect, which is omitted herein for brevity. Alternatively, the apparatus may correspond to performing the method described in the second aspect, and the relevant descriptions of the units in the apparatus are referred to the description of the second aspect, which is not repeated herein for brevity.
The method described in the first aspect or the second aspect may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software includes one or more modules or units corresponding to the functions described above. For example, a detection module or unit, a Wi-Fi module or unit, etc.
In a fourth aspect, embodiments of the present application provide an electronic device comprising a processor coupled to a memory for storing computer programs or instructions, the processor for executing the computer programs or instructions stored by the memory, such that the method of the first aspect is performed. For example, a processor is configured to execute a computer program or instructions stored in a memory, to cause the apparatus to perform the method in the first aspect.
In a fifth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program (which may also be referred to as instructions or code) for implementing the method in the first aspect. For example, the computer program, when executed by a computer, causes the computer to perform the method of the first aspect.
In a sixth aspect, embodiments of the present application provide a chip including a processor. The processor is configured to read and execute a computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof. Optionally, the chip further comprises a memory, and the memory is connected with the processor through a circuit or a wire.
In a seventh aspect, the present application provides a system-on-chip comprising a processor. The processor is configured to read and execute a computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof. Optionally, the chip system further comprises a memory, and the memory is connected with the processor through a circuit or a wire.
In an eighth aspect, embodiments of the present application provide a computer program product comprising a computer program (which may also be referred to as instructions or code) which, when executed by a computer, causes the computer to implement the method in the first aspect.
It will be appreciated that the advantages of the second to eighth aspects may be found in the relevant description of the first aspect, and are not repeated here.
Drawings
Fig. 1 is an application scenario schematic diagram of a Wi-Fi P2P-based data transmission method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of a Wi-Fi P2P application scenario according to an embodiment of the present application;
fig. 3 is a schematic diagram of a process of performing data interaction between modules of two electronic devices in an embodiment of the present application;
fig. 4 is a flow chart of a Wi-Fi P2P-based data transmission method according to the first embodiment of the present application;
fig. 5 is a schematic user interface diagram of a Wi-Fi P2P-based data transmission method according to a first embodiment of the present application;
fig. 6 is a schematic block diagram of a Wi-Fi P2P-based data transmission method according to the first embodiment of the present application;
fig. 7 is a flowchart illustrating a processing procedure of a transmitting end in a Wi-Fi P2P-based data transmission method according to a first embodiment of the present application;
fig. 8 is a flowchart illustrating a processing procedure of a receiving end in a Wi-Fi P2P-based data transmission method according to the first embodiment of the present application;
fig. 9 is a schematic block diagram of another Wi-Fi P2P-based data transmission method according to the first embodiment of the present application;
Fig. 10 is a flowchart of a Wi-Fi P2P-based data transmission method according to a second embodiment of the present application;
fig. 11 is a schematic block diagram of a Wi-Fi P2P-based data transmission method according to a second embodiment of the present application;
fig. 12 is another schematic block diagram of a Wi-Fi P2P-based data transmission method according to a second embodiment of the present application;
fig. 13 is a flowchart of a Wi-Fi P2P-based data transmission method according to a third embodiment of the present application;
fig. 14 is a schematic block diagram of a Wi-Fi P2P-based data transmission method according to a third embodiment of the present application;
fig. 15 is a schematic structural diagram of a Wi-Fi P2P-based data transmission device according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of 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, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The term "and/or" herein is an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. The symbol "/" herein indicates that the associated object is or is a relationship, e.g., A/B indicates A or B.
The terms "first" and "second" and the like in the description and in the claims are used for distinguishing between different objects and not for describing a particular sequential order of objects. For example, a first electronic device and a second electronic device, etc., are used to distinguish between different electronic devices, and are not used to describe a particular order of electronic devices.
In the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" means two or more, for example, a plurality of processing units means two or more processing units and the like; the plurality of elements means two or more elements and the like.
To facilitate understanding of embodiments of the present application, some of the terms of embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
1) Access point AP and station STA
The wireless local area network (wireless local area net, WLAN) mainly consists of Stations (STAs) and Access Points (APs). The STA device is an electronic device in the WLAN as an STA role, and the AP device is an electronic device in the WLAN as an AP role. In a WLAN, one or more STA devices may establish a wireless connection with an AP device through a built-in wireless network card or Wi-Fi module. The AP equipment can provide wireless connection service for the STA equipment, and a plurality of STA equipment can access the same Wi-Fi network through the AP equipment to realize interconnection. The AP device may be connected to the internet through a wire, so that the STA device may be connected to the internet through the AP device, for example, may download data from the internet side or upload data to the internet side, that is, the STA device may implement Wi-Fi internet service through the AP device.
In the embodiment of the present application, the STA device may be a notebook computer, or a desktop computer equipped with a wireless network card, i.e. a personal computer (personal computer, PC), or may be other electronic devices applying a Windows system, which is not limited in this application. The AP device may be a wireless router.
Illustratively, as shown in fig. 1 (a), the electronic device 1 and the electronic device 2 are STA devices, the wireless router 3 is an AP device, the electronic device 1 and the electronic device 2 respectively establish wireless connection with the wireless router 3 through Wi-Fi channels, and the wireless router 3 is connected to the network server 4 through wires. In this way, the electronic device 1 and the personal computer device 2 can implement the internet service through the wireless router 3, respectively. It should be noted that, in the present embodiment, the electronic device 1 and the electronic device 2 are connected to the same wireless router for illustration, and it is understood that, in actual implementation, the electronic device 1 and the electronic device 2 may be connected to different wireless routers, respectively, to implement the internet service.
For ease of illustration, a device that will support Wi-Fi wireless connectivity may be referred to below as a Wi-Fi device.
2) Wi-Fi P2P (peer-to-peer, end-to-end or Point-to-Point)
Wi-Fi P2P is a technical specification introduced by the Wi-Fi alliance, also called Wi-Fi Direct (Wi-Fi Direct), which supports multiple Wi-Fi devices in the absence of an AP to also form a point-to-point network (also called a P2P Group) and communicate with each other. For ease of illustration, wi-Fi devices supporting Wi-Fi P2P wireless connections may be referred to below as Wi-Fi P2P devices or P2P devices.
Two roles are defined in the P2P architecture, respectively:
(a) GO (group owner): AP roles in P2P networks.
(b) GC (group client): STA roles in P2P networks.
After P2P negotiation is completed among a plurality of P2P devices, one of the P2P devices acts as GO, i.e., AP role; other P2P devices act as GCs, i.e., STA roles. It should be noted that there can be only one GO in a P2P network, and one GO can support connections with one or more GCs.
Wi-Fi P2P connectivity may be applied in scenarios where large amounts of data are transmitted wirelessly between devices. For example, in actual implementation, wi-Fi P2P technology may be used for Wi-Fi screen display, for example, a smart phone supporting P2P may be directly connected to a smart television supporting P2P through Wi-Fi P2P technology, and then the smart phone transmits its screen display content to the smart television for display. Therefore, with the help of Wi-Fi P2P technology, the use scene of Wi-Fi technology is expanded by the direct connection between Wi-Fi devices.
3) Virtual AP (soft access point, softAP)
Virtual APs are also referred to as virtual hotspots or simulated hotspots. The virtual AP function can be realized on the electronic equipment by using special software through the wireless network card, and the wireless networking is realized. That is, the carrier in the WLAN is used as a wireless access point, and a computer, a mobile phone or other internet access device is connected to the carrier, and then the network of the carrier (e.g., 3G/4G/5G) is accessed.
In actual implementation, when a large amount of data needs to be transmitted between two electronic devices supporting P2P capability and applying Windows system in a wireless manner, the two electronic devices may be connected by a SoftAP-STA scheme: one electronic device can establish a softAP through a built-in wireless network card to serve as a wireless hotspot; another electronic device may be used as an STA, connected to the wireless hotspot, to implement Wi-Fi P2P connection between devices.
Exemplarily, as shown in (b) of fig. 1, assuming that the electronic device 1 and the electronic device 2 support Wi-Fi P2P, the electronic device 1 may create SoftAP as a wireless hotspot without connecting an AP; the electronic device 2 may be connected to the wireless hotspot, so that the electronic device 1 and the electronic device 2 may directly establish a connection and perform data interaction sharing, for example, may implement a multi-screen interaction function. By way of example, an image displayed on the screen of the electronic device 1 may be sent to the electronic device 2 for projection via a Wi-Fi P2P connection.
In some scenarios, a direct connection between multiple devices may be required through Wi-Fi P2P, while one or more of the multiple devices may also be required to communicate with the AP device through Wi-Fi connection. However, in the prior art, when one STA device tries to connect to another device through Wi-Fi P2P while there is communication with the AP device, the communication between the STA device and the AP device will be greatly affected.
Taking a specific scenario as an example, fig. 2 shows a schematic diagram of a Wi-Fi P2P application scenario according to an embodiment of the present application. As shown in fig. 2 (a), the electronic device 1 establishes a connection with the first AP based on the Wi-Fi protocol as an STA role; the electronic device 2, acting as STA, establishes a connection with the second AP based on Wi-Fi protocol. Wherein, the electronic device 1 and the electronic device 2 both apply Windows system and both support Wi-Fi P2P. Alternatively, the first AP and the second AP may be the same AP, or may be different APs, which is not limited in the embodiments of the present application.
As shown in fig. 2 (b), in the file sharing scenario implemented through the P2P connection, the electronic device 1 at the transmitting end creates a virtual AP, the electronic device 2 at the receiving end serves as an STA, and these two devices may establish Wi-Fi P2P data transmission channels. However, in the case where the electronic device 2 is connected to the second AP and is downloading a file from a network or playing a network video, if the electronic device 2 and the electronic device 1 establish a P2P connection to receive the file, the downloading of the network video or the file played on the electronic device 2 may be blocked, or even the electronic device 2 may be disconnected, for example, the electronic device 2 may display a prompt message: "device 1 sent a file to you, and your network connection will be temporarily interrupted in the transmission", which greatly affects the user's communication experience.
That is, a Windows system device (e.g., electronic device 2 described above) cannot support two STA roles simultaneously: one STA role is used to connect to a wireless hotspot (e.g., a second AP) to enable internet traffic, and the other STA role is used to connect to another device (e.g., electronic device 1 described above) to establish a Wi-Fi P2P connection.
In principle, when the electronic device 2 tries to establish a Wi-Fi P2P connection with the electronic device 1 while in communication with the AP, the electronic device 2 needs to perform a device discovery operation, such as scanning (scan), listening (listen), search (search), or the like, on a plurality of channels in order to discover (discover) the electronic device 1 and establish a connection therewith. When the electronic device 2 communicates with the second AP, the channel responsible for data communication with the second AP is in an operating state, and since the data communication and the device discovery operation cannot be performed simultaneously, if the electronic device 2 performs the scanning, listening or searching operation again at this time, the channel in communication with the AP cannot be operated at the time when the device discovery operation occurs, thereby affecting the communication between the electronic device 2 and the AP.
It should be noted that, here, the scenario description is performed on the premise that the electronic device does not support dual-frequency dual-transmission (dual band dual concurrent, DBDC). Specifically, while a STA device that does not support DBDC connects to an AP hotspot to surf the internet, if the STA device establishes a Wi-Fi P2P data transmission channel with other devices, the STA device may no longer connect to the hotspot to surf the internet, i.e., the internet surfing service may be interrupted.
In view of this, the embodiment of the present application provides a Wi-Fi P2P-based data transmission method, in a scenario where Wi-Fi direct connection is required between two electronic devices applying Windows systems to transmit data, a networked electronic device may create a virtual AP as a wireless hotspot, and another electronic device may connect to the wireless hotspot as an STA role, thereby establishing a Wi-Fi P2P channel between a transmitting device and a receiving device. The Wi-Fi P2P channel not only can transmit shared data, but also can transmit internet data, so that two-end equipment can still have internet surfing capability while transmitting data. Therefore, the problem that after the Wi-Fi P2P channel is established between two Windows system devices, the devices cannot be connected with a hot spot to surf the Internet is solved.
The execution body of the Wi-Fi P2P-based data transmission method provided in the embodiment of the present application may be the electronic device supporting Wi-Fi P2P and applying a Windows system, or may be a functional module and/or a functional entity capable of implementing the Wi-Fi P2P-based data transmission method in the electronic device, and the scheme of the present application may be implemented by means of hardware and/or software, and may specifically be determined according to actual use requirements.
First, a description will be given of a procedure of establishing Wi-Fi P2P connection between devices according to the embodiments of the present application in connection with a data interaction procedure between each module of the electronic device 1 and each module of the electronic device 2. Fig. 3 is a schematic diagram of a process of data interaction between each module in the electronic device 1 and each module in the electronic device 2.
As shown in fig. 3, the electronic device 1 may include: the device located in the application program layer cooperates with the APP, the first discovery connection module located in the system layer, the first Bluetooth chip and the first Wi-Fi chip located in the hardware layer. The electronic device 2 may include: a second discovery connection module and a co-service module (not shown) at the system level, a second bluetooth chip and a second Wi-Fi chip at the hardware level. As shown in fig. 3, the process of data interaction between the modules may include steps A1 to a16.
In step A1, the device cooperation APP in the electronic device 1 receives a sharing operation input by a user.
Illustratively, a control (e.g., a sharing control) for triggering inter-device connections and sharing files may be included in the interface of the device collaborative APP. For example, the sharing operation input by the user may be a series of operations in which the user triggers sharing after selecting a picture. For example, after a user selects a certain picture in the electronic device 1, the electronic device 1 may pop up an interface of the device collaborative APP, and when the user selects the sharing control, the electronic device 1 may scan to find surrounding connectable electronic devices, and display the scanned identifier of one or more electronic devices for the user to select; after the user selects one device identifier, the sharing operation can be completed.
And A2, the device cooperation APP sends a message to the first discovery connection module, and the message instructs the first discovery connection module to scan for nearby connectable devices.
After the device cooperation APP receives the sharing operation input by the user, the device cooperation APP sends an inter-process communication (inter-process communication, IPC) message to the first discovery connection module. The IPC message may carry a scan indication instruction, configured to instruct the first discovery connection module to invoke the capability scan of the first bluetooth chip to discover nearby connectable electronic devices.
And step A3, the first discovery connection module calls the Bluetooth capability scanning of the first Bluetooth chip to discover nearby connectable devices.
And after the first discovery connection module receives the IPC message, invoking the capability scanning of the first Bluetooth chip to discover nearby connectable electronic equipment.
In step A4, the electronic device 1 broadcasts the scanning signal through the first bluetooth chip.
In step A5, the electronic device 2 may receive the scan signal of the electronic device 1 through the second bluetooth chip and forward the scan signal to the second discovery connection module of the electronic device 2.
In step A6, the second discovery connection module of the electronic device 2 feeds back the basic information of the electronic device 2 itself to the first discovery connection module of the electronic device 1.
For example, the basic information of the electronic device 2 may include an internet protocol address (internet protocol address, IP address), a media access control address (media access control address, MAC address), a universal unique identification code (universally unique identifier, uuid), a device identification, a device name, and the like of the electronic device 2.
When the first discovery connection module of the electronic device 1 scans the connectable electronic device 2, the first discovery connection module may acquire basic information of the electronic device 2.
In step A7, the first discovery connection module sends the discovered basic information (such as the device name and MAC address) of the connectable electronic device to the device cooperation APP.
In step A8, the device cooperation APP displays the basic information of the connectable one or more electronic devices discovered by scanning in a connectable device list for display to a user for viewing.
In some embodiments, the connectable device list displayed by the device cooperation APP includes all devices, such as a tablet large screen, a mobile phone, or a wearable device, near the electronic device 1, for which bluetooth functions are turned on.
In other embodiments, after receiving the information of all the devices with the bluetooth function turned on, the device cooperation APP may screen out the devices supporting Wi-Fi P2P for display, for example, if the wearable device does not support Wi-Fi P2P, the device cooperation APP does not display the wearable device in the connectable device list.
In particular to the solution of the present application, the connectable one or more electronic devices found by the device in cooperation with APP scanning include the electronic device 2.
In step A9, when the user clicks the electronic device 2 in the connectable device list, the device cooperation APP may receive the clicking operation of the user.
And A10, the device cooperates with the APP to send an IPC message to the first discovery connection module, and the IPC message is used for indicating the first discovery connection module to call the first Bluetooth chip to establish Bluetooth connection with the electronic device 2.
The IPC message may carry basic information of the electronic device 2.
The bluetooth connection may be established by using a bluetooth low energy (bluetooh low energy, BLE) technology, or may be established by using other bluetooth technologies.
And step A11, after the first discovery connection module receives the IPC message, the capability of the first Bluetooth chip can be called to carry out Bluetooth connection with the second Bluetooth chip of the electronic equipment 2 so as to realize communication connection between the electronic equipment 1 and the electronic equipment 2.
Step a12, the bluetooth connection is successfully established between the electronic device 1 and the electronic device 2.
In step a13, the electronic device 1 negotiates to establish a P2P connection with the electronic device 2 based on the bluetooth connection.
The electronic device 1 and the electronic device 2 may interact with each other in the network connection based on the bluetooth connection. For example, the electronic device 2 may send a message to the electronic device 1 indicating that the electronic device 2 is networked or not networked.
In the embodiment of the present application, when negotiating to establish a P2P connection, different scenarios may correspond to different schemes or policies:
(1) A scenario in which both the electronic device 1 on the transmitting side and the electronic device 2 on the receiving side are networked.
Scheme one: the electronic equipment 1 creates a virtual AP as a wireless hotspot, the electronic equipment 2 at the receiving end serves as an STA role and is connected to the wireless hotspot, so that P2P connection can be successfully established between the electronic equipment 1 and the electronic equipment 2, data can be directly transmitted, the Internet surfing service of the electronic equipment 1 is not affected, and the electronic equipment 2 can realize the Internet surfing service through the wireless hotspot corresponding to the electronic equipment 1.
In the second scheme, the electronic device 2 creates a virtual AP as a wireless hotspot, the electronic device 1 at the receiving end takes a role of STA and connects to the wireless hotspot, so that a P2P connection can be successfully established between the electronic device 1 and the electronic device 2, data can be directly transmitted, the internet service of the electronic device 2 is not affected, and the electronic device 1 can realize the internet service through the wireless hotspot corresponding to the electronic device 2.
Alternatively, when the electronic device 1 of the transmitting end is networked, the virtual AP may be created by default by the transmitting end device without taking account of the networking situation of the electronic device 2 of the receiving end.
(2) The electronic equipment 1 at the transmitting end is not networked, and the electronic equipment 2 at the receiving end is networked.
The electronic equipment 2 creates a virtual AP as a wireless hotspot, the electronic equipment 1 takes a role of an STA and is connected to the wireless hotspot, so that P2P connection can be successfully established between the electronic equipment 1 and the electronic equipment 2, data can be directly transmitted, the Internet surfing service of the electronic equipment 2 is not affected, and the electronic equipment 1 can realize the Internet surfing service through the wireless hotspot corresponding to the electronic equipment 2.
(3) A scenario in which the electronic device 1 on the transmitting side is networked and the electronic device 2 on the receiving side is not networked.
The electronic equipment 1 creates a virtual AP as a wireless hotspot, the electronic equipment 2 takes a STA role and is connected to the wireless hotspot, so that P2P connection can be successfully established between the electronic equipment 1 and the electronic equipment 2, data can be directly transmitted, the Internet surfing service of the electronic equipment 1 is not affected, and the electronic equipment 2 can realize the Internet surfing service through the wireless hotspot corresponding to the electronic equipment 1.
(4) Neither the electronic device 1 at the transmitting end nor the electronic device 2 at the receiving end is networked.
Either of the electronic device 1 and the electronic device 2 may create a wireless hotspot to enable an inter-device P2P connection. For example, the electronic device 1 creates a virtual AP as a wireless hotspot, and the electronic device 2 acts as an STA and connects to the wireless hotspot, so that a P2P connection can be successfully established between the electronic device 1 and the electronic device 2, and data can be directly transmitted.
In the following, a scheme one of the (1) th scenario is taken as an example for illustration, and the scheme one correspondingly executes a14-a23 described below; scheme two of scenario (1) is similar to scheme one and will not be described again here. Then, the scheme A24-A32 corresponding to the (2) scene is taken as an exemplary illustration; the scheme corresponding to the (3) th scene is similar to the scheme corresponding to the (2) th scene, and will not be repeated here. The above-mentioned scenario (4) is not the focus of this case, and thus the processing procedure thereof is not shown in the flowchart.
In step a14, the first discovery connection module of the electronic device 1 invokes the first Wi-Fi chip to create a virtual AP.
Wherein the virtual AP has a service set identification (service set identifier, SSID) and a password.
Step a15, the first discovery connection module sends the SSID and the password to the second discovery connection module of the electronic device 2 through the established bluetooth connection.
Step A16, the second discovery connection module of the electronic device 2 invokes the second Wi-Fi chip to establish Wi-Fi P2P connection with the electronic device 1 according to the received SSID and password.
In step a17, the electronic device 2 connects to the virtual AP corresponding to the electronic device 1. If the electronic device 2 is networked through the second AP, the second Wi-Fi chip of the electronic device 2 disconnects from the second AP.
Step a18, a Wi-Fi P2P channel is successfully established between the electronic device 1 and the electronic device 2.
The Wi-Fi P2P channel is a physical channel for carrying data transmission.
In step a19, a Socket channel is established between the electronic device 1 and the electronic device 2.
The Socket channel is a logic channel established based on a Wi-Fi P2P channel.
In practical applications, the Socket channel is used for implementing data transmission based on IP of the two end devices or modules, a certain defined port, and agreement of protocols (such as TCP/IP, UDP, SMTP, FTP) supported by the two end devices.
The service module of the electronic device can create one or more Socket channels according to the current service condition to respectively transmit data of different services. Specifically, in this application, the current service may include a transmission service for sharing data and a transmission service for surfing the internet, based on which the electronic device 1 may create two Socket channels, which are respectively referred to as a Socket channel 1 and a Socket channel 2.Socket channel 1 can be used for transmitting shared data, and Socket channel 2 can be used for transmitting internet data.
In step a20, data is shared between the electronic device 1 and the electronic device 2 through the Socket channel 1.
In step a21, internet data of the electronic device 2 is transmitted between the electronic device 1 and the electronic device 2 through the Socket channel 2.
Thus, the electronic device 1 and the electronic device 2 can realize data sharing and internet surfing services through the P2P channel.
In step a22, after the sharing is completed, the electronic device 1 deletes the virtual AP.
Here, in response to the user trigger operation, the electronic apparatus 1 may delete the virtual AP; the electronic device 1 may automatically delete the virtual AP after the sharing is completed.
In step a23, the electronic device 2 disconnects from the virtual AP and automatically selects a usable hotspot, e.g. the electronic device 2 automatically connects to the originally connected second AP.
As can be seen from the above a14-a23, in the case of networking the electronic device 1, the electronic device 1 creates a virtual AP as a wireless hotspot; the electronic equipment 2 is used as an STA role and is connected to the virtual AP created by the electronic equipment 1, so that a P2P channel and a Socket channel are established between the equipment, and the purposes of data sharing and internet surfing are realized.
The following description will be further made with reference to a24-a32 below to further explain an implementation manner of establishing a P2P channel between devices when the electronic device 1 at the transmitting end is not networked and the electronic device 2 at the receiving end is networked.
In step a24, the second discovery connection module of the electronic device 2 invokes the second Wi-Fi chip to create a virtual AP.
Also, the virtual AP has a service set identification (service set identifier, SSID) and a password.
In step a25, the second discovery connection module sends the SSID and the password to the first discovery connection module of the electronic device 1 through the established bluetooth connection.
In step a26, the first discovery connection module of the electronic device 1 invokes the first Wi-Fi chip to establish Wi-Fi P2P connection with the electronic device 2 according to the received SSID and password.
Wherein the electronic device 1 is connected to a virtual AP corresponding to the electronic device 2.
Step a27, a Wi-Fi P2P connection is successfully established between the electronic device 1 and the electronic device 2.
In step a28, a Socket channel is established between the electronic device 1 and the electronic device 2.
Similarly, two Socket channels are established between the electronic device 1 and the electronic device 2, and are respectively called a Socket channel 1 and a Socket channel 2.Socket channel 1 can be used for transmitting shared data, and Socket channel 2 can be used for transmitting internet data.
In step a29, data is shared between the electronic device 1 and the electronic device 2 through the Socket channel 1.
In step a30, internet data of the electronic device 1 is transmitted between the electronic device 1 and the electronic device 2 through the Socket channel 2.
Thus, the electronic device 1 and the electronic device 2 can realize data sharing and internet surfing services based on Wi-Fi P2P channels.
In step a31, after the sharing is completed, the electronic device 1 disconnects from the virtual AP.
The electronic device 1 may automatically select a usable hotspot, e.g. the electronic device 1 may automatically connect to an originally connected AP.
In step a32, the electronic device 2 deletes the virtual AP.
Here, in response to the user trigger operation, the electronic apparatus 1 may delete the virtual AP; the electronic device 1 may automatically delete the virtual AP after the sharing is completed.
As can be seen from the above a24-a32, when the electronic device 1 at the transmitting end is not networked, and the electronic device 2 at the receiving end is networked, the electronic device 2 creates a virtual AP as a wireless hotspot; the electronic equipment 1 is used as an STA role and is connected to a virtual AP created by the electronic equipment 2, so that a P2P channel and a Socket channel are established between the equipment, and the purposes of data sharing and internet surfing are realized.
The Wi-Fi P2P-based data transmission method provided by the embodiments of the present application is exemplarily described below with reference to the accompanying drawings. For convenience of explanation, the electronic apparatus 1 of the transmitting side may be hereinafter referred to as a transmitting side apparatus, and the electronic apparatus 2 of the receiving side may be referred to as a receiving side apparatus.
First embodiment
The first embodiment mainly describes how data transmission is performed between the sending end device and the receiving end device through Wi-Fi P2P and how the purpose of uninterrupted internet service of the networked device is achieved in a scene that both the sending end device and the receiving end device are networked.
Fig. 4 is a flowchart of a Wi-Fi P2P-based data transmission method according to a first embodiment of the present application. Referring to fig. 4, the method 100 includes steps S101-S105 described below.
S101, the electronic device 1 receives a first operation of a user, where the first operation is used to trigger the electronic device 1 to send first data to the electronic device 2 in a P2P transmission manner.
The electronic device 1 and the electronic device 2 are devices applying a Windows system. Both the electronic device 1 and the electronic device 2 support Wi-Fi P2P protocols, and the P2P functions of the electronic device 1 and the electronic device 2 are turned on by default. The P2P function may also be referred to as a mutual transmission or sharing function, which is not limited in the embodiments of the present application.
Alternatively, the first operation may include a plurality of sub-operations. For example, the first operation includes a first sub-operation, a second sub-operation, a third sub-operation, and a fourth sub-operation described below. Illustratively, as shown in fig. 5, when a user needs to share a picture 40 (i.e., first data) on the electronic device 1 to the electronic device 2, the user may select the picture 40 (first sub-operation) of the electronic device 1, and when the menu bar 41 is popped up, the user may click on a "share" control (second sub-operation) in the menu bar 41, and then the electronic device 1 may automatically scan to find surrounding connectable devices. After the electronic device 1 discovers the electronic device 2, the electronic device 1 displays an identification 42 of the electronic device 2. In response to an operation (third sub-operation) in which the user selects the identification 42 of the electronic device 2, the electronic device 1 may display a prompt window 43 for prompting the user to confirm whether to send the picture 40 to the electronic device 2. In response to the user clicking on the send control in the prompt window 43 (fourth sub-operation), the electronic device 1 may send a message to the electronic device 2 to share the picture. As shown in fig. 4, the electronic device 2 may display a message prompt box 44 for sharing the picture, where the message prompt box 44 is used to prompt: the device 1 shares a picture with you, refuses or accepts it. It will be appreciated that the first operation corresponds to the sharing operation described above in fig. 3.
Alternatively, the Wi-Fi P2P function of the electronic device 1 may be triggered by a user to start, or may be automatically started when the electronic device 1 is started, or may be triggered to start under a specific condition, which is not limited in the embodiments of the present application.
In the first embodiment, as described above, when the electronic device 1 receives the first operation of the user, the electronic device 1 first discovers the electronic device 2 by broadcasting, scanning, or the like, and then the electronic device 1 may directly initiate establishment of the P2P channel with the electronic device 2 in the case of having been networked. Specifically, the electronic device 1 creates a virtual AP as a wireless hotspot; the electronic device 2 acts as an STA and connects to the virtual AP created by the electronic device 1, so as to establish a P2P channel between the devices. That is, in the case where the transmitting end device is networked, the virtual AP may be created by default by the transmitting end device as a wireless hotspot without knowing the networking condition of the receiving end device and without negotiating with the receiving end device which end device to create the virtual AP.
In other embodiments, when the electronic device 1 receives the first operation of the user, the electronic device 1 and the electronic device 2 may first establish a bluetooth connection channel, then perform information interaction through the bluetooth connection channel, and negotiate to establish a P2P channel between the devices. For example, one of the electronic device 1 and the electronic device 2 may be determined to be a virtual AP role according to the networking situation of both parties. Alternatively, the electronic device 1 and the electronic device 2 may negotiate that the networked one-end device creates a virtual AP as a wireless hotspot.
If the electronic device 1 is connected to the first AP and the electronic device 2 is connected to the second AP, that is, the sending device and the receiving device are both networked. In this case, the transmitting end may create a virtual AP as a wireless hotspot; alternatively, the receiving end may create a virtual AP as the wireless hotspot. Alternatively, the electronic device 1 and the electronic device 2 may negotiate the creation of the virtual AP by the sender. For convenience of explanation, fig. 3 illustrates an example in which the electronic device 1 at the transmitting end creates a virtual AP. Alternatively, the first AP and the second AP may be the same AP, or may be different APs, which is not limited in the embodiment of the present application.
S102, the electronic device 1 creates a virtual AP.
Referring to fig. 5 again, in the case where the transmitting device creates a virtual AP, when the electronic device 1 sends the picture 40 to the electronic device 2, the prompt window 43 popped up by the electronic device 1 prompts: the other party in transmission will be connected to the local network; the message prompt box 44 of the reality of the electronic device 2 prompts: the transmitting host will connect to the counterpart network.
S103, the electronic device 1 and the electronic device 2 establish a P2P channel based on the virtual AP.
In the embodiment of the present application, the electronic device 1 as the transmitting end creates a virtual AP as a wireless hotspot. Further, the electronic device 2, acting as STA, may connect to a virtual AP created by the electronic device 1. It will be appreciated that in the case where the electronic device 2 is connected to the virtual AP created by the electronic device 1, the electronic device 1 and the electronic device 2 successfully establish the P2P channel.
S104, the electronic equipment 1 sends the first data to the electronic equipment 2 through the P2P channel, and transmits the Internet surfing data of the electronic equipment 2.
It will be appreciated that data may be transferred directly between the electronic device 1 and the electronic device 2 via the P2P channel, and no data may be transferred indirectly via the server.
In the embodiment of the present application, the P2P channel established between the electronic device 1 and the electronic device 2 is one physical channel, which may be used as two logical channels in a specific application: one of the logic channels is used for transmitting first data to be shared, and the channel can be called a sharing channel; another logical channel is used to transmit the internet data of the electronic device 2, which may be referred to as an internet data channel.
S105, the electronic device 1 transmits the internet data of the electronic device 1 and the internet data of the electronic device 2 through the first AP and the network side.
The electronic device 1 not only can be used as an STA role, but also can interact with a network side through a first AP; moreover, the electronic device 1 can also be used as a virtual AP role, and establish a P2P channel with the electronic device 2 used as an STA role and perform data transmission; and, the electronic device 1 may also provide internet surfing capabilities for the electronic device 2 in case the electronic device 1 is networked. That is, through the scheme of the application, when the electronic device is used as the STA role to communicate with the AP, the P2P channel can be established as the virtual AP role with other devices, so that the end-to-end data transmission is realized, and the communication (i.e. the internet service) between the electronic device and the AP is not affected, so that the interaction experience of multiple devices can be improved.
In the embodiment of the present application, in the case where the electronic device 2 establishes a P2P channel with the electronic device 1, the electronic device 2 may disconnect from the originally connected second AP.
Optionally, in the embodiment of the present application, the electronic device 2 may display networking prompt information, where the networking prompt information is used to prompt the electronic device 2 to implement surfing through a wireless hotspot corresponding to the electronic device 1.
In some embodiments, the networking prompt information may include an option to confirm networking and an option to prohibit networking for selection by the user.
In one aspect, the electronic device 2 may be networked through the wireless hotspot in response to an acknowledge networking operation by the user on the electronic device 2. In this case, the P2P channel established between the electronic device 1 and the electronic device 2 may be used as two logical channels: one of the logical channels, the shared channel, is used for data transmission (e.g., transmitting first data); the other logical channel, i.e. the internet data channel, is used for transmitting internet data of the electronic device 2.
On the other hand, in response to a user disabling networking operations on the electronic device 2, the electronic device 2 may not surf the internet through the wireless hotspot. In this case, the P2P channel established between the electronic device 1 and the electronic device 2 may be used as a sharing channel only for data interchange.
The method steps described above with respect to fig. 4 are further described below in conjunction with fig. 6. Fig. 6 is a schematic block diagram of a Wi-Fi P2P-based data transmission method according to a first embodiment of the present application. Under the condition that both end devices access the network, the sending end takes a softAP role, the receiving end takes an STA role, and the receiving and transmitting sides can share file data and share Internet surfing capability on an established Wi-Fi P2P channel through logic shown in figure 4.
As shown in fig. 6 (a), the electronic device 1 connects to the first AP as an STA role, thereby forming a first Wi-Fi network through which the electronic device 1 can connect to the internet; the electronic device 2 connects to the second AP in the STA role, thereby forming a second Wi-Fi network through which the electronic device 2 can connect to the internet.
As shown in fig. 6 (b), when the user triggers the electronic device 1 to share data with the electronic device 2 in the P2P manner, the electronic device 1 at the transmitting end may create a virtual AP (i.e. SoftAP) as a wireless hotspot. The electronic device 2 at the receiving end may be connected to the SoftAP created by the electronic device 1 as an STA role, so that the electronic device 1 and the electronic device 2 establish a P2P channel (including a sharing data channel and a surfing data channel).
As shown in fig. 6 (a) and (b), the first Wi-Fi network of the transmitting end is still reserved, and the second Wi-Fi network of the receiving end is disconnected; and a third Wi-Fi network is newly established between the sending end equipment and the receiving end equipment. Based on the newly-built third Wi-Fi network, data sharing can be performed between the sending end device and the receiving end device, internet surfing data of the receiving end device can be transmitted, wherein the internet surfing data of the receiving end device can be transmitted to the sending end device through an internet surfing data channel, and further interaction with the internet side is performed through the first AP. That is, the receiving end device may be networked through the AP to which the transmitting end device is correspondingly connected, so that the internet service of the receiving end device is not affected.
In the embodiment of the application, under the condition that both the sending end equipment and the receiving end equipment are networked, when the sending end equipment creates the virtual AP as the wireless hotspot, the sending end equipment and the receiving end equipment can not only establish a P2P channel and share data through the P2P channel, but also transmit the internet data of the receiving end equipment through the P2P channel, that is, the receiving end equipment can be networked through the AP correspondingly connected with the sending end equipment, so that the sending end equipment and the receiving end equipment can be ensured to be continuously connected with the internet, and the user interaction experience is improved.
It should be noted that, in the embodiment of the present application, the virtual AP created by the electronic device, for example, the softAP module shown in fig. 6 and the softAP modules shown in fig. 9, 11, 12 and 14 described below, may be all part of the electronic device, and the softAP may be a functional module implemented by software and/or a module implemented by combining software and hardware in the electronic device, and not be another physical hardware independent of the electronic device.
The Wi-Fi P2P-based data transmission method provided in the embodiment of the present application is described below with reference to fig. 7 and 8 from the perspective of the transmitting end and the receiving end, respectively.
For the transmitting end: the sender uses the electronic device 1 with the wireless network function to create a network sharing hot spot and starts the network sharing hot spot to share the file. The sending end equipment is connected with the AP to perform internet surfing activities, and the internet surfing activities are not affected by network sharing hot spots.
For the receiving end: the receiving end uses the electronic equipment 2 with the wireless network function to connect the network sharing hot spot of the sending end, establishes direct connection with the sending end, and receives the file shared by the sending end. If the sending end can normally perform the internet surfing activity, after the receiving end is connected with the network sharing hot spot of the sending end, the receiving end can have the internet surfing activity capability through the network sharing hot spot.
Fig. 7 is a flowchart illustrating a processing procedure of a transmitting end in a Wi-Fi P2P-based data transmission method according to the first embodiment of the present application. As shown in fig. 7, the processing flow of the transmitting end includes steps S1011 to S1018. It can be understood that the execution bodies of the processing flows are all transmitting ends, for example, the electronic device 1.
S1011, the transmitting end and the receiving end establish basic communication connection.
Illustratively, the base communication connection may be a bluetooth connection.
S1012, the sender acquires the configuration file associated with the WLAN connection.
S1013, when the sender acquires the configuration file associated with the WLAN connection, the sender creates a network sharing hotspot by using the configuration file.
The transmitting device may be equipped with a wireless network card driver supporting virtual Wi-Fi functions, and the driver may be used to create a virtual AP, i.e., a software virtual AP. Through the virtual AP, network connection on the transmitting terminal equipment can be shared to the receiving terminal equipment, and the function of the wireless router is realized. The wireless network card may be connected to the AP, or may simultaneously virtual a hotspot (hotpoint), and share the hotspot to the receiving end device.
S1014, when the transmitting end does not acquire the configuration file, the transmitting end acquires a locally stored configuration file list associated with the WLAN connection.
Further, when the sender acquires the profile list, the sender creates a network sharing hotspot by using the profile existing in the profile list.
S1015, after the sender uses the configuration file to successfully create the network sharing hotspot, the sender sets the name and the password of the network sharing hotspot.
Wherein, the network sharing hot spot name may be SSID.
S1016, when the network sharing hot spot is opened, the sending end shares the file with the receiving end after the receiving end connects to the network sharing hot spot.
S1017, when the network sharing hot spot is not started, the sending end starts the network sharing hot spot.
Further, after the receiving end is connected with the network sharing hotspot, the sending end shares the file with the receiving end.
S1018, when sharing is finished, the sending end closes the network sharing hot spot.
Fig. 8 is a flowchart illustrating a processing procedure of a receiving end in a Wi-Fi P2P-based data transmission method according to an embodiment of the present application. As shown in fig. 8, the processing flow of the transmitting end includes steps S2011-S2019. It can be understood that the execution subjects of the process flow are all receiving ends, such as the electronic device 2.
S2011, the receiving end and the sending end establish basic communication connection.
Illustratively, the base communication connection may be a bluetooth connection.
S2012, the receiving end obtains the handle of the WLAN connection.
For example, the receiving end may receive a Wi-Fi P2P connection establishment request sent by the sending end, where the Wi-Fi P2P connection establishment request may include a handle of the WLAN connection. The handle of the WLAN connection may include relevant information parameters of the Wi-Fi P2P connection.
S2013, the receiving end obtains an available wireless network card.
S2014, the receiving end disconnects the current hot spot.
S2015, the receiving end scans Wi-Fi network sharing hot spots of the sending end through the WLAN module.
S2016, the receiving end sets configuration information for connecting to the network sharing hot point.
S2017, the receiving end is connected to the network sharing hot spot.
S2018, the receiving end receives the file shared by the sending end.
S2019, after sharing is finished, the receiving end disconnects the network sharing hot spot.
In the embodiment of the application, under the condition that both the sending end device and the receiving end device are networked, when the receiving end device creates the virtual AP as the wireless hotspot, the sending end device and the receiving end device can not only establish the P2P channel and share data through the P2P channel, but also transmit the internet data of the sending end device through the P2P channel, that is, the sending end device can be networked through the AP correspondingly connected with the receiving end device, so that the sending end device and the receiving end device can be ensured to be continuously connected with the internet, and the interaction experience of the device is improved.
It should be noted that, in the first embodiment described above, the creation of the virtual AP by the electronic device 1 at the transmitting end is taken as an example, it may be understood that, in the actual implementation, when the user triggers the electronic device 1 to share data with the electronic device 2 in the P2P manner, the electronic device 2 at the receiving end may also create the virtual AP as a wireless hotspot when both the transmitting end device and the receiving end device are networked; the electronic device 1 is connected to the virtual AP created by the electronic device 2 as an STA role, so that a P2P channel is established between the transmitting end and the receiving end.
In the case where the electronic device 1 is connected to the virtual AP created by the electronic device 2, the electronic device 1 may display networking prompt information, where the networking prompt information is used to prompt the electronic device 1 to implement surfing through a wireless hotspot corresponding to the electronic device 2. For a specific implementation manner in which the receiving end device creates the virtual AP and establishes the P2P channel with the transmitting end device through the virtual AP, reference may be made to the description of fig. 3, which is not repeated herein.
The method steps for creating a virtual AP by a receiving end device are further described below in conjunction with fig. 9. Fig. 9 is a schematic block diagram of another Wi-Fi P2P-based data transmission method according to the first embodiment of the present application.
In fig. 9, (a) is the same as that shown in fig. 6, (a) and both the electronic device 1 and the electronic device 2 are networked. When the user triggers the electronic device 1 to share data with the electronic device 2 in the P2P manner, the electronic device 1 at the transmitting end may negotiate with the electronic device 2 at the receiving end about establishing a P2P channel.
As shown in fig. 9 (b), the electronic device 2 at the receiving end may create a virtual AP (i.e., softAP) as a wireless hotspot. The electronic device 1 at the transmitting end may be connected to the SoftAP created by the electronic device 2 as an STA role, so that the electronic device 1 and the electronic device 2 establish a P2P channel (including a sharing data channel and a surfing data channel).
As shown in fig. 9 (a) and (b), the first Wi-Fi network of the transmitting end is disconnected, and the second Wi-Fi network of the receiving end is still reserved; and a fourth Wi-Fi network is newly established between the sending end equipment and the receiving end equipment. Based on the newly-built fourth Wi-Fi network, data sharing can be performed between the sending end equipment and the receiving end equipment, internet surfing data of the sending end equipment can be transmitted, wherein the internet surfing data of the sending end equipment can be transmitted to the receiving end equipment through an internet surfing data channel, and further interaction with the internet side is performed through the second AP. That is, the transmitting device may be networked through the AP to which the receiving device is correspondingly connected, so that the internet service of the transmitting device is not affected.
Second embodiment
The second embodiment mainly describes how data transmission is performed between a transmitting end device and a receiving end device through Wi-Fi P2P and how the purpose of uninterrupted internet service of the networked devices is achieved in a scene where only one of the transmitting end device and the receiving end device is networked.
Fig. 10 is a flowchart of a Wi-Fi P2P-based data transmission method according to a second embodiment of the present application. Referring to FIG. 10, the method 200 includes steps S201 and S202A-S205A, or steps S201 and S202B-S205B, described below.
S201, the electronic device 1 receives a first operation of the user, where the first operation is used to trigger the electronic device 1 to send first data to the electronic device 2 in a P2P transmission manner.
For the first operation, the process of establishing the bluetooth connection, and negotiating to establish the P2P channel, refer to the detailed description of the first operation in the above first embodiment, which is not repeated herein.
After step S201, in the case where the electronic device 1 is networked and the electronic device 2 is not networked, continuing to execute steps S202A to S205A described below; or continue to perform steps S202B-S205B described below in case the electronic device 1 is not networked and the electronic device 2 is networked.
S202A, if the electronic device 1 is connected to the first AP and the electronic device 2 is not networked, the electronic device 1 creates a virtual AP.
S203A, the electronic device 1 and the electronic device 2 establish a P2P channel based on the virtual AP.
It will be appreciated that the electronic device 1 is connected to the first AP and the electronic device 2 is not networked, which means that only the electronic device 1 of the electronic device 1 and the electronic device 2 is networked, that is, only the transmitting device of the transmitting device and the receiving device is networked.
In this embodiment of the present application, when the electronic device 1 receives the first operation of the user, the electronic device 1 and the electronic device 2 may first establish a bluetooth connection channel, and then perform information interaction based on the bluetooth connection channel, and negotiate that a virtual AP is created by a networked end device as a wireless hotspot. In particular, to the second embodiment, since the electronic apparatus 1 as the transmitting end has been networked, the electronic apparatus 1 can create a virtual AP as a wireless hotspot.
Illustratively, when the electronic device 1 receives the first operation of the user, the electronic device 1 first discovers the electronic device 2 by broadcasting, scanning, etc., and then the electronic device 1 may directly initiate the establishment of the P2P channel with the electronic device 2. Wherein, because the electronic device 1 is networked, the electronic device 1 creates a virtual AP as a wireless hotspot; the electronic device 2, acting as STA role, connects to the virtual AP created by the electronic device 1. It will be appreciated that in the case where the electronic device 2 is connected to the virtual AP created by the electronic device 1, the electronic device 1 and the electronic device 2 successfully establish the P2P channel.
S204A, the electronic device 1 sends the first data to the electronic device 2 through the P2P channel.
S205A, the electronic device 1 interacts data with the network side through the first AP.
The electronic device 1 not only can be used as an STA role, but also can interact data with a network side through a first AP; the electronic device 1 may also function as a virtual AP, establish a P2P channel with the electronic device 2 functioning as an STA, and perform data transmission. That is, through the scheme of the application, when the electronic device is used as the STA role to communicate with the AP, the P2P channel can be established as the virtual AP role with other devices, so that the end-to-end data transmission is realized, and the communication (i.e. the internet service) between the electronic device and the AP is not affected, so that the interaction experience of multiple devices can be improved.
Optionally, in the case that the electronic device 2 is connected to the virtual AP created by the electronic device 1, the electronic device 2 may also implement surfing through a wireless hotspot corresponding to the electronic device 1.
In some embodiments, the electronic device 2 may display networking prompt information, where the networking prompt information is used to prompt the electronic device 2 to implement surfing the internet through a wireless hotspot corresponding to the electronic device 1.
In some embodiments, the networking prompt information may include an option to confirm networking and an option to prohibit networking for selection by the user.
In one aspect, the electronic device 2 may be networked through the wireless hotspot in response to an acknowledge networking operation by the user on the electronic device 2. In this case, the P2P channel established between the electronic device 1 and the electronic device 2 may be used as two logical channels in a specific application: one of the logic channels is a network access data channel, which is used for transmitting network access data of the electronic equipment 2; the other logical channel, the shared channel, is used only for transmitting the first data.
On the other hand, in response to a user disabling networking operations on the electronic device 2, the electronic device 2 may not surf the internet through the wireless hotspot. In this case, the P2P channel established between the electronic device 1 and the electronic device 2, i.e., the sharing channel, is only used for transmitting the first data.
Steps S202A-S205A above describe that in the case where the sending device is networked, the sending device may create a virtual AP as a wireless hotspot, and then the receiving device connects to the wireless hotspot, so that a P2P channel is successfully established between the devices, and end-to-end data transmission is achieved. An implementation of how the P2P channel is established in case the receiving end device is networked will be described below in connection with steps S202B-S205B.
S202B, if the electronic device 1 is not networked and the electronic device 2 is connected to the second AP, the electronic device 2 creates a virtual AP.
S203B, the electronic device 1 and the electronic device 2 establish a P2P channel based on the virtual AP.
It will be appreciated that the electronic device 1 is not networked and the electronic device 2 is connected to the second AP, which means that only the electronic device 2 of the electronic device 1 and the electronic device 2 is networked, that is, only the receiving end device of the transmitting end device and the receiving end device is networked.
In this embodiment of the present application, when the electronic device 1 receives the first operation of the user, the electronic device 1 and the electronic device 2 may first establish a bluetooth connection channel, and then perform information interaction based on the bluetooth connection channel, and negotiate that a virtual AP is created by a networked end device as a wireless hotspot. In particular to the second embodiment, since the electronic device 2 as the receiving end has been networked, the electronic device 2 can create a virtual AP as a wireless hotspot.
Illustratively, when the electronic device 1 receives the first operation of the user, the electronic device 1 first discovers the electronic device 2 through bluetooth technology, and then the electronic device 1 negotiates with the electronic device 2 to establish the P2P channel. Wherein the electronic device 2 is networked, the electronic device 2 can create a virtual AP as a wireless hotspot; the electronic device 1, acting as STA, connects to the virtual AP created by the electronic device 2. It will be appreciated that in the case where the electronic device 1 is connected to the virtual AP created by the electronic device 2, the electronic device 1 and the electronic device 2 successfully establish the P2P channel.
S204B, the electronic device 1 sends the first data to the electronic device 2 through the P2P channel.
S205B, the electronic device 2 interacts data with the network side through the second AP.
The electronic device 2 not only can be used as an STA role, but also can interact with the network side through the second AP; the electronic device 2 may also function as a virtual AP, establish a P2P channel with the electronic device 1 functioning as an STA, and perform data transmission.
Optionally, in the embodiment of the present application, in a case where the electronic device 1 is connected to the virtual AP created by the electronic device 2, the electronic device 1 may also implement surfing through a wireless hotspot corresponding to the electronic device 2.
In some embodiments, the electronic device 1 may display networking prompt information, where the networking prompt information is used to prompt the electronic device 1 to implement surfing through a wireless hotspot corresponding to the electronic device 2.
In some embodiments, the networking prompt information may include an option to confirm networking and an option to prohibit networking for selection by the user.
In one aspect, in response to an acknowledge networking operation by a user on the electronic device 1, the electronic device 1 may be networked through a corresponding wireless hotspot of the electronic device 2. In this case, the P2P channel established between the electronic device 1 and the electronic device 2 may be used as two logical channels in a specific application: one of the logic channels is a network access data channel, which is used for transmitting network access data of the electronic equipment 2; the other logical channel, the shared channel, is used for transmitting the first data.
On the other hand, in response to a user's networking prohibition operation on the electronic device 1, the electronic device 1 may not be networked through the wireless hotspot corresponding to the electronic device 2. In this case, the P2P channel established between the electronic device 1 and the electronic device 2, i.e., the sharing channel, is only used for transmitting the first data.
As can be seen from the steps S202B-S205B, in the case that the receiving end device is networked, the receiving end device may create a virtual AP as a wireless hotspot, and then the transmitting end device connects to the wireless hotspot, so that a P2P channel is successfully established between the devices, and end-to-end data transmission is achieved.
According to the scheme, the electronic equipment can establish a P2P channel with other equipment as a virtual AP role while communicating with the AP as the STA role, so that end-to-end data transmission is realized, and communication (i.e. internet surfing service) between the electronic equipment and the AP is not affected under the condition, so that multi-equipment interaction experience can be improved.
The steps of the method for creating a virtual AP by a sender described in fig. 10 above are further described in conjunction with fig. 11. Fig. 11 is a schematic block diagram of a Wi-Fi P2P-based data transmission method according to a second embodiment of the present application.
As shown in fig. 11 (a), the electronic apparatus 1 connects to the first AP as an STA role, thereby forming a first Wi-Fi network through which the electronic apparatus 1 can connect to the internet. The electronic device 2 is not networked.
As shown in fig. 11 (b), when the user triggers the electronic device 1 to share data with the electronic device 2 in the P2P manner, the electronic device 1 at the transmitting end may create a virtual AP (i.e. SoftAP) as a wireless hotspot. The electronic device 2 at the receiving end may be connected to the SoftAP created by the electronic device 1 as an STA role, so that the electronic device 1 and the electronic device 2 establish a P2P channel (including a sharing data channel and a surfing data channel).
As shown in fig. 11 (a) and (b), the first Wi-Fi network of the transmitting end is still reserved, and a fifth Wi-Fi network is newly established between the transmitting end device and the receiving end device. Based on the newly-built fifth Wi-Fi network, data sharing can be performed between the sending end device and the receiving end device, internet surfing data of the receiving end device can be transmitted, wherein the internet surfing data of the receiving end device can be sent to the sending end device through an internet surfing data channel, and further interaction with the internet side is performed through the first AP. That is, the receiving end device may implement networking through the AP to which the transmitting end device is correspondingly connected.
In the embodiment of the application, when the sending end equipment is networked and the receiving end equipment is not networked, the sending end equipment can create the virtual AP as the wireless hotspot, so that the sending end equipment and the receiving end equipment can establish a P2P channel based on the wireless hotspot, data sharing can be realized through the P2P channel, the receiving end equipment can be provided with internet surfing capability, and the original internet surfing service of the sending end equipment is not influenced, thereby improving equipment interaction experience.
The method steps described above in fig. 10 for creating a virtual AP by a receiving end are further described below in conjunction with fig. 12. Fig. 12 is a schematic block diagram of another Wi-Fi P2P-based data transmission method according to the second embodiment of the present application.
As shown in fig. 12 (a), the electronic apparatus 1 is not networked. The electronic device 2 connects to the second AP in the STA role, thereby forming a second Wi-Fi network through which the electronic device 2 can connect to the internet. When the user triggers the electronic device 1 to share data with the electronic device 2 in the P2P manner, the electronic device 1 at the transmitting end may negotiate with the electronic device 2 at the receiving end about establishing a P2P channel.
As shown in fig. 12 (b), the electronic device 2 at the receiving end may create a virtual AP (i.e., softAP) as a wireless hotspot. The electronic device 1 at the transmitting end may be connected to the SoftAP created by the electronic device 2 as an STA role, so that the electronic device 1 and the electronic device 2 establish a P2P channel (including a sharing data channel and a surfing data channel).
As shown in fig. 12 (a) and (b), the second Wi-Fi network of the receiving end is still reserved, and a sixth Wi-Fi network is newly established between the transmitting end device and the receiving end device. Based on the newly-built sixth Wi-Fi network, data sharing can be performed between the sending end device and the receiving end device, internet surfing data of the sending end device can be transmitted, wherein the internet surfing data of the sending end device can be sent to the receiving end device through an internet surfing data channel, and further interaction with the internet side is performed through the second AP. That is, the transmitting device may implement networking through the AP to which the receiving device is correspondingly connected.
In the embodiment of the application, under the condition that the sending end equipment is not networked and the receiving end equipment is networked, the receiving end equipment can create a virtual AP as a wireless hotspot, so that the sending end equipment and the receiving end equipment can establish a P2P channel based on the wireless hotspot, data sharing can be realized through the P2P channel, the internet surfing capability can be provided for the sending end equipment, and the original internet surfing service of the receiving end equipment is not influenced, thereby improving equipment interaction experience.
Third embodiment
The third embodiment mainly describes how data transmission is performed between a transmitting end device and a receiving end device through Wi-Fi P2P in a scenario where neither the transmitting end device nor the receiving end device is networked.
Fig. 13 is a flowchart of a Wi-Fi P2P-based data transmission method according to a third embodiment of the present application. Referring to fig. 13, the method 300 includes steps S301-S304 described below.
S301, the electronic device 1 receives a first operation of a user, where the first operation is used to trigger the electronic device 1 to send first data to the electronic device 2 in a P2P manner.
The electronic device 1 and the electronic device 2 are devices applying a Windows system. The electronic device 1 and the electronic device 2 support Wi-Fi P2P protocols. For the first operation, the process of establishing the bluetooth connection, and negotiating to establish the P2P channel, refer to the detailed description of the first operation in the above first embodiment, which is not repeated herein.
That is, after step S301, if the electronic device 1 and the electronic device 2 are not networked, the following step S302A or S302B is continued, that is, the step S302A or S302B is alternatively executed.
S302A, if neither the electronic device 1 nor the electronic device 2 is networked, the electronic device 1 creates a virtual AP.
S302B, if neither the electronic device 1 nor the electronic device 2 is networked, the electronic device 2 creates a virtual AP.
S303, the electronic device 1 and the electronic device 2 establish a P2P channel based on the virtual AP.
S304, the electronic device 1 sends the first data to the electronic device 2 through the P2P channel.
Under the condition that the electronic equipment 1 and the electronic equipment 2 are not networked, the electronic equipment 1 at the transmitting end can create a virtual AP as a wireless hot spot; the electronic device 2 at the receiving end is used as an STA and connected to the wireless hotspot, so that the electronic device 1 and the electronic device 2 establish a P2P channel, and end-to-end data transmission is performed through the P2P channel. Alternatively, the electronic device 2 at the receiving end may create a virtual AP as a wireless hotspot; the electronic device 1 at the transmitting end is used as an STA and connected to the wireless hotspot, so that a P2P channel is established between the electronic device 1 and the electronic device 2, and end-to-end data transmission is performed through the P2P channel.
The method steps described above in fig. 13 for creating a virtual AP by a receiving end are further described below in conjunction with fig. 14. Fig. 14 is a schematic block diagram of a Wi-Fi P2P-based data transmission method according to a third embodiment of the present application.
As shown in fig. 14 (a), neither the electronic device 1 nor the electronic device 2 is networked.
When the user triggers the electronic device 1 to share data with the electronic device 2 in the P2P manner, the electronic device 1 at the transmitting end may negotiate with the electronic device 2 at the receiving end about establishing a P2P channel.
As shown in fig. 14 (b), a virtual AP (i.e., softAP) may be created by the electronic device 1 of the transmitting end as a wireless hotspot. The electronic device 2 at the receiving end may be connected to the SoftAP created by the electronic device 1 as an STA role, so that the electronic device 1 and the electronic device 2 establish a P2P channel (including a shared data channel). A seventh Wi-Fi network is newly established between the transmitting end device and the receiving end device. Based on the newly-built seventh Wi-Fi network, data sharing can be performed between the sending end device and the receiving end device.
Alternatively, as shown in fig. 14 (c), a virtual AP (i.e., softAP) may be created by the electronic device 2 at the receiving end as a wireless hotspot. The electronic device 1 at the transmitting end may be connected to the SoftAP created by the electronic device 2 as an STA role, so that the electronic device 1 and the electronic device 2 establish a P2P channel (including a shared data channel). An eighth Wi-Fi network is newly established between the sending end device and the receiving end device. Based on the newly-built eighth Wi-Fi network, data sharing can be performed between the sending terminal equipment and the receiving terminal equipment.
In the embodiment of the application, under the condition that the sending end equipment and the receiving end equipment are not networked, any one of the sending end equipment and the receiving end equipment can be used for creating a virtual AP as a wireless hot spot, so that the sending end equipment and the receiving end equipment can establish a P2P channel based on the wireless hot spot, and data sharing can be realized through the P2P channel, and therefore equipment interaction experience can be improved.
In summary, the above three embodiments take three application scenarios as examples, and the Wi-Fi P2P-based data transmission method provided in the embodiments of the present application is illustrated.
Scene one: under the condition that a sending end and a receiving end are respectively connected with an AP to surf the internet, if the sending end and the receiving end need Wi-Fi direct communication channels to exchange personal data, the sending end establishes a Wi-Fi channel in a software-by-AP role and the receiving end establishes a STA role, so that the sending end can provide the receiving end with surfing capability; or the receiving end establishes a Wi-Fi channel in a SoftAP role and the sending end establishes a Wi-Fi channel in an STA role, so that the receiving end can provide internet surfing capability for the sending end. Therefore, the shared data can be transmitted on the same P2P channel, and both end devices can be ensured to be on the Internet.
Scene II: under the condition that only one end of the sending end and the receiving end is accessed to the network, one end of the access network has a softAP role, one end of the non-access network has an STA role, and the sending end and the receiving end can only share file data on an established Wi-Fi P2P channel. Meanwhile, the established P2P channel does not influence the Internet surfing state of the equipment at one end of the accessed network.
Scene III: under the condition that the sending end and the receiving end are not connected with a network, the receiving end takes a STA role and the sending end takes a softAP role, or the sending end takes the STA role and the receiving end takes the softAP role, and the sending end and the receiving end can only share file data on an established Wi-Fi P2P channel.
According to the embodiment of the application, on a Wi-Fi P2P channel where the two receiving and transmitting sides transmit shared data, one device can use a hot spot of the other device, and the device can still have the internet surfing capability while transmitting the data. Therefore, the problem that when a large amount of data is transmitted between two Windows system devices in a wireless mode, after a Wi-Fi P2P channel is established, the devices cannot be connected with a hot spot to surf the Internet is solved.
In some embodiments, for cross-device wireless data transmission in which connection cannot be established by using a Wi-Fi P2P GO-GC mode, and each device also has a scene of connecting an AP hotspot internet surfing requirement, a scheme provided by the embodiments of the present application may also be used, where a sending end and a receiving end may share file data and share internet surfing capability on an established Wi-Fi P2P channel.
In some embodiments, the solution provided by the embodiments of the present application may also be applicable to two Surface devices installed with Windows systems, where the sending end and the receiving end may share file data and share internet surfing capability on an established Wi-Fi P2P channel.
It should also be noted that, in the embodiment of the present application, "greater than" may be replaced with "greater than or equal to", "less than or equal to" may be replaced with "less than", or "greater than or equal to" may be replaced with "greater than", "less than" may be replaced with "less than or equal to".
The various embodiments described herein may be separate solutions or may be combined according to inherent logic, which fall within the scope of the present application.
It will be appreciated that the methods and operations described above as being performed by an electronic device in various method embodiments may also be performed by components (e.g., chips or circuits) that may be used in an electronic device.
Having described the method embodiments provided herein, embodiments of the apparatus provided herein are described below. It should be understood that the descriptions of the apparatus embodiments and the descriptions of the method embodiments correspond to each other, and thus, descriptions of details not described may be referred to the above method embodiments, which are not repeated herein for brevity.
The solutions provided in the embodiments of the present application are mainly described above from the perspective of method steps. It will be appreciated that, in order to implement the above-described functions, an electronic device implementing the method includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven 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.
The embodiment of the present application may divide the functional modules of the electronic device according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is merely a logic function division, and other possible division manners may be implemented in practice. The following description will take an example of dividing each functional module into corresponding functions.
Fig. 15 is a schematic block diagram of a Wi-Fi P2P-based data transmission device 800 according to an embodiment of the present application. The apparatus 800 may be used to perform the actions performed by the electronic device in the method embodiments above. The apparatus 800 includes a detection unit 810 and a Wi-Fi unit 820.
The detecting unit 810 is configured to receive a sharing operation of a user, where the sharing operation is used to trigger the first electronic device to send first data to be shared to the second electronic device in a peer-to-peer P2P transmission manner; the first electronic device is connected to the first access point, and the second electronic device is connected to the second access point;
a Wi-Fi unit 820 for creating a virtual access point by the first electronic device in response to the sharing operation;
Wi-Fi unit 820 further configured to establish a P2P channel between the first electronic device and the second electronic device based on the virtual access point;
the Wi-Fi unit 820 is further configured to transmit, through the P2P channel, first data and internet data of the second electronic device between the first electronic device and the second electronic device;
the first electronic device and the second electronic device are electronic devices which do not support double-frequency double-transmission but support Wi-Fi P2P functions.
Alternatively, the first electronic device and the second electronic device may be devices in which Windows systems are installed.
According to the scheme, in a scene that Wi-Fi direct connection is needed between two electronic devices to transmit data, the networked electronic devices can create a virtual AP as a wireless hot spot, and the other electronic device can be connected to the wireless hot spot as an STA role, so that a Wi-Fi P2P direct connection channel is established between the sending end device and the receiving end device. The Wi-Fi P2P direct connection channel not only can transmit shared data, but also can transmit internet data, so that two-end equipment can still have internet surfing capability while transmitting data. Therefore, the problem that after a Wi-Fi P2P direct channel is established between two electronic devices, the devices cannot be connected with a hot spot to surf the Internet is solved.
The apparatus 800 according to the embodiment of the present application may correspond to performing the method described in the embodiment of the present application, and the foregoing and other operations and/or functions of the units in the apparatus 800 are respectively for implementing the corresponding flows of the method, and are not described herein for brevity.
Fig. 16 is a schematic structural diagram of an electronic device 900 provided in an embodiment of the present application. The electronic device 900 may include a processor 910, an external memory interface 920, an internal memory 921, a universal serial bus (universal serial bus, USB) interface 930, a charge management module 940, a power management unit 941, a battery 942, an antenna 1, an antenna 2, a mobile communication module 950, a wireless communication module 960, an audio module 970, a speaker 970A, a receiver 970B, a microphone 970C, an earphone interface 970D, a sensor module 980, keys 990, a motor 991, an indicator 992, a camera 993, a display 994, a user identification module (subscriber identification module, SIM) card interface 995, and the like. The sensor module 980 may include a pressure sensor 980A, a gyroscope sensor 980B, a barometric sensor 980C, a magnetic sensor 980D, an acceleration sensor 980E, a distance sensor 980F, a proximity sensor 980G, a fingerprint sensor 980H, a temperature sensor 980I, a touch sensor 980J, an ambient light sensor 980K, a bone conduction sensor 980L, and the like.
It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 900. In other embodiments of the present application, electronic device 900 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 910 may include one or more processing units such as, for example: the processor 910 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. The controller may be a neural hub and a command center of the electronic device 900, among other things. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 910 for storing instructions and data. In some embodiments, the memory in the processor 910 is a cache memory. The memory may hold instructions or data that the processor 910 has just used or recycled. If the processor 910 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 910 is reduced, thereby improving the efficiency of the system.
In some embodiments, processor 910 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others. It should be understood that the connection relationships between the modules illustrated in the embodiments of the present application are merely illustrative, and do not limit the structure of the electronic device 900. In other embodiments of the present application, the electronic device 900 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 940 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 940 may receive a charging input of the wired charger through the USB interface 930. In some wireless charging embodiments, the charge management module 940 may receive wireless charging input through a wireless charging coil of the electronic device 900. The charging management module 940 may also supply power to the electronic device through the power management unit 941 while charging the battery 942.
The power management unit 941 is used to connect the battery 942, the charge management module 940 and the processor 910. The power management unit 941 receives input from the battery 942 and/or the charge management module 940 to power the processor 910, the internal memory 921, the external memory, the display 994, the camera 993, the wireless communication module 960, and the like. The power management unit 941 may also be used to monitor battery capacity, battery cycle number, battery state of health (leakage, impedance) and other parameters. In other embodiments, the power management unit 941 may also be provided in the processor 910. In other embodiments, the power management unit 941 and the charge management module 940 may be disposed in the same device.
The wireless communication function of the electronic device 900 may be implemented by the antenna 1, the antenna 2, the mobile communication module 950, the wireless communication module 960, 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 the electronic device 900 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into 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 950 may provide a solution for wireless communication, including 2G/3G/4G/5G, as applied to the electronic device 900. The mobile communication module 950 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 950 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 950 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate the electromagnetic waves. In some embodiments, at least some of the functional modules of the mobile communication module 950 may be provided in the processor 910. In some embodiments, at least some of the functional modules of the mobile communication module 950 may be provided in the same device as at least some of the modules of the processor 910.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the 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 transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 970A, receiver 970B, etc.), or displays images or video through display 994. 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 communications module 950 or other functional modules, independent of the processor 910.
The wireless communication module 960 may provide solutions for wireless communication including WLAN (e.g., wi-Fi), BT, global navigation satellite system (global navigation satellite system, GNSS), FM, NFC, IR, or general 2.4G/5G wireless communication technology, etc., as applied on the electronic device 900. The wireless communication module 960 may be one or more devices that integrate at least one communication processing module. The wireless communication module 960 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 910. The wireless communication module 960 may also receive a signal to be transmitted from the processor 910, frequency modulate and amplify the signal, and convert the signal to electromagnetic waves through the antenna 2 for radiation.
In some embodiments, the wireless communication module 960 may be a Wi-Fi and/or bluetooth chip. The electronic device 900 may establish a connection with a chip of an electronic device such as a wireless headset through the chip, so as to implement wireless communication and service processing between the electronic device 900 and other electronic devices through the connection. Among other things, bluetooth chips can typically support BR/EDR bluetooth and BLE.
In some embodiments, antenna 1 and mobile communication module 950 of electronic device 900 are coupled, and antenna 2 and wireless communication module 960 are coupled, such that electronic device 900 may communicate with networks and other devices via wireless communication techniques. Wireless communication techniques may include global system for mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TDSCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 900 implements display functionality via a GPU, a display 994, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 994 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 910 may include one or more GPUs that execute program instructions to generate or change display information.
The display 994 is used to display images, videos, and the like. The display 994 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 900 may include 1 or N displays 994, N being a positive integer greater than 1.
The electronic device 900 may implement a photographing function through an ISP, a camera 993, a video codec, a GPU, a display 994, an application processor, and the like.
The ISP is used to process the data fed back by the camera 993. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, so that the electrical signal is converted into an image visible to naked eyes. ISP can also perform algorithm optimization on noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature, etc. of the photographed scene. In some embodiments, an ISP may be provided in the camera 993.
The camera 993 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 900 may include 1 or N cameras 993, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 900 is selecting a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 900 may support one or more video codecs. Thus, the electronic device 900 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent cognition of the electronic device 900 may be implemented by the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 920 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 900. The external memory card communicates with the processor 910 through an external memory interface 920 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 921 may be used to store computer-executable program code that includes instructions. The processor 910 executes various functional applications of the electronic device 900 and data processing by executing instructions stored in the internal memory 921. The internal memory 921 may include a stored program area and a stored data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 900 (e.g., audio data, phonebook, etc.), and so forth. In addition, the internal memory 921 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The processor 910 may be configured to execute the above-mentioned program codes and invoke the relevant modules to implement the functions of the electronic device in the embodiments of the present application. For example, establishing a plurality of communication links with another electronic device; when a preset service (such as a file transmission service) exists, data of the preset service is transmitted with another electronic device through a plurality of communication links.
The electronic device 900 may implement audio functionality through a speaker 970A, a receiver 970B, a microphone 970C, an earphone interface 970D, an application processor, and the like in the audio module 970. Such as music playing, recording, etc.
The audio module 970 is used to convert digital audio information to an analog audio signal output and also to convert an analog audio input to a digital audio signal. The audio module 970 may also be used to encode and decode audio signals. In some embodiments, the audio module 970 may be disposed in the processor 910 or some functional modules of the audio module 970 may be disposed in the processor 910.
Speaker 970A, also known as a "horn," is configured to convert audio electrical signals into sound signals. The electronic device 900 may listen to music, or to hands-free conversations, through the speaker 970A.
A receiver 970B, also known as a "earpiece," is used to convert an audio electrical signal into an acoustic signal. When electronic device 900 is answering a telephone call or voice message, voice may be received by placing receiver 970B in close proximity to the human ear.
Microphone 970C, also known as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 970C through the mouth, inputting an acoustic signal to the microphone 970C. The electronic device 900 may be provided with at least one microphone 970C. In other embodiments, the electronic device 900 may be provided with two microphones 970C, which may also perform noise reduction in addition to collecting sound signals. In other embodiments, the electronic device 900 may also be provided with three, four, or more microphones 970C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 970D is for connecting a wired earphone. The earphone interface 970D may be a USB interface 930 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 980A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 980A may be disposed on the display 994. The pressure sensor 980A is of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. When a force is applied to the pressure sensor 980A, the capacitance between the electrodes changes. The electronic device 900 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display 994, the electronic device 900 detects the touch operation intensity from the pressure sensor 980A. The electronic device 900 may also calculate the location of the touch based on the detection signal of the pressure sensor 980A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 980B can be used to determine the motion pose of the electronic device 900. In some embodiments, the angular velocity of electronic device 900 about three axes (e.g., x, y, and z axes) may be determined by gyro sensor 980B. The gyro sensor 980B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 980B detects the shake angle of the electronic device 900, and calculates the distance to be compensated by the lens module according to the angle, so that the lens counteracts the shake of the electronic device 900 by the reverse motion, thereby realizing anti-shake. The gyro sensor 980B can also be used for navigating, somatosensory game scenes.
The acceleration sensor 980E can detect the magnitude of acceleration of the electronic device 900 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 900 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The distance sensor 980F is used to measure distance. The electronic device 900 may measure distance by infrared or laser. In some embodiments, the electronic device 900 may range using the distance sensor 980F to achieve quick focus.
The proximity light sensor 980G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 900 emits infrared light outward through the light emitting diode. The electronic device 900 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that an object is in the vicinity of the electronic device 900. When insufficient reflected light is detected, the electronic device 900 may determine that there is no object in the vicinity of the electronic device 900. The electronic device 900 may detect that the user holds the electronic device 900 in close proximity to the ear using the proximity sensor 980G, so as to automatically extinguish the screen for power saving purposes. The proximity light sensor 980G can also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 980K is for sensing ambient light level. The electronic device 900 may adaptively adjust the brightness of the display 994 based on the perceived ambient light level. The ambient light sensor 980K may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 980K can also cooperate with proximity light sensor 980G to detect whether electronic device 900 is in a pocket to prevent false touches.
The air pressure sensor 980C is for measuring air pressure. In some embodiments, the electronic device 900 calculates altitude from barometric pressure values measured by the barometric pressure sensor 980C, aiding in positioning and navigation.
The magnetic sensor 980D includes a hall sensor. The electronic device 900 may detect displacement of the electronic device 900 using the magnetic sensor 980D. In some embodiments, the hall sensor may form a linear trapezoidal magnetic field (or referred to as a ramp magnetic field) by using a magnet, the displacement variation of the hall plate in the linear magnetic field corresponds to the magnetic field intensity variation, the formed hall potential is proportional to the displacement, and the electronic device 900 obtains the hall potential, so that the displacement can be measured.
The fingerprint sensor 980H is for capturing a fingerprint. The electronic device 900 may utilize the collected fingerprint feature to unlock the fingerprint, access an application lock, take a photograph of the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 980I is for detecting temperature. In some embodiments, the electronic device 900 utilizes the temperature detected by the temperature sensor 980I to execute a temperature processing strategy. For example, when the temperature reported by temperature sensor 980I exceeds a threshold, electronic device 900 performs a reduction in performance of a processor located in proximity to temperature sensor 980I in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 900 heats the battery 942 to avoid abnormal shutdown of the electronic device 900 due to low temperatures. In other embodiments, when the temperature is below a further threshold, the electronic device 900 performs boosting of the output voltage of the battery 942 to avoid abnormal shutdown caused by low temperatures.
Touch sensor 980J, also referred to as a "touch panel". The touch sensor 980J may be disposed on the display 994, and the touch sensor 980J and the display 994 form a touch screen, which is also referred to as a "touch screen". The touch sensor 980J is for detecting a touch operation acting on or near it. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 994. In other embodiments, the touch sensor 980J can also be disposed on a surface of the electronic device 900 other than where the display 994 is located.
The bone conduction sensor 980L may acquire a vibration signal. In some embodiments, bone conduction sensor 980L may acquire a vibration signal of the human vocal tract vibrating bone pieces. The bone conduction sensor 980L may also contact the pulse of the human body and receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 980L may also be provided in the headset, in combination with an osteoinductive headset. The audio module 970 can analyze the voice signal based on the vibration signal of the vocal part vibration bone piece obtained by the bone conduction sensor 980L, thereby realizing the voice function. The application processor can analyze heart rate information based on the blood pressure beat signals acquired by the bone conduction sensor 980L, so as to realize a heart rate detection function.
The keys 990 include a power-on key, a volume key, etc. The keys 990 may be mechanical keys. Or may be a touch key. The electronic device 900 may receive key inputs, generate key signal inputs related to user settings and function controls of the electronic device 900.
The motor 991 may generate a vibratory alert. The motor 991 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 991 may also correspond to different vibration feedback effects by touch operations applied to different areas of the display screen 994. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 992 may be an indicator light, which may be used to indicate a state of charge, a change in charge, or an indication message, missed call, notification, or the like.
The SIM card interface 995 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 995, or removed from the SIM card interface 995, to enable contact and separation with the electronic device 900. The electronic device 900 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 995 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 995 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 995 may also be compatible with different types of SIM cards. SIM card interface 995 may also be compatible with external memory cards. The electronic device 900 interacts with the network through the SIM card to implement functions such as talking and data communication. In some embodiments, the electronic device 900 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 900 and cannot be separated from the electronic device 900.
The electronic device 900 may be a mobile terminal or a non-mobile terminal. By way of example, electronic device 900 may be a cell phone, tablet, notebook, palmtop, vehicle terminal, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), wireless headset, wireless bracelet, wireless smart glasses, wireless watch, augmented reality (augmented reality, AR)/Virtual Reality (VR) device, desktop computer, smart appliance (e.g., television, speaker, refrigerator, air cleaner, air conditioner, electric cooker), etc. Among other things, the electronic device 900 may also be collectively referred to as an internet of things (Internet of Things, ioT) device. The device type of the electronic device 900 is not specifically limited in the embodiments of the present application.
It should be appreciated that the electronic device 900 shown in fig. 16 may correspond to the apparatus 800 shown in fig. 15. Among them, the sensor module 980 and the wireless communication module 960 in the electronic device 900 shown in fig. 16 may correspond to the detection unit 810 and the Wi-Fi unit 820 in the apparatus 800 in fig. 15, respectively.
In actual implementation, when the electronic device 900 is running, the processor 910 executes computer-executable instructions in the memory 921 to perform the operational steps of the method described above with the electronic device 900.
Optionally, in some embodiments, the present application provides a chip coupled to a memory, the chip for reading and executing a computer program or instructions stored in the memory to perform the methods in the embodiments described above.
Optionally, in some embodiments, the present application provides an electronic device comprising a chip for reading and executing a computer program or instructions stored in a memory, such that the method in the embodiments is performed.
Optionally, in some embodiments, the present application further provides a computer readable storage medium storing a program code, which when run on a computer, causes the computer to perform the method in the above embodiments.
Optionally, in some embodiments, the present application further provides a computer program product comprising computer program code which, when run on a computer, causes the computer to perform the method in the embodiments described above.
In an embodiment of the present application, an electronic device includes a hardware layer, an operating system layer running above the hardware layer, and an application layer running above the operating system layer. The hardware layer may include a central processing unit (central processing unit, CPU), a memory management unit (memory management unit, MMU), and a memory (also referred to as a main memory). The operating system of the operating system layer may be any one or more computer operating systems that implement business processing through processes (processes), for example, a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or windows operating system, etc. The application layer may include applications such as a browser, address book, word processor, instant messaging software, and the like.
The present embodiment does not particularly limit the specific structure of the execution body of the method provided in the present embodiment, as long as communication can be performed in the method provided in the present embodiment by running a program in which the code of the method provided in the present embodiment is recorded. For example, the execution body of the method provided in the embodiment of the present application may be an electronic device, or a functional module in the electronic device that can call a program and execute the program.
Various aspects or features of the present application can be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used herein may encompass a computer program accessible from any computer-readable device, carrier, or media. For example, computer-readable media may include, but are not limited to: magnetic storage devices (e.g., hard disk, floppy disk, or magnetic tape, etc.), optical disks (e.g., compact Disk (CD), digital versatile disk (digital versatile disc, DVD), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks, key drives, etc.).
Various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to: wireless channels, and various other media capable of storing, containing, and/or carrying instruction(s) and/or data.
It should be appreciated that the processors referred to in the embodiments of the present application may be central processing units (central processing unit, CPU), but may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be understood that the memory referred to in the embodiments of the present application may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM). For example, RAM may be used as an external cache. By way of example, and not limitation, RAM may include the following forms: static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
It should be noted that when the processor is a general purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, the memory (storage module) may be integrated into the processor.
It should also be noted that the memory described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
Those of ordinary skill in the art will appreciate that the elements and steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software 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.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Furthermore, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application, or the part contributing to the prior art, or the part of the technical solution, may be embodied in the form of a computer software product stored in a storage medium, the computer software product comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium may include, but is not limited to: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (13)

1. A Wi-FiP 2P-based data transmission method, comprising:
the method comprises the steps that a first electronic device receives a sharing operation of a user, wherein the sharing operation is used for triggering the first electronic device to send first data to be shared to a second electronic device in a point-to-point P2P transmission mode; wherein the first electronic device is connected to a first access point and the second electronic device is connected to a second access point;
responding to the sharing operation, and creating a virtual access point by the first electronic equipment;
the first electronic device establishes a P2P channel with the second electronic device based on the virtual access point; wherein, in a case where the second electronic device is connected to the virtual access point, the connection of the second electronic device with the second access point is disconnected;
The first electronic device sends the first data to the second electronic device through the P2P channel;
the first electronic device transmits internet surfing data of the second electronic device through the P2P channel;
the first electronic equipment interacts the internet data of the first electronic equipment and the internet data of the second electronic equipment with a network side through the first access point;
the first electronic device and the second electronic device are devices provided with Windows systems, and the first electronic device and the second electronic device do not support double-frequency double-transmission but support Wi-FiP2P functions.
2. The method of claim 1, wherein the P2P channel comprises a first Socket channel and a second Socket channel;
the first Socket channel is used for transmitting the first data, and the second Socket channel is used for transmitting internet surfing data of the second electronic device.
3. The method of claim 1, wherein the first electronic device establishes a P2P channel with the second electronic device based on the virtual access point, comprising:
the first electronic device sends hot spot information of the virtual access point to the second electronic device, wherein the hot spot information of the virtual access point comprises a service set identifier SSID and a password;
The second electronic equipment is connected to the virtual access point according to the received hot spot information of the virtual access point;
and the first electronic device and the second electronic device successfully establish a P2P channel.
4. The method of claim 1, wherein after the first electronic device receives the sharing operation of the user, the method further comprises:
responding to the sharing operation, the first electronic device displays first prompt information, wherein the first prompt information is used for prompting: and when the first electronic equipment and the second electronic equipment carry out data transmission, the second electronic equipment is connected to a wireless local area network of the first electronic equipment.
5. The method of claim 4, wherein the first electronic device creates a virtual access point, comprising:
the first electronic equipment receives a confirmation operation of the user on the first prompt information;
and responding to the confirmation operation of the user, and creating the virtual access point by the first electronic equipment.
6. The method of any one of claims 1 to 5, wherein the first electronic device receiving a sharing operation of a user comprises:
The first electronic equipment receives a first operation of a user, wherein the first operation is an operation of selecting the first data and triggering sharing;
responsive to the first operation, the first electronic device scans for nearby connectable devices;
the first electronic device displays the identification of the connectable device found by scanning, wherein the identification of the connectable device comprises the identification of the second electronic device;
the first electronic device receives a second operation of a user on the identifier of the second electronic device;
wherein the sharing operation includes the first operation and the second operation.
7. The method of any of claims 1-5, wherein after the first electronic device receives the sharing operation of the user, the method further comprises:
the first electronic equipment and the second electronic equipment establish Bluetooth connection;
the first electronic device sends a first request message to the second electronic device based on the Bluetooth connection;
the second electronic equipment receives the first request message sent by the first electronic equipment based on the Bluetooth connection;
the second electronic device displays the first request message;
Wherein, the first request message is used for prompting: the first electronic device will send data to the second electronic device and the second electronic device will connect to the wireless local area network of the first electronic device during data transmission.
8. The method of claim 7, wherein after the second electronic device displays the first request message, the method further comprises:
the second electronic equipment receives the confirmation operation of the user on the first request message;
the second electronic device sends a first message to the first electronic device, wherein the first message is used for prompting: the second electronic device has agreed to receive the first data sent by the first electronic device.
9. The method according to any one of claims 1 to 5, further comprising:
after the second electronic device successfully receives the first data, the second electronic device disconnects the virtual access point;
the second electronic device is reconnected to the second access point.
10. The method according to any one of claims 1 to 5, further comprising:
The first electronic device receives a second response message sent by the second electronic device, wherein the second response message is used for indicating that the first data is successfully received;
the first electronic device deletes the virtual access point.
11. An electronic device comprising a processor coupled to a memory, the processor for executing a computer program or instructions stored in the memory to cause the electronic device to implement the method of any one of claims 1-10.
12. A chip system coupled to a memory for reading and executing a computer program stored in the memory for implementing the method according to any of claims 1 to 10.
13. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when run on an electronic device, causes the electronic device to perform the method of any one of claims 1 to 10.
CN202310369125.0A 2021-10-29 2021-10-29 Wi-Fi P2P-based data transmission method and electronic equipment Pending CN116367123A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310369125.0A CN116367123A (en) 2021-10-29 2021-10-29 Wi-Fi P2P-based data transmission method and electronic equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310369125.0A CN116367123A (en) 2021-10-29 2021-10-29 Wi-Fi P2P-based data transmission method and electronic equipment
CN202111276093.7A CN115022849B (en) 2021-10-29 2021-10-29 Data transmission method based on Wi-Fi P2P and electronic equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202111276093.7A Division CN115022849B (en) 2021-10-29 2021-10-29 Data transmission method based on Wi-Fi P2P and electronic equipment

Publications (1)

Publication Number Publication Date
CN116367123A true CN116367123A (en) 2023-06-30

Family

ID=83064204

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202111276093.7A Active CN115022849B (en) 2021-10-29 2021-10-29 Data transmission method based on Wi-Fi P2P and electronic equipment
CN202310369125.0A Pending CN116367123A (en) 2021-10-29 2021-10-29 Wi-Fi P2P-based data transmission method and electronic equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202111276093.7A Active CN115022849B (en) 2021-10-29 2021-10-29 Data transmission method based on Wi-Fi P2P and electronic equipment

Country Status (1)

Country Link
CN (2) CN115022849B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160071826A (en) * 2014-12-12 2016-06-22 삼성전자주식회사 Method for connecting wireless network and electronic device thereof
CN106454766A (en) * 2016-09-27 2017-02-22 盐城工学院 Real-time cooperation data sharing system based on Android system and Wi-Fi Direct
CN107426726A (en) * 2017-07-07 2017-12-01 珠海市魅族科技有限公司 Network sharing method and device, terminal and storage medium
CN111026484A (en) * 2019-12-02 2020-04-17 维沃移动通信有限公司 Application sharing method, first electronic device and computer-readable storage medium
CN113038627B (en) * 2019-12-05 2022-09-16 华为技术有限公司 File sharing method, mobile device and computer storage medium

Also Published As

Publication number Publication date
CN115022849B (en) 2023-04-14
CN115022849A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
JP7378576B2 (en) Terminal device, method and system for implementing one-touch screen projection using remote control device
CN112469013B (en) Bluetooth connection method and related device
WO2021043198A1 (en) Bluetooth pairing method, and related device
WO2021043219A1 (en) Bluetooth reconnection method and related apparatus
CN111373713A (en) Message transmission method and device
WO2022068670A1 (en) Method for touching to establish wireless connection between devices, electronic device, and chip
CN114339709A (en) Wireless communication method and terminal device
WO2021027623A1 (en) Device capability discovery method and p2p device
WO2020155013A1 (en) Emergency calling method and user terminal
CN113645571A (en) Data transmission method and electronic equipment
EP4102927A1 (en) Dual wifi connection method and electronic device
CN113676902B (en) System, method and electronic equipment for providing wireless internet surfing
CN117425227A (en) Method and device for establishing session based on WiFi direct connection
CN115022849B (en) Data transmission method based on Wi-Fi P2P and electronic equipment
CN115022852B (en) Method for controlling Bluetooth transmission rate and electronic equipment
CN114980238B (en) Wi-Fi access method and related equipment
WO2023236670A1 (en) Data transmission management method, electronic device and storage medium
WO2023051204A1 (en) Cross-device connection method, electronic device and storage medium
CN115529639A (en) Network switching method and device, user equipment and readable storage medium
CN117014377A (en) Congestion control negotiation method, electronic equipment and storage medium
CN115802326A (en) Bluetooth connection method and electronic equipment
CN117098253A (en) Networking method and device
CN116938950A (en) Data transmission method, electronic equipment and storage medium
CN115134402A (en) Device connection method and electronic device

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