CN109587667B - Connection establishing method and device, equipment and storage medium - Google Patents

Connection establishing method and device, equipment and storage medium Download PDF

Info

Publication number
CN109587667B
CN109587667B CN201811409098.0A CN201811409098A CN109587667B CN 109587667 B CN109587667 B CN 109587667B CN 201811409098 A CN201811409098 A CN 201811409098A CN 109587667 B CN109587667 B CN 109587667B
Authority
CN
China
Prior art keywords
connection
connection information
request
information
establish
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
CN201811409098.0A
Other languages
Chinese (zh)
Other versions
CN109587667A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811409098.0A priority Critical patent/CN109587667B/en
Publication of CN109587667A publication Critical patent/CN109587667A/en
Priority to PCT/CN2019/110204 priority patent/WO2020103592A1/en
Application granted granted Critical
Publication of CN109587667B publication Critical patent/CN109587667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

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

Abstract

The embodiment of the application discloses a connection establishing method, a device, equipment and a storage medium, wherein the method comprises the following steps: a first device receives an operation instruction, wherein the operation instruction is used for instructing the first device to establish a P2P connection with a second device; if the P2P connection information of the second device is not stored in the first device, the first device sends the P2P connection information of the first device to the second device so as to trigger the second device to send a first connection request to the first device based on the P2P connection information of the first device; the first device receiving the first connection request; and the first device responds to the first connection request and establishes P2P connection with the second device.

Description

Connection establishing method and device, equipment and storage medium
Technical Field
The embodiment of the application relates to electronic technology, and relates to but is not limited to a connection establishment method, a connection establishment device, equipment and a storage medium.
Background
The Wireless Fidelity Direct (WFD) standard refers to allowing electronic devices in a Wireless network to connect to each other without passing through a Wireless router. Similar to bluetooth technology, this standard allows point-to-point (P2P, Peer-to-Peer) interconnection among multiple electronic devices. Compared with a bluetooth connection link, a direct connection link based on WiFi (i.e., a P2P connection link) has better data transmission speed, transmission distance, etc. than the bluetooth connection link, and thus is widely used. For example, WFD technology can be used to enable a user's laptop computer to bypass the access point and establish a P2P connection directly with a wireless printer, digital camera, projector, sensor, or television box, etc.
At present, when a first device needs to establish a P2P connection with a second device, in a normal situation, if the first device does not store P2P connection information of the second device, the first device needs to negotiate with the second device first, and after the first device establishes respective roles through negotiation and obtains P2P connection information of the second device, the P2P connection with the second device can be achieved.
However, the process of the first device completing the negotiation with the second device takes a long time, which is not favorable for the first device to quickly establish the P2P connection with the second device.
Disclosure of Invention
In view of the above, embodiments of the present application provide a connection establishment method and apparatus, a device, and a storage medium to solve at least one problem in the related art.
The technical scheme of the embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a connection establishment method, where the method includes:
a first device receives an operation instruction, wherein the operation instruction is used for instructing the first device to establish a P2P connection with a second device;
if the P2P connection information of the second device is not stored in the first device, the first device sends the P2P connection information of the first device to the second device so as to trigger the second device to send a first connection request to the first device based on the P2P connection information of the first device;
the first device receiving the first connection request;
and the first device responds to the first connection request and establishes P2P connection with the second device.
In a second aspect, an embodiment of the present application provides another connection establishment method, where the method includes:
a second device receiving P2P connection information of a first device, the P2P connection information of the first device being transmitted by the first device when the P2P connection information of the second device is not saved;
if the working channel of the second device includes the P2P channel indicated by the P2P connection information of the first device, the second device sends a first connection request to the first device to request to establish a P2P connection with the first device based on the P2P connection information of the first device.
In a third aspect, an embodiment of the present application provides a connection establishment apparatus, including:
a first receiving module, configured to receive an operation instruction, where the operation instruction is used to instruct the connection establishment apparatus to establish a P2P connection with a second device;
a first sending module, configured to, if the P2P connection information of the second device is not stored in the connection establishing apparatus, send the P2P connection information of the second device to the second device, so as to trigger the second device to send a first connection request to the connection establishing apparatus based on the P2P connection information of the connection establishing apparatus;
a second receiving module configured to receive the first connection request;
a response module configured to establish a P2P connection with the second device in response to the first connection request.
In a fourth aspect, an embodiment of the present application provides another connection establishment apparatus, including:
a third receiving module, configured to receive P2P connection information of a first device, the P2P connection information of the first device being sent by the first device when the P2P connection information of the connection establishing apparatus is not saved;
a second sending module, configured to, if the working channel of the connection establishing apparatus includes the P2P channel indicated by the P2P connection information of the first device, send a first connection request to the first device to request to establish a P2P connection with the first device based on the P2P connection information of the first device.
In a fifth aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory stores a computer program that is executable on the processor, and the processor implements the steps in any of the connection establishment methods described above when executing the program.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in any of the connection establishment methods described above.
In this embodiment of the present application, when a first device needs to establish a P2P connection with a second device, if the first device does not store P2P connection information of the second device, at this time, the first device does not trigger a negotiation process, that is, does not send a negotiation request to the second device, but directly sends its P2P connection information to the second device, so as to trigger the second device to send a first connection request to the first device based on the P2P connection information of the first device, thereby quickly implementing the P2P connection between the first device and the second device.
Drawings
Fig. 1A is a schematic flow chart illustrating an implementation of a connection establishment method according to an embodiment of the present application;
FIG. 1B is a schematic diagram of a P2P connection application interface according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of another connection establishment method according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating an implementation flow of a method for establishing a further connection according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating an implementation flow of a method for establishing a further connection according to an embodiment of the present application;
fig. 5 is a schematic flow chart illustrating an implementation of another connection establishment method according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating an implementation flow of a method for establishing a further connection according to an embodiment of the present application;
fig. 7 is a schematic flow chart illustrating an implementation of another connection establishment method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a connection establishment apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another connection establishment apparatus according to an embodiment of the present application;
fig. 10 is a hardware entity diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solution of the present application is further elaborated below with reference to the drawings and the embodiments.
An embodiment of the present application provides a connection establishment method, and fig. 1A is a schematic flow chart illustrating an implementation of the connection establishment method according to the embodiment of the present application, where as shown in fig. 1A, the method includes steps S101 to S111:
s101, a first device receives an operation instruction, wherein the operation instruction is used for indicating the first device to establish P2P connection with a second device;
for example, as shown in fig. 1B, a plurality of P2P devices (e.g., a second device 102, a third device 103, and a fourth device 104) capable of establishing a P2P connection are displayed on the P2P connection application interface 101 of the first device, so that, based on the P2P connection application interface 101, the user can select which device to perform a P2P connection with, for example, by touching an area where "the second device 102" is located in the P2P connection application interface 101, the first device is triggered to establish a P2P connection with the second device 102.
S102, if the first device does not store the P2P connection information of the second device, the first device sends a first Group Owner (GO) Negotiation Request (hereinafter referred to as a first GO Negotiation Request) to the second device;
there may be two reasons why the P2P connection information of the second device is not stored in the first device: for example, when the first device establishes a P2P connection with the second device for the first time, the P2P connection information of the second device is not stored in the first device. As another example, the first device may not maintain the P2P connection information of the second device when the first device and the second device last established a P2P connection.
S103, the second device responds to the first GO Negotiation request and returns a first GO Negotiation Response (GO Negotiation Response) to the first device;
s104, the first device receives the first GO negotiation response, starts to monitor a channel, and waits for receiving a second GO negotiation request sent by the second device;
s105, the second equipment executes P2P connection initialization;
s106, after the second device completes initialization of P2P connection, the second device sends the second GO negotiation request to the first device, where the second GO negotiation request carries negotiation information of the second device;
generally, the negotiation information of the second device includes a P2P Media Access Control (MAC) address of the second device, and a P2P channel supported by the second device.
S107, the first device responds to the second GO negotiation request and returns a second GO negotiation response to the second device, wherein the second GO negotiation response carries negotiation information of the first device;
similarly, the negotiation information of the first device generally includes the P2P MAC address of the first device, the P2P channels supported by the first device.
S108, after receiving the second GO Negotiation response, the second device returns a GO Negotiation confirmation (GO Negotiation confirmation) to the first device;
it should be noted that, after receiving the second GO negotiation response, the second device may determine that the role in P2P connection is the GO or the Group Client (GC), and if the role is the GO, wait to receive the connection request sent by the first device; if it is GC, a connection request is transmitted to the first device. In addition, the confirmation is negotiated, and simultaneously, the P2P channel used for subsequently establishing the P2P connection is also confirmed.
S109, the second device sends a first connection request to the first device based on the negotiation information of the first device;
here, it should be noted that the first connection request is used to request that a P2P connection is established with the first device on a P2P channel where the second device operates, and the first connection request carries a P2P MAC address of the second device. After receiving the first connection request, the first device sends a first connection response to the second device on a P2P channel on which the second device operates based on a P2P MAC address of the second device, wherein the first connection response is used for informing that the second device can establish a P2P connection; after receiving the first connection response, the second device returns a second connection response to the first device, and at this time, the first device and the second device complete the establishment of the P2P connection.
Assuming that the second device determines that the second device is in a role of a client (i.e., the second device serves as a GC) after receiving the second GO negotiation response, at this time, the second device sends the first connection request to the first device after returning a GO negotiation confirmation to the first device.
S110, the first device receives the first connection request;
and S111, the first device responds to the first connection request and establishes P2P connection with the second device.
In this embodiment, before establishing a P2P connection with the second device, if the P2P connection information of the second device is not stored in the first device, the first device and the second device first need to complete a negotiation procedure, that is, the foregoing steps S102 to S108, first, so that it takes a long time for the first device to establish the P2P connection with the second device.
Based on this, in order to quickly establish a P2P connection between the first device and the second device, the present embodiment provides another connection establishment method, which is applied to the first device, and the first device may be various types of electronic devices with connection establishment capability in the implementation process, for example, the first device may include a mobile phone, a tablet computer, a desktop computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a set-top box, and the like. The functions implemented by the method may be implemented by a processor in the first device calling program code, which may of course be stored in a computer storage medium, and the first device may, as seen, comprise at least a processor and a storage medium.
Fig. 2 is a schematic flow chart illustrating an implementation of another connection establishment method according to an embodiment of the present application, and as shown in fig. 2, the method includes steps S201 to S204:
s201, a first device receives an operation instruction, wherein the operation instruction is used for indicating the first device to establish P2P connection with a second device;
here, the first device determines whether it holds the P2P connection information of the second device in response to the operation instruction, and proceeds to step S202 if it does not hold the P2P connection information of the second device. If the first device itself stores the P2P connection information of the second device, the first device sends a second connection request to the second device to request to establish a P2P connection with the second device based on the P2P connection information of the second device.
S202, if the P2P connection information of the second device is not stored in the first device, the first device sends the P2P connection information of the first device to the second device to trigger the second device to send a first connection request to the first device based on the P2P connection information of the first device;
generally, the P2P connection information of the first device includes a P2P MAC address of the first device, a P2P channel supported by the first device, and a role (generally GO) when the first device makes a P2P connection with the second device. It can be understood that, if the P2P connection information of the second device is not stored in the first device, the first device skips the process of negotiating with the second device and directly sends its P2P connection information to the second device, thereby triggering the second device to send a first connection request to the first device based on the P2P connection information of the first device, and quickly establishing a P2P connection with the second device; the first connection request and the first device establish a P2P connection on a P2P channel where the second device operates, where the first connection request carries a P2P MAC address of the second device.
It should be noted that, in all the embodiments provided in this application, if the connection request is sent from the second device to the first device, it is referred to as a first connection request, and if the connection request is sent from the first device to the second device, it is referred to as a second connection request.
S203, the first device receives the first connection request;
s204, the first device responds to the first connection request and establishes P2P connection with the second device.
It can be understood that, after receiving the first connection request, the first device sends a first connection response to the second device on a P2P channel where the second device operates based on a P2P MAC address of the second device, where the first connection response carries information that a P2P connection can be established with the second device, that is, the first connection response is used for informing that the second device can establish a P2P connection; after receiving the first connection response, the second device returns a second connection response to the first device, where the second connection response carries information confirming establishment of the P2P connection, that is, the second connection response is used to inform the first device that the P2P connection is successfully established, and at this time, the first device and the second device complete establishment of the P2P connection.
It should be noted that, in all the embodiments provided in this application, if the connection response is sent by the first device to the second device, the connection response is referred to as a first connection response, and if the connection response is sent by the second device to the first device, the connection response is referred to as a second connection response. The first connection response and the second connection response have the same function, and both are used for informing the opposite side that the P2P connection can be established. For example, both the first connection response and the second connection response carry "OK" confirmation information.
In this embodiment of the present application, when a first device needs to establish a P2P connection with a second device, if the first device does not store P2P connection information of the second device, at this time, the first device does not trigger a negotiation process, that is, does not send a negotiation request to the second device, but directly sends its P2P connection information to the second device, so as to trigger the second device to send a first connection request to the first device based on the P2P connection information of the first device, thereby quickly implementing the P2P connection between the first device and the second device.
The embodiment of the present application provides a further connection establishment method, and fig. 3 is a schematic flow chart illustrating an implementation of the further connection establishment method provided in the embodiment of the present application, and as shown in fig. 3, the method includes steps S301 to S308:
s301, a first device receives an operation instruction, wherein the operation instruction is used for indicating the first device to establish P2P connection with a second device;
s302, the first device detects whether the P2P connection information of the second device is saved or not; if yes, go to step S303; otherwise, executing step S306;
s303, the first device sends a second connection request to the second device to request to establish a P2P connection with the second device based on the P2P connection information of the second device, and then the step S304 is carried out;
in general, regardless of whether the P2P connection information of the second device includes the role played by the second device when performing P2P connection, if the P2P connection information of the second device includes the P2P MAC address of the second device and the P2P channel supported by the second device, the first device may send a second connection request to the second device based on the two information. The second connection request is used for requesting the second device to establish a P2P connection on a P2P channel where the first device operates, and the second connection request carries a P2P MAC address of the first device. After receiving the second connection request, the second device sends a second connection response to the first device on a P2P channel on which the first device operates based on the P2P MAC address of the first device, wherein the second connection response is used for informing that the first device can establish a P2P connection; after receiving the second connection response, the first device returns a first connection response to the second device, and at this time, the second device and the first device complete the establishment of the P2P connection.
S304, the first device detects whether a connection response fed back by the second device based on the second connection request (i.e. the second connection response) is received within a preset time period; if yes, go to step S305; otherwise, executing step S306;
s305, the first device establishes a P2P connection with the second device based on the connection response;
s306, the first device sends the P2P connection information of the first device to the second device to trigger the second device to send the first connection request to the first device based on the P2P connection information of the first device, and then the step S307 is carried out;
it is to be understood that, if the P2P connection information of the second device is already saved in the first device, after the second connection request is sent to the second device, if the second device does not respond for a long time, at this time, the first device does not perform a negotiation process, but sends its P2P connection information to the second device to trigger the second device to send the first connection request to the first device based on the P2P connection information of the first device, thereby implementing a fast P2P connection.
Generally, after the first device sends the second connection request to the second device, the second device does not respond for a long time, which may be because the P2P connection information of the first device is not saved in the second device or the second device cannot operate on the P2P channel used by the current P2P connection.
S307, the first device receives the first connection request;
s308, the first device responds to the first connection request and establishes P2P connection with the second device.
An embodiment of the present application provides another connection establishment method, and fig. 4 is a schematic flow chart illustrating an implementation of another connection establishment method provided in the embodiment of the present application, where as shown in fig. 4, the method includes steps S401 to S407:
s401, a first device receives an operation instruction, wherein the operation instruction is used for indicating the first device to establish a P2P connection with a second device;
s402, if the P2P connection information of the second device is not stored in the first device, the first device detects whether the first device and the second device have an established non-P2P connection link; if yes, go to step S403; otherwise, go to step S404;
it should be noted that, if the P2P connection information of the second device is already stored in the first device, but after the first device sends the second connection request to the second device based on the P2P connection information of the second device, if the first device does not receive the connection response fed back by the second device based on the second connection request within a preset time period, the first device may also send its P2P connection information to the second device in steps S403 to S405 or in a broadcast manner.
For example, the non-P2P connection link may be an infrared link, a Near Field Communication (NFC) link, a bluetooth Socket link, or the like.
S403, the first device sends the P2P connection information of the first device to the second device through the non-P2P connection link, and then the step S406 is carried out;
s404, the first device and the second device establish the non-P2P connection link;
in other embodiments, if there is no established non-P2P connection link between the first device and the second device, the first device may further send the P2P connection information of the first device to the second device in a broadcast manner, that is, the first device broadcasts its P2P connection information, and if the second device receives the P2P connection information of the first device, the second device sends a first connection request to the first device based on the P2P connection information of the first device. Generally, when the second device receives the P2P connection information of the first device, if the second device is idle at this time (e.g., the second device does not currently establish a P2P connection with another device, or the second device currently establishes a P2P connection with another device, but the number of devices connecting the second device through the P2P does not exceed a preset threshold), the second device sends a first connection request to the first device.
S405, the first device sends the P2P connection information of the first device to the second device through the established non-P2P connection link;
generally, the first device does not need to negotiate with the second device when establishing the non-P2P connection link, thus saving the time consumed for negotiation. Establishing a non-P2P connection link between the first device and the second device, for example, via Bluetooth Low Energy (BLE) technology.
In other embodiments, in order to reduce power consumption of the first device and the second device, in a normal case, after the first device sends the P2P connection information of the first device to the second device through the established non-P2P connection link, the non-P2P connection link is disconnected.
S406, the first device receives a first connection request sent by the second device to the first device based on the P2P connection information of the first device;
s407, the first device responds to the first connection request, and establishes a P2P connection with the second device.
The embodiment of the present application provides another connection establishment method, which is applied to a second device, where the second device may be various types of electronic devices with connection establishment capability in the implementation process, for example, the first device may include a mobile phone, a tablet computer, a desktop computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a set-top box, and the like. The functions implemented by the method may be implemented by a processor in the first device calling program code, which may of course be stored in a computer storage medium, and the first device may, as seen, comprise at least a processor and a storage medium.
Fig. 5 is a schematic flow chart illustrating an implementation of another connection establishment method provided in the embodiment of the present application, and as shown in fig. 5, the method includes steps S501 to S502:
s501, a second device receives P2P connection information of a first device, wherein the P2P connection information of the first device is sent by the first device when the P2P connection information of the second device is not saved;
in other embodiments, the P2P connection information of the first device received by the second device may also be sent by the first device in the following example, that is: the P2P connection information of the second device is already saved in the first device, the first device sends a second connection request to the second device based on the P2P connection information of the second device, but if the first device does not receive a connection response fed back by the second device based on the second connection request within a preset time length, the first device sends own P2P connection information to the second device.
S502, if the working channel of the second device comprises the P2P channel indicated by the P2P connection information of the first device, the second device sends a first connection request to the first device to request to establish a P2P connection with the first device based on the P2P connection information of the first device.
An embodiment of the present application provides a method for establishing a further connection, and fig. 6 is a schematic flow chart illustrating an implementation of the method for establishing a further connection provided in the embodiment of the present application, where as shown in fig. 6, the method includes steps S601 to S604:
s601, a second device receives P2P connection information of a first device, wherein the P2P connection information of the first device is sent by the first device when the P2P connection information of the second device is not saved;
s602, the second device detects whether the working channel of the second device comprises a P2P channel indicated by the P2P connection information of the first device; if yes, go to step S603; otherwise, go to step S604;
s603, the second device sends a first connection request to the first device to request to establish a P2P connection with the first device based on the P2P connection information of the first device;
s604, the second device sends the P2P connection information of the second device to the first device to trigger the first device to send a second connection request to the second device to request to establish P2P connection with the second device based on the P2P connection information of the second device.
In practical applications, the second device may not support the P2P channel indicated by the P2P connection information of the first device, for example, the first device indicates that the P2P connection is established using the 5G channel, but since the second device can only operate on the 2.4G channel, in this case, to avoid a connection failure, in this embodiment of the present application, if the second device cannot operate on the P2P channel indicated by the P2P connection information of the first device, the second device sends its P2P connection information to the first device, and triggers the first device to request to connect the second device, so as to improve connection stability.
In other embodiments, the sending, by the second device, the P2P connection information of the second device to the first device may include: if the second device and the first device have an established non-P2P connection link, the second device sending P2P connection information of the second device to the first device through the non-P2P connection link; if there is no established non-P2P connection link between the second device and the first device, the second device broadcasting its own P2P connection information; or, if there is no established non-P2P connection link between the second device and the first device, the second device establishes the non-P2P connection link with the first device, and the second device sends the P2P connection information of the second device to the first device through the established non-P2P connection link.
An embodiment of the present application provides another connection establishment method, and fig. 7 is a schematic flow chart illustrating an implementation of another connection establishment method provided in the embodiment of the present application, where as shown in fig. 7, the method includes steps S701 to S711:
s701, a first device receives an operation instruction, wherein the operation instruction is used for indicating the first device to establish P2P connection with a second device;
s702, if the P2P connection information of the second device is not stored in the first device, the first device sends the P2P connection information of the first device to the second device;
in other embodiments, if the P2P connection information of the second device is already saved in the first device, the first device sends a second connection request to the second device based on the P2P connection information of the second device; and if the first device does not receive the connection response fed back by the second device based on the second connection request within the preset time length, the first device sends the own P2P connection information to the second device at the moment.
S703, the second device receives the P2P connection information of the first device;
s704, the second device detecting whether the working channel of the second device comprises a P2P channel indicated by the P2P connection information of the first device; if yes, go to step S705; otherwise, go to step S708;
s705, the second device sends a first connection request to the first device based on the P2P connection information of the first device;
s706, the first device receives the first connection request;
s707, the first device responds to the first connection request and establishes a P2P connection with the second device;
s708, the second device sends the P2P connection information of the second device to the first device;
s709, the first device sends a second connection request to the second device based on the P2P connection information of the second device;
s710, the second device receives the second connection request;
s711, the second device responds to the second connection request, and establishes a P2P connection with the first device.
At present, when a first device needs to establish a P2P connection with a second device, first, Group (Group) information needs to be negotiated with the second device, and interaction of P2P connection information of both sides is completed, and a specific process refers to an embodiment corresponding to fig. 1A, so that a process of implementing the P2P connection is relatively time-consuming. Based on this, in this embodiment of the present application, a first device serves as a GO role for a preset period of time to quickly generate Group information (i.e., its own P2P connection information), then the first device transmits the Group information to a second device through a Low power consumption Bluetooth technology (BLE), and the second device, after receiving the Group information, serves as a GC role to directly send a first connection request to the first device, so that a negotiation process is omitted, and therefore, a P2P connection between two ends can be quickly established.
It should be noted that, in other embodiments, the first device may also transmit the Group information to the second device by using an infrared technology or an NFC technology, or a bluetooth-based transmission method may also transmit the Group information to the second device by using a socket method.
Based on the foregoing embodiments, an embodiment of the present application provides a connection establishment apparatus, where the apparatus includes modules and units included in the modules, and may be implemented by a processor in an electronic device; of course, the implementation can also be realized through a specific logic circuit; in implementation, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 8 is a schematic structural diagram of a connection establishment apparatus according to an embodiment of the present application, and as shown in fig. 8, the apparatus 800 includes a first receiving module 801, a first sending module 802, a second receiving module 803, and a connection establishment module 804; wherein the content of the first and second substances,
a first receiving module 801 configured to receive an operation instruction, where the operation instruction is used to instruct the connection establishment apparatus 800 to establish a P2P connection with a second device; it should be noted that, in general, the apparatus corresponding to the second device is the connection establishing apparatus 900 shown in fig. 9.
A first sending module 802, configured to send the P2P connection information of the connection establishing apparatus 800 to the second device if the P2P connection information of the second device is not stored in the connection establishing apparatus 800, so as to trigger the second device to send a first connection request to the connection establishing apparatus 800 based on the P2P connection information of the connection establishing apparatus 800;
a second receiving module 803 configured to receive the first connection request;
a connection establishing module 804 configured to establish a P2P connection with the second device in response to the first connection request.
In other embodiments of the present invention, the substrate may be,
a first sending module 802, further configured to send a second connection request to the second device to request to establish a P2P connection with the second device based on the P2P connection information of the second device if the P2P connection information of the second device is already saved in the connection establishing apparatus 800;
the connection establishing module 804 is further configured to establish a P2P connection with the second device based on the connection response if a connection response fed back by the second device based on the second connection request is received within a preset time period.
In other embodiments of the present invention, the substrate may be,
the first sending module 802 is further configured to send the P2P connection information of the connection establishing apparatus 800 to the second device to trigger the second device to send the first connection request to the connection establishing apparatus 800 based on the P2P connection information of the connection establishing apparatus 800 if a connection response fed back by the second device based on the second connection request is not received within a preset time length.
In other embodiments, the first sending module 802 includes:
a sending unit, configured to send the P2P connection information of the connection establishing apparatus 800 to the second device through the non-P2P connection link if the connection establishing apparatus 800 and the second device have an established non-P2P connection link therebetween;
a broadcasting unit configured to broadcast the P2P connection information of the connection establishing apparatus 800 if there is no established non-P2P connection link between the connection establishing apparatus 800 and the second device;
or, the first sending module 802 further includes a connection establishing unit; wherein the content of the first and second substances,
the connection establishing unit is configured to establish a non-P2P connection link between the connection establishing apparatus 800 and the second device if there is no established non-P2P connection link between the connection establishing apparatus 800 and the second device; the sending unit is further configured to send the P2P connection information of the connection establishing apparatus 800 to the second device through the established non-P2P connection link.
An embodiment of the present application provides another connection establishing apparatus, fig. 9 is a schematic structural diagram of the another connection establishing apparatus in the embodiment of the present application, and as shown in fig. 9, the apparatus 900 includes a third receiving module 901 and a second sending module 902; wherein the content of the first and second substances,
a third receiving module 901, configured to receive P2P connection information of a first device, where the P2P connection information of the first device is sent by the first device when the P2P connection information of the connection establishing apparatus 900 is not saved; it should be noted that, in general, the apparatus corresponding to the first device is the connection establishment apparatus 800 shown in fig. 8.
A second sending module 902, configured to send, if the working channel of the connection establishing apparatus 900 includes the P2P channel indicated by the P2P connection information of the first device, a first connection request to the first device to request to establish a P2P connection with the first device based on the P2P connection information of the first device.
In other embodiments of the present invention, the substrate may be,
the second sending module 902 is further configured to, if the working channel of the connection establishing apparatus 900 does not include the P2P channel indicated by the P2P connection information of the first device, send the P2P connection information of the connection establishing apparatus 900 to the first device to trigger the first device to send a second connection request to the connection establishing apparatus 900 to request to establish a P2P connection with the connection establishing apparatus 900 based on the P2P connection information of the connection establishing apparatus 900.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be noted that, in the embodiment of the present application, if the connection establishment method is implemented in the form of a software functional module and sold or used as a standalone product, the connection establishment method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or a part contributing to the related art may be embodied in the form of a software product stored in a storage medium, and including instructions for enabling an electronic device (which may be a mobile phone, a tablet computer, a desktop computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a set-top box, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present application provides an electronic device, fig. 10 is a schematic diagram of a hardware entity of the electronic device according to the embodiment of the present application, and as shown in fig. 10, the hardware entity of the electronic device 100 includes: comprising a memory 1001 and a processor 1002, said memory 1001 storing a computer program operable on the processor 1002, said processor 1002 implementing the steps in the connection establishment method provided in the above described embodiments when executing said program.
The Memory 1001 is configured to store instructions and applications executable by the processor 1002, and may also buffer data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or already processed by the processor 1002 and modules in the electronic device 100, and may be implemented by a FLASH Memory (FLASH) or a Random Access Memory (RAM).
Correspondingly, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps in the connection establishment method provided in the above-mentioned embodiments.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; 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, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or a part contributing to the related art may be embodied in the form of a software product stored in a storage medium, and including instructions for enabling an electronic device (which may be a mobile phone, a tablet computer, a desktop computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a set-top box, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for connection establishment, the method comprising:
the first device receives an operation instruction, wherein the operation instruction is used for determining whether the P2P connection information of the second device is stored in the first device;
if the P2P connection information of the second device is not stored in the first device, the first device sends the P2P connection information of the first device to the second device so as to trigger the second device to send a first connection request to the first device based on the P2P connection information of the first device; wherein the P2P connection information of the first device at least includes: a P2P MAC address of the first device, P2P channels supported by the first device, and a role of the first device in making a P2P connection with the second device; the first connection request includes at least a P2P MAC address of the second device;
the first device receiving the first connection request;
and the first device responds to the first connection request and establishes P2P connection with the second device.
2. The method of claim 1, wherein after the first device receives the operation instruction, the method further comprises:
if the P2P connection information of the second device is saved in the first device, the first device sends a second connection request to the second device to request to establish a P2P connection with the second device based on the P2P connection information of the second device;
and if the first device receives a connection response fed back by the second device based on the second connection request within a preset time length, the first device establishes a P2P connection with the second device based on the connection response.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
if the first device does not receive a connection response fed back by the second device based on the second connection request within a preset time length, the first device sends its own P2P connection information to the second device to trigger the second device to send the first connection request to the first device based on the P2P connection information of the first device.
4. The method of claim 3, wherein the first device sends its P2P connection information to the second device, and wherein the method comprises:
if the first device and the second device have an established non-P2P connection link therebetween, the first device sending P2P connection information of the first device to the second device through the non-P2P connection link; alternatively, the first and second electrodes may be,
if there is no established non-P2P connection link between the first device and the second device, the first device broadcasting its own P2P connection information; alternatively, the first and second electrodes may be,
if the first device and the second device do not have an established non-P2P connection link, the first device and the second device establish the non-P2P connection link, and the first device sends P2P connection information of the first device to the second device through the established non-P2P connection link.
5. A method for connection establishment, the method comprising:
a second device receiving peer-to-peer P2P connection information of a first device, the P2P connection information of the first device being sent by the first device when the P2P connection information of the second device is not saved; wherein the P2P connection information of the first device at least includes: a P2P MAC address of the first device, P2P channels supported by the first device, and a role of the first device in making a P2P connection with the second device; the first connection request comprises at least a P2P MAC address of the second device;
if the working channel of the second device includes the P2P channel indicated by the P2P connection information of the first device, the second device sends a first connection request to the first device to request to establish a P2P connection with the first device based on the P2P connection information of the first device; wherein the first connection request includes at least a P2P MAC address of the second device.
6. The method of claim 5, further comprising:
if the working channel of the second device does not include the P2P channel indicated by the P2P connection information of the first device, the second device sends the P2P connection information of the second device to the first device so as to trigger the first device to send a second connection request to the second device to request to establish P2P connection with the second device based on the P2P connection information of the second device.
7. A connection establishment apparatus, comprising:
a first receiving module configured to receive an operation instruction, where the operation instruction is used to instruct to determine whether P2P connection information of a second device is stored;
a first sending module, configured to send the P2P connection information of the connection establishment apparatus to the second device if the P2P connection information of the second device is not stored in the connection establishment apparatus, so as to trigger the second device to send a first connection request to the connection establishment apparatus based on the P2P connection information of the connection establishment apparatus; wherein the P2P connection information of the first device at least includes: a P2P MAC address of the first device, P2P channels supported by the first device, and a role of the first device in making a P2P connection with the second device; the first connection request includes at least a P2P MAC address of the second device;
a second receiving module configured to receive the first connection request;
a connection establishing module configured to establish a P2P connection with the second device in response to the first connection request.
8. A connection establishment apparatus, comprising:
a third receiving module, configured to receive peer-to-peer P2P connection information of a first device, where the P2P connection information of the first device is sent by the first device when the P2P connection information of the connection establishing apparatus is not saved; wherein the peer-to-peer P2P connection information of the first device at least includes: the P2P MAC address of the first device, the P2P channels supported by the first device, and the role of the first device in P2P connectivity with a second device;
a second sending module, configured to send a first connection request to the first device to request to establish a P2P connection with the first device based on the P2P connection information of the first device if the working channel of the connection establishment apparatus includes a P2P channel indicated by the P2P connection information of the first device; wherein the first connection request includes at least a P2P MAC address of the second device.
9. An electronic device comprising a memory and a processor, the memory storing a computer program operable on the processor, wherein the processor implements the steps in the connection establishment method of any one of claims 1 to 4 when executing the program; alternatively, the processor implements the steps in the connection establishment method of claim 5 or 6 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the connection establishment method according to any one of claims 1 to 4; alternatively, the computer program realizes the steps in the connection establishment method of claim 5 or 6 when executed by a processor.
CN201811409098.0A 2018-11-23 2018-11-23 Connection establishing method and device, equipment and storage medium Active CN109587667B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811409098.0A CN109587667B (en) 2018-11-23 2018-11-23 Connection establishing method and device, equipment and storage medium
PCT/CN2019/110204 WO2020103592A1 (en) 2018-11-23 2019-10-09 Method for establishing connection, apparatus, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811409098.0A CN109587667B (en) 2018-11-23 2018-11-23 Connection establishing method and device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109587667A CN109587667A (en) 2019-04-05
CN109587667B true CN109587667B (en) 2021-06-18

Family

ID=65924377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811409098.0A Active CN109587667B (en) 2018-11-23 2018-11-23 Connection establishing method and device, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109587667B (en)
WO (1) WO2020103592A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109587667B (en) * 2018-11-23 2021-06-18 Oppo广东移动通信有限公司 Connection establishing method and device, equipment and storage medium
CN112312586B (en) * 2019-08-02 2023-01-17 Oppo广东移动通信有限公司 WiFi direct connection establishing method, device, equipment and storage medium
CN112351411A (en) * 2019-08-09 2021-02-09 华为技术有限公司 Information transmission method and electronic equipment
CN111372325B (en) * 2020-02-21 2022-04-26 华为技术有限公司 Method and device for establishing Wi-Fi point-to-point connection
CN114390337B (en) * 2020-10-21 2023-06-02 华为技术有限公司 Screen projection method and system and electronic equipment
CN114679732A (en) * 2020-12-24 2022-06-28 华为技术有限公司 Method and electronic equipment for data transmission under Wi-Fi direct connection
CN114697934A (en) * 2020-12-31 2022-07-01 华为技术有限公司 Method, equipment and system for transmitting data in near field
CN115315025A (en) * 2021-05-08 2022-11-08 广州视源电子科技股份有限公司 Equipment connection method, device, equipment and storage medium
CN113329373A (en) * 2021-06-08 2021-08-31 阿波罗智联(北京)科技有限公司 Vehicle machine interconnection method and device
CN114364026B (en) * 2021-08-27 2023-05-12 华为技术有限公司 Communication method and electronic equipment
CN113709555B (en) * 2021-08-27 2023-03-21 联想(北京)有限公司 Wireless video connection method, device and system
CN113873685B (en) * 2021-09-22 2024-02-06 深圳Tcl新技术有限公司 Method, device and equipment for establishing WiFi direct connection

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103124442A (en) * 2011-09-14 2013-05-29 三星电子株式会社 Apparatus and method for connecting to device in wireless terminal
CN104540088A (en) * 2014-12-23 2015-04-22 小米科技有限责任公司 Connection establishment method, terminal and device
WO2017115397A1 (en) * 2015-12-28 2017-07-06 Nec Corporation Method system and device for fast initial link setup in wireless peer to peer network
CN107409270A (en) * 2015-03-05 2017-11-28 三星电子株式会社 Method and apparatus for establishing the connection between equipment
WO2018030296A1 (en) * 2016-08-10 2018-02-15 キヤノン株式会社 Communication device, communication method and program
CN108605374A (en) * 2016-02-24 2018-09-28 三星电子株式会社 Show the method that equipment and setting show the working channel of equipment

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101842047B1 (en) * 2012-03-15 2018-03-26 삼성전자주식회사 Method and apparatus for group profile management in wi-fi direct communication system
US9730082B2 (en) * 2012-08-24 2017-08-08 Intel Corporation Methods and arrangements to relay packets via Wi-Fi direct
CN103813473B (en) * 2014-01-17 2017-08-25 深圳市金立通信设备有限公司 A kind of communication means, terminal and system
US9674643B2 (en) * 2014-03-17 2017-06-06 Intel IP Corporation Method, apparatus, and computer readable medium for switching between lower energy and higher energy wireless communication techniques
CN105451367A (en) * 2014-08-27 2016-03-30 华为技术有限公司 Wireless network connection method, device and system
CN105704837B (en) * 2014-11-28 2020-02-14 华为终端有限公司 Method and equipment for establishing wireless connection
CN110602223B (en) * 2015-06-15 2021-10-15 展讯通信(上海)有限公司 Point-to-point equipment and search matching method thereof
CN104936258A (en) * 2015-06-17 2015-09-23 青岛海信移动通信技术股份有限公司 Network access method, terminal and system
JP6700969B2 (en) * 2016-05-20 2020-05-27 キヤノン株式会社 Communication device, control method thereof, and program
CN106791069A (en) * 2016-12-14 2017-05-31 努比亚技术有限公司 Terminal connection device and method
CN106714132B (en) * 2017-01-24 2020-02-14 深圳创维-Rgb电子有限公司 Intelligent display terminal, intelligent equipment, intelligent interaction method and system
CN107018554B (en) * 2017-03-07 2020-11-06 Oppo广东移动通信有限公司 Data transmission method and device and intelligent terminal
CN109587667B (en) * 2018-11-23 2021-06-18 Oppo广东移动通信有限公司 Connection establishing method and device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103124442A (en) * 2011-09-14 2013-05-29 三星电子株式会社 Apparatus and method for connecting to device in wireless terminal
CN104540088A (en) * 2014-12-23 2015-04-22 小米科技有限责任公司 Connection establishment method, terminal and device
CN107409270A (en) * 2015-03-05 2017-11-28 三星电子株式会社 Method and apparatus for establishing the connection between equipment
WO2017115397A1 (en) * 2015-12-28 2017-07-06 Nec Corporation Method system and device for fast initial link setup in wireless peer to peer network
CN108605374A (en) * 2016-02-24 2018-09-28 三星电子株式会社 Show the method that equipment and setting show the working channel of equipment
WO2018030296A1 (en) * 2016-08-10 2018-02-15 キヤノン株式会社 Communication device, communication method and program

Also Published As

Publication number Publication date
CN109587667A (en) 2019-04-05
WO2020103592A1 (en) 2020-05-28

Similar Documents

Publication Publication Date Title
CN109587667B (en) Connection establishing method and device, equipment and storage medium
JP6424253B2 (en) Method and apparatus for relaying data communication in a Bluetooth network
JP6170310B2 (en) Peer-to-peer device search method and apparatus in wireless communication network, and device communication method
KR101742985B1 (en) The method of determining group owner in peer to peer network and the device thereof
US9942759B2 (en) Communication apparatus
JP5100854B2 (en) Communication apparatus and communication method
JP6755145B2 (en) Communication devices, their control methods and programs, and communication systems
JP2019537356A (en) Method of updating location area of user terminal, access network entity, user terminal and core network entity
JP2014225861A (en) Communication device, control method of the same, and program
US20160227470A1 (en) Bluetooth low energy packets
CN109379773B (en) Switching method, first output device and second output device
US10021004B2 (en) Communication device, control method for communication device, and program
KR102632536B1 (en) Electronic device for transmitting response message in bluetooth network environment and method thereof
WO2016009762A1 (en) Communication system, communication method, communication apparatus, method of controlling the same, and computer program
EP3700169B1 (en) Electronic device for communicating with external electronic device
KR102527868B1 (en) Apparatus and method for communicating data in network environment based on nan protocol
AU2018427289B2 (en) Transmission control method and device
JP6512875B2 (en) Communication device, control method of communication device, and program
JP2017191966A (en) Game system, processing program, processing method, game device, and information processing device
KR102303990B1 (en) Communication apparatus, external apparatus, control method for communication apparatus, control method for external apparatus, and non-transitory computer-readable storage medium
WO2014113991A1 (en) Nfc configuration method, nfc data transmission method, controller and nfc controller
JP6970578B2 (en) Communication equipment and its control method, program
US20140334340A1 (en) Communication device, method for controlling the communication device, and program
JP5199970B2 (en) System and method for displaying user in viewable range on display of operation target device
KR102596801B1 (en) PC5 link establishment methods, equipment and systems

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