Nothing Special   »   [go: up one dir, main page]

CN114980235B - Communication method, electronic equipment and storage medium - Google Patents

Communication method, electronic equipment and storage medium Download PDF

Info

Publication number
CN114980235B
CN114980235B CN202210903892.0A CN202210903892A CN114980235B CN 114980235 B CN114980235 B CN 114980235B CN 202210903892 A CN202210903892 A CN 202210903892A CN 114980235 B CN114980235 B CN 114980235B
Authority
CN
China
Prior art keywords
channel
connection
target
electronic device
mobile phone
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210903892.0A
Other languages
Chinese (zh)
Other versions
CN114980235A (en
Inventor
赵国强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Glory Smart Technology Development 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 CN202210903892.0A priority Critical patent/CN114980235B/en
Publication of CN114980235A publication Critical patent/CN114980235A/en
Application granted granted Critical
Publication of CN114980235B publication Critical patent/CN114980235B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/0005Control or signalling for completing the hand-off
    • H04W36/0011Control or signalling for completing the hand-off for data sessions of end-to-end connection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1048Departure or maintenance mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • 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)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application provides a communication method, electronic equipment and a storage medium, relates to the technical field of communication, and can improve the stability of P2P connection. The method comprises the following steps: the method comprises the steps that a first P2P connection is established between target electronic equipment and opposite-end electronic equipment; after the target electronic equipment starts to establish a first wireless connection with the first newly-added electronic equipment and before a working channel of the target electronic equipment is switched to a channel of the first wireless connection from a channel of the first P2P connection, the target electronic equipment sends first target synchronization time information and first target time slice information to opposite-end electronic equipment through the first P2P connection, so that the opposite-end electronic equipment determines the working channel of the target electronic equipment in real time according to the first target synchronization time information and the first target time slice information; the channel of the first wireless connection and the channel of the first P2P connection are same-frequency different channels.

Description

Communication method, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications, and in particular, to a communication method, an electronic device, and a storage medium.
Background
For facilitating data transmission between different electronic devices, an electronic device (e.g., a mobile phone, a tablet computer, etc.) may have a Wi-Fi peer-to-peer (P2P, which may also be referred to as a peer-to-peer network or a peer-to-peer) transmission function. When the Wi-Fi P2P connection is established between the two electronic devices, the two electronic devices send heartbeat packets periodically to enable the receiving end to make sure that the sending end is on line, and therefore the Wi-Fi P2P connection is kept continuously.
Currently, when an electronic device transmits a file using a Wi-Fi P2P function, the electronic device and an opposite terminal device (i.e., another electronic device) may be located in the same channel (e.g., a channel a) in the same frequency band (e.g., the frequency band to which 5G belongs). At this time, if the electronic device establishes a communication connection with another device (i.e., another electronic device or a wireless Access Point (AP), etc.), another channel, for example, a B channel, may be established between the electronic device and the other device. The other channel is in the same frequency band as the channel corresponding to the Wi-Fi P2P connection. In this case, since the electronic device cannot use two channels simultaneously, the electronic device needs to process data of two channels with the same frequency and different channels in a time-sharing manner. However, when the electronic device switches from the a channel to the B channel, the peer device may not receive a reply message (e.g., an Acknowledgement (ACK) message) of the heartbeat packet sent by the electronic device to the peer device within a certain time period, and at this time, the peer device considers that the electronic device is not online, and thus, may actively disconnect the Wi-Fi P2P connection with the electronic device. Therefore, the electronic device needs to establish Wi-Fi P2P connection with the opposite terminal device again subsequently, and the use experience of the user is reduced.
Disclosure of Invention
The embodiment of the application provides a communication method, an electronic device and a storage medium, which can improve the stability of P2P connection and prevent one end of the P2P connection from actively disconnecting the P2P connection.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a communication method is provided, where the method includes: the target electronic equipment and the opposite-end electronic equipment establish first P2P connection; after the target electronic equipment starts to establish a first wireless connection with the first newly-added electronic equipment and before a working channel of the target electronic equipment is switched to a channel of the first wireless connection from a channel of the first P2P connection, the target electronic equipment sends first target synchronization time information and first target time slice information to opposite-end electronic equipment through the first P2P connection, so that the opposite-end electronic equipment determines the working channel of the target electronic equipment in real time according to the first target synchronization time information and the first target time slice information; the channel of the first wireless connection and the channel of the first P2P connection are same-frequency different channels; the first target synchronization time information is used for indicating time synchronization of the opposite terminal electronic equipment and the target electronic equipment; the first target time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the target electronic equipment; the switching period is used for indicating the working time of the target electronic equipment on the channel to which the switching period belongs before the channel to which the switching period belongs is switched to other channels.
Based on the above technical solution, when the mobile phone establishes both a P2P connection with the opposite-end electronic device and a first wireless communication connection with the first newly-added electronic device, that is, when the target electronic device is in a same-frequency different channel, the target electronic device will carry synchronization time information (i.e., first target synchronization time information) and time slice information (i.e., first target time slice information) in each data packet when performing data interaction with the opposite-end electronic device except for a heartbeat packet and heartbeat acknowledgment information. The synchronization time information is used to make the time of the target electronic device consistent with that of the opposite-end electronic device, and the time slice information includes the switching period of each channel. Therefore, the opposite-end electronic device can accurately know the time when the target electronic device switches the channel, and further can send the heartbeat packet to the target electronic device only when the target electronic device works in the channel connected with the P2P. The P2P connection is not actively disconnected when the target electronic device is operating on a channel on which a wireless communication connection is established with another electronic device (e.g., a first added electronic device). And then the opposite-end electronic equipment ensures that the P2P connection is not actively disconnected when the target electronic equipment does not receive the heartbeat packet confirmation information within a certain time under the scene that the target electronic equipment has the P2P connection established with the opposite-end electronic equipment and the first wireless communication connection established with the first newly-added electronic equipment, and the P2P connection is continuously maintained. And then when the subsequent target electronic equipment needs to work on the channel of the P2P connection established with the opposite-end electronic equipment again, the P2P connection does not need to be established again, and the use experience of a user is improved.
In a possible design manner of the first aspect, in a case that the target electronic device is a slave electronic device and the first new electronic device is a second router, the first wireless connection is a second wireless communication connection; the main electronic device is a device which is used as a group owner GO in a P2P connection established between the target electronic device and the peer electronic device.
Based on the scheme, under the condition that the slave electronic equipment is in the same-frequency different channels, the synchronous time information and the time slice information capable of reflecting the switching period of each channel in the own same-frequency different channels are sent to the master electronic equipment in time, so that the master electronic equipment can accurately determine the working channel of the slave electronic equipment according to the information, further, the master electronic equipment can carry out interaction of heartbeat packages when the slave electronic equipment and the master electronic equipment are in the same channel, the heartbeat packages are not sent when the slave electronic equipment and the master electronic equipment are not in the same channel, and the P2P connection cannot be actively disconnected due to the fact that the confident information of the heartbeat packages cannot be received. The use experience of the user is guaranteed.
In a possible design manner of the first aspect, in a case that the target electronic device is a master electronic device and the first newly added electronic device is an electronic device capable of establishing a P2P connection, the first wireless connection is a second P2P connection; the main electronic device is a device which is used as a group owner GO in a P2P connection established between the target electronic device and the peer electronic device.
Based on the scheme, the master electronic device can be in the same-frequency different channels, and under the condition that the same-frequency different channels are all in P2P connection, the synchronous time information and the time slice information capable of reflecting the switching period of each channel in the own same-frequency different channels are sent to the slave electronic device in time, so that the slave electronic device can accurately determine the working channel of the slave electronic device according to the information, further the slave electronic device can perform interaction of heartbeat packages when the master electronic device and the slave electronic device are in the same channel, the heartbeat packages are not sent when the master electronic device and the slave electronic device are not in the same channel, and the P2P connection cannot be actively disconnected due to the fact that the heartbeat package confident information cannot be received. The use experience of the user is guaranteed.
In a possible design manner of the first aspect, if after the target electronic device establishes the first P2P connection with the peer electronic device, the peer electronic device establishes a second wireless connection with the second newly added electronic device, and a working channel of the peer electronic device has been switched to a channel of the second wireless connection; in the case that the working channel of the peer electronic device is switched to the channel of the second wireless connection, the method further includes:
After the target electronic equipment and the third newly added electronic equipment start to establish a third wireless connection, before a working channel of the target electronic equipment is switched from a first P2P (peer-to-peer) connection channel to a third wireless connection channel, the target electronic equipment determines a target preset time length and third target time slice information according to second target synchronous time information and second target time slice information; the second target synchronization time information is used for indicating time synchronization of the target electronic equipment and the opposite-end electronic equipment, and the second target time slice information is used for indicating a switching period of each channel in the same-frequency different channels of the opposite-end electronic equipment; the third target time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the target electronic equipment; the channel of the third wireless connection and the channel of the first P2P connection are same-frequency different channels;
the working channel of the target electronic equipment is switched from the first P2P connected channel to the third wireless connected channel, and is switched to the first P2P connected channel after the target preset duration lasts;
under the condition that the working channel of the target electronic equipment is switched to a first P2P (peer-to-peer) connected channel from a third wirelessly connected channel for the first time, if the working channel of the opposite-end electronic equipment is determined to be the first P2P connected channel according to the second target synchronization time information and the second target time slice information, the third target synchronization time information and the third target time slice information are sent to the opposite-end electronic equipment through the first P2P connected channel, so that the opposite-end electronic equipment determines the working channel of the target electronic equipment in real time according to the third target synchronization time information and the third target time slice information; wherein, the channel of the first wireless connection and the channel of the first P2P connection are same-frequency different channels; the third target synchronization time information is used for indicating time synchronization between the opposite-end electronic device and the target electronic device.
Based on the technical scheme, under the condition that the target electronic equipment establishes P2P connection with the opposite-end electronic equipment, establishes third wireless connection with third newly-added electronic equipment and establishes second wireless connection with second newly-added electronic equipment, namely the target electronic equipment and the opposite-end electronic equipment are both in same-frequency different channels, the target electronic equipment and the opposite-end electronic equipment can timely inform the opposite-end of corresponding synchronization time information and time slice information. The synchronization time information is used to synchronize the time of both. The time slice information is used for informing the opposite terminal of the period of switching the channel. Meanwhile, because the third target time slice information is obtained according to the second target time slice information and the second target synchronization time information, the target electronic device and the opposite-end electronic device can be switched to a channel connected with the P2P in the same time period, and the communication between the target electronic device and the opposite-end electronic device is ensured. Therefore, the opposite-end electronic equipment or the target electronic equipment can accurately know the time for the opposite end to switch the channel, and further can send the heartbeat packet to the opposite end and receive corresponding heartbeat packet confirmation information only when the opposite end and the target electronic equipment work in the channel corresponding to the P2P connection. When the peer end works on a channel where a wireless communication connection established with other electronic equipment (for example, a third newly-added electronic equipment or a second newly-added electronic equipment) is located, the P2P connection is not actively disconnected. Therefore, under the condition that the target electronic equipment and the opposite-end electronic equipment are both in the same-frequency different channels, the target electronic equipment and the opposite-end electronic equipment do not actively disconnect the P2P connection because the heartbeat packet confirmation information of the opposite end is not received within a certain time, but keep the P2P connection. And then when the subsequent needs to work on the channel connected with the P2P again, the P2P connection is established again, so that the use experience of the user is improved.
In a possible design manner of the first aspect, when the target electronic device is a slave electronic device, the second newly added electronic device is a device capable of establishing a P2P connection, and the second wireless connection is a P2P connection, after the target electronic device sends the third target synchronization time information and the third target time slice information to the peer electronic device through the first P2P connected channel, if the peer electronic device starts to establish a fourth wireless connection with the fourth newly added electronic device when the working channel is switched to the first P2P connected channel, the method further includes:
the target electronic equipment receives fourth target synchronization time information and fourth target time slice information which are sent by the opposite-end electronic equipment through the first P2P connection; after the opposite-end electronic device starts to establish the third wireless connection, before a working channel of the opposite-end electronic device is switched from a first P2P (peer-to-peer) connection channel to a fourth wireless connection channel, the opposite-end electronic device determines the fourth target time slice information according to the second target synchronization time information; the fourth target synchronization time information is used for indicating the time synchronization between the target electronic equipment and the opposite-end electronic equipment, and the fourth target time slice information is used for indicating the switching period and the channel switching sequence of each channel in the same-frequency different channels of the opposite-end electronic equipment; the channel switching sequence is used for representing the switching sequence of each channel in the same-frequency different channels;
After the target electronic equipment adjusts the time of the target electronic equipment according to the fourth target synchronous time information, determining channel adjustment information and fifth target time slice information according to the fourth target time slice information, and switching a working channel according to the channel adjustment information and the fifth target time slice information; the channel adjustment information is used for indicating the target electronic equipment to switch the working channel to the channel of the third wireless connection for the target duration and then to the channel of the first P2P connection; the target time length is the time length from the current moment obtained according to the fourth target time slice information to the time when the working channel of the opposite-end electronic equipment is switched to the channel connected with the first P2P; the fifth target time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the target electronic equipment;
when the working channel of the target electronic equipment is switched to a first P2P connection channel for the first time after the five target time slice information is determined, the target electronic equipment sends fifth target synchronization time information and fifth target time slice information to the opposite-end electronic equipment through the first P2P connection so that the opposite-end electronic equipment can determine the working channel of the target electronic equipment in real time according to the fifth target synchronization time information and the fifth target time slice information; and the fifth target synchronization time information is used for indicating the time synchronization of the opposite-end electronic equipment and the target electronic equipment.
Based on the above technical solution, compared with the planning scheme corresponding to the previous possible design manner, in the scheme, when the target electronic device is a slave electronic device, the second newly-added electronic device is a device capable of establishing a P2P connection, the second wireless connection is a P2P connection, and the opposite-end electronic device is newly added with a same-frequency different channel (a fourth wireless connection channel corresponding to the fourth newly-added electronic device), the target electronic device can adjust its own channel switching policy according to the change, so that the target electronic device and the opposite-end electronic device can still determine whether the channel of the opposite end is the same as the channel of the opposite end, that is, whether the channels of the P2P connection are the same. Therefore, the target electronic device and the opposite-end electronic device still do not actively disconnect the P2P connection because the heartbeat packet acknowledgement information of the opposite end is not received within a certain time, but keep the P2P connection. And then when the subsequent needs to work on the channel connected with the P2P again, the P2P connection is established again, so that the use experience of the user is improved.
In a possible design manner of the first aspect, in a case that the target electronic device is a master electronic device and the first new electronic device is a first router, the first wireless connection is a first wireless communication connection; the main electronic device is a device that is a group owner GO in a P2P connection established between the target electronic device and the peer electronic device.
Based on the technical scheme, the master electronic device can be in the same-frequency different channels, and under the condition that only one P2P connection exists in the same-frequency different channels, the synchronous time information and the time slice information capable of reflecting the switching period of each channel in the own same-frequency different channels are sent to the slave electronic device in time, so that the slave electronic device can accurately determine the working channel of the slave electronic device according to the information, the slave electronic device can further perform interaction of heartbeat packages when the master electronic device and the slave electronic device are in the same channel, the heartbeat packages are not sent when the master electronic device and the slave electronic device are not in the same channel, and the P2P connection cannot be actively disconnected due to the fact that the confident information of the heartbeat packages cannot be received. The use experience of the user is guaranteed.
In a possible design manner of the first aspect, after the target electronic device sends the first target synchronization time information and the first target time slice information to the peer electronic device through the first P2P connection, the method further includes:
the working channel of the target electronic equipment is switched from the channel of the first P2P connection to the channel of the first wireless communication connection;
after the target electronic device starts to establish a second P2P connection with the optional electronic device, before a working channel of the target electronic device is switched from a channel of the first wireless communication connection to a channel of the second P2P connection, the target electronic device determines sixth target time slice information according to the first target synchronization time information and the first target time slice information; the optional electronic equipment is electronic equipment capable of establishing P2P connection; the sixth target time slice information is used for indicating the switching period and the channel switching sequence of each channel in the same-frequency different channels of the target electronic equipment; the channel switching sequence is used for representing the switching sequence of each channel in the same-frequency different channels;
Under the condition that the working channel of the target electronic equipment is firstly switched to a channel connected with the second P2P, the target electronic equipment sends sixth target synchronous time information and sixth target time slice information to the optional electronic equipment through the second P2P connection; the sixth target synchronization time information is used for indicating time synchronization of the selectable electronic device and the target electronic device;
after the working channel of the target electronic equipment is firstly switched to the channel connected with the second P2P, under the condition of firstly switching to the channel connected with the first P2P, the target electronic equipment sends seventh target synchronization time information and seventh target time slice information to the opposite-end electronic equipment through the first P2P connection; the seventh target synchronization time information is used to indicate time synchronization between the peer electronic device and the target electronic device, and the seventh target time slice information includes sixth target time slice information.
Based on the technical scheme, under the condition that the main electronic equipment is in the same-frequency different channels and more than two channels exist in the same-frequency different channels, the synchronous time information and the time slice information capable of reflecting the switching period and the channel switching sequence of each channel in the own same-frequency different channels are sent to the slave electronic equipment in time, so that the slave electronic equipment can accurately determine the working channel of the slave electronic equipment according to the information, the slave electronic equipment can further perform interaction of heartbeat packages when the main electronic equipment and the slave electronic equipment are in the same channel, the heartbeat packages are not sent when the main electronic equipment and the slave electronic equipment are not in the same channel, and the P2P connection cannot be actively disconnected due to the fact that the confident information of the heartbeat packages cannot be received. The use experience of the user is ensured.
In a second aspect, an electronic device is provided, the electronic device comprising: a memory and one or more processors; the memory is coupled with the processor; wherein the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the communication method as provided in the first aspect.
In a third aspect, the present application provides a computer-readable storage medium comprising computer instructions that, when run on an electronic device, cause the electronic device to perform the communication method as provided in the first aspect and any one of its possible designs.
In a fourth aspect, the present application provides a computer program product for causing a computer to perform the communication method as provided in the first aspect and any one of its possible designs when the computer program product is run on the computer. Wherein the computer may be the aforementioned electronic device.
It should be understood that the advantageous effects achieved by the electronic device according to the second aspect and any one of the possible design manners of the electronic device according to the second aspect, the computer-readable storage medium according to the third aspect, and the computer program product according to the fourth aspect may refer to the advantageous effects of the first aspect and any one of the possible design manners of the electronic device, and are not described herein again.
Drawings
Fig. 1 is a schematic view of a P2P connection provided in the prior art;
fig. 2 is a schematic structural diagram of a communication system according to an embodiment of the present application;
fig. 3 is a schematic diagram of a possible structure of a communication system according to an embodiment of the present application;
fig. 4 is a schematic diagram of a possible structure of a communication system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another electronic device provided in the embodiment of the present application;
fig. 7 is a schematic structural diagram of a router according to an embodiment of the present application;
fig. 8 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 9 is a schematic view of an opening scenario of a P2P function according to an embodiment of the present application;
fig. 10 is a schematic diagram illustrating another P2P function startup scenario according to an embodiment of the present application;
fig. 11 is a schematic diagram illustrating a startup scenario of another P2P function according to an embodiment of the present application;
fig. 12 is a schematic view of an opening scenario of another P2P function provided in the embodiment of the present application;
fig. 13 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 14 is a flowchart illustrating a communication method according to an embodiment of the present application;
Fig. 15 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 16 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 17 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 18 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 19 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 20 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 21 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 22 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 23 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 24 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 25 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 26 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the specification of the present application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that "/" indicates an OR meaning, for example, A/B may indicate A or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by a person skilled in the art that the embodiments described herein can be combined with other embodiments.
The terms "first" and "second" in the following embodiments of the present application are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, unless stated otherwise, "plurality" means two or more.
First, the relevant data referred to in the present application are introduced:
frequency band: in the field of communications, a frequency band refers to a frequency range of electromagnetic waves.
Channel: in particular, the channel through which signals are transmitted in a communication system is formed by a transmission medium through which signals are transmitted from a transmitting end to a receiving end. Each frequency band commonly used by Wi-Fi is divided into multiple channels.
For example, the 2.4GHZ band-split channels and center frequencies used by Wi-Fi are shown in table 1 below.
TABLE 1
Figure 184148DEST_PATH_IMAGE001
As shown in table 1, the 2.4GHz band may be divided into 14 channels, and the effective width of each channel is 20 megahertz (MHz). Wherein the channel 14 is not normally used. The 802.11b/g standard or the 802.11a/b/g/n/ac standard generally supports 13 channels, channel 1 through channel 13. In other words, the above-mentioned Wi-Fi supported channels may include 13 channels of channel 1 to channel 13.
Also for example, the fractional channel and center frequency of the 5GHZ band division used by Wi-Fi are shown in table 2 below.
TABLE 2
Figure 657986DEST_PATH_IMAGE002
P2P: the term peer to peer is used throughout, i.e., end-to-end or point-to-point. The peer-to-peer technology is also called peer-to-peer internet technology, and is a new network technology, which relies on the computing power and bandwidth of participants in the network, rather than aggregating the dependencies on a few servers. A plurality of electronic devices with established P2P connections may be referred to as a P2P network, and the P2P network is generally used to connect nodes (i.e., electronic devices) through Ad Hoc (point-to-point) connections. The current P2P technology has multiple purposes, such as screen projection, multi-device cooperation, face-to-face quick transmission and the like.
The P2P referred to in this application may specifically refer to Wi-Fi P2P. Before two devices with Wi-Fi P2P connection are established, a heartbeat packet is periodically sent to each other, so that a receiving end determines that a sending end is online, and the Wi-Fi P2P connection (referred to as P2P connection for short in the rest of the present application) is continuously maintained.
Wi-Fi P2P technology, also known as Wi-Fi Direct, is a member of the Wi-Fi family of technologies. The Wi-Fi Direct standard refers to allowing devices in a wireless network to connect to each other without going through a router. This standard allows wireless devices to be interconnected in a point-to-point fashion, and has a significant increase in transmission speed and transmission distance over bluetooth.
In a P2P connection, a device has 2 roles: a Group Owner (GO) and a Group Client (GC), it can be simply understood that GO is a master and GC is a slave. When performing P2P join operations, GO and GC form a group, where the groups are divided into two types: permanent group and temporal group. In the persistence group, GO is impersonated by a specified device, and security configuration information and group related information once generated does not change subsequently. When the device is used subsequently, the information can be directly utilized, and the connection time is greatly reduced. In the temporal group, the role assignment of GO and GC is determined by group format and is the result of negotiation between both devices. the information of the temporal group is temporary, each subsequent use needs to be created temporarily, and the connection time is longer than the persistence group.
In a group formed by P2P connections, only one GO may exist, and the GO may be equivalent to a wireless Access Point (AP) for a GC, and one GO may establish P2P connections with multiple GCs to form a group. In this group, the GC and GO may also establish wireless connections with other APs not in the group.
It should be noted that the Wi-Fi P2P specification can be applied to WiFi devices supporting any IEEE 802.11 standard. The IEEE 802.11 standard may include: IEEE 802.11 b/g standard, IEEE 802.11 a standard, IEEE 802.11 b standard, IEEE 802.11 g standard, IEEE 802.11 ac standard, IEEE 802.11 n standard and the like. Wherein, the P2P devices supporting the same standard can be directly interconnected. For example, a P2P device supporting IEEE 802.11 a standard and a P2P device supporting IEEE 802.11 a standard may be directly interconnected. The P2P devices supporting different standards can be directly interconnected. For example, P2P devices supporting IEEE 802.11 a standard and P2P devices supporting IEEE 802.11 b standard may be directly interconnected.
As shown in fig. 1, in a possible scenario of the prior art, a first electronic device (e.g., a mobile phone) may first establish a P2P connection of a 149 channel (denoted by ch149 in the figure) of a 5G band with a second electronic device (e.g., a Personal Computer (PC), for example). Then, the first electronic device and the second electronic device periodically send a heartbeat packet (beacon) to the peer end, and the peer end returns an acknowledgement message (beacon-ACK) after receiving the heartbeat packet.
Then, the second electronic device may establish a wireless communication connection with the AP1 (e.g., a router) in the 153 channel (denoted by ch153 in the figure) of the 5G band. At this time, the second electronic device may have different channels with the same frequency. Since the second electronic device can process data of only one channel for one frequency band, the second electronic device needs to switch between the 149 channels and the 153 channels in a time-sharing manner. If the switching is performed every 100ms, it means that the PC will switch to the 153 channel after the 149 channel operates for 100ms, and will switch to the 149 channel after the 153 channel operates for 100 ms. The 5G frequency band 149 channel and the 5G frequency band 153 channel are only examples, and may be other different channels in the same frequency band. Of course, in practice, the second electronic device may also establish a channel 153 with the AP1 first and then establish a channel 149 with the first electronic device.
Then, if the second electronic device switches to 153 channel operation, the first electronic device sends a heartbeat packet to the second electronic device, and at this time, the second electronic device cannot return heartbeat packet confirmation information to the first electronic device in a short time (e.g., 5 ms). If the first electronic device does not receive the heartbeat packet acknowledgement information within a certain time (e.g., 5 ms), that is, a heartbeat packet timeout event (beacon timeout) occurs, the first electronic device actively disconnects the P2P connection with the second electronic device.
Alternatively, if the second electronic device switches to 153-channel operation, the second electronic device may not transmit the heartbeat packet to the second electronic device, and at this time, the first electronic device may not receive the heartbeat packet transmitted by the second electronic device in a short time (e.g., 5 ms). If the first electronic device does not receive the heartbeat packet within a certain time (e.g., 5 ms), the P2P connection with the second electronic device is actively disconnected. Or, in any other feasible scenario that the heartbeat packet transmission mechanism between the first electronic device and the second electronic device cannot be performed normally, the first electronic device actively disconnects the P2P connection with the second electronic device.
Therefore, when the subsequent second electronic device switches to the 149 channel, the P2P connection with the first electronic device needs to be reestablished, which causes a large time delay and affects the user experience. Of course, the scenario shown in fig. 1 is only an example, and in practice, on the basis that the first electronic device and the second electronic device establish a P2P connection, except for a case that the second electronic device can connect to the AP to cause the second electronic device to have the above problem due to the same frequency and different channels, the first electronic device can also connect to the AP to cause the first electronic device to have the same frequency and different channels (i.e., different channels in the same frequency band), so that the second electronic device actively disconnects the P2P connection when the second electronic device cannot normally perform transmission of the heartbeat packet with the first electronic device. The specific scenarios are similar to the above examples, and are not described here again. In addition, as in the scenario shown in fig. 1, if the second electronic device is the GO, the second electronic device may cause the second electronic device to have the same-frequency different channels by connecting to the AP, and in addition to the case that the second electronic device may have the same-frequency different channels by connecting to the AP, the second electronic device may also cause the second electronic device to have the same-frequency different channels by establishing a P2P connection with the electronic device other than the first electronic device and adding the connection to an existing group. The above-mentioned problem that the first electronic device actively disconnects the P2P connection with the second electronic device is further generated.
Based on the above problem, embodiments of the present application may provide a communication method that may be applied to a communication system including a master electronic device, a slave electronic device, and other electronic devices. A P2P connection is established between the master electronic device and the slave electronic device, the master electronic device is GO in a group formed by the P2P connection, and the slave electronic device is GC in the group formed by the P2P connection. The target electronic equipment (the master electronic equipment or the slave electronic equipment) and other electronic equipment establish wireless communication connection with the same frequency and different channels of the P2P connection. In the method, when the target electronic device performs data interaction with the peer electronic device (specifically, the peer electronic device establishing P2P connection with the target electronic device) except for the heartbeat packet and the heartbeat acknowledgment information, each data packet carries the synchronization time information and the time slice information. The synchronization time information is used for enabling the time of the target sub-device to be consistent with that of the opposite-end electronic device, and the time slice information is used for indicating how long the target electronic device works in the channel connected with the P2P, that is, how long the target electronic device is switched to other channels, and the switching period of each channel in the same-frequency different channels of the target electronic device. When the number of channels in the same-frequency different channels is more than two, a channel switching sequence is also included. Wherein the switching period is used to characterize how long to operate and then switch other channels. The channel switching sequence is used to characterize which channel is switched to when the channel needs to be switched, i.e. the switching sequence before multiple channels. Therefore, the peer electronic device can accurately know the time when the target electronic device switches the channel, and then can send the heartbeat packet to the target electronic device only when the target electronic device works in the channel corresponding to the P2P connection. Meanwhile, when the target electronic equipment works on a channel where the wireless communication connection established with other electronic equipment is located, the P2P connection is not actively disconnected. Unnecessary disconnection of P2P connection is avoided, and the use experience of a user is improved.
A specific architecture of a communication system that may be involved in the technical solution provided in the embodiment of the present application may be as shown in fig. 2, and includes a master electronic device 01, a slave electronic device 02, and another electronic device 03. A P2P connection is established between the master electronic device 01 and the slave electronic device 02, and a wireless communication connection or a P2P connection is established between the target electronic device (master electronic device and/or slave electronic device) and the other electronic device 03. In fig. 2, the other electronic devices include two electronic devices, and in practice, there may be fewer or more electronic devices. The master electronic device can establish wireless communication connection or P2P connection with other electronic devices, and the slave electronic device and other devices can only establish wireless communication connection.
In a first implementation, the other electronic device 03 may include the AP1. At this time, referring to (a) in fig. 3, in the communication system provided in the embodiment of the present application, the master electronic device 01 may be a target electronic device, and the master electronic device 01 and the AP1 establish a wireless communication connection. The wireless communication connection may be a wireless network connection that the electronic device accesses Wi-Fi, channels of the P2P connection and the wireless communication connection are same-frequency different channels, and the API may be a router. Here, the AP1 corresponds to a new electronic device in the present application, and the slave electronic device corresponds to a peer electronic device in the present application.
In a second implementable manner, the other electronic device 03 may comprise the AP2. At this time, referring to (b) in fig. 3, in the communication system provided in the embodiment of the present application, the slave electronic device 02 may be a target electronic device, and a wireless communication connection is established between the slave electronic device 02 and the AP2. The wireless communication connection may be a wireless connection for the electronic device to access Wi-Fi, channels of the P2P connection and the wireless communication connection are same-frequency different channels, and the AP2 may be a router. Here, the AP2 is equivalent to a newly added electronic device in the present application, and the main electronic device is equivalent to an opposite-end electronic device in the present application.
In a third implementable manner, the other electronic device 03 may include at least one GC1 corresponding to the host electronic device. At this time, referring to (c) in fig. 3, in the communication system according to the embodiment of the present application, the master electronic device 01 is a target electronic device, a P2P connection is also established between the master electronic device 01 and the GC1, and the master electronic device 01, the slave electronic device 02 and the GC1 belong to the same group communicated by the P2P connection. In FIG. 3 (c), at least one GC1 is shown as including GC1-1 and GC1-2, but in practice there may be more or less GCs 1. Here, the GC1 corresponds to a new electronic device in the present application, and the slave electronic device corresponds to a peer electronic device in the present application.
In a fourth implementable manner, the other electronic device 03 may include AP1 and AP2. At this time, referring to fig. 4 (a), in the communication system provided in the embodiment of the present application, both the master electronic device 01 and the slave electronic device 02 may be target electronic devices. Wireless communication connection is established between the master electronic device and the AP1, and wireless communication connection is established between the slave electronic device and the AP2. The wireless communication connection can be a wireless connection of the electronic device accessing Wi-Fi, channels of the P2P connection and the two wireless communication connections are same-frequency different channels, and both the AP1 and the AP2 can be routers.
Under the condition that the slave electronic device is a target electronic device and the master electronic device is equivalent to an opposite-end electronic device in the application, the AP1 may be equivalent to a second newly-added electronic device in the application, and the AP2 may be equivalent to a third newly-added electronic device in the application; when the master electronic device is a target electronic device and the slave electronic device is equivalent to an opposite-end electronic device in the present application, the AP1 may be equivalent to a third new electronic device in the present application, and the AP2 may be equivalent to a second new electronic device in the present application.
In a fifth implementable manner, the other electronic device 03 may include the AP1 and at least one GC1 corresponding to the master electronic device. At this time, referring to (b) in fig. 4, in the communication system provided in the embodiment of the present application, the master electronic device 01 may be a target electronic device, a wireless communication connection is established between the master electronic device 01 and the AP1, a P2P connection is also established between the master electronic device 01 and the GC1, and the master electronic device 01, the slave electronic device 02, and the GC1 belong to the same group formed by the P2P connections. The wireless communication connection may be a wireless connection through which the electronic device accesses Wi-Fi, channels of the P2P connection and the wireless communication connection are different channels of the same frequency, and the AP1 may be a router. In FIG. 4 (b), at least one GC1 is shown as including GC1-1 and GC1-2, and in practice there may be more or less GC1.
Taking at least one GC including one GC1 as an example, here, AP1 corresponds to a new electronic device in the present application, GC1 may correspond to an optional electronic device in the present application, and the slave electronic device corresponds to an opposite-end electronic device in the present application.
In a sixth implementable manner, the other electronic device 03 may include the AP2 and at least one GC1 corresponding to the master electronic device. At this time, referring to (c) in fig. 4, in the communication system provided in the embodiment of the present application, both the master electronic device 01 and the slave electronic device may be target electronic devices, a wireless communication connection is established between the slave electronic device 02 and the AP2, and a P2P connection is also established between the master electronic device 01 and the GC1. The master electronic device 01, the slave electronic device 02, and the GC1 belong to the same group constituted by P2P connections. The wireless communication connection may be a wireless connection for the electronic device to access Wi-Fi, channels of the P2P connection and the wireless communication connection are same-frequency different channels, and the AP2 may be a router. In FIG. 4 (b), at least one GC1 is shown as including GC1-1 and GC1-2, and in practice there may be more or less GCs 1.
Taking at least one GC1 including only one GC1 as an example, in the case that the slave electronic device is the target electronic device and the master electronic device is equivalent to the peer electronic device in the present application, the GC1 may be equivalent to the second newly added electronic device in the present application, and the AP2 may be equivalent to the third newly added electronic device in the present application;
In the case where the master electronic device is a target electronic device and the slave electronic device is equivalent to an opposite-end electronic device in the present application, the GC1 may be equivalent to a third new electronic device in the present application, and the AP2 may be equivalent to a second new electronic device in the present application.
In a seventh implementable manner, the other electronic device 03 may include AP1, AP2, and at least one GC1 corresponding to the master electronic device. At this time, referring to (d) in fig. 4, in the communication system provided in the embodiment of the present application, both the master electronic device 01 and the slave electronic device 02 may be target electronic devices. A wireless communication connection is established between the master electronic device 01 and the AP1, a wireless communication connection is established between the slave electronic device 02 and the AP2, and a P2P connection is established between the master electronic device 01 and the GC1. The master electronic device 01, the slave electronic device 02, and the GC1 belong to the same group constituted by P2P connections. The wireless communication connection can be a wireless connection of the electronic device accessing Wi-Fi, channels of the P2P connection and the wireless communication connection are same-frequency different channels, and both the AP1 and the AP2 can be routers.
Taking at least one GC1 including only one GC1 as an example, in a case where the slave electronic device is a target electronic device and the master electronic device is equivalent to an opposite-end electronic device in the present application, the GC1 may be equivalent to a second additional electronic device in the present application, the AP2 may be equivalent to a third additional electronic device in the present application, and the AP1 may be equivalent to a fourth additional electronic device in the present application.
In the present application, the P2P connection between GO and GC (GC 1 or GC 2), the wireless communication connection between GO and AP1, and the wireless communication connection between GC1 and AP2 may be established in sequence, and the sequence may be determined according to the practice, and the present application is not particularly limited. For convenience, in the following embodiments in the present application, a P2P connection established between GO and GC1 is taken as an example for related description, and is not described again herein.
For example, the master electronic device and the slave electronic device in the present application may be a tablet computer, an ultra-mobile personal computer (UMPC), a netbook, a desktop computer, a notebook computer, a mini-notebook computer, an ultrabook, a Personal Digital Assistant (PDA), a television, or other devices capable of being used for work and entertainment of a user, which have a P2P connection function.
Illustratively, taking an electronic device (a master electronic device or a slave electronic device) as a mobile phone as an example, as shown in fig. 5, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display 194, a Subscriber Identity Module (SIM) card interface 195, and the like.
The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
Wherein the gyro sensor may be used to determine the motion gesture of the electronic device 01, among other things. In some embodiments, the angular velocity of the electronic device about three axes (i.e., x, y, and z axes) may be determined by the gyroscope sensors. The gyro sensor may be used for photographing anti-shake. Illustratively, when the shutter is pressed down, the gyroscope sensor detects the shake angle of the electronic device, calculates the distance to be compensated for the lens module according to the angle, and enables the lens to counteract the shake of the electronic device through reverse movement, so as to realize anti-shake. The gyroscope sensor can also be used for navigation and motion sensing game scenes.
The acceleration sensor can detect the magnitude of acceleration of the electronic device in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 01 is stationary. The gesture that can also be used for discernment intelligence wearing equipment is applied to and is violently erected the screen and switch, uses such as pedometer.
The gyroscope sensor and the acceleration sensor can be combined to determine motion data such as the motion direction, the motion speed and the like of the user holding the electronic equipment.
It is to be understood that the illustrated structure of the embodiment of the present invention does not limit the electronic device. In other embodiments of the present application, an electronic device may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor (NPU), and/or a Micro Controller Unit (MCU), etc. Wherein, the different processing units may be independent devices or may be integrated in one or more processors.
The controller can be a neural center and a command center of the electronic device. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, a Serial Peripheral Interface (SPI), an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the interface connection relationship between the modules according to the embodiment of the present invention is only an exemplary illustration, and does not limit the structure of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive a charging input from a charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the 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 01 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to the electronic device 01.
The wireless communication module 160 may provide solutions for wireless communication applied to electronic devices, including Wireless Local Area Networks (WLANs) (e.g., wi-Fi networks), bluetooth (BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), NFC, infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves. In the embodiment of the present application, the wireless communication module 160 may support Wi-Fi P2P.
The electronic device implements display functionality via the GPU, the display screen 194, and the application processor, among other things. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen may be a touch screen. In some embodiments, electronic device 01 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor, and the like. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture still images or video. In some embodiments, the electronic device may include 1 or N cameras 193, N being a positive integer greater than 1.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. The NPU can realize applications such as intelligent cognition of electronic equipment, for example: the method comprises the steps of film sticking state recognition, image restoration, image recognition, face recognition, voice recognition, text understanding and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the electronic device 01. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 01 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The data storage area can store data (such as audio data, phone book and the like) created in the using process of the electronic device. In addition, the internal memory 121 may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a Universal Flash Storage (UFS), and the like.
The electronic device 01 may implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playing, recording, etc.
Touch sensors, also known as "Touch Panels (TPs)". The touch sensor may be disposed on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor may be disposed on a surface of the electronic device at a different location than the display screen 194.
The keys 190 include a power-on key, a volume key, and the like. The motor 191 may generate a vibration cue. Indicator 192 may be an indicator light that may be used to indicate a charging status, a change in power, or a short message, missed call, notification, etc. The SIM card interface 195 is used to connect a SIM card.
The configuration illustrated in the embodiment of the present invention is not limited to the electronic device. More or fewer components than shown may be included, or certain components may be combined, or certain components may be split, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
In the above example, the structure of the mobile-convenient electronic device having the mobile communication function is mainly shown, and what actually participates in the P2P connection may be an electronic device which does not have the mobile communication function and is not convenient to move. Exemplarily, taking an electronic device (a slave electronic device or a master electronic device) as a television as an example, as shown in fig. 6, the television may include: processor 210, external memory interface 220, internal memory 221, universal Serial Bus (USB) interface 230, power management module 240, antenna, wireless communication module 260, audio module 270, speaker 270A, microphone 270C, speaker interface 270B, sensor module 280, buttons 290, indicator 291, and display 292, among others. The sensor module 280 may include a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and the like.
Processor 210 may include one or more processing units, such as: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be a television's neural center and command center. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 210 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 210. If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 210, thereby increasing the efficiency of the system.
The power management module 240 is used to connect to a power source. The power management module 240 may also be coupled to the processor 210, the internal memory 221, the display 292, the wireless communication module 260, and the like. The power management module 240 receives power input and provides power to the processor 210, the internal memory 221, the display 292, and the wireless communication module 260. In some embodiments, the power management module 240 may also be disposed in the processor 210.
The wireless communication function of the television can be realized by the antenna and the wireless communication module 260, and the like. The wireless communication module 260 may provide a solution for wireless communication applied to the television, including Wireless Local Area Networks (WLANs), such as Wi-Fi networks, bluetooth (BT), global Navigation Satellite Systems (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (infrared, IR), and the like. In the embodiment of the present application, the wireless communication module 260 may support Wi-Fi P2P.
The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna, performs frequency modulation and filtering on the electromagnetic wave signal, and transmits the processed signal to the processor 210. The wireless communication module 260 may also receive a signal to be transmitted from the processor 210, frequency-modulate and amplify the signal, and convert the signal into electromagnetic waves via the antenna to radiate the electromagnetic waves. In some embodiments, the antenna of the television is coupled to the wireless communication module 260 so that the television can communicate with the network and other devices via wireless communication techniques.
The television implements the display function via the GPU, display 292, and application processor, etc. The GPU is a microprocessor for image processing, and is connected to a display 292 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when a television set is selected in a frequency point, the digital signal processor is used for performing fourier transform and the like on the frequency point energy. Video codecs are used to compress or decompress digital video. The television may support one or more video codecs. Thus, the television can play or record video in a plurality of coding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. The NPU can realize applications such as intelligent cognition of the television, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the television. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 221 may be used to store computer-executable program code, including instructions. The processor 210 executes various functional applications of the television set and data processing by executing instructions stored in the internal memory 221.
The television can implement audio functions through the audio module 270, the speaker 270A, the microphone 270C, the speaker interface 270B, the application processor, and the like. Such as music playing, recording, etc. Audio module 270 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. Audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be disposed in the processor 210, or some functional modules of the audio module 270 may be disposed in the processor 210. The speaker 270A, also called a "horn", is used to convert an audio electrical signal into an acoustic signal. The microphone 270C, also referred to as a "microphone," is used to convert acoustic signals into electrical signals.
Speaker interface 270B is for connecting a wired speaker. Speaker interface 270B may be USB interface 230, or may be an open mobile equipment platform (OMTP) standard interface of 3.5 mm, or a cellular telecommunications industry association (cellular telecommunications industry association) standard interface of the USA.
The keys 290 include a power-on key, a volume key, and the like. The keys 290 may be mechanical keys. Or may be touch keys. The television may receive key inputs to generate key signal inputs relating to user settings and function controls of the television.
The indicator 291 may be an indicator light, and may be used to indicate that the television is in a power-on state, a standby state, a power-off state, or the like. For example, the indication lamp is turned off, which can indicate that the television is in a power-off state; the indicating lamp is green or blue, and can indicate that the television is in a standby state; the indicator light is red, and can indicate that the television is in a standby state.
Typically, the television is provided with a remote control. The remote controller is used for controlling the television. The remote controller may include: a plurality of keys, such as a power key, a volume key, and other plurality of selection keys. The keys on the remote controller can be mechanical keys or touch keys. The remote control may receive key inputs, generate key signal inputs relating to user settings and function controls of the television, and transmit corresponding control signals to the television to control the television. For example, the remote controller may transmit a control signal to the television set through an infrared signal or the like. The remote controller can also comprise a battery accommodating cavity for accommodating a battery and supplying power to the remote controller.
It is to be understood that the illustrated structure of the present embodiment does not specifically limit the television. In other embodiments, the television may include more or fewer components than illustrated, or some components may be combined, or some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
For example, in the case of serving as the GC, the other electronic device may be a tablet computer, an ultra-mobile personal computer (UMPC), a netbook, a desktop computer, a notebook computer, a mini-notebook computer, an ultrabook (ultrabook), a Personal Digital Assistant (PDA), a television, or other devices with P2P connection function, which can be used for work and entertainment of a user. The specific structure of the above embodiments can refer to the related expressions in the foregoing embodiments, and details are not described herein.
When the other electronic device serves as the AP, the electronic device may be specifically a router. Illustratively, referring to fig. 7, the router may specifically include: processor 310, memory 320, wireless communication circuitry 330, antenna 331, network port 340.
The memory 320 is used to store instructions and data. The processor 310 may call instructions or data stored by the memory 320. The network port 340 may include a wired network interface that may be configured to couple to a network of the internet via a wired network such as broadband, and may provide access to the internet for a plurality of terminals. The network port 340 may also include a mobile communication module that may be configured to connect to a core network via a wireless communication technology. The wireless communication circuitry 330 may be configured to communicate via a wireless local area network standard, such as a Wi-Fi network. The wireless communication circuit 330 may be one or more devices that integrate at least one communication processing module. The wireless communication circuit 330 may receive electromagnetic waves via the antenna 332, frequency modulate and filter the electromagnetic wave signal, and send the processed signal to the processor 310. The wireless communication circuit 330 may also receive signals to be transmitted from the processor 310, frequency modulate them, amplify them, and convert them into electromagnetic waves via the antenna 331 for radiation.
It is to be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation to the router. In other embodiments of the present application, a router may include more or fewer components than illustrated, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Based on the communication system shown in fig. 3 (a), taking the master electronic device as a mobile phone, the slave electronic device as a tablet computer, and the AP1 as a first router as an example, as shown in fig. 8, the communication method provided in the embodiment of the present application may include S801 to S806:
s801, establishing a first P2P connection between the mobile phone and the tablet personal computer.
The channel of the first P2P connection may be 149 channels, and both the mobile phone and the tablet computer operate in 149 channels. In fig. 8, ch149 is taken as an example. Referring to fig. 8, after the mobile phone establishes the first P2P connection with the tablet computer, the mobile phone and the tablet computer periodically send heartbeat packets to the opposite end and receive corresponding confirmation information. Fig. 8 only illustrates that the tablet computer sends a heartbeat packet to the mobile phone and receives heartbeat packet confirmation information returned by the mobile phone, which is not limited to a specific implementation.
Specifically, the mobile phone and the tablet computer may establish the first P2P connection after executing the relevant connection operation after opening the first P2P connection function in response to the opening operation of the user.
In practice, there are many P2P functions that the mobile phone itself has. For example, taking an electronic device as a mobile phone as an example, the mobile phone may have functions of WlAN (wireless local area network) direct connection, XX sharing, screen projection, and the like, where XX may be a name or a trademark of a manufacturer to which the mobile phone belongs, for example, glory. Therefore, the process of establishing the first P2P connection corresponding to different P2P functions by the user using the mobile phone is different.
For example, taking the P2P function as the WlAN direct connection function, the first P2P connection as the WlAN direct connection, and the main electronic device as the mobile phone, the mobile phone may start the Wi-Fi function (which may be specifically referred to as the WlAN function in practice). Referring to fig. 9 (a), the handset may receive a user's trigger operation (e.g., a trigger operation) on a more functionality control 902 in a WLAN details page 901. In response to the trigger operation, the handset may display a WLAN capability page 903 as described in fig. 9 (b). Thereafter, the handset may receive a user trigger operation (e.g., click) of the WLAN direct functionality control 904 in the WLAN functionality page 903. In response to the trigger operation, the handset may display a WlAN direct details interface 905 as described in fig. 9 (c). In the WlAN direct details interface 905, there may be device names of available devices that the main electronic device may establish WlAN direct. For example, plate-XX, plate-XY, etc. The devices corresponding to these device names are also devices with WLAN functionality and specific WLAN direct functionality enabled in the same or similar manner as the mobile phone, for example, slave electronic devices. Then, taking the device name of the slave electronic device, namely, the tablet-XX as an example, the mobile phone may receive a trigger operation (for example, a click) of the tablet-XX in the WlAN direct connection detail interface 905 by the user, and request the established WlAN direct connection from the tablet.
The tablet may display a confirmation popup 906 shown with reference to fig. 9 (d) in response to a request for the handset to establish a WLAN direct. The confirmation popup 906 is mainly used to instruct the user of the tablet computer to confirm whether to establish WLAN direct connection with the mobile phone. Including a confirm control 907 or a cancel control 908. When the user of the tablet pc needs to establish a WLAN direct connection with the mobile phone, a confirmation operation (e.g., clicking) may be performed on the confirmation control 907. The tablet computer can respond to the confirmation operation of the user and establish the WLAN direct connection with the mobile phone. And then, the mobile phone and the tablet personal computer can transmit data by using the WLAN direct connection.
When the user to which the tablet computer belongs does not need to establish a WLAN direct connection with the mobile phone, a cancel operation (e.g., clicking) may be performed on the cancel control 908. The tablet computer can also respond to the cancel operation of the user and does not establish WLAN direct connection with the mobile phone. Of course, if the tablet computer sends the request for establishing the WLAN direct connection to the mobile phone in the process of establishing the WLAN direct connection, the mobile phone may display the confirmation popup window and receive the confirmation operation or cancel the operation of the user.
Certainly, the WLAN direct connection establishment process may be a process in which the mobile phone and the tablet establish the WLAN direct connection for the first time. When the WLAN direct connection is established between the mobile phone and the tablet again subsequently, on the basis that the WLAN functions are both turned on, the mobile phone or the tablet directly establishes the WLAN direct connection with the opposite terminal after receiving the trigger operation of the user on the device name of the opposite terminal in the WLAN direct connection detail interface. The opposite end of the mobile phone is a tablet personal computer, and the opposite end of the tablet personal computer is the mobile phone.
For another example, taking the P2P function as the XX sharing function and the first P2P connection as the XX sharing connection as an example, the mobile phone may receive an opening operation of the XX sharing function by the user. For example, referring to fig. 10 (a), the opening operation may be a triggering operation (e.g., a clicking operation) of the XX sharing control 1002 in the pull-down menu 1001 of the mobile phone by the user. Referring to fig. 10 (b), the opening operation may also be a trigger operation of the user to an opening control 1004 of the XX sharing function in the target interface 1003. The target interface 1003 may be displayed by the mobile phone in response to a triggering operation of the user on the sub-item shared by XX in the mobile phone setting menu.
In response to the opening operation, the cellular phone may display a prompt popup 1005 as shown in fig. 10 (c). The prompt popup 1005 is mainly used to prompt the user to start the XX sharing function and what function of the mobile phone needs to be started, and let the user confirm whether to start or not. As shown in fig. 10 (c), the prompt pop-up window 1005 may display "after being opened, the shared file automatically searches for a nearby device at any time, and thus, the traffic is not transmitted rapidly. This function requires turning on WLAN and bluetooth. Whether it is on or not. The prompt pop-up 1005 may also include a confirmation control 1006 and a cancel control 1007.
Then, the mobile phone may receive a confirmation operation of the user on the confirmation control 1006, and in response to the confirmation operation, the mobile phone starts the WLAN function, the bluetooth function, and the XX sharing function, and establishes an XX sharing link with the tablet computer. Of course, if the WLAN function and the bluetooth function are turned on in advance, the mobile phone may not display the prompt popup 1005 in response to the turning-on operation, but may display a popup for the user to confirm whether to turn on the XX sharing function.
At this time, the mobile phone may utilize the bluetooth scanning accessory to turn on the XX sharing device, such as a tablet. The same process for starting the XX sharing function by the tablet computer is carried out. Then, when the user shares a file, such as a picture, with the tablet computer, the user can share the file through the XX sharing function.
For another example, taking the master electronic device as a mobile phone, the slave electronic device as a television (the television may normally turn on the wireless screen projection function), the P2P function as a screen projection function, and the screen projection connection of the first P2P connection as an example, the mobile phone may receive a turn-on operation for turning on the wireless screen projection.
Illustratively, referring to fig. 11 (a), the opening operation may be a trigger operation (e.g., a click operation) of the unlimited screen control 1102 by the user in the pull-down menu 1101 of the mobile phone. Referring to fig. 11 (b), the opening operation may also be a triggering operation of the wireless screen projection control 1104 by the user in the more connection interface 1103. The more connection interface 1103 may be displayed by the mobile phone in response to a user's operation for triggering more connection controls in the mobile phone setting menu.
In the case where the handset has previously opened the WLAN function, in response to the opening operation, the handset may display a screen-shot popup 1105 as shown in fig. 11 (c). The screen-projection popup 1105 displays the device name of the device that the user can select to screen, for example, the device name of the tv: zb television. Under the condition that the WLAN function is not opened before the mobile phone, responding to the opening operation, the mobile phone firstly displays a popup window for prompting a user to open the WLAN function, and then displays the screen-projecting popup window after receiving the operation of the user to open the WLAN function.
Thereafter, the handset may send a screen-casting request to the television in response to a user's trigger operation on "zb television" in the screen-casting popup 1105. After receiving the screen-casting request, the tv displays a prompt popup 1201 as shown in fig. 12. The prompt popup 1201 is used to indicate a command for confirming whether the mobile phone is allowed to be dropped. Illustratively, the prompt popup 1201 may include a confirmation control 1202 and a cancel control 1203. After the confirmation control 1202 is triggered, the television sets can establish screen-casting connection with the mobile phone, and display the content of the mobile phone needing screen casting. After the cancel control 1202 is triggered, the television does not establish a screen-casting connection with the mobile phone, and the mobile phone cannot cast any content onto the television.
S802, the mobile phone and the first router establish first wireless communication connection.
Wherein, the channel of the first wireless communication connection can be 153 channels. Ch153 is exemplified in fig. 8. Generally, after a communication connection is newly established, a mobile phone may be switched to a new communication connection channel immediately or after processing currently processed data, that is, after S802 is executed, the mobile phone may perform channel switching, and after the switching is completed, both the first router and the second router work in 153 channels. The channel of the first wireless communication connection and the channel of the first P2P connection are same-frequency and different-frequency channels. The first wireless communication connection may here correspond to the first wireless connection in the present application.
Specifically, the specific implementation of establishing the first wireless communication connection between the mobile phone and the first router is a process of actually connecting the mobile phone to any Wi-Fi network. Specifically, after receiving a trigger operation (for example, clicking) performed by a user on a Wi-Fi network option in a Wi-Fi interface selectable by the mobile phone, and receiving a password input by the user, the mobile phone establishes a first wireless communication connection with a first router corresponding to the Wi-Fi network.
After the mobile phone establishes the first P2P connection with the tablet computer, if the first router starts to establish the first wireless communication connection of the same-frequency different channels with the first P2P connection (for example, the mobile phone has just sent the first wireless communication connection request to the first router), the mobile phone may first determine the time-sharing switching policy of the two same-frequency different channels, that is, determine the switching period of the two channels. The switching period is used for representing the time for switching other channels. The switching period may be determined by the mobile phone according to a preset rule. For example, the preset rule may limit a switching period corresponding to each channel when the mobile phone has the same-frequency different channels; alternatively, the preset rule may also be a calculation formula for calculating the switching period of a certain channel. This is not specifically limited by the present application.
Then, in order to prevent the tablet computer from actively disconnecting the first P2P connection because the tablet computer does not receive the heartbeat packet acknowledgement message when the working channel of the mobile phone is switched to the channel of the first wireless communication connection, the mobile phone needs to inform the tablet computer of the relevant information of the mobile phone switching channel in time, i.e., S803 is executed.
S803, after the first wireless communication connection between the mobile phone and the first router is started, and before the working channel is switched from the first P2P connection channel to the first wireless communication connection channel, when the mobile phone communicates with the tablet computer through the first P2P connection, the first synchronization time information and the first time slice information are added to each data packet.
Wherein the data packet does not include the heartbeat packet and heartbeat packet acknowledgement information.
The first synchronization time information is used for synchronizing the time of the tablet computer and the time of the mobile phone.
For example, the first synchronization time information may include a synchronization timer. When the mobile phone sends the synchronous timer to the tablet computer through the first P2P connection, the mobile phone starts a timer to time from zero, and meanwhile, the preset time length required by sending the synchronous timer to the tablet computer is determined by combining the time delay of sending data when the first P2P connection is established between the mobile phone and the tablet computer, and the timing time in the synchronous timer is set as the preset time length. Illustratively, for example, if the preset duration is 1ms, the timing time of the synchronization timer is 1ms. Of course, the preset duration may be set according to statistics of actual conditions before the mobile phone manufacturer leaves the factory. The determination method of the preset duration is not specifically limited in the present application.
Meanwhile, the synchronous timer is also used for indicating the tablet computer to continue to start timing according to the timing time; or the first synchronous time information may further include first indication information indicating that the tablet computer continues to start timing according to the timing time of the synchronous timer.
For another example, the first synchronization time information may further include an actual time at which the mobile phone itself is currently located, a preset time duration, and the first indication information. For example, the actual time may be 28 minutes, 56 seconds, 33ms at 12 hours, 6 months, 15 days, 2021.
Of course, the first synchronization time information may also be implemented in any other feasible manner as long as the time of the tablet computer can be indicated to be consistent with the mobile phone.
The first time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the mobile phone. Specifically, the first time slice information may include a first P2P switching period and a first radio channel switching period. The first P2P switching period is used to instruct the cell phone to switch back to the first P2P connected channel for a long time to operate again (i.e. the time length of the operation before the operating channel of the cell phone is switched from the first P2P connected channel to the other channel), and the first wireless channel switching period is used to instruct the cell phone to switch back to the first P2P connected channel (i.e. the time length of the operation before the operating channel of the cell phone is switched from the first P2P connected channel to the other channel) after the cell phone is switched to the first wireless communication connected channel.
The first P2P switching period and the first radio channel switching period may be determined by the mobile phone according to a preset rule. The specific implementation of the preset rule may refer to the related expressions in the foregoing embodiments, and details are not described here. Of course, the first P2P switching period and the first wireless channel switching period may be changed according to actual situations, for example, if a certain file sent to the tablet computer by the mobile phone is large and cannot be split for sending, the first P2P switching period may be increased.
S804, the tablet computer receives the data packet from the mobile phone.
Therefore, after the tablet computer receives the data packet sent by the mobile phone, the working channel of the mobile phone can be determined in real time according to the first synchronization time information and the first time slice information carried in the data packet. And then whether the mobile phone and the tablet computer work in a channel connected with the first P2P can be determined in real time. If the fact that whether the mobile phone and the tablet computer work in the first P2P connection channel or not is determined, the heartbeat packets are continuously and periodically sent to the mobile phone, and the heartbeat packet confirmation information from the mobile phone is received. When the mobile phone and the tablet computer are determined not to work in the first P2P connection channel, the heartbeat packet is stopped being sent to the mobile phone until the mobile phone and the tablet computer are determined to work in the first P2P connection channel again. Therefore, under the scene that the mobile phone has the first P2P connection established with the tablet computer and the first wireless communication connection established with the first router, the tablet computer does not actively disconnect the first P2P connection due to the fact that the tablet computer cannot receive heartbeat packet confirmation information within a certain time, and the first P2P connection is continuously maintained.
In this embodiment of the application, specifically, the step of disconnecting the first P2P connection may refer to no longer storing information (e.g., an interface, a serial number, etc.) about the first P2P connection of the opposite-end electronic device, and the step of maintaining the first P2P connection may be to continue storing information about the first P2P connection of the opposite-end electronic device.
S805, the working channel of the mobile phone is switched from the channel of the first P2P connection to the channel of the first wireless communication connection.
S806, when the working channel of the mobile phone is switched to the channel of the first P2P connection, and when the mobile phone communicates with the tablet computer through the first P2P connection, adding the first synchronization time information and the first time slice information to each data packet.
After S806, the tablet computer receives the data packet from the mobile phone.
It should be noted that, in order to ensure compatibility or consistency, when the mobile phone only establishes the first P2P connection with the tablet computer, the data packet sent by the mobile phone to the tablet computer through the first P2P connection may carry the first preset synchronization time information and the first preset time slice information. The first preset time slice information may be null, or include information indicating that the mobile phone will always operate on the channel of the first P2P connection. The first preset synchronization time information has the same function as the first synchronization time information.
In addition, in practice, the time of the mobile phone and the tablet computer may be synchronized only once, so that in some embodiments, the mobile phone only needs to send the first preset synchronization time information or the first synchronization time information to the tablet computer once, and then only needs to send the preset time slice information or the first time slice information.
Based on the above technical solutions of S801-S806, when the mobile phone establishes both a P2P connection with the tablet computer and a first wireless communication connection with the first router, that is, when the mobile phone is in a same-frequency different channel, the mobile phone will carry synchronization time information (i.e., first synchronization time information) and time slice information (i.e., first time slice information) in each data packet when performing data interaction with the tablet computer except for a heartbeat packet and heartbeat acknowledgment information. The synchronous time information is used for enabling the time of the mobile phone to be consistent with that of the tablet computer, and the time slice information comprises the switching period of each channel. Therefore, the tablet computer can accurately know the time when the mobile phone switches the channel, and further can send the heartbeat packet to the mobile phone only when the mobile phone works in the channel connected with the P2P. The P2P connection is not actively disconnected when the handset is operating on a channel on which a wireless communication connection is established with another electronic device (e.g., the first router). And then the tablet computer enables the P2P connection not to be actively disconnected when the heartbeat packet confirmation information cannot be received within a certain time under the scene that the mobile phone has the P2P connection established with the tablet computer and the first wireless communication connection established with the first router, and the P2P connection is continuously kept. And then when the follow-up mobile phone needs to work on the channel connected with the P2P established by the tablet computer again, the P2P connection does not need to be established again, and the use experience of the user is improved.
In some embodiments, based on the communication system shown in fig. 3 (b), taking the master electronic device as a mobile phone, the slave electronic device as a tablet computer, and the AP2 as a second router as an example, as shown in fig. 13, the communication method provided in this embodiment of the present application may include S1301-S1306:
s1301, the mobile phone and the tablet computer establish first P2P connection.
For specific implementation of S1301, reference may be made to related expressions after S801 in the foregoing embodiment, and details are not described here.
S1302, establishing a second wireless communication connection between the tablet computer and the second router.
Wherein the channel of the second wireless communication connection may be 42 channels. Ch42 is shown as an example in fig. 13. Generally, after a communication connection is newly established by the tablet computer, the tablet computer is switched to a new communication connection channel immediately or after the currently processed data is processed, that is, after the S1302 is executed, the tablet computer performs channel switching, and both the switched tablet computer and the second router operate in 42 channels. The channel of the second wireless communication connection and the channel of the first P2P connection are same-frequency different channels. The second wireless communication connection may here correspond to the first wireless connection in the present application.
Specifically, the specific implementation that the tablet computer establishes the second wireless communication connection with the second router is a process that the tablet computer is actually connected to any Wi-Fi network. Specifically, after receiving a password input by a user after a user performs a trigger operation (e.g., clicking) on a certain Wi-Fi network option in a Wi-Fi selectable interface on the mobile phone, the tablet computer establishes a second wireless communication connection with a second router corresponding to the Wi-Fi network.
After the tablet computer establishes the first P2P connection with the mobile phone, if the tablet computer starts to establish the second wireless communication connection (for example, the tablet computer just sends a second wireless communication connection request to the second router) of the same-frequency different channels with the first P2P connection, the tablet computer may first determine the time-sharing switching policy of the two same-frequency different channels, that is, determine the switching period of the two channels. The switching period is used for representing the time for switching other channels. The switching period may be determined by the tablet according to a preset rule. For example, the preset rule may limit a switching period corresponding to each channel when the same-frequency different channels exist in the tablet computer; alternatively, the preset rule may also be a calculation formula for calculating the switching period of a certain channel. This is not particularly limited by the present application.
Then, in order to prevent the mobile phone from actively disconnecting the first P2P connection because the corresponding heartbeat packet acknowledgment message is not received when the working channel of the tablet computer is switched to the channel of the second wireless communication connection, the tablet computer needs to inform the mobile phone of the relevant information of the tablet computer switching channel in time, that is, step S1303 is executed.
And S1303, after the tablet computer starts to establish the second wireless communication connection with the second router, before the working channel of the tablet computer is switched from the channel of the first P2P connection to the channel of the second wireless communication connection, and when the tablet computer communicates with the mobile phone through the first P2P connection, second synchronous time information and second time slice information are added to each data packet.
Wherein the data packet does not include a heartbeat packet and heartbeat packet acknowledgement information. The second synchronization time information is used for enabling the time of the mobile phone to be consistent with that of the tablet computer, and the second time slice information is used for indicating the switching period of each channel in all the same-frequency different channels corresponding to the tablet computer. Here, the second synchronization time information corresponds to the first target synchronization time information in the present application, and the second slot information corresponds to the first target slot information in the present application.
The second synchronization time information is used for indicating time synchronization of the mobile phone and the tablet computer. The second synchronization time information can be realized by referring to the related expression of the first synchronization time information in the foregoing embodiment.
The second time slice information is used for indicating the switching period of each channel in all the same-frequency different channels corresponding to the tablet computer. It may specifically include a first P2P switching period and a second radio channel switching period. The first P2P switching period is used to instruct the tablet computer how long to switch back to the channel of the first P2P connection for the second time to switch back to another channel (here, the channel of the second wireless communication connection) for work, and the second wireless channel switching period is used to instruct the tablet computer how long to switch back to the channel of the first P2P connection for the second time after switching to the channel of the second wireless communication connection.
And S1304, the mobile phone receives the data packet from the tablet personal computer.
Therefore, after the mobile phone receives the data packet sent by the tablet computer, whether the tablet computer and the mobile phone work in the channel connected with the first P2P can be determined in real time according to the second synchronous time information and the third time slice information carried in the data packet, and if it is determined that the mobile phone and the tablet computer work in the channel connected with the first P2P, the heartbeat packet is continuously and periodically sent to the mobile phone and the heartbeat packet confirmation information from the mobile phone is received. When the tablet computer and the mobile phone are determined not to work in the first P2P connection channel, the heartbeat packet is stopped being sent to the tablet computer until the tablet computer and the mobile phone are determined to work in the second first P2P connection channel again. Therefore, under the scene that the tablet computer has the first P2P connection established with the mobile phone and the second wireless communication connection established with the second router, the tablet computer does not actively disconnect the first P2P connection due to the fact that the tablet computer cannot receive heartbeat packet confirmation information within a certain time, and the first P2P connection is continuously maintained.
S1305, the working channel of the tablet computer is switched from the channel of the first P2P connection to the channel of the second wireless communication connection.
S1306, when the working channel is switched to the channel of the first P2P connection, and the tablet pc communicates with the mobile phone through the first P2P connection, adding the second synchronization time information and the second time slice information to each data packet.
After S1306, the mobile phone receives the data packet from the tablet computer.
It should be noted that, in order to ensure compatibility or consistency, when the tablet pc only establishes the first P2P connection with the mobile phone, the tablet pc may carry the second preset synchronization time information and the second preset time slice information in the data packet sent to the mobile phone through the first P2P connection. The second preset time slice information may be null, or include information indicating that the tablet computer will always operate on the channel of the first P2P connection. The second preset synchronization time information and the second synchronization time information may have the same role.
In addition, in practice, the time of the mobile phone and the tablet computer may be synchronized only once, so that in some embodiments, the mobile phone only needs to send the second preset synchronization time information or the second synchronization time information to the tablet computer once, and then only needs to send the second preset time slice information or the second time slice information.
Based on the technical solutions of S1301-S1306, when the tablet pc establishes both a P2P connection with the mobile phone and a second wireless communication connection with the second router, that is, when the tablet pc is in a same-frequency different-channel state, when the tablet pc performs data interaction with the mobile phone except for a heartbeat packet and heartbeat acknowledgment information, each data packet carries synchronization time information (i.e., first synchronization time information) and time slice information (i.e., first time slice information). The synchronous time information is used for enabling the time of the tablet computer to be consistent with that of the mobile phone, and the time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the tablet computer. Therefore, the mobile phone can accurately know the time when the tablet computer switches the channel, and further can send the heartbeat packet to the tablet computer only when the tablet computer works in the channel corresponding to the P2P connection. When the tablet computer works on a channel where a wireless communication connection established with other electronic equipment (such as a first router) is located, the P2P connection is not actively disconnected. Furthermore, under the scene that the tablet computer has both the P2P connection established with the mobile phone and the first wireless communication connection established with the first router, the mobile phone does not actively disconnect the P2P connection but continues to maintain the P2P connection when the heartbeat packet acknowledgement information cannot be received within a certain time. And then when the follow-up tablet computer needs to work on the channel of the P2P connection established with the mobile phone again, the P2P connection does not need to be established again, and the use experience of the user is improved.
Based on the communication system shown in fig. 3 (c), taking the master electronic device as a mobile phone, the slave electronic device as a tablet computer, and the at least one GC1 including a personal computer PC as an example, as shown in fig. 14, the communication method provided in the embodiment of the present application may include S1401-S1408:
s1401, the cell-phone establishes first P2P connection with the panel computer.
The specific implementation of S1401 may refer to the related expressions after S801 in the foregoing embodiment, and is not described herein again.
S1402, the mobile phone and the PC establish second P2P connection.
Wherein, the channel of the second P2P connection may be 140 channels. Ch140 is exemplified in fig. 14. The channel of the second P2P connection and the channel of the first P2P connection are same-frequency and different-frequency channels. Here, the second P2P connection may correspond to the first wireless connection in the present application.
Generally, after a communication connection is newly established, the mobile phone will be switched to a new communication connection channel immediately or after the currently processed data is processed, that is, after S1402 executes, the mobile phone will perform channel switching, and after the switching is completed, the PC and the mobile phone both operate at 140. In the case that both the mobile phone and the PC operate in 140 channels, referring to fig. 14, the mobile phone and the PC periodically send heartbeat packets to the opposite terminal and receive corresponding acknowledgement information. Fig. 14 only illustrates an example in which the PC sends a heartbeat packet to the handset.
For specific implementation of establishing the second P2P connection between the mobile phone and the PC, reference may be made to the related expression in S801 in the foregoing embodiment, and details are not described here again.
After the mobile phone establishes the first P2P connection with the tablet computer, if the mobile phone starts to establish the second P2P connection (for example, the mobile phone just sends a second P2P connection request to the PC) with the same frequency and different channels as the first P2P connection, the tablet computer may first determine the time-sharing switching strategy of the two same frequency and different channels, that is, determine the switching period of the two channels. The switching period is used for representing the time for switching other channels. The switching period may be determined by the handset according to a preset rule. The specific implementation of the preset rule may refer to the related expression in S802 in the foregoing embodiment, and details are not described here.
Then, in order to prevent the tablet computer from actively disconnecting the first P2P connection because the tablet computer does not receive the heartbeat packet acknowledgement message when the working channel of the mobile phone is switched to the channel of the second P2P connection, the mobile phone needs to inform the tablet computer of the relevant information of the mobile phone switching channel in time, that is, S1403 is executed.
It should be noted that there is no necessary sequence in S1401 and S1402, and it is determined according to actual requirements whether the mobile phone first establishes the first P2P connection with the tablet PC or the second P2P connection with the PC, and the application is not particularly limited. In the case that the mobile phone establishes the second P2P connection with the PC and then establishes the first P2P connection with the tablet PC, the tablet PC and the PC may be replaced with each other, and the first P2P connection and the second P2P connection may be replaced with each other in the steps of this embodiment.
S1403, after the second P2P connection between the mobile phone and the PC starts, and before the working channel is switched from the first P2P connection channel to the second P2P connection channel, when the mobile phone communicates with the tablet computer through the first P2P connection, third synchronization time information and third time slice information are added to each data packet.
The third synchronization time information is used to synchronize the time of the tablet computer with the time of the mobile phone, and the specific implementation of the third synchronization time information may refer to the related expression of the first synchronization time information in the foregoing embodiment. The third synchronization time information corresponds to the first target synchronization time information in the present application, and the third slot information corresponds to the first target slot information in the present application.
The third time slice information is used for indicating the switching period of each channel in all the same-frequency different channels corresponding to the mobile phone. Specifically, the third time slice information may include a first P2P handover period and a second P2P handover period. The first P2P switching period is used to indicate how long the mobile phone switches back to the first P2P connected channel to switch back to other channels (here, the second P2P connected channel) for work, and the second P2P switching period is used to indicate how long the mobile phone switches back to the first P2P connected channel after switching to the second P2P connected channel. Of course, the first P2P switching period and the second P2P switching period may be changed according to actual situations, for example, if a certain file sent to the mobile phone by the tablet computer is large and cannot be split for sending, the first P2P switching period may be increased.
And S1404, the tablet computer receives the data packet from the mobile phone.
Therefore, after the tablet computer receives the data packet sent by the mobile phone, whether the mobile phone and the tablet computer work in the channel connected with the first P2P can be determined in real time according to the third synchronous time information and the third time slice information carried in the data packet, and if it is determined that the mobile phone and the tablet computer work in the channel connected with the first P2P, the heartbeat packet is continuously and periodically sent to the mobile phone and the heartbeat packet confirmation information from the mobile phone is received. When the mobile phone and the tablet computer are determined not to work in the first P2P connection channel, the heartbeat packet is stopped being sent to the mobile phone until the mobile phone and the tablet computer are determined to work in the first P2P connection channel again. Therefore, under the scene that the mobile phone has the first P2P connection established with the tablet computer and the second P2P connection established with the PC, the tablet computer does not actively disconnect the first P2P connection without receiving the heartbeat packet confirmation information within a certain time, but continuously keeps the first P2P connection.
S1405, when the working channel of the mobile phone is switched from the channel of the first P2P connection to the channel of the second P2P connection, and the mobile phone communicates with the PC through the second P2P connection, adding fourth synchronization time information and fourth time slice information to each data packet; wherein the fourth time slice information comprises third time slice information.
The fourth synchronization time information is used to synchronize the time of the PC and the time of the mobile phone, and the specific implementation of the fourth synchronization time information may refer to the related expression of the first synchronization time information in the foregoing embodiment.
The fourth time slice information is used for indicating the switching period of each channel in all the same-frequency different channels corresponding to the mobile phone. How to determine the specific implementation of the switching period of each channel in all the same-frequency different channels corresponding to the mobile phone may refer to the related expression about the switching period in the foregoing embodiment, which is not described herein again.
S1406, the PC receives the data packet from the mobile phone.
S1407, when the working channel of the mobile phone is switched from the channel of the second P2P connection to the channel of the first P2P connection, the mobile phone adds the third synchronization time information and the third time slice information to each data packet when communicating with the PC through the second P2P connection.
And S1408, the tablet computer receives the data packet from the mobile phone.
Therefore, after receiving the data packet sent by the mobile phone, the PC can determine whether the mobile phone and the PC both work in the channel connected with the second P2P in real time according to the fourth synchronization time information and the fourth time slice information carried in the data packet, and if it is determined that the mobile phone and the PC both work in the channel connected with the second P2P, the PC continues to periodically send the heartbeat packet to the mobile phone and receives the heartbeat packet confirmation information from the mobile phone. And when the mobile phone and the PC are determined not to work in the second P2P connection channel, stopping sending the heartbeat packet to the mobile phone until the mobile phone and the PC are determined to work in the second P2P connection channel again. Therefore, under the scene that the mobile phone has the first P2P connection established with the tablet computer and the second P2P connection established with the PC, the PC does not actively disconnect the second P2P connection without receiving the heartbeat packet confirmation information within a certain time, but continuously keeps the second P2P connection.
In addition, in practice, the time of the mobile phone and the tablet computer, and the time of the mobile phone and the PC may be synchronized only once, so that the mobile phone may always be synchronized, in some embodiments, only need to send the first preset synchronization time information or the third synchronization time information to the tablet computer once, and only need to send the first preset time slice information or the third time slice information subsequently. Similarly, the mobile phone only needs to send the fourth synchronization time information to the tablet computer once, and then only needs to send the fourth time slice information.
It should be further noted that, if at least one GC1 further includes more PCs, after a mobile phone starts establishing a new P2P connection with a new PC that is newly added, and before a working channel of the mobile phone is switched to a channel of the new P2P connection, the mobile phone sends synchronization time information and integrated time slice information to a corresponding old PC through the P2P connection to which the current working channel belongs. The synchronization time information is used to make the time of the old PC the same as the time of the handset.
The integrated time slice information is used to indicate a channel switching sequence and how long the mobile phone switches to each of all P2P connected channels (including the channel of the P2P connection to be established) again (i.e., a switching period of each channel). The switching period of each channel may be determined according to a preset rule, and specific implementation of the preset rule may refer to the description in the foregoing embodiments, which is not described herein again.
The channel switching sequence is used to characterize which channel to switch to when a channel needs to be switched. The channel switching sequence may be specifically determined according to the sequence in which the mobile phone establishes the P2P connection to which the channel belongs. For example, the same-frequency different channels of the mobile phone include an a channel, a B channel and a C channel. If the mobile phone establishes the P2P connection to which the channel a belongs first, then establishes the P2P connection to which the channel B belongs, and finally establishes the P2P connection to which the channel C belongs. The sequence of the subsequent mobile phone switching channels is a channel a-B channel-C channel-a channel. Of course, this is merely an example, and the channel switching order may be determined in any other feasible manner.
Then, when the working channel of the mobile phone is switched to the channel of the new P2P connection, the mobile phone sends the synchronization time information and the integrated time slice information to the new PC. The synchronization time information is used to make the time of the new PC the same as the time of the mobile phone. The integrated time slice information is used to indicate the channel switching sequence and how long the mobile phone switches to each of all the P2P connected channels to switch again (i.e. the switching period of each channel). The channel switching sequence and the integrated time information are updated according to the increase of PCs which establish P2P connections with the mobile phone, that is, each time a P2P connection is newly established by the mobile phone, the integrated time slice information will increase the switching period of the channel of the newly established P2P connection, and the channel switching sequence will also increase the switching sequence of the channel of the newly established P2P connection.
Therefore, all PCs connected with the mobile phone can synchronize with the time of the mobile phone according to the synchronization time information received by the PCs, and can know which channel the mobile phone works on at present by combining the comprehensive time slice information, thereby determining whether the channels are the same as the working channel of the PCs (namely the channel of the P2P connection established between the PCs and the mobile phone). When the mobile phone and the mobile phone are determined to work in the same channel, the heartbeat packet is periodically sent to the mobile phone and the heartbeat packet confirmation information from the mobile phone is received. And when the mobile phone and the mobile phone do not work in the same channel, the heartbeat packet is not sent to the mobile phone until the mobile phone and the mobile phone are determined to work in the same channel again. Furthermore, the method avoids that the PC actively disconnects the corresponding P2P connection because the heartbeat packet confirmation information of the mobile phone is not received within a certain time, and improves the use experience of the user.
Based on the technical solutions of S1401-S1406, when the mobile phone establishes both the first P2P connection with the tablet computer and the second P2P connection with the PC, that is, when the mobile phone is in a same frequency and different channels, the mobile phone will carry synchronization time information (i.e., third synchronization time information) and time slice information (i.e., third time slice information) in each data packet when performing data interaction with the tablet computer except for the heartbeat packet and the heartbeat acknowledgment information. The third synchronous time information is used for enabling the time of the mobile phone to be consistent with that of the tablet computer, and the third time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the mobile phone. Secondly, when the mobile phone performs data interaction with the PC except for the heartbeat packet and the heartbeat acknowledgment information, each data packet carries the synchronization time information (i.e. the fourth synchronization time information) and the time slice information (i.e. the fourth time slice information). The fourth synchronization time information is used for enabling the time of the PC to be consistent with that of the mobile phone, and the fourth time slice information is used for indicating the switching period of each channel in all the same-frequency different channels of the mobile phone. When there is more than one PC, the fourth time slice information may further include a channel switching sequence, and in this case, the fourth time slice information may be referred to as integrated time slice information. Therefore, the tablet personal computer or the PC can accurately know the time when the mobile phone switches the channel, and further can send the heartbeat packet to the mobile phone only when the mobile phone works in the channel corresponding to the P2P connection established by the mobile phone. When the mobile phone works on a channel where a wireless communication connection established with other electronic equipment (such as a PC or a tablet computer) is located, the P2P connection is not actively disconnected. Thus, in a scenario that the mobile phone has both a P2P connection established with the tablet computer and a first wireless communication connection established with the PC, the tablet computer or the mobile phone does not actively disconnect the P2P connection (the first P2P connection or the second P2P connection) but continues to maintain the P2P connection when the tablet computer or the mobile phone does not receive the heartbeat packet acknowledgement information within a certain time. And when the subsequent mobile phone needs to work on the channel connected with the P2P again, the P2P connection does not need to be established again, and the use experience of the user is improved.
In some embodiments, based on the communication system shown in fig. 4 (a), taking the master electronic device as a mobile phone, the slave electronic device as a tablet computer, the AP1 as a first router, and the AP2 as a second router as an example, as shown in fig. 15, the communication method provided in this embodiment of the present application may include S1501 to S1510:
s1501, the mobile phone and the tablet computer establish first P2P connection.
The specific implementation of S1501 can refer to the related expressions after S801 in the foregoing embodiments, and details are not described here.
S1502, the mobile phone establishes a first wireless communication connection with the first router.
For specific implementation of S1502, reference may be made to related descriptions of S802 in the foregoing embodiments, and details are not described here. Here, the first wireless communication connection may correspond to a second wireless connection in the present application, and the first router may correspond to a second additional electronic device in the present application.
After the mobile phone establishes the first P2P connection with the tablet computer, if the first router starts to establish the first wireless communication connection of the same-frequency different channels with the first P2P connection (for example, the mobile phone has just sent the first wireless communication connection request to the first router), the mobile phone may first determine the time-sharing switching policy of the two same-frequency different channels, that is, determine the switching period of the two channels. The switching period is used for representing the time for switching other channels. The switching period may be determined by the handset according to a preset rule. For example, the preset rule may limit a switching period corresponding to each channel when the same-frequency different channels exist in the mobile phone; alternatively, the preset rule may also be a calculation formula for calculating the switching period of a certain channel. This is not specifically limited by the present application.
Then, in order to prevent the tablet computer from actively disconnecting the first P2P connection because the tablet computer does not receive the heartbeat packet acknowledgement message when the working channel of the mobile phone is switched to the channel of the first wireless communication connection, the mobile phone needs to inform the tablet computer of the relevant information of the mobile phone switching channel in time, i.e., S1503 is executed.
S1503, after the first wireless communication connection between the mobile phone and the first router is started, and before the working channel is switched from the first P2P connection channel to the first wireless communication connection channel, when the mobile phone communicates with the tablet computer through the first P2P connection, adding the first synchronization time information and the first time slice information to each data packet.
Wherein the data packet does not include a heartbeat packet and heartbeat packet acknowledgement information.
The specific implementation of the first synchronization time information and the first time slice information may refer to the related expressions in S803 in the foregoing embodiment, and details are not described here. Here, the first synchronization time information may correspond to second target synchronization time information in the present application, and the first slot information may correspond to second target slot information in the present application.
S1504, the tablet computer receives the data packet from the mobile phone.
After the step S1504 is executed, the tablet computer may determine in real time whether the mobile phone and the tablet computer both operate in the first P2P connected channel according to the first synchronization time information and the first time slice information carried in the data packet, and if it is determined that the mobile phone and the tablet computer both operate in the first P2P connected channel, continue to periodically send heartbeat packets to the mobile phone and receive heartbeat packet confirmation information from the mobile phone. When the mobile phone and the tablet computer are determined not to work in the first P2P connection channel, the heartbeat packet is stopped being sent to the mobile phone until the mobile phone and the tablet computer are determined to work in the first P2P connection channel again. Therefore, under the scene that the mobile phone has the first P2P connection established with the tablet computer and the first wireless communication connection established with the first router, the tablet computer does not actively disconnect the first P2P connection due to the fact that the tablet computer cannot receive heartbeat packet confirmation information within a certain time, and the first P2P connection is continuously maintained.
In addition, in the embodiment of the present application, each time the working channel of the subsequent mobile phone is switched to the channel of the first P2P connection, the mobile phone adds the first synchronization time information and the first time slice information to each data packet. And then, the tablet computer receives the data packet from the mobile phone. Not shown in fig. 15.
S1505, the working channel of the mobile phone is switched from the first P2P connection channel to the first wireless communication connection channel.
S1506, the tablet computer establishes a second wireless communication connection with the second router.
Wherein the channel of the second wireless communication connection may be 42 channels. Generally, after a communication connection is newly established by the tablet computer, the tablet computer is switched to a new communication connection channel immediately or after the currently processed data is processed, that is, after the S1302 is executed, the tablet computer performs channel switching, and both the switched tablet computer and the second router operate in 42 channels. The second router may here correspond to a third new electronic device in the present application and the second wireless communication connection may correspond to a third wireless connection in the present application.
The specific implementation of S1506 may refer to the related expression of S1302 in the foregoing embodiment, and is not described herein again.
It should be noted that there is no necessary sequence in S1506 and S1502, and it is determined according to actual requirements whether the mobile phone first establishes the first wireless communication connection with the first router or the tablet computer first establishes the second wireless communication connection with the second router.
If the tablet pc establishes the second wireless communication connection with the second router first, reference may be made to S1302-S1305 in the foregoing embodiment for specific contents of S1502-S1505 after S1501 in this embodiment. In the following step S1505 and the following steps, the second wireless communication connection is replaced by the first wireless communication connection, the tablet pc is replaced by the mobile phone, the second router is replaced by the first router, and the corresponding details (for example, the specific channel may be adaptively changed) are finely adjusted.
After the tablet computer establishes a first P2P connection with the mobile phone, and the mobile phone establishes a first wireless communication connection with the first router first, if the tablet computer and the second router start to establish a second wireless communication connection (for example, the tablet computer just sends a second wireless communication connection request to the second router) with the same frequency and different channels as those of the first P2P connection, the tablet computer is not switched to the channel of the first P2P connection in order to prevent the mobile phone from being switched to the channel of the first P2P connection. Therefore, the tablet computer needs to determine a time-sharing switching strategy of two same-frequency different channels of the tablet computer according to the first synchronization time information and the first time slice information sent to the tablet computer by the mobile phone, that is, to determine a switching period of the two same-frequency different channels of the tablet computer. The switching period is used for representing the time for switching other channels. The switching period may be determined by the tablet according to a preset rule. The specific implementation of the preset rule may refer to the related expressions in the foregoing embodiments, and details are not described here.
Then, in order to prevent the working channel of the tablet computer from being switched to the channel of the second wireless communication connection, the mobile phone is switched to the channel of the first P2P connection, and further the first P2P connection is actively disconnected because the corresponding heartbeat packet acknowledgement information cannot be received, the tablet computer needs to inform the mobile phone of the relevant information of the tablet computer switching channel in time, that is, S1507 to S1509 are executed.
S1507, after the tablet computer starts establishing the second wireless communication connection with the second router, before the working channel of the tablet computer is switched from the first P2P connection channel to the second wireless communication connection channel, the tablet computer determines the first preset duration and the fifth time slice information according to the first synchronization time information and the first time slice information.
The first preset time length is used for indicating how long the working channel of the tablet computer stays on the channel of the second wireless communication connection for the first time and then is switched to other channels. Here, the first preset duration may be equal to a target preset duration in the present application, and the fifth time slice information may be equal to a third target time slice information in the present application.
In a first implementation manner, if the current mobile phone operates on the channel of the first P2P connection, the tablet computer may determine, according to the first synchronization time information and the first time slice information, that the first preset time duration may be the sum of the remaining time of the current mobile phone operating on the channel of the first P2P connection and a first radio channel switching period in the first time slice information. For example, in the first time slice information, the first P2P switching period is 100ms, the first radio channel switching period is 100ms, and it is determined that the mobile phone has operated for 90ms in the first P2P connected channel according to the current time, so that the first preset time duration is 10ms +100ms =110ms. The scenario corresponding scheme of the implementation manner is a technical scheme corresponding to the subsequent S1507A-S1511A.
In a second implementation manner, if the current mobile phone works on the channel of the first wireless communication connection, the tablet computer may determine, according to the first synchronization time information and the first time slice information, that the first preset time duration may be the remaining time of the current mobile phone working on the channel of the first wireless communication connection. For example, the first wireless channel switching period in the first time slice information is 100ms, and it is determined that the mobile phone has already operated for 90ms on the channel of the first wireless communication connection according to the current time, so that the first preset time duration is 10ms. The scenario of the second implementation is illustrated in fig. 15.
Certainly, in practice, the first preset duration may also be determined in any other feasible manner, as long as it is ensured that when the tablet computer switches the working channel subsequently according to the first preset duration and the fifth time slice information, when the tablet computer works on the channel connected to the first P2P, the mobile phone also works on the channel connected to the first P2P, and this application does not specifically limit this.
And the fifth time slice information is used for indicating the switching period of each channel in all the same-frequency and different-channel corresponding to the tablet computer. Specifically, the fifth time slice information may include a first P2P switching period and a second wireless channel switching period. The first P2P switching period is used to instruct the tablet computer how long to switch back to the channel of the first P2P connection for a second time to switch back to another channel (i.e., the channel of the second wireless communication connection) for work, and the second wireless channel switching period is used to instruct the tablet computer how long to switch back to the channel of the first P2P connection for a second time after switching to the channel of the second wireless communication connection. The first P2P switching period in the fifth time slice information is equal to the first P2P switching period in the first time slice information, and the second radio channel switching period is equal to the first radio channel switching period in the first time slice information.
S1508, the working channel of the tablet computer is switched from the channel of the first P2P connection to the channel of the second wireless communication connection, and is switched to the channel of the first P2P connection after a first preset duration.
S1509, when the working channel of the tablet computer is switched to the first P2P connection channel, if it is determined that the working channel of the mobile phone is also the first P2P connection channel according to the first synchronization time information and the first time slice information, adding the fifth synchronization time information and the fifth time slice information to each data packet when communicating with the mobile phone through the first P2P connection.
Wherein the data packet does not include the heartbeat packet and heartbeat packet acknowledgement information.
And the fifth synchronization time information is used for indicating the time synchronization of the mobile phone and the tablet computer. It should be noted that, since the tablet computer has received the first synchronization time information sent by the mobile phone before, and the times of the tablet computer and the mobile phone are synchronized in a consistent manner, the tablet computer may only send the fifth time slice information without sending the fifth synchronization time information to the mobile phone. Here, the fifth synchronization time information may correspond to the third target synchronization time information in the present application.
S1510, the mobile phone receives the data packet from the tablet computer.
Then, the working channels of the mobile phone and the tablet computer can be simultaneously switched to the channel connected with the first P2P, and the mobile phone and the tablet computer can also know the time when the opposite side does not work in the channel connected with the first P2P, so that the mobile phone and the tablet computer can periodically send heartbeat packets to the opposite side and receive heartbeat packet confirmation information of the opposite side only when the mobile phone and the tablet computer work together in the channel connected with the first P2P. Otherwise, the heartbeat packet is not sent any more, and the first P2P connection is maintained.
It should be noted that, in order to ensure compatibility or consistency, in the case that only the first P2P connection between the mobile phone and the tablet computer is established, the mobile phone or the tablet computer may carry first preset synchronization time information (or second preset synchronization time) and first preset time slice information (or first preset synchronization time slice information) in a data packet sent to the opposite end through the first P2P connection. The first preset time slice information may be null or include information indicating that the mobile phone will always operate on the channel of the first P2P connection. The first preset synchronization time information and the first synchronization time information may have the same role.
In addition, in practice, the time of the mobile phone and the tablet computer may need to be synchronized only once, and thus the mobile phone may always be synchronized, so in some embodiments, the mobile phone only needs to send the first preset synchronization time information or the first synchronization time information to the tablet computer once, and only needs to send the first preset time slice information, the first time slice information, and the fifth time slice information subsequently.
Based on the technical scheme of S1501-S1509, when the mobile phone establishes both the first P2P connection with the tablet computer and the first wireless communication connection with the first router and the second wireless communication connection with the second router, that is, when the mobile phone and the tablet computer are both in the same frequency and different channels, the mobile phone and the tablet computer can inform each other of the corresponding synchronization time information (the first synchronization time information or the fifth synchronization time information) and the time slice information (the first time slice information or the fifth time slice information) in time. The synchronization time information is used to synchronize the time of both. The time slice information is used for informing the opposite terminal of the period of switching the channel. Meanwhile, the fifth time slice information is obtained according to the first time slice information and the first synchronization time information, so that the mobile phone and the tablet computer can be switched to a P2P connection channel in the same time period, and communication between the mobile phone and the tablet computer is ensured. Therefore, the tablet computer or the mobile phone can accurately know the time when the opposite terminal switches the channel, and then can send the heartbeat packet to the opposite terminal and receive corresponding heartbeat packet confirmation information only when the opposite terminal and the mobile phone work in the channel corresponding to the P2P connection. When the peer end works on a channel where a wireless communication connection established with other electronic equipment (such as a first router or a second router) is located, the P2P connection is not actively disconnected. Therefore, under the condition that the mobile phone and the tablet computer are both in the same-frequency different channels, the mobile phone and the tablet computer do not actively disconnect the P2P connection because the heartbeat packet confirmation information of the opposite end is not received within a certain time, but keep the P2P connection. And then when the subsequent needs to work on the channel connected with the P2P again, the P2P connection is established again, so that the use experience of the user is improved.
In another possible implementation manner, if the working channel of the mobile phone is a channel of the P2P connection when the tablet starts to establish the second wireless communication connection with the second router, S1507-S1510 may be replaced with S1507A-S1511A:
S1507A, after the tablet computer starts establishing the second wireless communication connection with the second router, and before the working channel of the tablet computer is switched from the P2P connection channel to the second wireless communication connection channel, if the tablet computer determines that the working channel of the mobile phone is the P2P connection channel according to the first synchronization time information and the first time slice information, the tablet computer determines the first preset time duration and the fifth time slice information according to the first synchronization time information and the first time slice information, and when communicating with the mobile phone through the P2P connection, adds the fifth synchronization time information, the first preset time duration, and the fifth time slice information to each data packet.
S1508A, the mobile phone receives the data packet from the tablet computer.
S1509A, the working channel of the tablet computer is switched from the channel connected with the P2P to the channel connected with the second wireless communication, and the working channel of the tablet computer is switched to the channel connected with the P2P after working on the channel connected with the second wireless communication for a first preset time.
S1510A, when the working channel of the tablet computer is switched to the P2P connection channel and the tablet computer communicates with the mobile phone through the P2P connection, adding fifth synchronization time information and fifth time slice information to each data packet.
S1511A, the mobile phone receives the data packet from the tablet computer.
The effects of the solutions corresponding to S1507A to S1511A are the same as those of the solutions corresponding to S1501 to S1510, and are not described herein again. The difference is that in the technical scheme corresponding to S1507A-S1511A, when the tablet pc is switched to the channel of the second wireless communication connection for the first time to operate, the mobile phone can accurately determine the time when the tablet pc switches back to the P2P connection according to the fifth synchronization time information, the first preset time and the fifth time slice information, and during the time, when the mobile phone operates in the channel of the P2P connection, the mobile phone does not actively disconnect the P2P connection because the heartbeat packet acknowledgement information from the tablet pc is not received, thereby ensuring the user experience.
In some embodiments, based on the communication system shown in fig. 4 (b), where the master electronic device is a mobile phone, the slave electronic device is a tablet computer, the AP1 is a first router, and the at least one GC1 includes a PC as an example, referring to fig. 16, the communication method provided in this embodiment of the present application may include S1601 to S1611:
S1601, the mobile phone and the tablet computer establish a first P2P connection.
The channel of the first P2P connection may be 149 channels, and at this time, both the mobile phone and the tablet computer operate in the 149 channels. In fig. 16, ch149 is taken as an example. Referring to fig. 14, after the mobile phone establishes the first P2P connection with the tablet computer, the mobile phone and the tablet computer periodically send heartbeat packets to the opposite terminal and receive corresponding acknowledgement information. Fig. 14 only illustrates that the tablet computer sends the heartbeat packet to the mobile phone and receives the heartbeat packet confirmation information returned by the mobile phone, which is not limited to a specific implementation.
For details, how to establish the first P2P connection may refer to the related description in S801, and details are not described herein.
S1602, the mobile phone establishes a first wireless communication connection with the first router.
Wherein, the channel of the first wireless communication connection may be 153 channel. Ch153 is exemplified in fig. 16. Generally, after a communication connection is newly established, a mobile phone will be switched to a new communication connection channel immediately or after processing currently processed data, that is, after S802 executes, the mobile phone will perform channel switching, and both the mobile phone and the first router operate in 153 channels after switching.
Specifically, for a specific implementation of establishing the first wireless communication connection between the mobile phone and the first router, reference may be made to relevant expressions in S802 in the foregoing embodiment, and details are not described here again.
After the P2P connection is established between the mobile phone and the tablet computer, if the first router starts to establish a first wireless communication connection (for example, the mobile phone just sends a first wireless communication connection request to the first router) with the same frequency and different channels as the P2P connection, the mobile phone may first determine a time-sharing switching policy for the two same frequency and different channels, that is, determine a switching period for the two channels. The switching period is used for representing the time for switching other channels. The switching period may be determined by the handset according to a preset rule. For example, the preset rule may limit a switching period corresponding to each channel when the mobile phone has the same-frequency different channels; alternatively, the preset rule may also be a calculation formula for calculating the switching period of a certain channel. This is not particularly limited by the present application.
Then, in order to prevent the tablet computer from actively disconnecting the P2P connection because the tablet computer does not receive the heartbeat packet confirmation message when the working channel of the mobile phone is switched to the channel of the first wireless communication connection, the mobile phone needs to inform the tablet computer of the relevant information of the mobile phone switching channel in time, that is, step S1603 is executed.
S1603, after the first wireless communication connection between the mobile phone and the first router is started, and before the working channel of the mobile phone is switched from the first P2P connection channel to the first wireless communication connection channel, when the mobile phone communicates with the tablet computer through the first P2P connection, adding the first synchronization time information and the first time slice information to each data packet.
Wherein the data packet does not include a heartbeat packet and heartbeat packet acknowledgement information.
The specific implementation of the first synchronization time information and the first time slice information may refer to the related expression in S803 in the foregoing embodiment, and details are not repeated here. Here, the first synchronization time information may correspond to first target synchronization time information in the present application, and the first slot information may correspond to first target slot information in the present application.
And S1604, the tablet personal computer receives the data packet from the mobile phone.
After the step S1604 is executed, the tablet computer may determine, in real time, whether the mobile phone and the tablet computer both work in the first P2P connected channel according to the first synchronization time information and the first time slice information carried in the data packet, and if it is determined that the mobile phone and the tablet computer both work in the first P2P connected channel, continue to periodically send the heartbeat packet to the mobile phone and receive the heartbeat packet confirmation information from the mobile phone. When the mobile phone and the tablet computer are determined not to work in the first P2P connection channel, the heartbeat packet is stopped being sent to the mobile phone until the mobile phone and the tablet computer are determined to work in the P2P connection channel again. Therefore, under the scene that the mobile phone has the first P2P connection established with the tablet computer and the first wireless communication connection established with the first router, the tablet computer does not actively disconnect the first P2P connection due to the fact that the tablet computer cannot receive heartbeat packet confirmation information within a certain time, and the first P2P connection is continuously maintained.
S1605, the working channel of the mobile phone is switched from the channel of the first P2P connection to the channel of the first wireless communication connection.
S1606, the mobile phone and the PC establish a second P2P connection.
Wherein, the channel of the second P2P connection may be 140 channels. In fig. 16, ch140 is taken as an example.
Generally, after a communication connection is newly established, the mobile phone will be switched to a new communication connection channel immediately or after processing the currently processed data, that is, after S1606 executes, the mobile phone will switch channels, and after switching, the PC and the mobile phone both work at 140. In the case that both the mobile phone and the PC operate in 140 channels, referring to fig. 14, the mobile phone and the PC periodically send heartbeat packets to the opposite terminal and receive corresponding acknowledgement information.
For specific implementation of establishing the second P2P connection between the mobile phone and the PC, reference may be made to the related expression in S801 in the foregoing embodiment, and details are not described here again.
After the first P2P connection is established between the mobile phone and the tablet computer, and the first wireless communication connection is established between the mobile phone and the first router, if the mobile phone and the PC start to establish the second P2P connection (for example, the mobile phone just sends a second P2P connection request to the PC), the tablet computer may first determine the time-sharing switching policy of the three channels with the same frequency and different channels, that is, determine the switching period of the three channels. The switching period is used for representing the time for switching other channels. The conversion period may be determined by the mobile phone according to a preset rule. The specific implementation of the preset rule may refer to the related expression in S802 in the foregoing embodiment, and details are not described here.
Then, in order to prevent the working channel of the mobile phone from being switched to the channel of the second P2P connection, the tablet computer actively disconnects the first P2P connection because the tablet computer does not receive the corresponding heartbeat packet confirmation information; secondly, in order to prevent the PC from actively disconnecting the second P2P connection because the PC does not receive the corresponding heartbeat packet acknowledgement message when the working channel of the mobile phone is switched to the channel of the first P2P connection, the mobile phone needs to inform the tablet computer of the relevant information of the mobile phone switching channel in time, i.e., execute S1607-S1611.
It should be noted that there is no necessary sequence in S1606 and S1601, and it is determined according to an actual requirement whether the mobile phone first establishes the first P2P connection with the tablet PC or the second P2P connection with the PC, and the present application is not particularly limited. In the case that the mobile phone establishes the second P2P connection with the PC and then establishes the first P2P connection with the tablet PC, the tablet PC and the PC may be replaced with each other, and the first P2P connection and the second P2P connection may be replaced with each other in the step of this embodiment.
S1607, after the mobile phone starts to establish the second P2P connection with the PC, the mobile phone determines the sixth time slice information according to the first synchronization time and the first time slice information before the working channel of the mobile phone is switched from the channel of the first wireless communication connection to the channel of the second P2P connection.
And the sixth time slice information is used for indicating the switching sequence and the switching period of each channel in all the same-frequency different channels corresponding to the mobile phone. Specifically, the sixth time slice information may include a channel switching sequence, a first P2P switching period, a second P2P switching period, and a first wireless channel switching period. The channel switching sequence is used for representing the channel to which the mobile phone is switched when the mobile phone needs to switch the channel, namely, the switching sequence of switching each channel in the same-frequency different channels by the mobile phone is specifically indicated. The specific implementation of the method can refer to the related expression after S1407, which is not described in detail here. The first P2P switching cycle is used to instruct the mobile phone to switch back to the first P2P connected channel for a long time to switch to other channels for work again, the second P2P switching cycle is used to instruct the mobile phone to switch to other channels after switching to the second P2P channel for a long time, and the first wireless channel switching cycle is used to instruct the mobile phone to switch to other channels after switching to the first wireless communication connected channel for a long time. The first P2P switching period in the sixth time slice information is equal to the P2P switching period in the first time slice information, and the first radio channel switching period is equal to the first radio channel switching period in the first time slice information. The second P2P switching period is determined by the mobile phone according to a preset rule, and the specific implementation of the preset rule can refer to the related expressions in the foregoing embodiments.
Here, the sixth time slice information may correspond to the sixth target time slice information in the present application.
S1608, when the working channel of the mobile phone is switched to the channel of the second P2P connection, the mobile phone adds sixth synchronization time information and sixth time slice information to each data packet when communicating with the PC through the second P2P connection.
Wherein the data packet does not include the heartbeat packet and heartbeat packet acknowledgement information. The sixth synchronization time information is used to indicate time synchronization between the PC and the mobile phone, and specific implementation thereof may refer to related expression of the first synchronization time information in the foregoing embodiment, which is not described herein again. Here, the sixth synchronization time information may correspond to the sixth target synchronization time information in the present application.
It should be noted that, since the tablet computer has received the first synchronization time information sent by the mobile phone before, and the times of the tablet computer and the mobile phone are synchronized in a consistent manner, the tablet computer may only send the sixth time slice information without sending the sixth synchronization time information to the mobile phone.
S1609, the PC receives the data packet from the mobile phone.
And then, after receiving the data packet sent by the mobile phone, the PC can determine whether the mobile phone and the PC both work in a channel connected with the second P2P in real time according to the sixth synchronization time information and the sixth time slice information carried in the data packet, and if it is determined that the mobile phone and the PC both work in the channel connected with the second P2P, the PC continues to periodically send heartbeat packets to the mobile phone and receives heartbeat packet confirmation information from the mobile phone. And when the mobile phone and the PC are determined not to work in the second P2P connection channel, stopping sending the heartbeat packet to the mobile phone until the mobile phone and the PC are determined to work in the second P2P connection channel again. Therefore, under the scene that the mobile phone has the first P2P connection established with the tablet computer and the second P2P connection established with the PC, the PC does not actively disconnect the second P2P connection without receiving the heartbeat packet confirmation information within a certain time, but continuously keeps the second P2P connection.
S1610, when the working channel of the mobile phone is switched to the channel of the first P2P connection, and the mobile phone communicates with the tablet computer through the first P2P connection, adding seventh synchronization time information and seventh time slice information to each data packet; the seventh time slice information includes sixth time slice information.
And the seventh synchronization time information is used for indicating that the time of the tablet personal computer is synchronous with the mobile phone. It should be noted that, since the tablet computer has received the first synchronization time information sent by the mobile phone before, and the times of the two are synchronized in a consistent manner, the tablet computer may only send the seventh time slice information without sending the seventh synchronization time information to the mobile phone. Here, the seventh synchronous time information may correspond to seventh target synchronous time information in the present application, and the seventh time slice information may correspond to seventh target time slice information in the present application.
S1611, the tablet personal computer receives the data packet from the mobile phone.
And then, the tablet computer can determine whether the mobile phone and the tablet computer work in a channel connected with the first P2P in real time according to the seventh synchronous time information and the seventh time slice information carried in the data packet, and if it is determined that the mobile phone and the tablet computer work in the channel connected with the first P2P, the heartbeat packet is continuously and periodically sent to the mobile phone and the heartbeat packet confirmation information from the mobile phone is received. When the mobile phone and the tablet computer are determined not to work in the first P2P connection channel, the heartbeat packet is stopped being sent to the mobile phone until the mobile phone and the tablet computer are determined to work in the P2P connection channel again. Therefore, under the scene that the mobile phone has the first P2P connection established with the tablet computer, the first wireless communication connection established with the first router and the second P2P connection established with the PC, the tablet computer does not actively disconnect the first P2P connection within a certain time without receiving heartbeat packet confirmation information, but continuously keeps the first P2P connection.
In this embodiment, the foregoing S1606 and S1602 do not have a necessary sequence, and it is determined whether the mobile phone first establishes the first wireless communication connection with the first router or the mobile phone first establishes the second P2P connection with the PC according to actual requirements.
If the mobile phone establishes the second P2P connection with the PC first, i.e. S1606 is prior to S1606, the specific contents of S1602 to S1605 after S1601 in this embodiment may refer to S1402 to S1406 in the foregoing embodiment. The content of S16006 may be replaced with the content of S1602, and the subsequent S1607-S1611 may be S1607A-S1611A:
S1607A, after the mobile phone starts establishing the first wireless communication connection with the first router, before the working channel of the mobile phone is switched from the second P2P connection channel to the first wireless communication connection channel, and when the mobile phone communicates with the PC through the second P2P connection, the sixth synchronization time information and the sixth time slice information are added to each data packet.
S1608A, the PC receives the data packet from the mobile phone.
S1609A, the working channel of the mobile phone is switched to the first wireless communication connection.
S1610A, when a working channel of the mobile phone is switched to a channel of the first P2P connection and communication is performed with the tablet computer through the first P2P connection, adding seventh synchronization time information and seventh time slice information to each data packet; the seventh time slice information includes sixth time slice information.
S1611A, the tablet personal computer receives a data packet from the mobile phone.
The effect of the technical solution corresponding to S1607A-a1611A is the same as the effect of the technical solution corresponding to S1607-S1611, and is not described herein again.
It should be noted that, in order to ensure compatibility or consistency, when the mobile phone only establishes the first P2P connection with the tablet computer, the mobile phone may carry the first preset synchronization time information and the first preset time slice information in the data packet sent to the mobile phone through the first P2P connection. The first preset time slice information may be null or include information indicating that the mobile phone will always operate on the channel of the first P2P connection. The first preset synchronization time information and the third synchronization time information may have the same role.
In addition, in practice, the time of the mobile phone and the tablet computer, and the time of the mobile phone and the PC may be synchronized only once, so that in some embodiments, the mobile phone only needs to send the first preset synchronization time information or the first synchronization time information to the tablet computer once, and then only needs to send the first preset time slice information, the first time slice information, and the seventh time slice information. Similarly, the mobile phone only needs to send the sixth synchronization time information to the PC once, and then only needs to send the seventh time slice information.
It should be further noted that, if at least one GC1 further includes more PCs, after a new P2P connection is established between a mobile phone and a new PC in a group in which a newly added mobile phone is used as a GO each time, before a working channel of the mobile phone is switched to a channel of the new P2P connection, if the working channel is a channel of an old P2P connection, the synchronization time information and the integrated time slice information are sent to the corresponding old PC or tablet computer through the P2P connection to which the current working channel belongs. The synchronization time information is used to indicate that the time of the old PC or tablet is the same as the time of the mobile phone. If the working channel is not the channel of the old P2P connection, the mobile phone will send the synchronization time information and the integrated time slice information to the corresponding old PC or tablet computer through the P2P connection to which the current working channel belongs when the working channel is switched to the channel of the old P2P connection. The integrated time slice information may be obtained from the synchronized time information and time slice information sent by the mobile phone to the PC that joined the group a previous time before the new PC joined the group. Specifically, the switching period of the P2P connected channel corresponding to the new PC may be added to the time slice information, and the number of times of the new channel is added to the channel switching sequence, so as to obtain the integrated time slice information.
The integrated time slice information is used to indicate a channel switching sequence and how long the mobile phone switches to each of all P2P connected channels (including the channel of the P2P connection to be established) again (i.e., a switching period of each channel). The switching period of each channel may be determined according to a preset rule, and specific implementation of the preset rule may refer to the description in the foregoing embodiments, which is not described herein again. The detailed implementation of the channel switching sequence can refer to the description in the foregoing embodiments, and is not described herein again.
Then, when the working channel of the mobile phone is switched to the channel of the new P2P connection, the mobile phone sends the synchronization time information and the integrated time slice information to the new PC. The channel switching sequence and the integrated time information are updated according to the increase of PCs which establish P2P connections with the mobile phone, that is, each time a P2P connection is newly established by the mobile phone, the integrated time slice information will increase the switching period of the channel of the newly established P2P connection, and the channel switching sequence will also increase the switching sequence of the channel of the newly established P2P connection.
Therefore, the tablet personal computer and all the PCs connected with the mobile phone can synchronize with the time of the mobile phone according to the synchronization time information received by the tablet personal computer and all the PCs, and can know which channel the mobile phone works on at present by combining the comprehensive time slice information, so as to determine whether the channel is the same as the working channel of the tablet personal computer (namely, the channel for establishing the P2P connection between the PC and the mobile phone). When the mobile phone and the mobile phone are determined to work in the same channel, the heartbeat packet is periodically sent to the mobile phone and the heartbeat packet confirmation information from the mobile phone is received. And when the mobile phone and the mobile phone do not work in the same channel, the heartbeat packet is not sent to the mobile phone until the mobile phone and the mobile phone work in the same channel is determined again. Furthermore, the situation that the tablet personal computer and the PC actively disconnect the corresponding P2P connection because the heartbeat packet confirmation information of the mobile phone is not received within a certain time is avoided, and the use experience of a user is improved.
Based on the technical scheme of S1601-S1611, when the mobile phone establishes a first P2P connection with the tablet computer, a first wireless communication connection with the first router, and a second P2P connection with the PC, that is, when the mobile phone has a same frequency and different channels, the mobile phone timely informs all peer-to-peer synchronization time information (first synchronization time information, sixth synchronization time information, or seventh synchronization time information) and time slice information (first time slice information, sixth time slice information, or seventh time slice information) corresponding to the P2P connections. The synchronous time information is used for enabling the time synchronization of the three devices to be consistent. The time slice information is used for informing the opposite terminal of the period of switching the channel. Therefore, the tablet personal computer or the PC can accurately know the time when the mobile phone switches the channel, and further can send the heartbeat packet to the mobile phone and receive the corresponding heartbeat packet confirmation information only when the mobile phone and the PC work in the channel corresponding to the P2P connection. The P2P connection is not actively disconnected while the handset is operating on a channel on which a wireless communication connection is established with another electronic device (e.g., a first router). Therefore, under the condition that the mobile phone is in a same-frequency different-channel state, the tablet personal computer and the PC do not actively disconnect the P2P connection because the heartbeat packet confirmation information of the opposite terminal is not received within a certain time, but keep the P2P connection. And then when the subsequent needs to work on the channel of the corresponding P2P connection again, the corresponding P2P connection is established again, so that the use experience of the user is improved.
In some embodiments, based on the communication system shown in fig. 4 (c), taking the master electronic device as a mobile phone, the slave electronic device as a tablet computer, the AP2 as a second router, and the at least one GC1 including a PC as an example, as shown in fig. 17, the communication method provided in this embodiment of the present application may include S1701-S1711:
s1701, the mobile phone establishes a first P2P connection with the tablet computer.
The specific implementation of S1701 may refer to the related expressions after S801 in the foregoing embodiment, and details are not described here.
S1702, the mobile phone and the PC establish a second P2P connection.
The specific implementation of S1702 may refer to the related expression of S1402 in the foregoing embodiment, and is not described herein again.
After the mobile phone establishes the first P2P connection with the tablet computer, if the mobile phone starts to establish the second P2P connection (for example, the mobile phone just sends a second P2P connection request to the PC) with the same frequency and different channels as the first P2P connection, the tablet computer may first determine the time-sharing switching strategy of the two same frequency and different channels, that is, determine the switching period of the two channels. The switching period is used for representing the time for switching other channels. The switching period may be determined by the handset according to a preset rule. The specific implementation of the preset rule may refer to the related expression in S802 in the foregoing embodiment, and details are not described here. Here, the second P2P connection may correspond to a second wireless connection in the present application.
Then, in order to prevent the tablet computer from actively disconnecting the first P2P connection because the tablet computer does not receive the corresponding heartbeat packet acknowledgement information when the working channel of the mobile phone is switched to the channel of the second P2P connection, the mobile phone needs to inform the tablet computer of the relevant information of the mobile phone switching channel in time, that is, S1703 is executed.
It should be noted that there is no necessary sequence in the above S1701 and S1702, and it is determined according to the actual requirement whether the mobile phone first establishes the first P2P connection with the tablet PC or the second P2P connection with the PC, and the application is not particularly limited. In the case that the mobile phone establishes the second P2P connection with the PC and then establishes the first P2P connection with the tablet PC, the tablet PC and the PC may be replaced with each other, and the first P2P connection and the second P2P connection may be replaced with each other in the steps of this embodiment.
And S1703, after the second P2P connection between the mobile phone and the PC is started, before the working channel of the mobile phone is switched from the first P2P connection channel to the second P2P connection channel, and when the mobile phone communicates with the tablet computer through the first P2P connection, third synchronization time information and third time slice information are added to each data packet.
For specific implementation of S1703, reference may be made to related expressions of S1403 in the foregoing embodiment, and details are not described here again. Here, the third synchronization time information may correspond to the second target synchronization time information in the present application, and the third synchronization time slice information may correspond to the second target synchronization time information in the present application.
S1704, the tablet computer receives a data packet from the mobile phone.
The effects of S1702-S1704 can refer to the related expressions after S1404 in the foregoing embodiments, and are not described herein again.
In addition, in the embodiment of the present application, each time the working channel of the subsequent mobile phone is switched to the channel of the first P2P connection, the mobile phone adds the third synchronization time information and the third time slice information to each data packet. And then, the tablet computer receives the data packet from the mobile phone. Not shown in fig. 17.
S1705, under the condition that the working channel of the mobile phone is switched from the channel connected with the first P2P to the channel connected with the second P2P, when the mobile phone communicates with the PC through the second P2P connection, fourth synchronous time information and fourth time slice information are added in each data packet; wherein the fourth time slice information comprises the third time slice information.
The specific implementation of S1705 may refer to the related description after S1405 in the foregoing embodiment, and is not described herein again.
S1706, the PC receives the data packet from the mobile phone.
The corresponding effects of the technical solutions corresponding to S1705 and S1706 may refer to the related expressions after S1408 in the foregoing embodiment, and are not described herein again.
S1707, the tablet computer and the second router establish second wireless communication connection.
The specific implementation of S1707 may refer to the specific description of S1302 in the foregoing embodiment, and is not described herein again. The second wireless communication connection here corresponds to the third wireless connection in the present application.
After the mobile phone first establishes the first P2P connection and the second P2P connection with the tablet PC and the PC in sequence, if the tablet PC starts to establish the second wireless communication connection with the second router (for example, the tablet PC has just sent the second wireless communication connection request to the second router), the tablet PC is not switched to the channel of the first P2P connection in order to prevent the mobile phone from being switched to the channel of the first P2P connection. Therefore, the tablet computer needs to determine a time-sharing switching strategy of the two same-frequency different channels of the tablet computer according to the third synchronous time information and the third time slice information sent by the mobile phone to the tablet computer, that is, to determine an appropriate switching cycle of the two same-frequency different channels of the tablet computer, so that the tablet computer and the mobile phone can be switched to the first P2P connected channel within the same time period. The determination of the switching period may refer to the related descriptions in the foregoing embodiments, and details are not repeated here.
Then, in order to prevent the problem that the mobile phone switches to the first P2P connection channel when the working channel of the tablet computer is switched to the second wireless communication connection channel, and further the first P2P connection is actively disconnected because the corresponding heartbeat packet acknowledgement information cannot be received, the tablet computer needs to inform the mobile phone of the relevant information of the tablet computer switching channel in time, that is, S1708-S1712 are executed.
S1708, after the tablet computer starts to establish the second wireless communication connection with the second router, before the working channel of the tablet computer is switched from the first P2P connected channel to the second wireless communication connected channel, the tablet computer determines a second preset duration and eighth time slice information according to the third synchronization time information and the third time slice information.
And the second preset time length is used for indicating that the working channel of the tablet computer is switched to the channel of the second wireless communication connection for the first time, stays for a long time and then is switched to other channels. Here, the second preset duration may be equal to a target preset duration in the present application, and the eighth time slice information may be equal to a third target time slice information in the present application.
In a first realizable manner, if the current mobile phone operates on the channel of the first P2P connection, the tablet computer may determine, according to the third synchronization time information and the third time slice information, that the second preset time duration may be a sum of a remaining time of the current mobile phone operating on the channel of the first P2P connection and a second P2P switching period in the third time slice information. For example, in the third time slice information, the first P2P switching period is 100ms, the second P2P switching period is 100ms, and it is determined that the mobile phone has operated for 90ms in the first P2P connected channel according to the current time, and then the second preset time duration is 10ms +100ms =110ms. The scenario corresponding to this implementation is the following technical solution corresponding to S1708A-S1711A.
In a second implementable manner, if the current mobile phone works on the channel of the second P2P connection, the tablet computer may determine, according to the first synchronization time information and the first time slice information, that the second preset time duration may be the remaining time of the current mobile phone working on the channel of the second P2P connection. For example, the second P2P switching period in the third time slice information is 100ms, and it is determined that the mobile phone has already operated for 90ms on the channel connected to the second P2P according to the current time, and then the second preset time duration is 10ms. The scenario of the second implementation is illustrated in fig. 15.
Certainly, in practice, the second preset duration may also be determined in any other feasible manner, as long as it is ensured that when the tablet computer subsequently switches the working channel according to the second preset duration and the eighth time slice information, and when the tablet computer works on the channel connected to the first P2P, the mobile phone also works on the channel connected to the first P2P, which is not specifically limited by the application.
And the eighth time slice information is used for indicating the switching period of each channel in all the same-frequency and different-channel corresponding to the tablet computer. Specifically, the eighth time slice information may include a first P2P switching period and a second wireless channel switching period. The first P2P switching period is used to instruct the mobile phone to switch back to the first P2P connected channel for a long time to switch back to other channels (here, channels of the second wireless communication connection) for work, and the second P2P switching period is used to instruct the tablet computer to switch back to the first P2P connected channel for a long time after switching to the second wireless communication connected channel. The first P2P switching period in the eighth time slice information is equal to the first P2P switching period in the third time slice information, and the second radio channel switching period is equal to the second P2P switching period in the third time slice information.
S1709, the working channel of the tablet computer is switched from the first P2P connection channel to the second wireless communication connection channel, and is switched to the first P2P connection channel after a second preset duration.
S1710, when the working channel of the tablet computer is switched to the channel of the first P2P connection, if it is determined that the working channel of the mobile phone is also the channel of the first P2P connection according to the third synchronization time information and the third time slice information, when communicating with the mobile phone through the first P2P connection, adding eighth synchronization time information and eighth time slice information to each data packet.
Wherein the data packet does not include the heartbeat packet and heartbeat packet acknowledgement information. The eighth synchronization time information here may correspond to the third target synchronization time information in the present application.
And the eighth synchronous time information is used for indicating the time synchronization of the mobile phone and the tablet computer. It should be noted that, since the tablet computer has received the third synchronization time information sent by the mobile phone before, and the times of the two are synchronized in a consistent manner, the tablet computer may only send the eighth time slice information without sending the eighth synchronization time information to the mobile phone.
And S1711, the mobile phone receives the data packet from the tablet computer.
Then, the working channels of the mobile phone and the tablet computer can be simultaneously switched to the channel connected with the first P2P, and the mobile phone and the tablet computer can also know the time when the opposite side does not work in the channel connected with the first P2P, so that the mobile phone and the tablet computer can periodically send heartbeat packets to the opposite side and receive heartbeat packet confirmation information of the opposite side only when the mobile phone and the tablet computer work together in the channel connected with the first P2P. Otherwise, the heartbeat packet is not sent any more, and the P2P connection is maintained.
It should be noted that, in order to ensure compatibility or consistency, in the case that only the first P2P connection between the mobile phone and the tablet pc is established, the first preset synchronization time information and the first preset time slice information may be carried in both data packets sent by the mobile phone or the tablet pc to the opposite end through the P2P connection. The first preset time slice information may be null or include information indicating that the mobile phone will always operate on a channel of the P2P connection. The first preset synchronization time information and the first synchronization time information may have the same role.
In addition, in practice, the time of the mobile phone and the tablet computer may be synchronized only once, so that in some embodiments, the mobile phone only needs to send the first preset synchronization time information or the first synchronization time information to the tablet computer once, and then only needs to send the first preset time slice information, the third time slice information, and the eighth time slice information.
It should be further noted that, if at least one GC1 further includes more PCs, after a new P2P connection is established between a mobile phone and a new PC in a group in which a newly added mobile phone is used as a GO, and before a working channel of the mobile phone is switched to a channel of the new P2P connection, synchronization time information and integrated time slice information are sent to a corresponding old PC through a P2P connection to which a current working channel belongs. The synchronization time information is used to make the time of the old PC the same as the time of the handset. The integrated time slice information may refer to the associated expressions in the previous embodiment. The mobile phone will send the synchronized time information and the integrated time slice information to the old PC or tablet computer only when switching to the channel of the old P2P connection. Meanwhile, the switching period of the second wireless communication connection channel in the same-frequency different channels of the tablet computer is increased, and the new switching period may be the sum of the old switching period and the switching period of the P2P connection channel corresponding to the new PC. Therefore, when the working channel of the tablet computer is switched to the channel of the second wireless communication connection, the working channel of the mobile phone is also switched to the P2P channel except the first P2P channel. Of course, when the working channel of the mobile phone is switched to the channel of the new P2P connection, the mobile phone will also send the synchronization time information and the integrated time slice information to the new PC.
The effect of the above possible solution in which at least one GC1 includes more PCs can be expressed by referring to the related contents in the foregoing embodiments, and will not be described herein again. The difference is that in the feasible scheme including more PCs in this embodiment, the tablet computer and the mobile phone may also be switched to the channel of the first P2P connection to work in the same time period, and in the rest time periods, the tablet computer and the mobile phone do not send the heartbeat packet to the opposite terminal and do not actively disconnect the first P2P connection, so that the use experience of the user is improved.
In this embodiment, the foregoing S1707 and S1702 do not have a certain order, and specifically, it is determined according to actual requirements whether the tablet PC establishes the second wireless communication connection with the second router first or the mobile phone establishes the second P2P connection with the PC first, and this application is not limited specifically. If the tablet computer establishes the second wireless communication connection with the second wireless router first, that is, S1707 is first, the specific contents of S1702-S1706 after S1701 in this embodiment may refer to S1302-S1305 in the foregoing embodiment, and replace the P2P connection therein with the first P2P connection, and replace the content of S1707 in this embodiment with the content of S1702. Subsequent S1708-S1711 may adjust on this basis, so that the switching cycle of the second P2P connection channel in the same-frequency different channels of the mobile phone is the same as the switching cycle of the second wireless communication connection channel in the same-frequency different channels of the tablet computer, the switching cycle of the first P2P connection channel of the mobile phone and the tablet computer is the same, and the mobile phone and the tablet computer may switch to the first P2P connection channel in the same time period. The technical effect of this technical solution is the same as the technical effect of S1708-S1711, and is not described herein again.
Based on the technical scheme of S1701-S1711, when the mobile phone establishes both the first P2P connection with the tablet computer and the second P2P connection with the PC, and the tablet computer also establishes the second wireless communication connection with the second router, that is, when the mobile phone and the tablet computer are both in the same frequency and different channels, the mobile phone timely informs all opposite terminals of the P2P connection of the corresponding synchronization time information (the third synchronization time information or the fourth synchronization time information) and the time slice information (the third time slice information or the fourth time slice information). The synchronous time information is used for enabling the time synchronization of the three devices to be consistent. The time slice information is used to inform the opposite end of the period of switching channels. In addition, the tablet pc timely informs the mobile phone of corresponding synchronization time information (eighth synchronization time information) and time slice information (eighth time slice information). Because the eighth time information is based on the third time slice information and the third synchronization time information, the mobile phone and the tablet computer can be switched to the first P2P connection channel in the same time period, so that the communication between the mobile phone and the tablet computer is ensured, and when the mobile phone and the tablet computer do not work in the first P2P connection channel at the same time, the first P2P connection is not actively disconnected, so that the user experience is improved. Therefore, under the condition that the mobile phone and the tablet computer are both in the same frequency and different channels, the mobile phone, the tablet computer and the PC do not actively disconnect the P2P connection because the heartbeat packet confirmation information of the opposite end is not received within a certain time, but keep the P2P connection. And then when the subsequent needs to work on the channel of the corresponding P2P connection again, the corresponding P2P connection is established again, so that the use experience of the user is improved.
In another possible implementation manner, if the working channel of the mobile phone is the channel of the first P2P connection when the tablet starts to establish the second wireless communication connection with the second router, S1708-S1711 may be replaced by S1708A-S1711A:
S1707A, after the tablet computer starts to establish the second wireless communication connection with the second router, before the working channel of the tablet computer is switched from the channel of the first P2P connection to the channel of the second wireless communication connection, if the tablet computer determines that the working channel of the mobile phone is the channel of the first P2P connection according to the third synchronization time information and the third time slice information, the tablet computer determines the second preset time duration and the eighth time slice information according to the third synchronization time information and the third time slice information, and when communicating with the mobile phone through the first P2P connection, adds the eighth synchronization time information and the eighth time slice information to each data packet.
S1708A, the mobile phone receives the data packet from the tablet computer.
S1709A, the working channel of the tablet computer is switched from the channel connected to the first P2P to the channel connected to the second wireless communication, and is switched to the channel connected to the first P2P after working on the channel connected to the second wireless communication for a second preset time.
S1710A, when the working channel of the tablet computer is switched to the channel of the first P2P connection, and the tablet computer communicates with the mobile phone through the first P2P connection, adding eighth synchronization time information and eighth time slice information to each data packet.
And S1711A, the mobile phone receives the data packet from the tablet computer.
The effects of the technical solutions corresponding to S1708A to S1711A are the same as those of the technical solutions corresponding to S1708 to S1711, and are not described herein again.
In some embodiments, based on the communication system shown in fig. 4 (d), taking the master electronic device as a mobile phone, the slave electronic device as a tablet, the AP1 as a first router, and the AP2 as a second router, and taking at least one GC1 including a PC as an example, as shown in fig. 18, the communication method provided in this embodiment of the present application may include S1801-S1817:
s1801, the mobile phone and the tablet computer establish a first P2P connection.
For specific implementation of S1801, reference may be made to related expressions after S801 in the foregoing embodiment, and details are not described here.
And S1802, the mobile phone and the PC establish a second P2P connection.
The specific implementation of S1802 may refer to the related expression of S1402 in the foregoing embodiment, and details are not described here.
It should be noted that there is no necessary sequence in S1801 and S1802, and it is determined according to actual requirements whether the mobile phone first establishes the first P2P connection with the tablet PC or the second P2P connection with the PC, and the present application is not limited specifically. In the case that the mobile phone establishes the second P2P connection with the PC and then establishes the first P2P connection with the tablet PC, the tablet PC and the PC may be replaced with each other, and the first P2P connection and the second P2P connection may be replaced with each other in the step of this embodiment.
The meaning of executing S1803 after S1802 may refer to the related expression of executing S1703 after S1702 in the foregoing embodiment, and is not described herein again.
S1803, after the second P2P connection between the mobile phone and the PC starts, and before the working channel of the mobile phone is switched from the first P2P connection channel to the second P2P connection channel, and when the mobile phone communicates with the tablet computer through the first P2P connection, third synchronization time information and third time slice information are added to each data packet.
For specific implementation of S1803, reference may be made to related expressions of S1403 in the foregoing embodiment, and details are not described here again.
And S1804, the tablet personal computer receives the data packet from the mobile phone.
The effects of S1802-S1804 may refer to the related expressions after S1404 in the foregoing embodiments, and are not described herein again.
In addition, in the embodiment of the present application, each time the working channel of the subsequent handset is switched to the channel of the first P2P connection, the handset needs to add the third synchronization time information and the third time slice information to each data packet. And then, the tablet computer receives the data packet from the mobile phone. Not shown in fig. 18.
S1805, when the working channel of the mobile phone is switched from the first P2P connection channel to the second P2P connection channel, and the mobile phone communicates with the PC through the second P2P connection, adding fourth synchronization time information and fourth time slice information to each data packet; wherein the fourth time slice information comprises third time slice information.
The specific implementation of S1805 may refer to the related expression after S1405 in the foregoing embodiment, and is not described herein again.
S1806, the PC receives the data packet from the mobile phone.
The effect corresponding to the technical solutions corresponding to S1805 and S1806 may refer to the related expression after S1408 in the foregoing embodiment, and details are not repeated here.
S1807, the tablet computer and the second router establish a second wireless communication connection.
For specific implementation of S1807, reference may be made to specific descriptions of S1302 in the foregoing embodiments, and details are not described here.
The meaning of executing S1808-S1812 after S1807 may refer to the related expression of executing S1708-S1712 after S1707, and is not described herein again.
S1808, after the tablet computer starts to establish the second wireless communication connection with the second router, before the working channel of the tablet computer is switched from the first P2P connection channel to the second wireless communication connection channel, the tablet computer determines a second preset duration and eighth time slice information according to the third synchronization time information and the third time slice information.
The specific implementation of S1808 may refer to the related expression of S1708, which is not described herein again.
S1809, the working channel of the tablet computer is switched from the channel connected to the first P2P to the channel connected to the second wireless communication, and is switched to the channel connected to the first P2P after working on the channel connected to the second wireless communication for a second preset time.
S1810, when the working channel of the tablet computer is switched to the first P2P connection channel, if it is determined that the working channel of the mobile phone is also the first P2P connection channel according to the third synchronization time information and the third time slice information, adding eighth synchronization time information and eighth time slice information to each data packet when communicating with the mobile phone through the first P2P connection.
S1811, the mobile phone receives a data packet from the tablet computer.
Then, the working channels of the mobile phone and the tablet computer can be simultaneously switched to the channel connected with the first P2P, and the mobile phone and the tablet computer can also know the time when the opposite side does not work in the channel connected with the first P2P, so that the mobile phone and the tablet computer can periodically send heartbeat packets to the opposite side and receive heartbeat packet confirmation information of the opposite side only when the mobile phone and the tablet computer work together in the channel connected with the first P2P. Otherwise, the heartbeat packet is not sent any more, and the P2P connection is kept.
It should be noted that, in order to ensure compatibility or specific implementation of consistency, reference may be made to relevant expressions after S1711 in the foregoing embodiment, and details are not described here again.
In addition, in practice, the time of the mobile phone and the tablet computer may need to be synchronized only once, and thus the mobile phone may always be synchronized, so in some embodiments, the mobile phone only needs to send the first preset synchronization time information or the first synchronization time information to the tablet computer once, and only needs to send the first preset time slice information, the third time slice information, and the eighth time slice information subsequently.
It should be noted that if at least one GC1 further includes more PCs. For a specific implementation that at least one GC1 further includes more PCs, reference may be made to the related expression after S1711 in the foregoing embodiment, and details are not described here again.
In this embodiment of the application, there is no necessary sequence in S1807 and S1802, and specifically, it is determined according to actual requirements whether the tablet PC first establishes the second wireless communication connection with the second router or the mobile phone first establishes the second P2P connection with the PC, and this application is not particularly limited. If the tablet pc establishes the second wireless communication connection with the second wireless router first, that is, S1807 is prior, the specific contents of S1802-S1806 subsequent to S1801 in this embodiment may refer to S1302-S1305 in the foregoing embodiment, where P2P connection is replaced by the first P2P connection, and the content of S1807 in this embodiment is replaced by the content of S1802. Subsequent S1808-S1811 may be adjusted on this basis, so that the switching period of the second P2P connected channel in the same-frequency different channel of the mobile phone is the same as the switching period of the second wireless communication connected channel in the same-frequency different channel of the tablet computer, the switching period of the first P2P connected channel of the mobile phone and the tablet computer is the same, and the mobile phone and the tablet computer may switch to the first P2P connected channel in the same time period. The technical effect of this solution is the same as the technical effect of S1808-S1811, and is not described herein again.
S1812, the mobile phone establishes a first wireless communication connection with the first router.
The specific implementation of S1812 may refer to the related expression of S802 in the foregoing embodiment, and details are not repeated here.
S1813, after the mobile phone starts establishing the first wireless communication connection with the first router, and before the working channel of the mobile phone is switched from the first P2P connection channel to the first wireless communication connection channel, the mobile phone determines a third preset time and ninth time slice information according to the third synchronization time information and the third time slice information, and adds the ninth synchronization time information and the ninth time slice information to each data packet when communicating with the tablet computer through the first P2P connection.
The ninth time synchronization information is used to indicate time synchronization between the tablet computer and the mobile phone, and specific implementation thereof may refer to related expression of the first synchronization time in the foregoing embodiment, which is not described herein again. The ninth time slice information is used for indicating the switching period and the channel switching sequence of each channel in all the same-frequency different channels corresponding to the mobile phone. The ninth slot information may include a channel switching order, a first P2P switching period, a second P2P switching period, and a first wireless channel switching period. The explanation and specific implementation of each parameter can refer to the related expressions in the foregoing embodiments, and are not described herein again. The first P2P switching period may be the same as the first P2P switching period in the third time slice information, the second P2P switching period may be the same as the second P2P switching period in the third time slice information, the first radio channel switching period may be determined by the mobile phone according to a preset rule, and specific implementation of the preset rule may refer to the description in the foregoing embodiments, and details are not repeated here. Of course, the first P2P switching period and the second P2P switching period may be determined again according to the predetermined rule.
It should be noted that, since the tablet computer has received the third synchronization time information sent by the mobile phone before, and the times of the tablet computer and the third synchronization time information are synchronized in a consistent manner, the tablet computer may only send the ninth time slice information without sending the ninth synchronization time information to the mobile phone.
In addition, in the embodiment of the present application, when the working channel of the subsequent mobile phone is switched to the channel of the first P2P connection, and the mobile phone communicates with the tablet computer through the first P2P connection, the ninth synchronization time information and the ninth time slice information are added to each data packet. The tablet computer then receives the data packet from the mobile phone. Not shown in fig. 18.
S1814, the tablet computer receives the data packet from the mobile phone, determines the channel adjustment information and the tenth time slice information according to the ninth time slice information after adjusting the time according to the ninth synchronization time information, and switches the working channel according to the channel adjustment information and the tenth time slice information.
The channel adjustment information may instruct the tablet computer to switch the working channel to the channel of the second wireless communication connection for the target duration before switching to the channel of the first P2P connection. The target duration may be a duration from the current time to the time when the working channel of the mobile phone is switched to the channel connected to the first P2P connection, which is obtained according to the ninth time slice information.
The tenth time slice information may specifically indicate a switching period of each of the same-frequency and different-frequency channels of the tablet computer. Specifically, the tenth time slice information may include: a first P2P switching period and a second wireless channel switching period.
Because the tenth time slice information is obtained by combining the ninth time slice information, when the working channel of the tablet computer is switched according to the tenth time slice information, the working channel of the mobile phone can be the first P2P connection channel when the working channel of the tablet computer is subsequently switched to the first P2P connection channel.
For example, if the ninth time slice information indicates that the mobile phone is switched to the channel of the first wireless communication connection from the first time, the switching sequence is as follows: a channel of the first P2P connection- > a channel of the second P2P connection- > a channel of the first wireless communication connection. And the switching period of each channel is 100ms. In the tenth slot information, the first P2P switching period is 100ms, and the second radio channel switching period is 200ms.
Then, it can be seen that the working channels of the tablet computer and the mobile phone are switched to the channel of the first P2P connection within the same 100ms.
S1815, the working channel of the mobile phone is switched from the first P2P connection channel to the first wireless communication connection channel, and the working channel is switched according to the ninth time slice information.
S1816, when the working channel of the tablet computer is switched to the channel of the first P2P connection, and the tablet computer communicates with the mobile phone through the first P2P connection, adding the tenth synchronization time information and the tenth time slice information to each data packet.
The tenth synchronization time information is used for indicating time synchronization between the mobile phone and the tablet computer. It should be noted that, since the tablet computer has received the third synchronization time information sent by the mobile phone before, and the times of the two are synchronized in a consistent manner, the tablet computer may only send the tenth time slice information without sending the tenth synchronization time information to the mobile phone.
S1817, the mobile phone receives the data packet from the tablet computer.
It should be noted that, in order to ensure compatibility or consistency, when the mobile phone only establishes the first P2P connection with the tablet computer, the mobile phone may carry the first preset synchronization time information and the first preset time slice information in the data packet sent to the mobile phone through the first P2P connection. The first preset time slice information may be null or include information indicating that the mobile phone will always operate on the channel of the first P2P connection. The first preset synchronization time information and the third synchronization time information may have the same role.
In addition, in practice, the times of the mobile phone and the tablet computer, and the times of the mobile phone and the PC may need to be synchronized only once, and thus the mobile phone may always be synchronized, so in some embodiments, the mobile phone only needs to send the first preset synchronization time information or the third synchronization time information to the tablet computer once, and only needs to send the first preset time slice information, the third time slice information, and the ninth time slice information subsequently. Similarly, after receiving the first preset synchronization time information or the third synchronization time information, the tablet computer only needs to send the eighth time slice information and the tenth time slice information subsequently, and does not need to send other synchronization time information. Similarly, the mobile phone only needs to send the fourth synchronization time information to the PC once, and then only needs to send the fourth time slice information.
It should be noted that the above S1813-S1817 are only examples, and in practice, any other feasible manner may be used when the appropriate ninth time slice information and the tenth time slice information are negotiated between the tablet computer and the mobile phone, which is not limited in this application.
In addition, the order of establishing the second wireless communication connection between the tablet PC and the second router, establishing the first wireless communication connection between the mobile phone and the first wireless router, and establishing the second P2P connection between the mobile phone and the PC is not necessarily limited, and may be determined according to the actual situation. In the above embodiment, only the first case that the mobile phone establishes the second P2P connection with the PC, the second case that the mobile phone establishes the first wireless communication connection with the first wireless router, and the last case that the tablet computer establishes the second wireless communication connection with the second router are taken as an example, the specific implementation of the other cases may be reasonably deduced by referring to the descriptions in the foregoing other embodiments, and details are not described here.
In this embodiment, the second P2P connection may correspond to the second wireless connection in the present application, the third synchronization time information may correspond to the second target synchronization time information in the present application, the third time slice information may correspond to the second target time slice information in the present application, the second wireless communication connection may correspond to the third wireless connection in the present application, the eighth time slice information may correspond to the third target synchronization time information in the present application, the eighth synchronization time information may correspond to the third target synchronization time information in the present application, the first wireless communication connection may correspond to the fourth wireless connection in the present application, the ninth synchronization time information may correspond to the fourth target synchronization time information in the present application, the ninth time slice information may correspond to the fourth target time slice information in the present application, the tenth time slice information may correspond to the fifth target time slice information in the present application, and the tenth synchronization time information may correspond to the fifth target synchronization time information in the present application.
Based on the technical scheme of S1801-S1817, under the condition that the mobile phone establishes both the first P2P connection with the tablet computer and the second P2P connection with the PC, and the tablet computer establishes both the second wireless communication connection with the second router and the first P2P connection with the mobile phone, that is, the mobile phone and the tablet computer are both in the same frequency and different channels, the mobile phone can timely inform all opposite terminals of the P2P connection of corresponding synchronization time information and time slice information. The synchronous time information is used for enabling the time synchronization of the three devices to be consistent. The time slice information is used to inform the opposite end of the period of switching channels. In addition, the tablet personal computer can inform the corresponding synchronous time information and time slice information of the mobile phone in time. And then make cell-phone and panel computer switch over to the channel that first P2P connects in the same time quantum, guaranteed communication between them, and make both not work when the channel that first P2P connects simultaneously, no longer initiatively break first P2P and connect, people have improved user's use and have experienced. Therefore, under the condition that the mobile phone and the tablet computer are both in the same frequency and different channels, the mobile phone, the tablet computer and the PC do not actively disconnect the P2P connection because the heartbeat packet confirmation information of the opposite end is not received within a certain time, but keep the P2P connection. And then when the subsequent needs to work on the channel of the corresponding P2P connection again, the corresponding P2P connection is established again, so that the use experience of the user is improved.
In the foregoing seven embodiments, it can be seen that, when a connection state of a target electronic device (an electronic device with a same-frequency and different-channel) changes and a working channel is in a P2P connection channel, corresponding synchronization time information and time slice information are added to each data packet (excluding a heartbeat packet and heartbeat packet acknowledgement information). Wherein the connection status may be used to indicate the number of wireless connections established by the target electronic device, and the change in the connection status may be an indication that the number of wireless connections established by the target electronic device has changed.
Therefore, the opposite-end electronic equipment can know the opportunity of the target electronic equipment for switching the working channel according to the synchronous time information and the time slice information, and then can send the heartbeat packet to the target electronic equipment and receive corresponding heartbeat packet confirmation information only when the target electronic equipment and the opposite-end electronic equipment (namely the opposite-end electronic equipment) are both in the same P2P connected channel. And when the target electronic device and the opposite-end electronic device are not in the same channel of the P2P connection, the heartbeat packet is not sent to the target electronic device, and the P2P connection established with the target electronic device is not actively disconnected because the corresponding heartbeat packet confirmation information is not received. The user experience is guaranteed. However, in practice, after a certain wireless connection is established in the target electronic device, the switching period of each channel of the same-frequency different channels is not changed after the switching period is determined, so the scheme in the seven embodiments described above causes a great waste of channel resources by adding the synchronization time information and the time slice information to each data packet corresponding to the P2P connection. Based on this, the communication method provided by the present application further includes the following several embodiments.
Referring to fig. 19 in conjunction with fig. 8, the communication method provided by the present application may include S1901-S1904:
s1901, the mobile phone and the tablet computer establish a first P2P connection.
For the specific implementation of S1901, reference may be made to the specific expression of S801 in the foregoing embodiment, and details are not repeated here.
S1902, the mobile phone establishes a first wireless communication connection with the first router.
The specific implementation of S1902 may refer to the specific representation of S802 in the foregoing embodiment, and is not described herein again. The first wireless communication connection may here correspond to the first wireless connection in the present application.
S1903, after the mobile phone starts to establish the first wireless communication connection with the first router and before the working channel is switched from the first P2P connection channel to the first wireless communication connection channel, the mobile phone sends the first synchronization time information and the first time slice information to the tablet computer through the first P2P connection.
The first synchronization information and the first time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer communicate through a first P2P connection, which is not specifically limited in this application.
For specific implementation of S1903, reference may be made to the specific expression of S803 in the foregoing embodiment, and details are not described here. The difference between the two is that in S1903, the first synchronization time information and the first time slice information will not be added to each data packet of the mobile phone communicating with the tablet computer through the first P2P connection. The consumption of channel resources is reduced.
S1904, the tablet computer receives first synchronous time information and first time slice information from the mobile phone.
The expansion schemes of the technical solutions corresponding to S1901 to S1904 may refer to the related expressions of the expansion schemes for S801 to S806 in the foregoing embodiment, and are not described herein again.
Based on the technical solutions of the above-mentioned S1901 to S1904, specific effects thereof can refer to the effects of the technical solutions of the above-mentioned S801 to S806. The difference is that compared with the technical solutions corresponding to S801 to S806, the technical solutions of S1901 to S1904 can reduce the consumption of channel resources and improve the utilization rate of the channel resources.
Referring to fig. 20 in conjunction with fig. 13, the communication method provided by the present application may include S2001-S2004:
s2001, the mobile phone and the tablet computer establish a first P2P connection.
Specific implementation of S2001 may refer to specific expression of S1301 in the foregoing embodiment, and details are not described here.
S2002, the tablet personal computer and the second router establish second wireless communication connection.
The specific implementation of S2002 may refer to the specific representation of S1302 in the foregoing embodiment, and is not described herein again. The second wireless communication connection may here correspond to the first wireless connection in the present application.
And S2003, after the tablet computer starts to establish a second wireless communication connection with the second router and before a working channel of the tablet computer is switched from a channel connected with the first P2P to a channel connected with the second wireless communication, the tablet computer sends second synchronous time information and second time slice information to the mobile phone through the first P2P connection.
The second synchronization information and the second time slice information may be placed in a single data packet, or may be placed in a data packet in which the tablet computer and the mobile phone communicate through the first P2P connection, which is not specifically limited in this application.
For specific implementation of S2003, reference may be made to specific descriptions of S1303 in the foregoing embodiment, which is not described herein again. The difference between the two is that in S2003, the second synchronization time information and the second time slice information will not be added to each data packet of the tablet computer communicating with the mobile phone through the first P2P connection. The consumption of channel resources is reduced.
And S2004, the mobile phone receives second synchronous time information and second time slice information from the tablet personal computer.
For the expansion scheme of the technical scheme corresponding to S2001-S2004, reference may be made to the related expression of the expansion scheme of S1301-S1306 in the foregoing embodiment, and details are not described here again.
Based on the technical solutions of S2001-S2004, specific effects thereof can be referred to the effects of the technical solutions of S1301-S1306. The difference is that compared with the technical solutions corresponding to S1301-S1306, the technical solutions of S2001-S2004 can reduce the consumption of channel resources, and improve the utilization rate of the channel resources.
Referring to fig. 21 in conjunction with fig. 14, a communication method provided in this embodiment may include S2101 to S2106:
s2101, a first P2P connection is established between the mobile phone and the tablet personal computer.
For specific implementation of S2101, reference may be made to related expressions of S1401 in the foregoing embodiments, and details are not described herein.
S2102, the mobile phone and the PC establish second P2P connection.
The specific implementation of S2102 may refer to the related expression of S1402 in the foregoing embodiment, and is not described herein again. Here, the second P2P connection may correspond to the first wireless connection referred to in this application.
S2103, after the mobile phone starts establishing the second P2P connection with the PC, and before the working channel is switched from the first P2P connection channel to the second P2P connection channel, the mobile phone sends the third synchronization time information and the third time slice information to the tablet computer through the first P2P connection.
The third synchronization information and the third time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer communicate through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2103 may refer to the specific representation of S1403 in the foregoing embodiment, and details are not described here. The difference between the two is that in S2103, the third synchronization time information and the third time slice information are not added to each data packet of the tablet pc communicated with the mobile phone through the first P2P connection. The consumption of channel resources is reduced.
S2104, the tablet computer receives third synchronization information and third time slice information from the mobile phone.
S2105, when the working channel of the mobile phone is switched from the first P2P connection channel to the second P2P connection channel for the first time, the mobile phone sends fourth synchronous time information and fourth time slice information to the PC through the second P2P; wherein the fourth time slice information comprises third time slice information.
The fourth synchronization information and the fourth time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer are in communication through a second P2P connection, which is not specifically limited in this application.
The specific implementation of S2105 may refer to the specific representation of S1405 in the foregoing embodiment, and is not described herein again. The difference between the two is that in S2105, the fourth synchronization time information and the fourth time slice information are not added to each data packet communicated with the PC through the second P2P connection by the mobile phone, but only when the working channel is switched from the channel of the first P2P connection to the channel of the second P2P connection for the first time, the fourth synchronization time information and the fourth time slice information are sent to the PC once. The consumption of channel resources is reduced.
S2106, the PC receives the fourth synchronous time information and the fourth time slice information from the mobile phone.
Specific implementation of an extension scheme in which at least one GC1 includes more PCs may refer to the related description in the foregoing embodiments, and is not described herein again.
For the expansion schemes corresponding to S2101 to S2106, reference may be made to the related expressions of the expansion schemes for S1401 to S1408 in the foregoing embodiments, and details are not described here.
The specific effects of the technical solutions based on the above S2101 to S2106 can be referred to the effects of the technical solutions corresponding to the above S1401 to S1408. The difference is that compared with the technical solutions corresponding to S1401-S1408, the technical solutions of S2101-S2106 can reduce the consumption of channel resources and improve the utilization rate of the channel resources.
Referring to fig. 22 in conjunction with fig. 15, the communication method provided by the present application may include S2201-S2210:
s2201, the mobile phone and the tablet computer establish first P2P connection.
For specific implementation of S2201, reference may be made to related expressions after S1501 in the foregoing embodiment, and details are not described here.
S2202, the mobile phone establishes a first wireless communication connection with the first router.
The specific implementation of S2202 may refer to the related expression of S1502 in the foregoing embodiment, and details are not repeated here.
S2203, after the mobile phone starts to establish the first wireless communication connection with the first router and before the working channel is switched from the first P2P connection channel to the first wireless communication connection channel, the mobile phone sends the first synchronization time information and the first time slice information to the tablet computer through the first P2P connection.
The first synchronization information and the first time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer communicate through a first P2P connection, which is not specifically limited in this application.
For the specific implementation of S2203, reference may be made to the specific expression of S1503 in the foregoing embodiment, and details are not described here. The difference between the two is that in S2203, the first synchronization time information and the first time slice information are not added to each data packet of the mobile phone communicating with the tablet computer through the first P2P connection. The consumption of channel resources is reduced.
S2204, the tablet computer receives first synchronization information and first time slice information from the mobile phone.
The effect performed in S2204 can refer to the related expression of S1504 in the foregoing embodiment, and is not described herein again.
S2205, the working channel of the mobile phone is switched from the channel of the first P2P connection to the channel of the first wireless communication connection.
S2206, the tablet computer and the second router establish second wireless communication connection.
The specific implementation of S2206 may refer to the related expression of S1506 in the foregoing embodiment, and is not described herein again.
S2207, after the tablet computer starts to establish the second wireless communication connection with the second router, before the working channel of the tablet computer is switched from the first P2P connection channel to the second wireless communication connection channel, the tablet computer determines the first preset duration and the fifth time slice information according to the first synchronization time information and the first time slice information.
For specific implementation of S2207, reference may be made to the related expression of S1507 in the foregoing embodiment, and details are not described here.
S2208, the working channel of the tablet computer is switched from the first P2P connection channel to the second wireless communication connection channel, and is switched to the first P2P connection channel after the duration lasts for a first preset time.
S2209, when the working channel of the tablet computer is first switched from the channel of the second wireless communication connection to the channel of the first P2P connection, if it is determined that the working channel of the mobile phone is also the channel of the first P2P connection according to the first synchronization time information and the first time slice information, sending the fifth synchronization time information and the fifth time slice information to the mobile phone through the first P2P connection.
The fifth synchronization information and the fifth time slice information may be placed in a single data packet, or may be placed in a data packet in which the tablet computer and the mobile phone communicate through the first P2P connection, which is not specifically limited in this application.
For specific implementation of S2209, reference may be made to specific descriptions of S1509 in the foregoing embodiments, and details are not described here. The difference between the two is that in S2209, the tablet computer only sends the fourth synchronization time information and the fourth time slice information to the mobile phone once through the first P2P connection when the channel of the second wireless communication connection is switched to the channel of the first P2P connection for the first time, instead of adding the fourth synchronization time information and the fourth time slice information to each data packet when the working channel is switched to the channel of the first P2P connection each time. The consumption of channel resources is reduced.
S2210, the mobile phone receives fourth synchronous time information and fourth time slice information from the tablet computer.
In this embodiment, the first wireless communication connection may correspond to a second wireless connection in the present application, the first synchronization time information may correspond to a second target synchronization time information in the present application, the first time slice information may correspond to a second target time slice information in the present application, the second wireless communication connection may correspond to a third wireless connection in the present application, the fifth time slice information may correspond to a third target time slice information in the present application, and the fifth synchronization time information may correspond to a third target synchronization time information in the present application.
For the technical solution expansion schemes corresponding to S2201-S2210, reference may be made to the related expressions of the expansion schemes for S1501-S1510 in the foregoing embodiments, and details are not described here again.
Based on the technical solutions of the above S2201 to S2210, specific effects thereof can refer to effects of the technical solutions corresponding to the above S1501 to S1510. The difference is that compared with the technical solutions corresponding to S1501-S15108, the technical solutions of S2201-S2210 can reduce the consumption of channel resources and improve the utilization rate of the channel resources.
With reference to fig. 23 in conjunction with fig. 16, the communication method provided by the present application may include S2301-S2311:
S2301, establishing a first P2P connection between the mobile phone and the tablet computer.
The specific implementation of S2301 may refer to the related expression of S1601 in the foregoing embodiment, and is not described herein again.
S2302, the mobile phone establishes a first wireless communication connection with the first router.
The specific implementation of S2302 can refer to the related expression of S1602 in the foregoing embodiment, and is not described herein again.
S2303, after the first wireless communication connection between the mobile phone and the first router is started, and before the working channel of the mobile phone is switched from the first P2P connection channel to the first wireless communication connection channel, the mobile phone sends the first synchronization time information and the first time slice information to the tablet computer through the first P2P connection.
The first synchronization information and the first time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer are connected and communicated through a P2P connection, which is not specifically limited in this application.
The specific implementation of S2303 may refer to the specific expression of S1603 in the foregoing embodiment, and is not described herein again. The difference between the two is that in S2303, the first synchronization time information and the first time slice information are not added to each data packet of the mobile phone in communication with the tablet computer through the first P2P connection. The consumption of channel resources is reduced.
S2304, the tablet computer receives first synchronization information and first time slice information from the mobile phone.
S2305, switching the working channel of the mobile phone from the first P2P connection channel to the first wireless communication connection channel.
S2306, the mobile phone and the PC establish second P2P connection.
The specific implementation of S2306 may refer to the specific expression of S1606 in the foregoing embodiment, which is not described herein again.
S2307, after the mobile phone starts establishing the second P2P connection with the PC, and before the working channel of the mobile phone is switched from the channel of the first wireless communication connection to the channel of the second P2P connection, the mobile phone determines the sixth time slice information according to the first synchronization time and the first time slice information.
The specific implementation of S2307 may refer to the specific expression of S1607 in the foregoing embodiment, which is not described herein again.
S2308, when the working channel of the mobile phone is first switched to the channel of the second P2P connection, the mobile phone sends the sixth synchronization time information and the sixth time slice information to the PC through the second P2P connection.
The sixth synchronization information and the sixth time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the PC communicate through the second P2P connection, which is not specifically limited in this application.
The specific implementation of S2208 may refer to the specific representation of S1608 in the foregoing embodiment, and is not described herein again. The difference between the two is that in S2208, the mobile phone only sends the sixth synchronization time information and the sixth time slice information to the PC once through the second P2P connection when switching to the channel of the second P2P connection for the first time, instead of adding the sixth synchronization time information and the sixth time slice information to each data packet each time the working channel is switched to the channel of the second P2P connection. The consumption of channel resources is reduced.
S2309, the PC receives sixth synchronization time information and sixth time slice information from the mobile phone.
The effect performed by S2309 can refer to the related expression after S1609 in the foregoing embodiment, and is not described herein again.
S2310, after the working channel of the mobile phone is switched to the second P2P connection channel for the first time, and under the condition that the working channel of the mobile phone is switched to the first P2P connection channel for the first time, the mobile phone sends seventh synchronization time information and seventh time slice information to the tablet computer through the first P2P connection; the seventh time slice information includes sixth time slice information.
The seventh synchronization information and the seventh time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer communicate through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2310 may refer to the specific representation of S1610 in the foregoing embodiment, and is not described herein again. The difference between the two is that, in S2310, the mobile phone only sends the seventh synchronization time information and the seventh time slice information to the tablet computer through the first P2P connection once after the working channel is switched to the channel of the second P2P connection for the first time, instead of adding the seventh synchronization time information and the seventh time slice information to each data packet every time the working channel is switched to the channel of the first P2P connection. The consumption of channel resources is reduced.
S2311, the tablet computer receives seventh synchronization time information and seventh time slice information from the mobile phone.
In this embodiment, the first synchronization time information may be equivalent to the first target synchronization time information in the present application, the first time slice information may be equivalent to the first target time slice information in the present application, the sixth synchronization time information may be equivalent to the sixth target synchronization time information in the present application, the sixth time slice information may be equivalent to the sixth target time slice information in the present application, the seventh synchronization time information may be equivalent to the seventh target synchronization time information in the present application, and the seventh time slice information may be equivalent to the seventh target time slice information in the present application.
For the expansion scheme of the technical scheme corresponding to S2301-S2311, reference may be made to the related expression of the expansion scheme for S1601-S1611 in the foregoing embodiment, and details are not described here again.
Based on the technical solutions of S2301 to S2311, specific effects thereof can refer to the effects of the technical solutions of S1601 to S1611. The difference is that compared with the technical scheme corresponding to S1601-S1611, the technical scheme of S2301-S2311 can reduce the consumption of channel resources and improve the utilization rate of the channel resources.
Referring to fig. 24 in conjunction with fig. 17, the communication method provided in the present application may include S2401 to S2411:
s2401, establishing a first P2P connection between the mobile phone and the tablet personal computer.
The specific implementation of S2401 may refer to the related expression after S1701 in the foregoing embodiment, and details are not described here again.
S2402, the mobile phone and the PC establish second P2P connection.
The specific implementation of S2402 may refer to the related expression of S1702 in the foregoing embodiment, which is not described herein again.
S2403, after the second P2P connection between the mobile phone and the PC is started, and before the working channel of the mobile phone is switched from the first P2P connection channel to the second P2P connection channel, the mobile phone sends third synchronous time information and third time slice information to the tablet computer through the first P2P connection.
The third synchronization information and the third time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer communicate through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2403 may refer to the related expression of S1703 in the foregoing embodiment, and details are not described here. The difference between the two is that in S2403, the third synchronization time information and the third time slice information are not added to each data packet that the tablet computer communicates with the mobile phone through the first P2P connection. The consumption of channel resources is reduced.
S2404, the tablet computer receives third synchronous time information and third time slice information from the mobile phone.
The effects of S2402 to S2404 can refer to the related expressions after S1704 in the foregoing embodiment, and are not described herein again.
S2405, when the working channel of the mobile phone is switched from the channel connected with the first P2P to the channel connected with the second P2P for the first time, the mobile phone sends fourth synchronous time information and fourth time slice information to the PC through the second P2P connection; wherein the fourth time slice information comprises the third time slice information.
The fourth synchronization information and the fourth time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the PC communicate through the second P2P connection, which is not specifically limited in this application.
For specific implementation of S2405, reference may be made to related expressions after S1705 in the foregoing embodiment, and details are not described here again. The difference between the two is that in S2405, the fourth synchronization time information and the fourth time slice information are not added to each data packet communicated with the PC through the second P2P connection by the mobile phone, but only when the working channel is switched from the channel of the first P2P connection to the channel of the second P2P connection for the first time, the fourth synchronization time information and the fourth time slice information are sent to the PC once. The consumption of channel resources is reduced.
S2406, the PC receives fourth synchronization information and fourth time slice information from the mobile phone.
The effect corresponding to the technical solutions corresponding to S2405 and S2406 can refer to the related expression after S1706 in the foregoing embodiment, and details are not described here again.
S2407, establishing a second wireless communication connection between the tablet computer and the second router.
The specific implementation of S2407 may refer to the specific representation of S1707 in the foregoing embodiment, and details are not described here.
S2408, after the tablet computer starts to establish the second wireless communication connection with the second router, before a working channel of the tablet computer is switched from the first P2P connection channel to the second wireless communication connection channel, the tablet computer determines a second preset time length and eighth time slice information according to the third synchronous time information and the third time slice information.
The specific implementation of S2408 may refer to the related expressions in the foregoing embodiments, and details are not described here.
S2409, switching the working channel of the tablet computer from the channel connected to the first P2P to the channel connected to the second wireless communication, and switching to the channel connected to the first P2P after a second preset duration.
S2410, when the working channel of the tablet computer is first switched from the channel of the second wireless communication connection to the channel of the first P2P connection, if it is determined that the working channel of the mobile phone is also the channel of the first P2P connection according to the third synchronization time information and the third time slice information, sending the eighth synchronization time information and the eighth time slice information to the mobile phone through the first P2P connection.
The eighth synchronization information and the eighth time slice information may be placed in a single data packet, or may be placed in a data packet in which the tablet computer and the mobile phone communicate through the first P2P connection, which is not specifically limited in this application.
For specific implementation of S2410, reference may be made to related expressions after S1710 in the foregoing embodiment, and details are not described here. The difference between the two is that, in S2410, the eighth synchronization time information and the eighth time slice information are not added to each data packet communicated with the mobile phone by the tablet computer through the first P2P connection, but only sent to the mobile phone once when the working channel is switched from the channel of the second P2P connection to the channel of the first P2P connection. The consumption of channel resources is reduced.
S2411, the mobile phone receives the eighth synchronization time information and the eighth time slice information from the tablet computer.
In this embodiment, the second P2P connection may correspond to a second wireless connection in the present application, the third synchronization time information may correspond to a second target synchronization time information in the present application, the third time slice information may correspond to a second target time slice information in the present application, the second wireless communication connection may correspond to a third wireless connection in the present application, the eighth time slice information may correspond to a third target time slice information in the present application, and the eighth synchronization time information may correspond to a third target synchronization time information in the present application.
For the technical solutions corresponding to S2401-S2411, reference may be made to the related expressions of the technical solutions for S1701-S1711 in the foregoing embodiments, and details are not repeated here.
The specific effects of the embodiments based on S2401-S2411 can be referred to the effects of the embodiments corresponding to S1701-S1711. The difference is that the technical solutions of S2401-S2411 can reduce the consumption of channel resources and improve the utilization rate of channel resources compared with the technical solutions of S1701-S1711.
Referring to fig. 25 in conjunction with fig. 18, the communication method provided by the present application includes S2501 to S2517:
S2501, establishing a first P2P connection between the mobile phone and the tablet computer.
For specific implementation of S2501, reference may be made to related descriptions after S1801 in the foregoing embodiment, and details are not described here.
S2502, the mobile phone and the PC establish second P2P connection.
The specific implementation of S2502 may refer to the related expression of S1802 in the foregoing embodiment, and is not described herein again.
S2503, after the mobile phone starts to establish the second P2P connection with the PC, before a working channel of the mobile phone is switched from the first P2P connection channel to the second P2P connection channel, the mobile phone sends the third synchronization time information and the third time slice information to the tablet computer through the first P2P connection.
The third synchronization information and the third time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer communicate through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2503 may refer to the related expression of S1803 in the foregoing embodiment, and is not described herein again. The difference between the two is that in S2503, the third synchronization time information and the third time slice information are not added to each data packet of the tablet computer communicating with the mobile phone through the first P2P connection. The consumption of channel resources is reduced.
S2504, the tablet computer receives third synchronous time information and third time slice information from the mobile phone.
The effects of S2502 to S2504 can refer to the related expressions after S1804 in the foregoing embodiment, and are not described herein again.
S2505, when the working channel of the mobile phone is switched from the channel connected with the first P2P to the channel connected with the second P2P for the first time, the mobile phone sends fourth synchronous time information and fourth time slice information to the PC through the second P2P connection; wherein the fourth time slice information comprises third time slice information.
The fourth synchronization information and the fourth time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the PC communicate through the second P2P connection, which is not specifically limited in this application.
For specific implementation of S2505, reference may be made to related descriptions after S1805 in the foregoing embodiment, and details are not described here. The difference between the two is that in S2505, the fourth synchronization time information and the fourth time slice information are not added to each data packet communicated with the PC through the second P2P connection by the mobile phone, but only when the working channel is switched from the channel of the first P2P connection to the channel of the second P2P connection for the first time, the fourth synchronization time information and the fourth time slice information are sent to the PC once. The consumption of channel resources is reduced.
S2506, the PC receives fourth synchronous time information and fourth time slice information from the mobile phone.
The effect corresponding to the technical solutions corresponding to S2505 and S2506 may refer to the related expression after S1808 in the foregoing embodiment, and details are not described here.
S2507, the tablet computer and the second router establish second wireless communication connection.
The specific implementation of S2507 may refer to the specific expression of S1807 in the foregoing embodiment, and is not described herein again.
S2508, after the tablet computer starts to establish the second wireless communication connection with the second router, before a working channel of the tablet computer is switched from a channel connected with the first P2P to a channel connected with the second wireless communication, the tablet computer determines second preset time length and eighth time slice information according to the third synchronous time information and the third time slice information.
The specific implementation of S2508 may refer to the related expression of S1808, which is not described herein again.
S2509, switching the working channel of the tablet computer from the channel connected to the first P2P to the channel connected to the second wireless communication, and switching to the channel connected to the first P2P after working on the channel connected to the second wireless communication for a second preset time.
S2510, when the working channel of the tablet computer is first switched from the channel of the second wireless communication connection to the channel of the first P2P connection, if it is determined that the working channel of the mobile phone is also the channel of the first P2P connection according to the third synchronization time information and the third time slice information, the eighth synchronization time information and the eighth time slice information are sent to the mobile phone through the first P2P connection.
The eighth synchronization information and the eighth time slice information may be placed in a single data packet, or may be placed in a data packet in which the tablet computer and the mobile phone are in communication through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2510 may refer to the related expression after S1810 in the foregoing embodiment, and is not described herein again. The difference between the two is that, in S2510, the eighth synchronization time information and the eighth time slice information are not added to each data packet communicated with the mobile phone by the tablet computer through the first P2P connection, but only when the working channel is switched from the channel of the second P2P connection to the channel of the first P2P connection for the first time, the eighth synchronization time information and the eighth time slice information are sent to the mobile phone for the first time. The consumption of channel resources is reduced.
S2511, the mobile phone receives the eighth synchronization time information and the eighth time slice information from the tablet computer.
S2512, the mobile phone establishes a first wireless communication connection with the first router.
The specific implementation of S2512 may refer to the related expression of S1812 in the foregoing embodiment, and details are not described herein.
S2513, after the mobile phone starts establishing the first wireless communication connection with the first router, before the working channel of the mobile phone is switched from the first P2P connection channel to the first wireless communication connection channel, the mobile phone determines a third preset time length and ninth time slice information according to the third synchronization time information and the third time slice information, and sends the ninth synchronization time information and the ninth time slice information to the tablet computer through the first P2P connection.
The ninth synchronization information and the ninth time slice information may be placed in a single data packet, or may be placed in a data packet in which the mobile phone and the tablet computer communicate through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2513 may refer to the related expression after S1813 in the foregoing embodiment, and details are not described here. The difference between the two is that in S2513, the eighth synchronization time information and the eighth time slice information are not added to each data packet in the communication between the mobile phone and the tablet computer through the first P2P connection, but the ninth synchronization time information and the ninth time slice information are only sent once. The consumption of channel resources is reduced.
S2514, the tablet computer receives the ninth synchronization time information and the ninth time slice information from the mobile phone, determines the channel adjustment information and the tenth time slice information according to the ninth synchronization time information after adjusting time according to the ninth synchronization time information, and switches the working channel according to the channel adjustment information and the tenth time slice information.
The tenth synchronization time information and the tenth time slice information may be placed in a single data packet, or may be placed in a data packet in which the tablet computer and the mobile phone communicate through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2514 may refer to the related expression after S1814 in the foregoing embodiment, and details are not described here.
S2515, the working channel of the mobile phone is switched from the first P2P connection channel to the first wireless communication connection channel, and the working channel is switched according to the ninth time slice information.
S2516, when the working channel of the tablet computer is first switched to the channel of the first P2P connection after the tenth time slice information is obtained, the tablet computer sends the tenth synchronization time information and the tenth time slice information to the mobile phone through the first P2P connection.
The tenth synchronization time information and the tenth time slice information may be placed in a single data packet, or may be placed in a data packet in which the tablet computer and the mobile phone communicate through the first P2P connection, which is not specifically limited in this application.
The specific implementation of S2516 may refer to the related expression after S1816 in the foregoing embodiment, and details are not described here. The difference between the first synchronization time information and the second synchronization time information is that, in S2516, the eighth synchronization time information and the eighth time slice information are not added to each data packet communicated with the mobile phone through the first P2P connection by the tablet computer, but the tenth synchronization time information and the tenth time slice information are sent to the mobile phone once only when the working channel is switched to the channel of the first P2P connection for the first time after the tablet computer acquires the tenth time slice information. The consumption of channel resources is reduced.
S2517, the mobile phone receives the tenth synchronization time information and the tenth time slice information from the tablet computer.
In this embodiment, the second P2P connection may correspond to a second wireless connection in the present application, the third synchronization time information may correspond to second target synchronization time information in the present application, the third time slice information may correspond to second target synchronization time information in the present application, the second wireless communication connection may correspond to a third wireless connection in the present application, the eighth time slice information may correspond to third target synchronization time information in the present application, the eighth synchronization time information may correspond to third target synchronization time information in the present application, the first wireless communication connection may correspond to a fourth wireless connection in the present application, the ninth synchronization time information may correspond to fourth target synchronization time information in the present application, the ninth time slice information may correspond to fourth target synchronization time information in the present application, the tenth time slice information may correspond to fifth target time slice information in the present application, and the tenth synchronization time information may correspond to fifth target synchronization time information in the present application.
For the expansion schemes of the technical solutions corresponding to S2501 to S2517, reference may be made to the related expressions of the expansion schemes for S1801 to S1817 in the foregoing embodiment, and details are not described herein again.
Based on the technical solutions of S2501 to S2517, specific effects thereof can be referred to the effects of the technical solutions of S1801 to S1817. The difference is that compared with the technical solutions corresponding to S1801-S1817, the technical solutions of S2501-S2517 can reduce the consumption of channel resources and improve the utilization rate of the channel resources.
It is to be understood that the above-mentioned devices and the like include corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those of skill in the art will readily 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 performed in hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional modules according to the 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 module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
In a case where each functional module is divided according to each function, as shown in fig. 26, an embodiment of the present application provides an electronic device including: a connection establishment module 311, a processing module 312 and a communication module 313.
Wherein the connection establishing module is configured to establish a first P2P connection with the peer electronic device. The processing module 312 is configured to, after the connection establishing module 311 starts to establish the first wireless connection with the first new device, before the working channel of the target electronic device is switched from the channel of the first P2P connection to the channel of the first wireless connection, control the communication module 313 to send the first target synchronization time information and the first target time slice information to the peer electronic device through the first P2P connection, so that the peer electronic device determines the working channel of the target electronic device in real time according to the first target synchronization time information and the first target time slice information; the channel of the first wireless connection and the channel of the first P2P connection are same-frequency different channels. The first target synchronization time information is used for indicating time synchronization of the opposite terminal electronic equipment and the target electronic equipment; the first target time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the target electronic equipment; the switching period is used for indicating the working time of the target electronic equipment on the channel to which the switching period belongs before the channel to which the switching period belongs is switched to other channels.
The specific functions of the connection establishing module 311, the processing module 312 and the communication module 313 in the electronic device may be determined by referring to the specific implementation functions of the devices (such as a mobile phone or a tablet computer) with the same frequency and different channels in the foregoing embodiment, which are not described herein again.
With regard to the electronic device in the foregoing embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the communication method in the foregoing embodiment, and is not specifically set forth herein. The related advantages can also refer to the related advantages of the foregoing communication method, and are not described herein again.
An embodiment of the present application further provides an electronic device, which includes: a memory and one or more processors; the memory is coupled with the processor; wherein the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the communication method as provided by the preceding embodiments. The specific structure of the electronic device may refer to the structure of the electronic device shown in fig. 5 or fig. 6.
Embodiments of the present application further provide a computer-readable storage medium, which includes computer instructions, when the computer instructions are executed on an electronic device, the electronic device is caused to execute the communication method provided in the foregoing embodiments.
Embodiments of the present application further provide a computer program product, where the computer program product contains executable instructions, and when the computer program product runs on an electronic device, the electronic device is caused to execute the communication method provided in the foregoing embodiments.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus/device and method may be implemented in other manners. For example, the above-described apparatus/device embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical function division, and other division manners may exist in actual implementation, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, or portions of the technical solutions that substantially contribute to the prior art, or all or portions of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within 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 (8)

1. A method of communication, comprising:
the method comprises the steps that a first P2P connection is established between target electronic equipment and opposite-end electronic equipment;
after the target electronic device starts to establish a first wireless connection with a first newly-added electronic device, before a working channel of the target electronic device is switched from a channel of the first P2P connection to a channel of the first wireless connection, the target electronic device sends first target synchronization time information and first target time slice information to the opposite-end electronic device through the first P2P connection, so that the opposite-end electronic device determines the working channel of the target electronic device in real time according to the first target synchronization time information and the first target time slice information; the channel of the first wireless connection and the channel of the first P2P connection are same-frequency different channels;
The first target synchronization time information is used for indicating time synchronization of the opposite-end electronic equipment and the target electronic equipment; the first target time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the target electronic equipment; the switching period is used for indicating the working time of the target electronic equipment on the channel to which the switching period belongs before the channel to which the switching period belongs is switched to other channels each time;
if the target electronic equipment and the opposite-end electronic equipment establish first P2P connection, the opposite-end electronic equipment establishes second wireless connection with second newly-increased electronic equipment, and the working channel of the opposite-end electronic equipment is switched to the channel of the second wireless connection; in a case that the working channel of the peer electronic device is switched to the channel of the second wireless connection, the method further includes:
after the target electronic equipment and the third newly added electronic equipment start to establish a third wireless connection, before a working channel of the target electronic equipment is switched from the first P2P connected channel to a third wireless connected channel, the target electronic equipment determines a target preset time length and third target time slice information according to second target synchronous time information and second target time slice information; the second target synchronization time information is used for indicating time synchronization between the target electronic device and the opposite-end electronic device, and the second target time slice information is used for indicating a switching period of each channel in the same-frequency different channels of the opposite-end electronic device; the third target time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the target electronic equipment; the channel of the third wireless connection and the channel of the first P2P connection are same-frequency different channels;
The working channel of the target electronic equipment is switched from the channel connected with the first P2P to the channel connected with the third wireless network, and is switched to the channel connected with the first P2P after the target duration lasts for a preset time;
under the condition that the working channel of the target electronic equipment is switched to the first P2P connected channel from the third wirelessly connected channel for the first time, if the working channel of the opposite-end electronic equipment is determined to be the first P2P connected channel according to the second target synchronization time information and the second target time slice information, sending third target synchronization time information and third target time slice information to the opposite-end electronic equipment through the first P2P connected channel so that the opposite-end electronic equipment determines the working channel of the target electronic equipment in real time according to the third target synchronization time information and the third target time slice information; wherein, the channel of the first wireless connection and the channel of the first P2P connection are same-frequency different channels; the third target synchronization time information is used for indicating time synchronization between the peer electronic device and the target electronic device.
2. The method of claim 1, wherein the first wireless connection is a second wireless communication connection if the target electronic device is a slave electronic device and the first added electronic device is a second router; and the main electronic equipment is the equipment which is used as a group owner GO in the P2P connection established between the target electronic equipment and the opposite-end electronic equipment.
3. The method of claim 1, wherein in the case that the target electronic device is a master electronic device and the first added electronic device is an electronic device capable of establishing a P2P connection, the first wireless connection is a second P2P connection; the main electronic device is a device which is used as a group owner GO in a P2P connection established between the target electronic device and the opposite-end electronic device.
4. The method according to claim 1, wherein when the target electronic device is a slave electronic device, the second newly added electronic device is a device capable of establishing a P2P connection, and the second wireless connection is a P2P connection, after the target electronic device sends third target synchronization time information and third target time slice information to the peer electronic device through a channel of the first P2P connection, if the peer electronic device starts to establish a fourth wireless connection with a fourth newly added electronic device when an operating channel is switched to the channel of the first P2P connection, the method further includes:
the target electronic equipment receives fourth target synchronization time information and fourth target time slice information which are sent by the opposite-end electronic equipment through the first P2P connection; after the peer electronic device starts to establish the third wireless connection, before a working channel of the peer electronic device is switched from a channel of the first P2P connection to a channel of the fourth wireless connection, the peer electronic device determines that the fourth target synchronization time information and the fourth target time slice information are obtained; the fourth target synchronization time information is used for indicating time synchronization between the target electronic device and the opposite-end electronic device, and the fourth target time slice information is used for indicating a switching period and a channel switching sequence of each channel in the same-frequency different channels of the opposite-end electronic device; the channel switching sequence is used for representing the switching sequence of each channel in the same-frequency different channels;
After the target electronic equipment adjusts the time of the target electronic equipment according to the fourth target synchronous time information, determining channel adjustment information and fifth target time slice information according to the fourth target time slice information, and switching a working channel according to the channel adjustment information and the fifth target time slice information; the channel adjustment information is used for indicating the target electronic device to switch a working channel to the channel of the third wireless connection for the target duration before switching to the channel of the first P2P connection; the target time length is obtained according to the fourth target time slice information, and the target time length is the time length from the current moment to the time when the working channel of the opposite-end electronic equipment is switched to the first P2P connection channel; the fifth target time slice information is used for indicating the switching period of each channel in the same-frequency different channels of the target electronic equipment;
when the working channel of the target electronic device is switched to the channel of the first P2P connection for the first time after the five target time slice information is determined, the target electronic device sends fifth target synchronization time information and the fifth target time slice information to the opposite-end electronic device through the first P2P connection, so that the opposite-end electronic device determines the working channel of the target electronic device in real time according to the fifth target synchronization time information and the fifth target time slice information; wherein the fifth target synchronization time information is used to indicate time synchronization of the peer electronic device and the target electronic device.
5. The method of claim 1, wherein if the target electronic device is a master electronic device and the first new electronic device is a first router, the first wireless connection is a first wireless communication connection; the main electronic device is a device which is used as a group owner GO in a P2P connection established between the target electronic device and the opposite-end electronic device.
6. The method of claim 5, wherein after the target electronic device sends first target synchronization time information and first target time slice information to the peer electronic device over the first P2P connection, the method further comprises:
the working channel of the target electronic equipment is switched from the channel of the first P2P connection to the channel of the first wireless communication connection;
after the target electronic device starts to establish a second P2P connection with optional electronic devices, before a working channel of the target electronic device is switched from a channel of the first wireless communication connection to a channel of the second P2P connection, the target electronic device determines sixth target time slice information according to the first target synchronization time information and the first target time slice information; the selectable electronic equipment is electronic equipment capable of establishing P2P connection; the sixth target time slice information is used for indicating the switching period and the channel switching sequence of each channel in the same-frequency different channels of the target electronic equipment; the channel switching sequence is used for representing the switching sequence of each channel in the same-frequency different channels;
When the working channel of the target electronic device is switched to the channel of the second P2P connection for the first time, the target electronic device sends sixth target synchronization time information and the sixth target time slice information to the optional electronic device through the second P2P connection; wherein the sixth target synchronization time information is used to indicate time synchronization of the optional electronic device with the target electronic device;
after the working channel of the target electronic device is firstly switched to the channel connected with the second P2P, the target electronic device sends seventh target synchronization time information and seventh target time slice information to the opposite-end electronic device through the first P2P connection under the condition of firstly switching to the channel connected with the first P2P; the seventh target synchronization time information is used to indicate time synchronization between the peer electronic device and the target electronic device, and the seventh target time slice information includes the sixth target time slice information.
7. An electronic device comprising memory and one or more processors; the memory is coupled with the processor; wherein the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the communication method of any of claims 1-6.
8. A computer-readable storage medium comprising computer instructions which, when executed on an electronic device, cause the electronic device to perform the communication method of any one of claims 1-6.
CN202210903892.0A 2022-07-29 2022-07-29 Communication method, electronic equipment and storage medium Active CN114980235B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210903892.0A CN114980235B (en) 2022-07-29 2022-07-29 Communication method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210903892.0A CN114980235B (en) 2022-07-29 2022-07-29 Communication method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114980235A CN114980235A (en) 2022-08-30
CN114980235B true CN114980235B (en) 2022-12-09

Family

ID=82969303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210903892.0A Active CN114980235B (en) 2022-07-29 2022-07-29 Communication method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114980235B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011156638A2 (en) * 2010-06-10 2011-12-15 Qualcomm Incorporated Peer-to-peer communication with symmetric waveform for downlink and uplink
CN102291794A (en) * 2011-09-27 2011-12-21 杭州华三通信技术有限公司 Channel switching method and equipment in MESH network
WO2013125825A1 (en) * 2012-02-24 2013-08-29 Samsung Electronics Co., Ltd. Method and apparatus for allocating ip address in wireless communication network
CN105792291A (en) * 2014-12-23 2016-07-20 华为技术有限公司 Channel switching method and wireless access device
CN110049532A (en) * 2019-03-12 2019-07-23 上海感悟通信科技有限公司 A kind of heartbeat method, controlled node and control node for wireless self-networking
CN113965496A (en) * 2021-10-15 2022-01-21 上汽通用五菱汽车股份有限公司 Method for optimizing response of screen projection process

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101976518B1 (en) * 2012-10-22 2019-05-10 삼성전자주식회사 Wi-fi p2p communication terminal device and method thereof
US20170188411A1 (en) * 2014-05-08 2017-06-29 Telefonaktiebolaget Lm Ericsson (Publ) Relating Activity Periods for a UE Performing Device-to-Device (D2D) and Cellular Operations
US10869232B2 (en) * 2018-01-16 2020-12-15 Mediatek Singapore Pte. Ltd. Method and apparatus for advertising channel switch time in a wireless transmission system
CN111641979B (en) * 2020-04-30 2021-12-03 华为技术有限公司 Method for realizing Wi-Fi point-to-point service and related equipment
CN114007267A (en) * 2020-07-28 2022-02-01 华为技术有限公司 Channel adjusting method and electronic equipment
CN112073949B (en) * 2020-08-24 2024-05-28 浙江大华技术股份有限公司 Data transmission method, related device and equipment
CN115988643A (en) * 2021-10-14 2023-04-18 荣耀终端有限公司 WiFi P2P connection method, electronic device and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011156638A2 (en) * 2010-06-10 2011-12-15 Qualcomm Incorporated Peer-to-peer communication with symmetric waveform for downlink and uplink
CN102291794A (en) * 2011-09-27 2011-12-21 杭州华三通信技术有限公司 Channel switching method and equipment in MESH network
WO2013125825A1 (en) * 2012-02-24 2013-08-29 Samsung Electronics Co., Ltd. Method and apparatus for allocating ip address in wireless communication network
CN105792291A (en) * 2014-12-23 2016-07-20 华为技术有限公司 Channel switching method and wireless access device
CN110049532A (en) * 2019-03-12 2019-07-23 上海感悟通信科技有限公司 A kind of heartbeat method, controlled node and control node for wireless self-networking
CN113965496A (en) * 2021-10-15 2022-01-21 上汽通用五菱汽车股份有限公司 Method for optimizing response of screen projection process

Also Published As

Publication number Publication date
CN114980235A (en) 2022-08-30

Similar Documents

Publication Publication Date Title
CN117376615B (en) Screen-throwing display method and electronic equipment
WO2021043219A1 (en) Bluetooth reconnection method and related apparatus
US11051260B2 (en) Asynchronous quick connect for low-latency transitions of content presentation between two devices
WO2022143071A1 (en) Connection establishment method and electronic device
US20240215088A1 (en) Device networking method, electronic device, and storage medium
JP2016127379A (en) Information processing device, control method, and program
CN114980235B (en) Communication method, electronic equipment and storage medium
CN114650513A (en) Communication method and communication device
WO2022111657A1 (en) Wlan communication method and related apparatus
JP2017204740A (en) Communication device, control method of communication device, and program
CN114173285B (en) Bluetooth back connection method, system, electronic equipment, server and storage medium
WO2022111712A1 (en) Audio and video synchronization method and device
CN113783758B (en) Method for configuring monitoring period and corresponding electronic equipment
WO2022042261A1 (en) Screen sharing method, electronic device and system
JP6860992B2 (en) Information processing device, control method of information processing device, program of information processing device and information processing system
CN116981108B (en) Wireless screen-throwing connection method, mobile terminal and computer readable storage medium
CN116700547B (en) Cursor traversing method and device
JP7158886B2 (en) IMAGE PROCESSING APPARATUS, ELECTRONIC DEVICE, AND IMAGE PROCESSING APPARATUS CONTROL METHOD
JP7490352B2 (en) COMMUNICATION DEVICE, ITS CONTROL METHOD, AND ITS PROGRAM
EP4203409A1 (en) Method and devices for configuring device
WO2022095581A1 (en) Data transmission method and terminal device
US20240340986A1 (en) Data Transmission Management Method, Electronic Device, and Storage Medium
JP6887850B2 (en) Communication device, control method of communication device, program
JP2023039666A (en) Electronic device, electronic device control method, and program
CN118368322A (en) Channel selection method and electronic equipment

Legal Events

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

Effective date of registration: 20230914

Address after: 201306 building C, No. 888, Huanhu West 2nd Road, Lingang New District, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai

Patentee after: Shanghai Glory Smart Technology Development Co.,Ltd.

Address before: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee before: Honor Device Co.,Ltd.