CN115515254A - Point-to-point connection establishing method and device, storage medium and electronic equipment - Google Patents

Point-to-point connection establishing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN115515254A
CN115515254A CN202110697074.5A CN202110697074A CN115515254A CN 115515254 A CN115515254 A CN 115515254A CN 202110697074 A CN202110697074 A CN 202110697074A CN 115515254 A CN115515254 A CN 115515254A
Authority
CN
China
Prior art keywords
connection
group
point
password
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110697074.5A
Other languages
Chinese (zh)
Inventor
李蔚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202110697074.5A priority Critical patent/CN115515254A/en
Publication of CN115515254A publication Critical patent/CN115515254A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • 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)

Abstract

The embodiment of the application discloses a point-to-point connection establishing method, a point-to-point connection establishing device, a storage medium and electronic equipment, wherein the method comprises the following steps: the method comprises the steps of obtaining a broadcast packet broadcasted by second equipment, reading a communication connection identifier in the broadcast packet, locally inquiring a group connection password of the second equipment based on the communication connection identifier, initiating a connection establishment flow to the second equipment based on the communication connection identifier and the group connection password, and joining a point-to-point connection group established by the second equipment based on the connection establishment flow. By adopting the embodiment of the application, the speed of establishing the point-to-point connection can be improved, and the safety of the communication connection is guaranteed.

Description

Point-to-point connection establishing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for establishing a peer-to-peer connection, a storage medium, and an electronic device.
Background
With the continuous development of communication technology, the interconnection application scenes between at least two electronic devices are more and more, such as wireless screen projection, wireless mutual transmission, smart home and the like; under these interconnection application scenarios, it is often involved to establish a point-to-point connection between at least two electronic devices, and then perform data interaction based on the point-to-point connection, for example, establish a point-to-point connection between a mobile phone and a smart television, and then transmit multimedia data.
Disclosure of Invention
The embodiment of the application provides a point-to-point connection establishing method and device, a storage medium and electronic equipment. The technical scheme of the embodiment of the application is as follows:
in a first aspect, an embodiment of the present application provides a method for establishing a peer-to-peer connection, where the method is applied to a first device, and the method includes:
acquiring a broadcast packet broadcast by second equipment, and reading a communication connection identifier in the broadcast packet;
querying locally for a group connection password of the second device based on the communication connection identification;
initiating a connection establishment flow to second equipment based on the communication connection identifier and the group connection password, and joining a point-to-point connection group established by the second equipment based on the connection establishment flow;
and the first communication mode corresponding to the point-to-point connection group is different from the second communication mode of the second device broadcasting the broadcast packet.
In a first aspect, an embodiment of the present application provides a method for establishing a peer-to-peer connection, where the method is applied to a second device, and the method includes:
establishing a point-to-point connection group, and broadcasting a broadcast packet, wherein the broadcast packet carries a communication connection identifier, and the communication connection identifier is used for indicating that a first device locally inquires a group connection password of the point-to-point connection group after acquiring the broadcast packet and initiates a connection establishment process based on the communication connection identifier and the group connection password;
joining the peer-to-peer connection group in response to the first device based on the connection establishment procedure;
and the first communication mode corresponding to the point-to-point connection group is different from the second communication mode of the second device broadcasting the broadcast packet.
In a third aspect, an embodiment of the present application provides a peer-to-peer connection establishing apparatus, where the apparatus includes:
the broadcast reading module is used for acquiring a broadcast packet broadcast by the second equipment and reading a communication connection identifier in the broadcast packet;
a password query module, configured to query a group connection password of the second device locally based on the communication connection identifier;
and the connection establishing module is used for initiating a connection establishing process to the second equipment based on the communication connection identifier and the group connection password and adding the point-to-point connection group established by the second equipment based on the connection establishing process.
In a fourth aspect, an embodiment of the present application provides a peer-to-peer connection establishing apparatus, where the apparatus includes:
the method comprises the steps that a broadcast module is created and used for creating a point-to-point connection group and broadcasting a broadcast packet, wherein the broadcast packet carries a communication connection identifier of the point-to-point connection group, and the communication connection identifier is used for indicating first equipment to locally inquire a group connection password of the point-to-point connection group after acquiring the broadcast packet and initiating a connection establishment process based on the communication connection identifier and the group connection password;
a connection response module configured to respond to the first device joining the peer-to-peer connection group based on the connection establishment procedure.
In a fifth aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a sixth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
in one or more embodiments of the present application, a point-to-point connection group may be created in advance by a second device, then a broadcast packet carrying a communication connection identifier of the point-to-point connection group is broadcast, and after scanning and reading the communication connection identifier in the broadcast packet, a group connection password corresponding to the communication connection identifier may be quickly queried locally, so as to directly initiate a connection establishment procedure, and join the point-to-point connection group created by the second device based on the connection establishment procedure. The whole process of establishing the point-to-point connection does not relate to the flows of channel monitoring, equipment discovery, information negotiation and the like in the related technology, the establishment of the point-to-point connection between at least two pieces of equipment can be quickly realized, the flow of establishing the point-to-point connection in real time is simplified, and the time for establishing the point-to-point connection is saved; and in the whole connection establishment process, connection safety problems such as connection password leakage and the like cannot be involved, and the connection safety is ensured while the point-to-point connection is established quickly.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for establishing a peer-to-peer connection according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating another peer-to-peer connection establishment method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating another peer-to-peer connection establishment method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating another peer-to-peer connection establishment method according to an embodiment of the present application;
fig. 5 is a schematic view of a scenario architecture for establishing a peer-to-peer connection according to an embodiment of the present application;
fig. 5a is an interaction diagram of a peer-to-peer connection establishment system according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a peer-to-peer connection establishing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of another peer-to-peer connection establishment apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another peer-to-peer connection establishment apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present application, it is noted that, unless explicitly stated or limited otherwise, "including" and "having" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The present application will be described in detail with reference to specific examples.
In one embodiment, as shown in fig. 1, a point-to-point connection establishment method is proposed, which is applicable to the first device according to the present application, and which can be implemented by means of a computer program and which can be run on a point-to-point connection establishment apparatus based on the von neumann architecture. The computer program may be integrated into the application or may run as a separate tool-like application.
Specifically, the peer-to-peer connection establishing method includes:
step S101: and acquiring a broadcast packet broadcast by the second equipment, and reading the communication connection identifier in the broadcast packet.
In the present application, a peer-to-peer connection is also often referred to as a P2P connection, and in an actual application environment, the connection manner between a plurality of devices is often simplified, so that data such as pictures and texts can be shared between the devices more quickly and conveniently. The P2P connection may be established between two devices, and then data may be transmitted based on the P2P connection, for example, the P2P connection may be quickly established between a first device and a second device, and then data may be shared with each other based on the P2P connection. The first device and the second device may be referred to as a set of directly connected devices.
For example, in one scenario, device 1 is connecting to the extranet through WiFi, and wants to share extranet video to device 2. If the device 1 creates an AP (hotspot) to log in the device 2, the device 1 will disconnect the originally connected extranet, and the video sharing loses meaning. In this embodiment, the device 1 creates a P2P group, so that the problem of network disconnection does not exist, and the video sharing is not affected.
In the related art, the establishment of P2P connection often involves that a group of devices need to perform steps of channel monitoring, device scanning, device discovery, GO negotiation, connection handshake, and the like in sequence, and then establishes P2P connection between a group of directly connected devices, which means that the link establishment speed is slow. In addition, when the connection is established by using the above-mentioned P2P technology, the connection can be established only one by one.
The peer-to-peer connection establishment method can be used for quickly establishing the P2P connection between the two devices.
The second device may pre-establish a P2P group (P2P group). A P2P group may be understood as a hotspot network. However, the second device does not need to disconnect the original network connection (wired network connection or wireless network connection) in the process of establishing the P2P group. The exemplary second device may establish a P2P group using network communication means such as WiFi, zigBee, etc. The second device may be designated as a Group Owner (GO) in the P2P Group in this application, it being understood that the second device may function as a GO node in this application.
Specifically, based on the actual application environment, the second device serves as a GO node to establish a P2P group (which may also be understood as a P2P network) in advance, in some embodiments, in the process of establishing the P2P group, a group of "communication connection identifier and group connection password" may be locally selected as group link information to complete an initialization configuration process of creating the P2P group, and after the P2P group is created, the second device serves as the GO node. Then, the second device may broadcast the broadcast packet externally by way of communication broadcast (e.g., bluetooth broadcast), and one or more electronic devices within the broadcast range of the broadcast packet signal of the second device may scan the broadcast packet by way of channel scanning.
Specifically, after acquiring the broadcast packet, the first device analyzes the broadcast packet based on a communication protocol corresponding to the broadcast packet (for example, a bluetooth protocol corresponding to a bluetooth broadcast packet, such as a low power consumption bluetooth protocol), and after analyzing the broadcast packet, reads the communication connection identifier carried by the broadcast packet.
The communication connection identifier is used to uniquely characterize group indication information of the peer-to-peer connection group created by the second device, and in some embodiments, may also be understood as link establishment information of the peer-to-peer connection group, it is to be noted that the data of the communication connection identifier does not include a group connection password of the peer-to-peer connection group.
Taking the example that the second device scans the broadcast packet, the second device acts as a Group Client (GC) node. The second device scans the broadcast packet, and the broadcast packet generated by the second device carries the communication connection identifier. The second device may read data of the broadcast packet after acquiring the broadcast packet, so as to acquire the communication connection identifier in the broadcast packet.
In practical application, the communication connection Identifier characterizing the peer-to-peer connection group may be a Service Identifier Set (SSID) of the peer-to-peer connection group, or may be an index number that may be used to locally retrieve link establishment information of the peer-to-peer connection group established by the second device by the first device, and may be understood as a retrievable group connection password and/or a number of the Service Identifier Set. In this application, the second device may not negotiate GO information (such as negotiating a group connection password) with the group client and may not directly broadcast the group connection password of the current point-to-point connection group at the same time in the entire stage of the point-to-point connection establishment.
Optionally, in some embodiments, the foregoing broadcast packet may include a channel of the second device, a MAC address, an SSID, and the like of the second device;
step S102: locally querying the second device for a group connection password based on the communication connection identification.
In the application, the first device locally stores a mapping relationship between at least one group of reference communication connection identifiers and reference group connection passwords of a point-to-point connection group which can be created by the second device, and based on the mapping relationship, the second device can index the group connection passwords which are matched with the communication connection identifiers after acquiring the communication connection identifiers. The "mapping relationship between at least one group of reference communication connection identifiers and reference group connection passwords" may be characterized in the form of a mapping set, a mapping table, an array, or the like.
In a specific implementation scenario, the communication connection identifier may be an index number for the peer-to-peer connection group, and in some embodiments, when the second device creates the peer-to-peer connection group: a group of "index number-Service Set Identification (SSID) -group connection password (password)" may be selected as Go information to create a point-to-point connection group.
Illustratively, the "mapping relationship between at least one group of reference communication connection identifiers and reference group connection passwords" locally storable in the first device is: at least one set of mapping relationships of "reference index number-reference Service Set Identification (SSID) -reference group connection password (password)". Then, after the communication connection identifier in the broadcast packet, that is, the index number is indexed in the mapping relationship, and whether the "Service Set Identifier (SSID) -group connection password (password)" corresponding to the index number exists is inquired, and the "Service Set Identifier (SSID) -group connection password (password)" may be understood as the group connection information of the peer-to-peer connection group, so that the group connection password (password) and the Service Set Identifier (SSID) may be acquired at this time.
In one particular implementation scenario, the communication connection identification is a service identification set (SSID) for a peer-to-peer connection group, and in some embodiments, when the second device creates the peer-to-peer connection group: a group of "Service Set Identification (SSID) -group connection password (password)" may be selected to create a point-to-point connection group as Go information (which may be understood as group connection information in some embodiments).
Illustratively, the "mapping relationship between at least one group of reference communication connection identifiers and reference group connection passwords" locally storable in the first device is: at least one set of "reference Service Set Identification (SSID) -reference group connection password (password)" mapping. Then, after the communication connection identifier (i.e. service identifier set (SSID)) in the broadcast packet is based, the service identifier set (SSID) is indexed in the mapping relationship to query whether a "group connection password (password)" corresponding to the service identifier set (SSID) exists, and the "Service Set Identifier (SSID) -group connection password (password)" may be understood as group connection information of the peer-to-peer connection group, so that the group connection password (password) may be obtained at this time. Thereby completing the step of locally querying a group connection password for the point-to-point connection group of the second device based on the set of service identifications.
In some embodiments, the "mapping relationship between the at least one group of reference communication connection identifiers and the reference group connection password" stored locally by the first device is not obtained from the second device, that is, the whole peer-to-peer connection process does not involve a link establishment information interaction process between the devices for establishing the peer-to-peer connection in order to realize fast connection establishment. In some embodiments, the mapping relationship "between the at least one set of reference communication connection identifier and the reference set connection password stored locally by the first device may be obtained from a server in the cloud in advance. The server, which may be understood as a cloud, may generate link establishment information (index number, service Set Identifier (SSID) -group connection password (password), etc.) that is used by the second device to establish the peer-to-peer connection group. That is, the first device may obtain the following information from the server in the cloud in advance: the data of the "mapping relationship of at least one group of reference communication connection identifications and reference group connection passwords", also referred to as a connection password set in some embodiments.
For example, the server at the cloud may generate N groups of "reference communication connection identifiers and reference group connection passwords", then one copy is stored on the second device, the second device selects one group as link establishment information to establish the P2P in the subsequent actual application stage based on the N groups of "reference communication connection identifiers and reference group connection passwords", and the first device may acquire the N groups of "reference communication connection identifiers and reference group connection passwords" from the server at the cloud in advance before the second device establishes the P2P, so that the communication connection identifiers acquired in the broadcast packet at the actual application stage may quickly acquire the correct group connection passwords that may be used to establish the point-to-point connection.
Step S103: initiating a connection establishment flow to a second device based on the communication connection identifier and the group connection password, and joining a point-to-point connection group created by the second device based on the connection establishment flow.
Specifically, the first device may determine, based on the communication connection identifier, a peer-to-peer connection group Service Set Identifier (SSID) created by the second device, where the group connection password is a password for joining in the peer-to-peer connection group, and then initiate a connection establishment procedure based on the group connection password after uniquely determining the peer-to-peer connection group Service Set Identifier (SSID) created by the second device, so that the first device successfully joins in the peer-to-peer connection group created by the second device after the second device responds to the connection establishment procedure. A connection establishment process can be that a first device initiates connection handshake information to a second device based on a group connection password, the second device verifies the group connection password after receiving the connection handshake information, and device verification of the first device can be completed after the group connection password is verified, so that the connection establishment process is successfully responded, and the first device can join a point-to-point connection group created by the second device.
In some embodiments, the first communication mode corresponding to the peer-to-peer connection group and the second communication mode in which the second device broadcasts the broadcast packet may be different, and the first communication mode may be as follows: any communication mode that may send broadcast data packets to the outside in a broadcast transmission mode, for example, the first communication mode may use a bluetooth communication mode, that is, a bluetooth communication mode is used to send broadcast packets to the current bluetooth network, for example, the first communication mode may use a radio broadcast mode, and the second communication mode may be in the related art: any communication mode of the point-to-point connection group can be established, for example, the second communication mode can be a wireless fidelity (WIFI) communication mode, such as a wireless network direct connection mode (WIFI direct connection mode). The types of the first communication mode and the second communication mode are not limited in some embodiments related to the present application, and may be determined based on an actual application environment.
In this embodiment of the application, the second device may create a point-to-point connection group in advance, then broadcast a broadcast packet carrying a communication connection identifier of the point-to-point connection group, and after scanning and reading the communication connection identifier in the broadcast packet, the first device may quickly query a group connection password corresponding to the communication connection identifier locally, thereby directly initiating a connection establishment procedure, and join the point-to-point connection group created by the second device based on the connection establishment procedure. The whole process of establishing the point-to-point connection does not relate to the flows of channel monitoring, equipment discovery, information negotiation and the like in the related technology, the establishment of the point-to-point connection between at least two pieces of equipment can be quickly realized, the flow of establishing the point-to-point connection in real time is simplified, and the time for establishing the point-to-point connection is saved; and in the whole connection establishment process, connection safety problems such as connection password leakage and the like cannot be involved, and the connection safety is ensured while the point-to-point connection is established quickly.
Referring to fig. 2, fig. 2 is a flowchart illustrating a peer-to-peer connection establishment method according to another embodiment of the present disclosure. Specifically, the method comprises the following steps:
step S201: and acquiring a connection password set corresponding to the second equipment when the point-to-point connection group is created from the server, wherein the connection password set comprises at least one group of reference connection identification and reference connection password.
In this application, the peer-to-peer connection establishment method may involve a server, where a first device may obtain a connection password set of a peer-to-peer connection group of a second device based on server assistance, and may also be understood as a connection password set that may obtain a GO node based on server assistance, according to some embodiments, the second device serving as the GO node establishes a P2P group based on a set of "reference connection identifier and reference connection password" in the connection password set, and after the establishment is completed, a broadcast packet including a communication connection identifier (i.e., a currently selected reference connection identifier) is broadcasted externally in the form of a broadcast packet, so that after a first device serving as a GC node scans the broadcast packet and obtains a communication connection identifier therein, since before that, the first device has obtained a connection password set corresponding to a peer-to-peer connection group created for the second device to the server, the connection password set includes at least one set of reference connection identifier and reference connection identifier, that is to obtain a communication connection identifier uniquely indexed in the local connection password set after the communication connection password set corresponding to the P2P group created by the second device.
In a specific implementation scenario, generally, the establishment of the point-to-point connection is based on a user triggering a corresponding target service on a device, and it can be understood that the target service needs to be implemented based on the establishment of the point-to-point connection between two devices, for example, the target service may be a wireless screen-casting service, a data fast-sharing service, a data fast-moving service, a video data transmission service, and the like. When a user triggers a target business service on first equipment for the first time, the method relates to a service data initialization process matched with the target business service, in the service data initialization process, the first equipment responds to the starting of the target business service and actively sends a set acquisition request of a connection password set of all or part of second equipment capable of establishing point-to-point connection to a server, namely the first equipment can establish point-to-point connection with a plurality of second equipment, the first equipment can simultaneously request the connection password set of the plurality of second equipment from the server based on the set acquisition request, and the server can respond to the set acquisition request and send the connection password set of at least one second equipment to the first equipment.
Further, when there are a plurality of connection password sets of the second devices corresponding to the server, a target second device whose location distance between the first device and the second device satisfies a distance threshold may be selected based on location information of the plurality of second devices and location information of the first device, and then the connection password set corresponding to the target second device may be sent to the first device, where the distance threshold may be used to determine the second device belonging to the first device, and it may be understood that the set acquisition request may carry location information of the first device at this time.
In a possible implementation, the first device may also generate a set obtaining request including device information specifying the second device based on the device information (e.g., mac address and device identifier) about the second device input by the user, so that the server may read the device information after receiving the set obtaining request, obtain a target second device corresponding to the device information on the server based on the device information (e.g., mac address and device identifier), and then send a connection password set corresponding to the target second device to the first device.
It is understood that in the present application, the server stored connection password set contains at least one set of reference connection id and reference connection password.
In addition, the server may be associated with a plurality of second devices for maintaining and managing the second devices, and in some embodiments, the server may preset a connection password set, for example, a connection password set including n sets of "reference connection id and reference connection password" on the second devices in a device factory stage.
Step S202: storing the connection password set locally.
Specifically, after receiving the connection password set based on the communication network between the first device and the server, the first device locally stores the connection password set, so that when the point-to-point connection is subsequently established, the first device can locally query the group connection password corresponding to the second device when the P2P group is currently established based on the obtained communication connection identifier.
The first device stores the connection password set locally, the whole point-to-point connection process does not involve a link establishment information interaction process for establishing point-to-point connection between the devices and a negotiation process for establishing a P2P group for realizing quick connection establishment, and the establishment process of the point-to-point connection is greatly simplified.
In a possible implementation, when the link establishment information (index number, service Set Identifier (SSID) -group connection password (password), etc.) used on the second device to establish the peer-to-peer connection group changes, the server may synchronize the link establishment information to the first device in advance so that the first device performs data update on the "reference connection identifier and reference connection password" in the connection password set. It will be appreciated that the point in time at which the above-described data update process is triggered precedes the establishment of the set of point-to-point connections.
In addition, the "link establishment information (index number, service Set Identifier (SSID) -group connection password (password), etc.) used by the second device changes" may be that, because of factors such as data amount and usage duration, the connection password set used by the second device is based on communication security considerations, all data in the connection password set on the second device exceeds the time limit, for example, 10 sets of "index number-Service Set Identifier (SSID) -group connection password (password)" link establishment information are stored in advance in the connection password set on the second device, or 10 sets of "Service Set Identifier (SSID) -group connection password (password)" link establishment information, a usage duration threshold value exists for each set of link establishment information (the time thresholds of the sets may be set to be the same or different), and when the usage times corresponding to all the link establishment information all reach the usage duration threshold value, all data in the connection password set on the second device may be considered to exceed the time limit. At this point, the second device may request the service to update the connection password set to complete the data update to the connection password set on the second device. The server simultaneously updates the connection password set to the first device.
In some embodiments, the second device creates a peer-to-peer connection group based on the connection password set obtained from the server, the connection password set being generated by the server, that is, the connection password sets on the first device and the second device are both generated and updated by the server;
in some embodiments, the second device generates a set of connection passwords based on the same group connection password generation policy as the server and creates a group of point-to-point connections based on the set of connection passwords.
Step S203: and acquiring a broadcast packet broadcast by the second equipment, and reading a communication connection identifier and a communication connection channel in the broadcast packet.
According to some embodiments, the communication connection identifier is used to uniquely characterize group indication information of the peer-to-peer connection group created by the second device, which may also be understood as link establishment information of the peer-to-peer connection group in some embodiments, it is to be noted that the data of the communication connection identifier does not include a group connection password of the peer-to-peer connection group.
The communication connection channel refers to a data signal transmission channel of a point-to-point connection taking a wireless communication signal as a transmission medium. Which may also be referred to as the wireless band of the point-to-point communication connection. For example, the commonly used ieee802.11b/g operates in the 2.4 to 2.4835GHz band, which is divided into 11 or 13 channels. When there are more than two APs (access points) in the wireless signal coverage of the wireless AP (access point), each AP (access point) needs to set a different frequency band to avoid the collision of the common channels.
It will be appreciated that the second device, acting as a group owner node (Go node), when creating the P2P group, will also select an appropriate communication connection channel based on the current communication channel environment, and carry the interactive data in the point-to-point connection based on the selected communication connection channel.
In this embodiment of the present application, the broadcast packet may also carry a communication connection channel in addition to the communication connection identifier, and the communication connection channel may be used by the first device to quickly determine a communication channel used by the peer-to-peer connection group, so as to save time for scanning a network-wide channel, and quickly facilitate the first device to join in a P2P group of the second device.
According to some embodiments, based on an actual application environment, the second device serves as a GO node to establish a P2P group (which may also be understood as a P2P network) in advance, in some embodiments, in the process of establishing the P2P group, a group of "communication connection identifier and group connection password" may be selected locally as group link information to complete an initialization configuration process of creating the P2P group, and after the P2P group is created, the second device serves as the GO node. Then, the second device may broadcast the broadcast packet externally by way of communication broadcast (e.g., bluetooth broadcast), and one or more electronic devices within the broadcast range of the broadcast packet signal of the second device may scan the broadcast packet by way of channel scanning.
After the first device acquires the broadcast packet, for example, a bluetooth protocol corresponding to the bluetooth broadcast packet, such as a bluetooth low energy protocol), the broadcast packet is analyzed, and after the analysis, the communication connection identifier and the communication connection channel carried by the broadcast packet can be read.
Illustratively, taking the communication mode corresponding to the broadcast packet as a bluetooth communication mode as an example, two roles are defined in a bluetooth protocol: central and Peripheral, i.e., central and Peripheral devices. The first device as a central device may actively scan and connect with a peripheral device (e.g., a terminal device such as a mobile phone), and the second device as a peripheral device may receive a bluetooth broadcast packet sent by the second device or be connected by the central device. The second device sends out a Bluetooth broadcast packet in a Bluetooth broadcast mode, and the first device discovers the second device in a Bluetooth broadcast packet scanning mode.
In general, the length of the bluetooth broadcast packet is a fixed number of bytes (e.g. 31 bytes), and is composed of several data units representing different meanings, such as broadcast type, broadcast address (public address or random address), device name, broadcast data length, broadcast data, etc. data columns, usually "communication connection identifier and communication connection channel" can be set in the broadcast data columns, and if the valid data portion is less than 31 bytes, the remaining bytes are usually complemented by 0.
Optionally, the first device may also read a device address, such as a MAC address, of the second device in the broadcast packet.
Step S204: and inquiring a connection password corresponding to the communication connection identifier in the locally stored connection password set, and taking the target connection password as a current group connection password aiming at the second equipment.
According to some embodiments, the communication connection identification may be an index number for the group of point-to-point connections, and in some embodiments, when the second device creates the group of point-to-point connections: a group of "index number-Service Set Identification (SSID) -group connection password (password)" may be selected as Go information to create a point-to-point connection group.
Illustratively, the set of connection passwords locally storable at the first device may be: at least one set of mapping relationship of reference index number-reference Service Set Identification (SSID) -reference group connection password (password). Then, after the communication connection identifier in the broadcast packet, that is, the index number is used to index into the connection password set, and whether the "Service Set Identifier (SSID) -group connection password (password)" corresponding to the index number exists is queried, and the "Service Set Identifier (SSID) -group connection password (password)" may be understood as the group connection information of the peer-to-peer connection group, so that the group connection password (password) and the Service Set Identifier (SSID) may be obtained.
In accordance with some embodiments, the communication connection identification is a service identification set (SSID) for a group of point-to-point connections, and in some embodiments, when the second device creates the group of point-to-point connections: a group of "Service Set Identification (SSID) -group connection password (password)" may be selected to create a point-to-point connection group as Go information (which may be understood as group connection information in some embodiments).
Illustratively, the set of connection passwords that may be stored locally at the first device is: at least one set of mapping relationships of "reference Service Set Identification (SSID) -reference group connection password (password)". Then, after the communication connection identifier in the broadcast packet, that is, the service identifier set (SSID), is used to index into the connection password set, and it is queried whether there is a "group connection password (password)" corresponding to the service identifier set (SSID), where the "Service Set Identifier (SSID) -group connection password (password)" may be understood as group connection information of a peer-to-peer connection group, and at this time, the group connection password (password) may be obtained. Thereby completing the step of locally querying a group connection password for the point-to-point connection group of the second device based on the set of service identifications.
In a possible embodiment, the first device indexes in the connection password set based on the communication connection identifier, and in the indexing process:
if the connection password set does not have the connection password corresponding to the communication connection identifier, the data in the connection password set in the first device is invalid, the first device may reacquire the group connection information of the P2P group for the second device from the server, and it can be understood that the group connection information mainly includes the target connection identifier and the group connection password corresponding to the point-to-point connection group.
In a specific implementation, the first device may obtain, from the broadcast packet, a device address used for uniquely characterizing the identity of the second device, and in some embodiments, the device address may be a MAC address (physical address), an IP address, and the like. Based on the device address, the first device may obtain group connection information for a peer-to-peer connection group of the second device to the server, the group connection information may be a service set identification and a group connection password.
According to some embodiments, the group connection information currently used by the second device for creating may be derived from a connection password set obtained from the server, that is, the group connection information used by the server to generate the P2P group created by the second device, that is, the "service set identifier and the group connection password"
According to some embodiments, the second device generates a connection password set based on the same group connection password generation policy as the server and creates a point-to-point connection group based on the connection password set, and the server can accurately determine the service set identifier and the group connection password created by the second device at any time based on the same group connection password generation policy as the second device.
The group connection password generation strategy can be used for generating a service set identifier and a group connection password based on a user-defined information generation algorithm; for example: the group connection password generation strategy may be that an integer time (e.g., an integer hour, an integer time) is used as an entropy source, and a random number generator is used to generate a group of connection passwords and service set identifiers based on the entropy source.
Furthermore, in the actual use stage, the group connection information of the P2P group generated by the second device in a period of time can be accurately estimated by using the whole time as the entropy source. It is understood that the generated "group connection password and service set identifier" has uniqueness over a period of time with an integer time (e.g., an integer hour, an integer time, etc.) as an entropy source, such as 09:15 the second device generates a service set identifier and a group connection password based on the '9' hour, and the first device acquires multiple sets of link establishment information generated by the server based on multiple hours from the server. Further, the server may feed back group connection information (reference communication connection id and reference group connection password) associated with all the time points corresponding to a time period (e.g., one day, one week).
Step S205: initiating a connection establishment flow to a second device based on the communication connection identifier and the group connection password, and joining a point-to-point connection group created by the second device based on the connection establishment flow.
For details, refer to step S101, which is not described herein again.
In a specific implementation manner, if a communication connection channel is read, a connection establishment procedure may be initiated to a second device based on the communication connection identifier and the group connection password trigger, and the connection establishment procedure is directly added to a point-to-point connection group created by the second device with the communication connection channel as a reference, so that channel scanning is performed in a full-network channel scanning manner under the condition that the communication connection channel is not known, and time for channel scanning is saved.
In some embodiments, the reference connection channel of the traffic service network of the second device is the same as the communication connection channel. The service network is a communication service network for acquiring the service for the second device, for example, the service data acquired by the second device is transmitted to another device by using a point-to-point connection. Further, the communication mode of the service network and the point-to-point connection is the same communication mode, for example, both the service network and the point-to-point connection are WiFi communication modes, and a reference connection channel of the communication service network and a communication connection channel of the communication mode using the point-to-point connection in the related art are different, so in a service sharing scenario, if the second device shares a video acquired based on an external network to the first device using the point-to-point connection, there is a time delay from slicing data from the reference connection channel to the communication connection channel, and in order to reduce the time delay, the reference connection channel of the service network of the second device and the communication connection channel may be set to be the same channel.
Step S206: and if the communication state of the point-to-point connection group is a communication interruption state, re-acquiring the broadcast packet broadcast by the second equipment, and executing the step of reading the communication connection identifier and the communication connection channel in the broadcast packet.
The channel update procedure may be understood as that, due to the existence of higher channel interference (as there are more devices in the frequency band channel) in the current communication connection channel of the second device, the second device may trigger the channel update procedure to switch the current communication connection channel to the communication channel with the better channel environment. For the related channel update process, reference may be made to other embodiments of the present application, which are not described herein in detail.
The group connection information updating process generates data update for the communication connection identifier and/or the group connection password of the point-to-point connection group of the current second device, such as data change of the communication connection identifier and/or the group connection password.
Specifically, when the peer-to-peer connection group of the second device generates a channel update procedure or a group connection information update procedure or a communication failure, the peer-to-peer connection group between the first device and the second device may interrupt communication, that is, when the communication state of the peer-to-peer connection group is a communication interruption state, the first device may reacquire a broadcast packet broadcasted by the second device, and perform a step of reading a communication connection identifier and a communication connection channel in the broadcast packet, so that a connection establishment procedure may be initiated to the second device again based on the communication connection identifier and the group connection password, and join the peer-to-peer connection group created by the second device based on the connection establishment procedure.
In this embodiment of the present application, the second device may create a point-to-point connection group in advance, then broadcast a broadcast packet carrying a communication connection identifier of the point-to-point connection group, and after the first device scans and reads the communication connection identifier in the broadcast packet, the first device may quickly query a group connection password corresponding to the communication connection identifier locally, thereby directly initiating a connection establishment procedure, and join the point-to-point connection group created by the second device based on the connection establishment procedure. The whole process of establishing the point-to-point connection does not relate to the flows of channel monitoring, equipment discovery, information negotiation and the like in the related technology, the establishment of the point-to-point connection between at least two pieces of equipment can be quickly realized, the flow of establishing the point-to-point connection in real time is simplified, and the time for establishing the point-to-point connection is saved; in the whole connection establishment process, connection safety problems such as connection password leakage and the like cannot be involved, and the connection safety is guaranteed while point-to-point connection is established quickly; the connection password set can be generated and transmitted to each device based on the assistance of the server, no additional negotiation link establishment information is needed between every two devices, and the connection establishment is more convenient and fast; and the first device can acquire the channel and quickly join the point-to-point connection of the second device based on the channel, so that the time overhead of whole network channel scanning is avoided.
In one embodiment, as shown in fig. 3, a point-to-point connection establishing method is proposed, which is applicable to the second apparatus according to the present application, and which can be implemented by means of a computer program and can be run on a point-to-point connection establishing means based on the von neumann architecture. The computer program may be integrated into the application or may run as a separate tool-like application.
Specifically, the peer-to-peer connection establishing method includes:
step S301: and establishing a point-to-point connection group, and broadcasting a broadcast packet, wherein the broadcast packet carries the communication connection identifier of the point-to-point connection group.
The communication connection identifier is used for indicating the first equipment to locally inquire the group connection password of the point-to-point connection group after acquiring the broadcast packet and initiating a connection establishment process based on the communication connection identifier and the group connection password;
according to some embodiments, the peer-to-peer connection is often also referred to as a P2P connection, which may enable the P2P connection to be established between two devices, and then transmit data based on the P2P connection, for example, may enable the P2P connection to be quickly established between the first device and the second device, and then share data with each other based on the P2P connection. The first device and the second device may be referred to as a set of directly connected devices.
The peer-to-peer connection establishment method can be used for quickly establishing the P2P connection between the two devices.
The second device may pre-establish a P2P group (P2P group). A P2P group may be understood as a hotspot network. However, the second device does not need to disconnect the original network connection (wired network connection or wireless network connection) in the process of establishing the P2P group. The exemplary second device may establish a P2P group using a network communication method such as WiFI, zigBee, and the like. The second device may be designated as a Group Owner (GO) in the P2P Group in this application, and it is understood that the second device may serve as a GO node in this application.
According to some embodiments, a group of "communication connection identifier and group connection password" may be selected locally as group link information during the process of establishing the P2P group to complete the initialization configuration process of creating the P2P group, and the second device serves as the GO node after the P2P group is created. Then, the second device may broadcast the broadcast packet externally by way of communication broadcast (e.g., bluetooth broadcast), and one or more electronic devices within the broadcast range of the broadcast packet signal of the second device may scan the broadcast packet by way of channel scanning. Further, the broadcast packet at least carries a communication connection identifier of the point-to-point connection group.
According to some embodiments, the server may be associated with a plurality of second devices for maintaining and managing the second devices, and in some embodiments, a connection password set, for example, a connection password set including n sets of "reference connection identifier and reference connection password" may be preset at a local end of the second device, that is, the second device, in a device factory stage, where n is a positive integer.
Further, in subsequent practical applications, if each group of data in the connection password set exceeds the time limit due to limitations of connection duration, access data amount, and the like, for example, 10 groups of "index number-Service Set Identifier (SSID) -group connection password (password)" link establishment information or 10 groups of "Service Set Identifier (SSID) -group connection password (password)" link establishment information are stored in advance in the connection password set on the second device, a use duration threshold exists for each group of link establishment information (the duration thresholds of the groups may be set to be the same or different), and when the use durations corresponding to all the link establishment information reach the use duration threshold, all the data in the connection password set on the second device may be considered to exceed the time limit. The second device may request the server for updating the connection password set, that is, the server may regenerate a next connection password set including n sets of "reference connection id and reference connection password", and then send the next connection password set to the second device, and then the second device saves the next connection password set, thereby completing updating the connection password set.
The communication connection identifier may be understood as group indication information for uniquely characterizing the peer-to-peer connection group created by the current second device, and may also be understood as link establishment information of the peer-to-peer connection group in some embodiments, it is to be noted that the data of the communication connection identifier does not include a group connection password of the peer-to-peer connection group.
According to some embodiments, the aforementioned broadcast packet may include a channel of the second device, a MAC address, an SSID, etc. of the second device;
the first equipment can read the communication connection identifier in the broadcast packet after acquiring the broadcast packet, further locally inquire the group connection password of the point-to-point connection group and initiate a connection establishment process based on the communication connection identifier and the group connection password;
it is understood that, the first device may determine, based on the communication connection identifier, a peer-to-peer connection group Service Set Identifier (SSID) created by the second device, and the group connection password is a password for joining the peer-to-peer connection group, and then, after uniquely determining the peer-to-peer connection group Service Set Identifier (SSID) created by the second device, initiate a connection establishment procedure based on the group connection password, and after responding to the connection establishment procedure, the second device may successfully join the peer-to-peer connection group created by the second device.
In a specific implementation scenario, the time when the second device creates the peer-to-peer connection group may be that the creation is started when the second device is powered on, that is, the second device may automatically select a group of communication connection identifiers and a group connection password to create the peer-to-peer connection group based on a local selection at a device power-on stage; the time for the second device to create the peer-to-peer connection group may be based on a fixed period, and the peer-to-peer connection group is periodically opened, for example, once every hour;
optionally, the time when the second device creates the peer-to-peer connection group may be based on an input connection opening instruction, where the connection opening instruction may be a human-computer interaction instruction input by a user at the second device; the connection opening instruction may be a human-computer interaction instruction input by a user on the first device, and the first device sends the connection opening instruction to the second device, and the second device opens the peer-to-peer connection in response to the connection opening instruction. The connection opening instruction may be a voice input instruction input by a user in the environment of the first device or the second device, such as voice input: and starting point-to-point connection, and when the first device/the second device recognizes a voice input instruction, responding to the voice input instruction and creating a point-to-point connection group.
Step S302: joining the peer-to-peer connection group in response to the first device based on a connection establishment procedure.
According to some embodiments, a connection establishment procedure may be that a first device initiates connection handshake information to a second device based on a group connection password, the second device verifies the group connection password after receiving the connection handshake information, and device verification of the first device may be completed after the group connection password is verified, so that the second device successfully responds to the connection establishment procedure, and thus the first device may join a point-to-point connection group created by the second device.
In addition, the peer-to-peer connection establishment method is not limited to a scenario in which a first device (serving as a GC node) and a second device (serving as a GO node) establish a P2P group.
The point-to-point connection establishing method related by the application can be applied to the following implementation scenes:
1. establishing a point-to-point connection (which may be understood as a "1-to-1" scenario) between a second device (as a GO node) and a first device (as a GC node);
2. establishing a Wi-Fi P2P connection between a second device (as a GO node) and a plurality of first devices (as GC nodes) ("one-to-many" scenario);
3. establishing Wi-Fi P2P connections between a plurality of second devices (as GO nodes) and a first device (as GC nodes) ("many-to-one" scenario);
4. establishing Wi-Fi P2P connections between a plurality of second devices (as GO nodes) and a plurality of first devices (as GC nodes) ("many-to-many" scenarios);
mode 1, a "1 to 1" scenario can be seen in any of the previous embodiments.
Mode 2, a Wi-Fi P2P connection is established between one second device (as GO node) and a plurality of first devices (as GC nodes) (a "one-to-many" scenario) as follows:
it is understood that in this case, one second device (as a GO node) and a plurality of first devices (as GC nodes) may be included in the P2P network. The number and type of the first devices (as GC nodes) may be determined by a specific service scenario and is not limited herein.
2.1 before establishing a P2P connection in a P2P network, a user may specify which device is the second device, i.e., which device node is the GO node, through an application service layer (an application service layer in an operating system on either the first device or the second device, such as an application service). After the GO node is appointed, the home terminal of the GO node selects a group of link establishment information (the link establishment information can be generated by a server and is acquired in advance) to establish a specified number of point-to-point connection groups (determined based on the number of GC nodes), broadcasts broadcast packets (carrying communication connection identifiers and channels of corresponding point-to-point connection groups) of each point-to-point connection group respectively,
2.2 broadcasting the broadcast packet;
2.3 after each first device (as a GC node) receives the broadcast packet, each first device parses the broadcast packet, and executes the method for establishing a point-to-point connection in the foregoing embodiment, which is not described herein again.
It should be noted that, based on the above "one-to-one" scenario, the "one-to-many" scenario and the "one-to-one" scenario are consistent in the procedure of establishing point-to-point connections, except that the GO node broadcasts a broadcast packet for multiple GC nodes to establish point-to-point connection groups in sequence. The broadcast messages contained in the broadcast packets differ only in the communication connection establishment identities of each set of point-to-point connections, and in some embodiments the channels differ.
Mode 3: point-to-point connections between multiple second devices (as GO nodes) and one first device (as a GC node) are established (a "many-to-one" scenario).
It is understood that in this case, a plurality of second devices (as GO nodes) and one first device (as GC nodes) may be included in the peer-to-peer network. The number and type of the second devices (as GO nodes) may be determined by a specific service scenario (e.g., a screen shot service), and is not limited herein.
Based on the aforementioned "one-to-one" scenario and "one-to-many" scenario, the procedure for establishing each group of P2P connections in the "many-to-one" scenario is substantially the same as the procedure in the "one-to-one" scenario above, except that the first device (as a GC node) in the "many-to-one" scenario receives broadcast packets of a plurality of second devices (as GO nodes). And the broadcast packets involved in establishing a connection will be correspondingly different. Specifically, in a "many-to-one" scenario, a first device (serving as a GC node) may execute the peer-to-peer connection establishment method according to the present application multiple times, so as to join peer-to-peer connections corresponding to multiple second devices (serving as GO nodes), respectively.
Mode 4: establishing Wi-Fi P2P connections between the plurality of second devices (as GO nodes) and the plurality of first devices (as GC nodes) (a "many-to-many" scenario) as follows:
it is understood that in this case, a plurality of second devices (as GO nodes) and a plurality of first devices (as GC nodes) may be included in the peer-to-peer network. The number and types of the second devices (as GO nodes) and the first devices (as GC nodes) may be determined by a specific service scenario and are not limited herein.
Based on the aforementioned "one-to-one" scenario, "one-to-many" scenario, and "many-to-one" scenario, the process of establishing a point-to-point connection in the "many-to-many" scenario is substantially the same as or similar to the above "one-to-one" scenario, "one-to-many" scenario, and "many-to-one" scenario, except that the second device (as a GO node) sends broadcast packets for multiple GC nodes to join in the point-to-point connection group, respectively, and the first device (as a GC node) receives broadcast packets of multiple second devices (as GO nodes).
That is to say, in a scenario of "many-to-many", a first device (serving as a GC node) may execute the peer-to-peer connection establishment method according to the present application many times, and a second device (serving as a GO node) may also correspondingly execute the peer-to-peer connection establishment method according to the present application many times.
In this embodiment of the present application, the second device may create a point-to-point connection group in advance, then broadcast a broadcast packet carrying a communication connection identifier of the point-to-point connection group, and after the first device scans and reads the communication connection identifier in the broadcast packet, the first device may quickly query a group connection password corresponding to the communication connection identifier locally, thereby directly initiating a connection establishment procedure, and join the point-to-point connection group created by the second device based on the connection establishment procedure. The whole process of establishing the point-to-point connection does not relate to the flows of channel monitoring, equipment discovery, information negotiation and the like in the related technology, the establishment of the point-to-point connection between at least two pieces of equipment can be quickly realized, the flow of establishing the point-to-point connection in real time is simplified, and the time for establishing the point-to-point connection is saved; in the whole connection establishment process, connection safety problems such as connection password leakage and the like cannot be involved, and the connection safety is guaranteed while point-to-point connection is established quickly; the connection password set can be generated and transmitted to each device based on the assistance of the server, additional negotiation and link establishment information is not needed between every two devices, and connection establishment is more convenient and fast; and the first device can acquire the channel and quickly join the point-to-point connection of the second device based on the channel, so that the time overhead of whole network channel scanning is avoided.
Referring to fig. 4, fig. 4 is a flowchart illustrating a peer-to-peer connection establishment method according to another embodiment of the present application. Specifically, the method comprises the following steps:
step S401: a group connection identification and a group connection password are determined from a set of connection passwords.
In a specific embodiment, the second device may determine a group of "communication connection identifier and group connection password" from a locally stored connection password set, where the connection password set may be generally obtained from the server in advance and stored locally.
In some embodiments, the second device may locally store a connection password set, where the connection password set includes at least one set of "reference communication connection identifier and reference group connection password", and the second device may previously obtain the connection password set from a server in the cloud. It can be understood that the server in the cloud may generate link establishment information (index number, service Set Identifier (SSID) -group connection password (password), etc.) used by the second device to establish the peer-to-peer connection group. That is, the second device may obtain the following information from the server in the cloud in advance: concatenating the data of the password set.
For example, the cloud server may generate N groups of "reference communication connection identifiers and reference group connection passwords", then store one copy on the second device, and the second device selects one group as the link establishment information to create the P2P group in the subsequent actual application stage based on the N groups of "reference communication connection identifiers and reference group connection passwords".
Optionally, in some embodiments, the server may preset a connection password set, for example, a connection password set including n sets of "reference connection identifier and reference connection password", on the second device at a device factory stage.
In a specific embodiment, the second device generates a connection password set based on the same group connection password generation policy as the server, and then determines a group connection identifier and a group connection password from the connection password set.
The group connection password generation strategies of the second device and the server are the same, so that the group connection password sets determined by the two ends are ensured to be consistent.
According to some embodiments, the second device generates a connection password set based on the same group connection password generation policy as the server and creates a point-to-point connection group based on the connection password set, and the server can accurately determine the service set identifier and the group connection password created by the second device at any time based on the same group connection password generation policy as the second device.
The group connection password generation strategy can be used for generating a service set identifier and a group connection password based on a user-defined information generation algorithm; for example: the group connection password generation strategy may be that an integer time (e.g., an integer hour, an integer time) is used as an entropy source, and a random number generator is used to generate a group of connection passwords and service set identifiers based on the entropy source. Furthermore, in the actual use stage, the group connection information of the P2P group generated by the second device in a period of time can be accurately estimated by using the whole time as the entropy source. It is understood that the generated "group connection password and service set identifier" has uniqueness over a period of time with an integer time (e.g., an integer hour, an integer time, etc.) as an entropy source, such as 09:15 the second device generates a service set identifier and a group connection password based on the '9' hour, and the first device acquires multiple sets of link establishment information generated by the server based on multiple hours from the server. Further, the server may feed back group connection information (reference communication connection id and reference group connection password) associated with all the time points corresponding to a time period (e.g., one day, one week). That is, the first device may generate at least one set of connection codes including a "reference connection id and a reference connection code" based on the time parameter in advance.
In a specific implementation scenario, the connection password set generally includes more than one group of "reference communication connection identifier and reference group connection password", and the present application may count connection time parameters of each group of "reference communication connection identifier and reference group connection password" in consideration of security of peer-to-peer connection, where the connection time parameters may be total connection duration and connection usage times of each group of "reference communication connection identifier and reference group connection password" and may be considered as one time when P2Pgroup is established once with certain link establishment information), and it may be understood that when the total connection duration exceeds a certain duration threshold, the security of the current group of link establishment information is considered to be low; or, when the number of connections exceeds a certain number threshold, the security of the current link establishment information may be considered to be low
Specifically, the second device may obtain, from the connection password set, connection time parameters corresponding to each group of communication connection identifiers and group connection passwords together, that is, obtain time parameters of each group of link establishment information, such as total connection duration and connection usage times (establishing a P2Pgroup once with certain link establishment information may be regarded as one time).
A group connection identification and a group connection password are then determined from a set of connection passwords based on each of the connection time parameters.
Further, a target connection time parameter satisfying a reference time parameter is determined in each connection time parameter, and a group of communication connection identifiers and a group connection password indicated by the target connection time parameter are obtained from a connection password set.
For example, taking the connection time parameter as the total connection time, after the total connection time of each set of link establishment information is obtained, it is sequentially determined whether each set of total connection time is smaller than a reference time parameter, where the reference time parameter may be a time threshold set for the total connection time, a target connection time parameter smaller than the time threshold may be obtained by comparing, and then a set of communication connection identifier and a set of connection password indicated by the target connection time parameter is obtained from the connection password set.
Further, if there are a plurality of target connection time parameters, a final target connection time parameter may be determined by selecting one of the plurality of target connection time parameters; the method also can adopt the steps of sequencing a plurality of target connection time parameters based on time length and selecting the optimal target connection time parameter indicated by the minimum time length.
For example, taking the connection time parameter as the number of connection uses as an example, after the number of connection uses of each set of establishment link information is obtained, it is sequentially determined whether the number of connection uses of each set is smaller than a reference time parameter, where the reference time parameter may be a time threshold set for the number of connection uses, a target connection time parameter smaller than the time threshold may be obtained by comparing, and then a set of communication connection identifier and a set connection password indicated by the target connection time parameter are obtained from a connection password set.
Further, if there are a plurality of target connection time parameters, a final target connection time parameter may be determined by selecting one of the plurality of target connection time parameters; the method can also adopt the steps of sequencing a plurality of target connection time parameters based on the number of times of use and selecting the optimal target connection time parameter indicated by the minimum number of times of use.
Step S402: and creating a point-to-point connection group based on the communication connection identification and the group connection password.
Step S403: and broadcasting the broadcast packet.
The broadcast packet carries a communication connection identifier of the point-to-point connection group, and the communication connection identifier is used for indicating that the first equipment locally inquires a group connection password of the point-to-point connection group after acquiring the broadcast packet and initiates a connection establishment process based on the communication connection identifier and the group connection password;
in a possible implementation manner, the second device may obtain a communication connection channel and a communication connection identifier of the point-to-point connection group, and broadcast a broadcast packet, where the broadcast packet carries the communication connection channel and the communication connection identifier.
According to some embodiments, the communication connection channel refers to a data signal transmission channel of a "point-to-point connection" in which a wireless communication signal is used as a transmission medium. Which may also be referred to as the wireless band of the point-to-point communication connection. For example, the commonly used ieee802.11b/g operates in the 2.4 to 2.4835GHz band, which is divided into 11 or 13 channels. When there are more than two APs (access points) in the wireless signal coverage of the wireless AP (access point), each AP (access point) needs to set a different frequency band to avoid the collision of the common channels.
According to some embodiments, the second device, as a group owner node (Go node), when creating the P2P group, will also select an appropriate communication connection channel based on the current communication channel environment, and carry the interactive data in the point-to-point connection based on the selected communication connection channel.
In this embodiment of the application, the broadcast packet may carry a communication connection channel in addition to the communication connection identifier, and the communication connection channel may be used by the first device to quickly determine a communication channel used by the peer-to-peer connection group, so that time for scanning a full network channel is saved, and the first device can be quickly and conveniently added to a P2P group of the second device.
According to some embodiments, based on an actual application environment, the second device serves as a GO node to establish a P2P group (which may also be understood as a P2P network) in advance, in some embodiments, in the process of establishing the P2P group, a group of "communication connection identifier and group connection password" may be locally selected as group link information to complete an initialization configuration process of creating the P2P group, and after the P2P group is created, the second device serves as the GO node. Then, the second device may broadcast the broadcast packet externally by way of communication broadcast (e.g., bluetooth broadcast), and one or more electronic devices within the broadcast range of the broadcast packet signal of the second device may scan the broadcast packet by way of channel scanning.
Step S404: joining the peer-to-peer connection group in response to the first device based on the connection establishment procedure.
For details, refer to step S303, which is not described herein again.
Step S405: counting connection time parameters corresponding to the communication connection identification and/or the group connection password, performing a connection information updating process on the point-to-point connection group based on the connection time parameters, and executing the broadcast packet;
the group connection information updating process generates data update for the communication connection identifier and/or the group connection password of the point-to-point connection group of the current second device, such as data change of the communication connection identifier and/or the group connection password.
In a specific implementation scenario, the present application may count connection time parameters of the current group of "reference communication connection identifier and reference group connection password" based on a security perspective of the peer-to-peer connection, where the connection time parameters may be total connection time of each group of "reference communication connection identifier and reference group connection password", and connection usage times, and a P2Pgroup established once with a certain link establishment information may be regarded as one time), and the like, and it may be understood that when the total connection time exceeds a certain time threshold, the security of the current group of link establishment information is considered to be low; therefore, the second device may replace the link establishment information of the current P2P group, that is, "the communication connection identifier and the group connection password" of the current P2P group, and the replacement process, that is, the connection information update process, may always be to execute the connection time parameter corresponding to each group of communication connection identifiers and group connection passwords together obtained from the connection password set;
and a step of determining a group of communication connection identifiers and group connection passwords from the connection password set based on each of the connection time parameters, which can be specifically referred to as steps S402-S403.
In some embodiments, the connection information updating process may first locally query whether each group of the "reference communication connection identifier and the reference group connection password" in the connection password set is invalid, if each group of the "reference communication connection identifier and the reference group connection password" exceeds the set usage duration threshold, if there is a group of the "reference communication connection identifier and the reference group connection password" that is valid, a group of the communication connection identifier and the group connection password that does not exceed the duration threshold may be locally determined from the connection password set based on each of the connection time parameters; if each group of the reference communication connection identifier and the reference group connection password is invalid, the second device may request the server for updating the connection password set, that is, the server may regenerate a next connection password set including n groups of the reference connection identifier and the reference connection password, and then send the next connection password set to the second device, and then the second device stores the next connection password set, thereby completing updating of the connection password set. Thereby locally determining from the connection cipher set a group of communication connection identifications and group connection ciphers which do not exceed the duration threshold.
And then generating a broadcast packet based on the communication connection identifier and the group connection password of the current P2Pgroup, and broadcasting the broadcast packet.
Step S406: monitoring communication environment parameters of the point-to-point connection group, carrying out a channel updating process on the point-to-point connection group based on the communication environment parameters, and executing the broadcast packet.
The channel update procedure may be understood as that, due to the existence of higher channel interference (as there are more devices in the frequency band channel) in the current communication connection channel of the second device, the second device may trigger the channel update procedure to switch the current communication connection channel to the communication channel with the better channel environment. For the related channel update process, reference may be made to other embodiments of the present application, which are not described herein in detail.
In a specific implementation, the second device may monitor communication environment parameters of the point-to-point connection group, determine quality of a communication channel of a current communication channel based on the communication environment parameters, and perform channel switching on the channel of the point-to-point connection group when the communication quality of the current communication channel is not good, that is, switch the current channel to another communication channel, thereby completing a channel update procedure.
In practical applications, the communication environment parameter may be at least one of parameters of Reference Signal Receiving Power (RSRP) of the communication channel, received Signal Code Power (RSCP), ratio of received chip Signal strength to Noise strength (EcIo) of the received Signal to Noise spectral density (EcNo)/Signal-to-Noise Ratio (Signal-to-Noise Ratio, SNR)/Reference Signal Receiving Quality (RSRQ), bit Error Rate (Bit Error Ratio, BER)/block Error Rate (blocker Rate, BLER)/Packet Error Rate (Packet Error Rate, PER) of the received Signal, and the like, and of course, the communication channel quality of the communication channel may be evaluated by measuring other parameters.
The second device may determine the communication quality of the communication channel according to the communication environment parameter, in a specific implementation, an evaluation threshold or an evaluation range may be set for the communication environment parameter, and when the communication environment parameter does not satisfy the evaluation threshold or the evaluation range, it is determined that the communication quality of the communication channel is not good, at this time, the second device starts measurement of the communication quality of each communication channel included in the entire network, so as to determine a channel communication parameter of each communication channel, the channel communication parameter may be consistent with the parameter included in the aforementioned communication environment parameter, and the ranking priority of each communication channel is determined according to the high-low order of the channel communication parameter, for example, the second device may measure the signal power of each communication channel, and determine the ranking priority of each communication channel according to the high-low order of the signal power; for example, the second device may measure signal strength values of the channels, determine the priority of the channels according to the order of the signal strength values, and so on.
In this embodiment of the present application, the second device may create a point-to-point connection group in advance, then broadcast a broadcast packet carrying a communication connection identifier of the point-to-point connection group, and after the first device scans and reads the communication connection identifier in the broadcast packet, the first device may quickly query a group connection password corresponding to the communication connection identifier locally, thereby directly initiating a connection establishment procedure, and join the point-to-point connection group created by the second device based on the connection establishment procedure. The whole process of establishing the point-to-point connection does not relate to the flows of channel monitoring, equipment discovery, information negotiation and the like in the related technology, the establishment of the point-to-point connection between at least two pieces of equipment can be quickly realized, the flow of establishing the point-to-point connection in real time is simplified, and the time for establishing the point-to-point connection is saved; in the whole connection establishment process, connection safety problems such as connection password leakage and the like cannot be involved, and the connection safety is guaranteed while point-to-point connection is established quickly; the connection password set can be generated and transmitted to each device based on the assistance of the server, no additional negotiation link establishment information is needed between every two devices, and the connection establishment is more convenient and fast; and the first equipment can acquire the channel and quickly join the point-to-point connection of the second equipment based on the channel, so that the time overhead of whole network channel scanning is avoided.
Fig. 5 is a schematic structural diagram of a peer-to-peer connection establishment system according to an embodiment of the present application. As shown in fig. 5, the peer-to-peer connection establishment system 100 includes a first device 100, a second device 110, and a server 120.
The server 120 has a network communication function, and may be a separate server device, such as: rack, blade, tower or cabinet type server equipment, or hardware equipment with stronger computing power such as a workstation and a large computer; the server cluster can also be a server cluster formed by a plurality of servers, each server in the service cluster can be formed in a symmetrical mode, wherein each server has equivalent functions and equivalent positions in a service link, each server can provide services for the outside independently, and the independent service can be understood as the assistance without other servers.
The first device 100 and the second device 110 may each be an electronic device with peer-to-peer communication functionality, including but not limited to: wearable devices, handheld devices, personal computers, tablet computers, televisions, in-vehicle devices, smart phones, computing devices or other processing devices connected to a wireless modem, and the like. Electronic devices in different networks may be called different names, such as: user equipment, access terminal, subscriber unit, subscriber station, mobile station, remote terminal, mobile device, user terminal, wireless communication device, user agent or user equipment, cellular telephone, cordless telephone, personal Digital Assistant (PDA), terminal equipment in a 5G network or future evolution network, and the like.
The first device 100, the second device 110 and the server 120 are in interactive communication via a network, which may be a wireless network including but not limited to a cellular network, a wireless local area network, an infrared network or a bluetooth network, or a wired network including but not limited to an ethernet network, a Universal Serial Bus (USB) or a controller area network.
Referring to fig. 5a, fig. 5a is an interaction diagram of a peer-to-peer connection establishment system according to an embodiment of the present application.
Step S501: the second device 110 obtains a connection password set from the server 120;
step S502: the first device 100 acquires a connection password set corresponding to the second device 110 when the point-to-point connection group is created from the server 120;
step S503: the second device 110 determines a group of communication connection identifiers and group connection passwords from the connection password set to create a point-to-point connection group, and broadcasts a broadcast packet;
step S504: the first device 100 acquires a broadcast packet broadcast by the second device 110, and reads a communication connection identifier in the broadcast packet;
step S505: the first device 100 locally queries the group connection password of the second device based on the communication connection identification;
step S506: the first device 100 initiates a connection establishment procedure to the second device 120 based on the communication connection identifier and the group connection password;
step S507: the second device 120 responds to the connection establishment procedure to join the first device 100 to the set of point-to-point connections.
Step S508: the second device 120 counts connection time parameters corresponding to the communication connection identifier and/or the group connection password, performs a connection information update procedure on the point-to-point connection group based on the connection time parameters, and executes the step of broadcasting the broadcast packet.
Step S509: the second device 120 monitors the communication environment parameter of the peer-to-peer connection group, performs a channel update procedure on the peer-to-peer connection group based on the communication environment parameter, and executes the step of broadcasting the broadcast packet.
Step S510: if the communication status of the peer-to-peer connection group is a communication interruption status, the first device 100 re-acquires the broadcast packet broadcast by the second device 120, and performs the step of reading the communication connection identifier and the communication connection channel in the broadcast packet.
In addition, the embodiment of the point-to-point connection establishment system provided in the foregoing embodiment and the point-to-point connection establishment methods in some embodiments belong to the same concept, and the method steps not involved in the embodiment of the point-to-point connection establishment system may refer to the point-to-point connection establishment methods belonging to the same concept in some embodiments, and the detailed implementation process thereof is referred to in the embodiment of the method and will not be described herein again.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 6, a schematic structural diagram of a peer-to-peer connection establishing apparatus according to an exemplary embodiment of the present application is shown. The point-to-point connection establishing means may be implemented in software, hardware or a combination of both as all or part of the device. The device 1 comprises a broadcast reading module 11, a password query module 12 and a connection establishment module 13.
A broadcast reading module 11, configured to obtain a broadcast packet broadcast by a second device, and read a communication connection identifier in the broadcast packet;
a password query module 12, configured to query a group connection password of the second device locally based on the communication connection identifier;
a connection establishing module 13, configured to initiate a connection establishing procedure to the second device based on the communication connection identifier and the group connection password, and join the peer-to-peer connection group created by the second device based on the connection establishing procedure.
Optionally, as shown in fig. 7, the apparatus 1 further includes:
a password obtaining module 14, configured to obtain, from the server, a connection password set corresponding to the second device when creating the point-to-point connection group, where the connection password set includes at least one reference connection identifier and a reference connection password;
the password obtaining module 14 is further configured to locally store the connection password set.
Optionally, the second device creates a peer-to-peer connection group based on the connection password set acquired from the server, where the connection password set is generated by the server;
or the like, or, alternatively,
the second device generates a connection password set based on a group connection password generation policy that is the same as that of the server and creates a point-to-point connection group based on the connection password set.
Optionally, the password querying module 12 is specifically configured to:
and inquiring a connection password corresponding to the communication connection identifier in the locally stored connection password set, and taking the target connection password as a current group connection password aiming at the second equipment.
Optionally, the apparatus 1 is specifically configured to:
if the connection password set does not have the connection password corresponding to the communication connection identifier, acquiring group connection information aiming at a point-to-point connection group from a server based on the equipment address corresponding to the second equipment in the broadcast packet, wherein the group connection information comprises a service set identifier and a group connection password corresponding to the point-to-point connection group.
Optionally, the broadcast reading module 11 is specifically configured to: reading the communication connection identification and the communication connection channel in the broadcast packet:
optionally, the connection establishing module 13 is specifically configured to: joining the point-to-point connection group created by the second device based on the communication connection channel.
Optionally, the apparatus 1 is specifically configured to:
and if the communication state of the point-to-point connection group is a communication interruption state, re-acquiring the broadcast packet broadcast by the second equipment, and executing the step of reading the communication connection identifier and the communication connection channel in the broadcast packet.
Optionally, the apparatus 1 is specifically configured to:
the communication connection identifier is an index number for a point-to-point connection group, and group connection information of the point-to-point connection group of the second device is queried locally based on the index number, wherein the group connection information is a service identifier set and a group connection password of the point-to-point connection group created by the second device; or the like, or, alternatively,
the communication connection identifier is a service identifier set for a peer-to-peer connection group, and a group connection password of the peer-to-peer connection group of the second device is queried locally based on the service identifier set.
Optionally, the apparatus 1 is specifically configured to: acquiring a broadcast packet broadcasted by the second equipment in a Bluetooth communication mode; the joining of the peer-to-peer connection group created by the second device includes:
and adding the point-to-point connection group created by the second equipment in a wireless network direct connection mode.
It should be noted that, when the peer-to-peer connection establishing apparatus provided in the foregoing embodiment executes the peer-to-peer connection establishing method, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed to 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 functions described above. In addition, the point-to-point connection establishing apparatus and the point-to-point connection establishing method provided in the above embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments and are not described herein again.
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.
Please refer to fig. 8, which illustrates a schematic structural diagram of a peer-to-peer connection establishing apparatus according to an exemplary embodiment of the present application. The point-to-point connection establishing means may be implemented in software, hardware or a combination of both as all or part of the device. The apparatus 2 comprises a create broadcast module 21 and a connection response module 22.
A creating and broadcasting module 21, configured to create a point-to-point connection group, and broadcast a broadcast packet, where the broadcast packet carries a communication connection identifier of the point-to-point connection group, and the communication connection identifier is used to instruct a first device to locally query a group connection password of the point-to-point connection group after acquiring the broadcast packet, and initiate a connection establishment procedure based on the communication connection identifier and the group connection password;
a connection responding module 22, configured to respond to the first device joining the peer-to-peer connection group based on the connection establishment procedure.
Optionally, the creating and broadcasting module 21 is specifically configured to:
determining a group of communication connection identification and a group connection password from a connection password set, and creating a point-to-point connection group based on the communication connection identification and the group connection password, wherein the connection password set comprises at least one group of reference connection identification and reference connection password.
Optionally, the creating and broadcasting module 21 is specifically configured to:
determining a communication connection identifier and a group connection password from a connection password set based on the connection password set acquired from a server; or the like, or a combination thereof,
and determining a group of communication connection identifiers and group connection passwords from the connection password set based on the connection password set generated by the same group connection password generation strategy as the server.
Optionally, the creating and broadcasting module 21 is specifically configured to:
acquiring connection time parameters corresponding to all groups of communication connection identifications and group connection passwords from a connection password set;
a group connection identification and a group connection password are determined from a set of connection passwords based on each of the connection time parameters.
Optionally, the creating and broadcasting module 21 is specifically configured to:
and determining a target connection time parameter meeting the reference time parameter in each connection time parameter, and acquiring a group of communication connection identifiers and group connection passwords indicated by the target connection time parameter from a connection password set.
Optionally, the creating and broadcasting module 21 is specifically configured to:
and acquiring a communication connection channel and a communication connection identifier of the point-to-point connection group, and broadcasting a broadcast packet, wherein the broadcast packet carries the communication connection channel and the communication connection identifier.
Optionally, the apparatus 2 is specifically configured to:
counting connection time parameters corresponding to the communication connection identification and/or the group connection password, performing a connection information updating process on the point-to-point connection group based on the connection time parameters, and executing the broadcast packet; and/or monitoring communication environment parameters of the point-to-point connection group, performing a channel updating process on the point-to-point connection group based on the communication environment parameters, and executing the broadcast packet.
It should be noted that, when the peer-to-peer connection establishing apparatus provided in the foregoing embodiment executes the peer-to-peer connection establishing method, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed to 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 functions described above. In addition, the point-to-point connection establishing apparatus and the point-to-point connection establishing method provided in the above embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the point-to-point connection establishment method according to the embodiments shown in fig. 1 to 5, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 1 to 5, which is not described herein again.
The present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded by the processor and executes the point-to-point connection establishing method according to the embodiments shown in fig. 1 to fig. 5, where a specific execution process may refer to specific descriptions of the embodiments shown in fig. 1 to fig. 5, and details are not described herein.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002.
The communication bus 1002 is used to implement connection communication among these components.
The user interface 1003 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 1001 may include one or more processing cores, among other things. The processor 1001 connects various parts throughout the server 1000 using various interfaces and lines, and performs various functions of the server 1000 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1005 and calling data stored in the memory 1005. Alternatively, the processor 1001 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-programmable gate array (FPGA), and Programmable Logic Array (PLA). The processor 1001 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 1001, but may be implemented by a single chip.
The memory 1005 may include a Random Access Memory (RAM) or a Read-only memory (Read-only memory). Optionally, the memory 1005 includes a non-transitory computer-readable medium (non-transitory-reusable storage medium). The memory 1005 may be used to store an instruction, a program, code, a set of codes, or a set of instructions. The memory 1005 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 1005 may alternatively be at least one memory device located remotely from the processor 1001. As shown in fig. 9, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a switching power supply circuit loss determination program.
In the embodiment of the present application, the main body of execution of each step may be the electronic device described above. Optionally, the execution subject of each step is an operating system of the electronic device. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this embodiment of the present application.
The electronic device of the embodiment of the application can also be provided with a display device, and the display device can be various devices capable of realizing a display function, for example: a cathode ray tube (CR) display, a light-emitting diode (LED) display, an electronic ink panel, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. A user may view information such as displayed text, images, video, etc. using a display device on an electronic device. The electronic device may be a smartphone, a tablet computer, a gaming device, an AR (augmented reality) device, an automobile, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
In the electronic device shown in fig. 9, the processor 1001 may be configured to call an application program stored in the memory 1005, and specifically perform the following operations:
acquiring a broadcast packet broadcast by second equipment, and reading a communication connection identifier in the broadcast packet;
querying locally for a group connection password of the second device based on the communication connection identification;
initiating a connection establishment flow to the second equipment based on the communication connection identification and the group connection password, and joining the point-to-point connection group created by the second equipment based on the connection establishment flow.
In one or more embodiments, the processor 1001 may execute any method step related in the foregoing method embodiments, and the electronic device and the peer-to-peer connection establishing method embodiment provided in this embodiment belong to the same concept, and details of the implementation process are referred to in the method embodiment, and are not described herein again.
Referring to fig. 10, a schematic structural diagram of another electronic device is provided in the embodiment of the present application. As shown in fig. 10, the electronic device 2000 may include: at least one processor 2001, at least one network interface 2004, a user interface 2003, memory 2005, at least one communication bus 2002.
The communication bus 2002 is used to implement connection communication between these components.
The user interface 2003 may include a Display screen (Display), and the optional user interface 2003 may further include a standard wired interface and a wireless interface.
The network interface 2004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 2001 may include one or more processing cores, among other things. The processor 2001 connects the various parts within the overall server 2000 using various interfaces and lines, and performs various functions of the server 2000 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 2005 and calling data stored in the memory 2005. Optionally, the processor 2001 may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 2001 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 2001, but may be implemented by a single chip.
The Memory 2005 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 2005 includes a non-transitory computer-readable medium. The memory 2005 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 1005 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 2005 may optionally also be at least one memory device located remotely from the aforementioned processor 2001. As shown in fig. 10, the memory 2005, which is one type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a point-to-point connection establishment application program.
In the electronic device 2000 shown in fig. 10, the user interface 2003 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and processor 2001 may be configured to invoke the point-to-point connection establishment application stored in memory 2005 and perform the following in particular:
establishing a point-to-point connection group, and broadcasting a broadcast packet, wherein the broadcast packet carries a communication connection identifier of the point-to-point connection group, and the communication connection identifier is used for indicating that a first device locally inquires a group connection password of the point-to-point connection group after acquiring the broadcast packet and initiates a connection establishment process based on the communication connection identifier and the group connection password;
joining the peer-to-peer connection group in response to the first device based on the connection establishment procedure.
In one or more embodiments, the processor 2001 may execute any method step related in the foregoing method embodiments, and the electronic device and the peer-to-peer connection establishing method embodiment provided in this embodiment belong to the same concept, and details of the implementation process are referred to in the method embodiment, and are not described herein again.
It is clear to a person skilled in the art that the solution of the present application can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, where the hardware may be, for example, a Field-ProgrammaBLE Gate Array (FPGA), an Integrated Circuit (IC), or the like.
It should be noted that for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of 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 shown or discussed coupling or direct coupling or communication connection between each other may be through some service interfaces, indirect coupling or communication connection of devices or units, and may be electrical or in 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, may be located in one place, or may be 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, 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 computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, and the memory may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above description is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure should not be limited thereby. It is intended that all equivalent variations and modifications made in accordance with the teachings of the present disclosure be covered thereby. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (19)

1. A method for establishing a peer-to-peer connection, the method being applied to a first device, the method comprising:
acquiring a broadcast packet broadcast by second equipment, and reading a communication connection identifier in the broadcast packet;
locally querying the second device for a group connection password based on the communication connection identification;
initiating a connection establishment flow to a second device based on the communication connection identifier and the group connection password, and joining a point-to-point connection group created by the second device based on the connection establishment flow.
2. The method according to claim 1, wherein before acquiring the broadcast packet broadcast by the second device and reading the communication connection identifier in the broadcast packet, the method further comprises:
obtaining a connection password set corresponding to second equipment when a point-to-point connection group is created from a server, wherein the connection password set comprises at least one group of reference connection identification and reference connection password;
storing the connection password set locally.
3. The method of claim 2, wherein the querying the second device locally for a group connection password based on the communication connection identification comprises:
and inquiring a connection password corresponding to the communication connection identifier in the locally stored connection password set, and taking the target connection password as a current group connection password for the second device.
4. The method of claim 3, further comprising:
if the connection password set does not have the connection password corresponding to the communication connection identifier, acquiring group connection information aiming at a point-to-point connection group from a server based on the equipment address corresponding to the second equipment in the broadcast packet, wherein the group connection information comprises a service set identifier and a group connection password corresponding to the point-to-point connection group.
5. The method of claim 1, wherein reading the communication connection identifier in the broadcast packet comprises:
reading the communication connection identifier and the communication connection channel in the broadcast packet:
the joining of the peer-to-peer connection group created by the second device includes:
joining the peer-to-peer connection group created by the second device based on the communication connection channel.
6. The method of claim 5, further comprising:
and if the communication state of the point-to-point connection group is a communication interruption state, re-acquiring the broadcast packet broadcast by the second equipment, and executing the step of reading the communication connection identifier and the communication connection channel in the broadcast packet.
7. The method of claim 1, wherein the querying the second device locally for a group connection password based on the communication connection identification comprises:
the communication connection identifier is an index number for a point-to-point connection group, and group connection information of the point-to-point connection group of the second device is queried locally based on the index number, wherein the group connection information is a service identifier set and a group connection password of the point-to-point connection group created by the second device; or the like, or, alternatively,
the communication connection identifier is a service identifier set aiming at a point-to-point connection group, and a group connection password of the point-to-point connection group of the second equipment is inquired locally based on the service identifier set.
8. The method of claim 1, wherein the obtaining the broadcast packet broadcast by the second device comprises:
acquiring a broadcast packet broadcasted by the second equipment in a Bluetooth communication mode;
the joining of the peer-to-peer connection group created by the second device includes:
and adding the point-to-point connection group created by the second equipment in a wireless network direct connection mode.
9. A peer-to-peer connection establishment method applied to a second device, the method comprising:
establishing a point-to-point connection group, and broadcasting a broadcast packet, wherein the broadcast packet carries a communication connection identifier of the point-to-point connection group, and the communication connection identifier is used for indicating that a first device locally inquires a group connection password of the point-to-point connection group after acquiring the broadcast packet and initiates a connection establishment process based on the communication connection identifier and the group connection password;
responding to the connection establishment procedure to enable the first device to join the point-to-point connection group.
10. The method of claim 9, wherein creating the set of point-to-point connections comprises:
determining a group of communication connection identification and a group connection password from a connection password set, and creating a point-to-point connection group based on the communication connection identification and the group connection password, wherein the connection password set comprises at least one group of reference connection identification and reference connection password.
11. The method of claim 10, wherein determining a set of reference connection id and reference connection password from the set of connection passwords comprises:
determining a communication connection identifier and a group connection password from a connection password set based on the connection password set acquired from a server; or the like, or, alternatively,
and determining a group of communication connection identifications and group connection passwords from the connection password set based on the connection password set generated by the same group connection password generation strategy as the server.
12. The method of claim 11, wherein determining a group connection identifier and a group connection password from a set of connection passwords comprises:
acquiring connection time parameters corresponding to all groups of communication connection identifications and group connection passwords from a connection password set;
a group connection identification and a group connection password are determined from a set of connection passwords based on each of the connection time parameters.
13. The method of claim 12, wherein determining a group connection identifier and a group connection password from a set of connection passwords based on each of the connection time parameters comprises:
and determining a target connection time parameter meeting the reference time parameter in each connection time parameter, and acquiring a group of communication connection identifiers and group connection passwords indicated by the target connection time parameter from a connection password set.
14. The method of claim 10, wherein broadcasting a broadcast packet, the broadcast packet carrying a communication connection identification for the set of point-to-point connections, comprises:
and acquiring a communication connection channel and a communication connection identifier of the point-to-point connection group, wherein the broadcast packet carries the communication connection channel and the communication connection identifier.
15. The method of claim 10, further comprising:
counting connection time parameters corresponding to the communication connection identification and/or the group connection password, performing a connection information updating process on the point-to-point connection group based on the connection time parameters, and executing the broadcast packet; and/or the presence of a gas in the gas,
monitoring communication environment parameters of the point-to-point connection group, carrying out a channel updating process on the point-to-point connection group based on the communication environment parameters, and executing the broadcast packet.
16. A point-to-point connection establishment system, characterized in that the system comprises a first device and a second device, wherein:
the second device is used for creating a point-to-point connection group and broadcasting a broadcast packet, wherein the broadcast packet carries a communication connection identifier of the point-to-point connection group;
the first device is configured to acquire a broadcast packet broadcast by the second device, read a communication connection identifier in the broadcast packet, and locally query a group connection password of the second device based on the communication connection identifier; initiating a connection establishment process to the second equipment based on the communication connection identifier and the group connection password;
the second device is further configured to respond to the connection establishment procedure, so that the first device joins the peer-to-peer connection group.
17. The system of claim 16, further comprising a server, wherein:
the server is used for sending a connection password set corresponding to the second equipment when the point-to-point connection group is created to the first equipment, wherein the connection password set comprises at least one group of reference connection identification and reference connection password; and the number of the first and second groups,
the second device is further configured to determine a group of communication connection identifiers and a group connection password from a connection password set, and create a peer-to-peer connection group based on the communication connection identifiers and the group connection password.
18. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to perform the method steps according to any one of claims 1 to 8 or 9 to 15.
19. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 8 or 10 to 15.
CN202110697074.5A 2021-06-23 2021-06-23 Point-to-point connection establishing method and device, storage medium and electronic equipment Pending CN115515254A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110697074.5A CN115515254A (en) 2021-06-23 2021-06-23 Point-to-point connection establishing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110697074.5A CN115515254A (en) 2021-06-23 2021-06-23 Point-to-point connection establishing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115515254A true CN115515254A (en) 2022-12-23

Family

ID=84499100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110697074.5A Pending CN115515254A (en) 2021-06-23 2021-06-23 Point-to-point connection establishing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115515254A (en)

Similar Documents

Publication Publication Date Title
US9271136B2 (en) Probe messaging for direct link connections
US8848915B2 (en) Method for automatic WLAN connection between digital devices and digital device therefor
WO2020132922A1 (en) Method and device for connecting bluetooth devices
US11129016B2 (en) Method and device for networking between devices
CN104205933B (en) Seamless transition of cellular phone from cellular communication to Wi-Fi communication
CN104539324B (en) Bluetooth low-power-consumption networking interconnecting method and system
CN109743783B (en) Data transmission control method and related product
CN105050033A (en) Piconet networking interconnection method and system based on low-power-dissipation Bluetooth and traditional Bluetooth
US10764805B2 (en) Signal strength measurement method and device
CN110121902B (en) Communication establishment method and terminal
CN110636483A (en) Network distribution method and system
US9781579B2 (en) Method and device for realizing terminal WIFI talkback
CN104283743A (en) Home network equipment and proxy service discovering method
CN110602682A (en) Network management system and method based on Bluetooth BLE and mesh mixing
US10091636B2 (en) Probe messaging for direct link connections
EP3364709B1 (en) Data link establishment methods and apparatus
CN105451368B (en) Communication method and device
JP2023511094A (en) Method and apparatus for displaying IMS emergency service status
US11979247B2 (en) Message forwarding method and apparatus
WO2021134701A1 (en) D2d communication method, apparatus and system
WO2023151423A1 (en) Device connection method and apparatus, device, and storage medium
TW201735711A (en) D2D based communication method and terminal
CN113519176B (en) Communication method, communication device and terminal
CN115515254A (en) Point-to-point connection establishing method and device, storage medium and electronic equipment
CN108718401B (en) Video conference implementation method and related device

Legal Events

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