CN111866824A - Method and equipment for establishing communication connection and data transmission - Google Patents

Method and equipment for establishing communication connection and data transmission Download PDF

Info

Publication number
CN111866824A
CN111866824A CN201910361577.8A CN201910361577A CN111866824A CN 111866824 A CN111866824 A CN 111866824A CN 201910361577 A CN201910361577 A CN 201910361577A CN 111866824 A CN111866824 A CN 111866824A
Authority
CN
China
Prior art keywords
terminal
mac address
broadcast message
ble broadcast
connection
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
CN201910361577.8A
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.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201910361577.8A priority Critical patent/CN111866824A/en
Publication of CN111866824A publication Critical patent/CN111866824A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

The present invention relates to the field of terminal technologies, and in particular, to a method and a device for establishing a communication connection and transmitting data. In the embodiment of the invention, the first terminal determines the Wi-Fi P2P MAC address of the second terminal through a BLE broadcast message interacted with the second terminal, establishes Wi-Fi P2P connection with the second terminal according to the Wi-Fi P2P MAC address, and performs data transmission with the second terminal through Wi-Fi P2P connection, so that a scheme of combined transmission of Bluetooth and Wi-Fi P2P is provided. Furthermore, because the BLE broadcast message is of a scannable non-directional type, the Wi-Fi P2P connection can be established through the BLE broadcast message without establishing Bluetooth pairing connection between the first terminal and the second terminal, so that the time consumed by the Bluetooth pairing connection is avoided, and the process of establishing the Wi-Fi P2P connection is simplified.

Description

Method and equipment for establishing communication connection and data transmission
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to a method and a device for establishing a communication connection and transmitting data.
Background
With the continuous development of communication technology, the applications of bluetooth transmission and Wi-Fi (Wireless Fidelity) transmission in the data transmission field of intelligent devices are relatively wide, wherein:
(1) Bluetooth is a wireless technology standard, and can realize short-distance data exchange (using 2.4-2.485GHz UHF radio waves in ISM (Industrial Scientific Medical) band) between fixed equipment, mobile equipment and building personal area networks, when data transmission is performed by using bluetooth technology, the transmission speed is slow, and data files with capacity of tens of MB to GB level cannot be transmitted at High speed.
(2) Wi-Fi is a technology that allows an electronic device to connect to a Wireless Local Area Network (WLAN), typically using the 2.4G UHF or 5G SHF ISM radio frequency bands. When the Wi-Fi is used for data transmission, high-speed large-capacity data transmission can be realized.
In summary, no scheme for jointly transmitting data by using Bluetooth and Wi-Fi exists.
Disclosure of Invention
The invention provides a method and equipment for establishing communication connection and data transmission, which are used for solving the problem that no scheme for jointly transmitting data by using Bluetooth and Wi-Fi exists at present.
In a first aspect, a method for establishing a communication connection and data transmission provided in an embodiment of the present invention includes:
the method comprises the steps that a first terminal determines Wi-Fi P2P MAC (Wi-Fi Peer-to-Peer Media Access Control Address) Address information according to a scanned BLE (Bluetooth Low Energy, Bluetooth) broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type;
The first terminal establishes Wi-Fi P2P connection with opposite terminal equipment through the Wi-Fi P2P MAC address information;
and the first terminal performs data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
According to the method, the first terminal determines the Wi-Fi P2PMAC address of the second terminal through a BLE broadcast message interacted with the second terminal, establishes Wi-Fi P2P connection with the second terminal according to the Wi-Fi P2P MAC address, and performs data transmission with the second terminal through Wi-Fi P2P connection, so that a scheme of combined transmission of Bluetooth and Wi-Fi P2P is provided. Furthermore, because the BLE broadcast message is of a scannable non-directional type, the Wi-Fi P2P connection can be established through the BLE broadcast message without establishing Bluetooth pairing connection between the first terminal and the second terminal, so that the time consumed by the Bluetooth pairing connection is avoided, and the process of establishing the Wi-Fi P2P connection is simplified.
In an optional implementation manner, the determining, by the first terminal, Wi-FiP2P MAC address information according to the scanned BLE broadcast message includes:
the first terminal determines Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
And the first terminal determines Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
According to the method, the Wi-Fi P2P MAC address is placed in the BLE broadcast message, the Wi-Fi P2P MAC address can be determined more intuitively and quickly by analyzing the BLE broadcast message, if the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address is placed in the BLE broadcast message, the memory occupied by effective data in the BLE broadcast message can be saved, and the work load for analyzing the BLE broadcast message is small.
In an optional embodiment, the BLE broadcast packet includes preset UUID (universal unique identifier) information.
According to the method, the first terminal can screen and filter the received BLE broadcast message according to the preset UUID information, if the BLE broadcast message does not contain the preset UUID information, the fact that the opposite terminal device does not support the Bluetooth and Wi-Fi P2P combined transmission function is determined, the mode of presetting the UUID information is more flexible, and the operation is simple.
The method comprises the steps that a second terminal sends a BLE broadcast message containing a Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type;
after receiving a request for establishing Wi-Fi P2P connection sent by opposite-end equipment, the second terminal sends a response for agreeing to establish Wi-Fi P2P connection to the opposite-end equipment;
And the second terminal performs data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
In an optional implementation manner, before the second terminal sends a BLE broadcast message including a MAC address used for determining Wi-Fi P2P, the method further includes:
the second terminal places own Wi-Fi P2P MAC address information in the BLE broadcast message; or
And the second terminal places the own Bluetooth MAC address and the own Wi-Fi P2P MAC address in the BLE broadcast message.
In an optional embodiment, the BLE broadcast packet includes preset UUID information.
In a third aspect, an embodiment of the present invention further provides a first terminal for establishing a communication connection and data transmission, where the first terminal includes: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the terminal to perform the following:
determining Wi-Fi P2P MAC address information according to the scanned BLE broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type; establishing Wi-Fi P2P connection with opposite-end equipment through the Wi-Fi P2P MAC address information; and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
In one possible implementation, the processor is specifically configured to:
determining Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
And determining Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
In an optional embodiment, the BLE broadcast packet includes preset UUID information.
In a fourth aspect, an embodiment of the present invention further provides a second terminal for establishing a communication connection and data transmission, where the second terminal includes: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the terminal to perform the following:
sending a BLE broadcast message containing a MAC address used for determining Wi-Fi P2P, wherein the type of the BLE broadcast message is a scannable non-directional type;
after receiving a request for establishing Wi-Fi P2P connection sent by opposite-end equipment, sending a response for agreeing to establish Wi-Fi P2P connection to the opposite-end equipment;
and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
In an optional embodiment, the processor is further configured to:
Placing own Wi-Fi P2P MAC address information in the BLE broadcast message; or
And placing the own Bluetooth MAC address and the difference information of the Bluetooth MAC address and the own Wi-Fi P2P MAC address in the BLE broadcast message.
In an optional embodiment, the BLE broadcast packet includes preset UUID information.
In a fifth aspect, an embodiment of the present invention further provides a first terminal for establishing a communication connection and data transmission, where the first terminal includes:
a first processing module: the device comprises a scanning module, a scanning module and a processing module, wherein the scanning module is used for scanning BLE broadcast messages to determine Wi-Fi P2P MAC address information according to the scanned BLE broadcast messages, and the types of the BLE broadcast messages are scannable non-directional types;
a first connection module: the terminal is used for establishing Wi-Fi P2P connection with opposite terminal equipment through the Wi-Fi P2P MAC address information;
a first transmission module: the terminal equipment is used for carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
In a fifth aspect, an embodiment of the present invention further provides a second terminal for establishing a communication connection and data transmission, where the second terminal includes:
a second processing module: the device comprises a receiver and a transmitter, wherein the receiver is used for sending a BLE broadcast message containing a MAC address used for determining Wi-Fi P2P, and the type of the BLE broadcast message is a scannable non-directional type;
A second connection module: the terminal device is used for sending a response of agreeing to establish Wi-Fi P2P connection to the opposite terminal device after receiving a request of establishing Wi-Fi P2P connection sent by the opposite terminal device;
a second transmission module: the terminal equipment is used for carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
In a seventh aspect, the present application further provides a computer storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of the method of the first aspect.
In addition, for technical effects brought by any one implementation manner of the second aspect to the sixth aspect, reference may be made to technical effects brought by different implementation manners of the first aspect or the second aspect, and details are not described here.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1A is a schematic view of a scenario for establishing a Wi-Fi P2P communication connection according to an embodiment of the present invention;
Fig. 1B is a schematic view of another scenario for establishing a Wi-Fi P2P communication connection according to an embodiment of the present invention;
fig. 2A is a schematic diagram of an interactive system for establishing a communication connection and data transmission according to an embodiment of the present invention;
fig. 2B is a schematic interface diagram of a terminal for displaying a shortcut icon in a pull-up manner according to an embodiment of the present invention;
fig. 2C is a schematic interface diagram of a terminal regarding a file sharing manner according to an embodiment of the present invention;
fig. 2D is a schematic diagram of a pop-up window interface of a terminal according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a format of a customized BLE broadcast message according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a PDU (Protocol Data Unit) in a custom BLE broadcast message according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a PDU Header in the customized BLE broadcast packet according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a PDU Payload (basic necessary data) in the customized BLE broadcast packet according to an embodiment of the present invention;
fig. 7A is an interface schematic diagram of configuration information of a terminal according to an embodiment of the present invention;
fig. 7B is an interface schematic diagram of another terminal configuration information provided in the embodiment of the present invention;
Fig. 8 is a flowchart illustrating a method for establishing a communication connection and a data transmission corresponding to a first terminal according to an embodiment of the present invention;
fig. 9 is a flowchart illustrating a method for establishing a communication connection and a data transmission corresponding to a second terminal according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a first terminal for establishing a communication connection and data transmission according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a second terminal for establishing a communication connection and data transmission according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a third terminal for establishing a communication connection and data transmission according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a second terminal for establishing a communication connection and data transmission according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of a second terminal for establishing a communication connection and data transmission according to a second embodiment of the present invention;
fig. 15 is a schematic structural diagram of a third terminal for establishing a communication connection and data transmission according to an embodiment of the present invention;
fig. 16 is a schematic flowchart of a first terminal side method for establishing a communication connection and data transmission according to an embodiment of the present invention;
Fig. 17 is a schematic flowchart of a third method for establishing a communication connection and transmitting data according to a second terminal side of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
Some of the words that appear in the text are explained below:
1. the term "and/or" in the embodiments of the present invention describes an association relationship of associated objects, and indicates that three relationships may exist, for example, a and/or B may indicate: 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.
2. In the embodiment of the invention, the term "Wi-Fi P2P", also called WLAN direct connection, can realize interconnection and high-speed data transmission between terminals without a Wi-Fi hotspot and a cellular network.
3. The terms "first terminal" and "second terminal" in the embodiments of the present invention refer to smart devices, such as mobile phones, tablets, smart cameras, smart printers, and the like, which have Wi-Fi functionality and bluetooth functionality.
4. The term "BLE" in the embodiment of the present invention refers to a key technology proposed by the bluetooth 4.0 specification, which is used for discovering devices and performing some simple communications, and has the advantages of low operating power consumption and low standby power consumption, but the transmission rate of BLE is relatively low, and is not suitable for transmitting a large amount of data streams.
5. The term "packet" in the embodiments of the present invention refers to a data unit, i.e., a data block, exchanged and transmitted in a network, and includes complete data information to be sent.
The application scenario described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not form a limitation on the technical solution provided in the embodiment of the present invention, and it can be known by a person skilled in the art that with the occurrence of a new application scenario, the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems. In the description of the present invention, the term "plurality" means two or more unless otherwise specified.
The following takes a mobile phone as an example to introduce the scheme of the invention:
suppose that the two mobile phones share files in a mode of combined transmission of bluetooth and Wi-Fi, wherein a file sender is a mobile terminal 1, and a file receiver is a mobile terminal 2. The mobile terminal 1 and the mobile terminal 2 are respectively provided with a function switch for joint transmission of Bluetooth and Wi-Fi P2P, and when the function switch is clicked, the Bluetooth and WLAN functions are simultaneously started, wherein the WLAN functions comprise Wi-Fi hotspot connection and Wi-Fi P2P connection.
After the WLAN function is turned on, the mobile terminal 1 determines, through the scanned BLE broadcast message, a mobile terminal that supports bluetooth and Wi-FiP2P joint transmission, such as: and if the scanned BLE broadcast message contains preset UUID information which indicates that the Bluetooth and Wi-Fi P2P joint transmission is supported, determining that the mobile terminal sending the BLE broadcast message has the Bluetooth and Wi-Fi P2P joint transmission function. The mobile terminal 1 analyzes the scanned BLE broadcast message containing the preset UUID information to obtain the equipment name of the mobile terminal sending the BLE broadcast message, and adds the equipment name to an equipment list which supports the combined transmission of Bluetooth and Wi-Fi P2P in the local.
For example, referring to fig. 1A, the mobile terminal 1 parses the scanned BLE broadcast packet containing the preset UUID information, and the parsed device name is "mobile terminal 2", then the mobile terminal 1 adds "mobile terminal 2" to a local "connectable device searched by me" list, where "unconnected" displayed behind "mobile terminal 2" in the device list indicates that the mobile terminal 1 and the mobile terminal 2 are in an unconnected state.
At this time, if the user selects "mobile terminal 2" through the device list of mobile terminal 1, mobile terminal 1 sends a request for establishing Wi-Fi P2P connection to mobile terminal 2, and if mobile terminal 1 receives a response for agreeing to establish Wi-Fi P2P connection sent by mobile terminal 2, the connection establishment between mobile terminal 1 and Wi-Fi P2P of mobile terminal 2 is completed. The mobile terminal 1 performs data transmission, i.e. file sharing, with the peer device through the Wi-FiP2P connection, where the mobile terminal 2 is the peer device of the mobile terminal 1 in the above example, and the whole process is described below in terms of the mobile terminal 2:
correspondingly, after a function switch jointly transmitted by Bluetooth and Wi-Fi P2P on the mobile terminal 2 is clicked and opened, the Bluetooth and WLAN functions on the mobile terminal 2 are simultaneously started, after the WLAN function is started, the mobile terminal 2 sends a BLE broadcast message containing preset UUID information, after the mobile terminal 2 receives a request for establishing Wi-Fi P2P connection sent by the mobile terminal 1, if a user clicks an agreement key, the mobile terminal 2 sends an agreement for establishing Wi-Fi P2P connection response to the mobile terminal 1, and the mobile terminal 2 receives a shared file sent by the mobile terminal 1 through the established Wi-Fi P2P connection.
It should be noted that, the above-mentioned taking the mobile terminal 1 as an initiator for establishing the Wi-Fi P2P connection and the mobile terminal 2 as an opposite device for passively waiting for the Wi-Fi P2P connection are only examples, and the operation of any one party is not limited to all functions integrated on the mobile terminal in the embodiment of the present invention. That is, in this process, the mobile terminal 2 may also serve as an initiator initiating the establishment of the Wi-Fi P2P connection, and the mobile terminal 1 serves as a receiver receiving the request for establishing the Wi-Fi P2P.
It can be understood that, while scanning the BLE broadcast message, the mobile terminal 1 also sends the BLE broadcast message containing the preset UUID information; the mobile terminal 2 sends a BLE broadcast message containing the preset UUID information and scans the BLE broadcast message, that is, both the mobile terminal 1 and the mobile terminal 2 are bidirectionally scanned. Therefore, the mobile terminal 1 may also perform the specific operation steps of the mobile terminal 2 described above; the mobile terminal 2 may also perform the specific operation steps of the mobile terminal 1 described above. As shown in fig. 1B, the mobile terminal 1 adds the mobile terminal 1 to a local connectable device list according to the scanned BLE broadcast packet, and the mobile terminal 1 also sends the BLE broadcast packet while scanning the BLE broadcast packet; while the mobile terminal 2 sends the BLE broadcast message, the mobile terminal 1 can also be added to a local "i search connectable device" list of the mobile terminal 2 according to the scanned BLE broadcast message containing the preset UUID information sent by the mobile terminal 1, so that a user can select Wi-Fi P2P connection on the list, and connect to an opposite terminal device for file sharing through Wi-Fi P2P.
Because the BLE broadcast message used in the embodiment of the invention is a scannable non-directional type BLE broadcast message based on a Bluetooth protocol, the BLE broadcast message of the type only allows other devices to scan the message to acquire information therein, but cannot initiate a Bluetooth connection request through the message, the embodiment of the invention does not need to establish Bluetooth pairing connection on two sides, and establishes Wi-Fi P2P connection through the BLE broadcast message, thereby realizing combined transmission of Bluetooth and Wi-Fi P2P, and meanwhile, compared with the scheme of establishing Bluetooth connection first and then establishing Wi-Fi P2P connection information through Bluetooth channel interaction, the scheme avoids a large amount of time consumed by Bluetooth pairing connection, and simplifies the process of establishing Wi-Fi P2P connection.
The embodiments of the present invention will be described in further detail with reference to the drawings attached hereto.
As shown in fig. 2A, an embodiment of the present invention provides an interactive system for establishing a communication connection and data transmission, including: a first terminal 10 and a second terminal 20.
The first terminal 10 is configured to determine Wi-Fi P2P MAC address information according to the scanned BLE broadcast packet, where the type of the BLE broadcast packet is a scannable non-directional type; establishing Wi-Fi P2P connection with opposite-end equipment through the Wi-Fi P2P MAC address information; and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
A second terminal 20, configured to send a BLE broadcast packet including a MAC address used for determining Wi-Fi P2P, where a type of the BLE broadcast packet is a scannable non-directional type; after receiving a request for establishing Wi-Fi P2P connection sent by opposite-end equipment, sending a response for agreeing to establish Wi-Fi P2P connection to the opposite-end equipment; and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
Through the scheme, the first terminal determines the Wi-Fi P2P MAC address of the second terminal through a BLE broadcast message interacting with the second terminal, establishes Wi-Fi P2P connection with the second terminal according to the Wi-Fi P2P MAC address, and performs data transmission with the second terminal through Wi-Fi P2P connection, a scheme of combined transmission of Bluetooth and Wi-Fi P2P is provided, further, due to the fact that the BLE broadcast message is of a scannable non-directional type, Wi-Fi P2P connection can be established through the BLE broadcast message without establishing Bluetooth pairing connection between the first terminal and the second terminal, time consumed by Bluetooth pairing connection is avoided, and the process of establishing Wi-Fi P2P connection is simplified.
In the embodiments of the present invention, there are various ways for triggering the first terminal to scan the BLE broadcast packet containing the preset UUID information or triggering the second terminal to send the BLE broadcast containing the preset UUID information, and the following examples are specifically described below:
the first triggering mode is as follows: triggering by identifying a function switch supporting combined transmission of Bluetooth and Wi-Fi P2P;
the terminal is integrated with a function switch with an identifier supporting combined transmission of Bluetooth and Wi-Fi P2P, after the function switch is turned on, a command of combined transmission of Bluetooth and Wi-Fi P2P is triggered, after the terminal receives the command, the Bluetooth function and the WLAN function are started, and Bluetooth scanning and Wi-Fi P2P direct scanning are started.
And if the BLE broadcast message containing the preset UUID information is scanned through Bluetooth, determining the Wi-Fi P2P MAC address of the opposite terminal equipment according to the information in the BLE broadcast message, and establishing Wi-Fi P2P connection.
The function switch for identifying the combined transmission supporting the bluetooth and the Wi-Fi P2P has various display forms, such as:
the display mode is as follows: see fig. 1A or fig. 1B;
the function switch is set on a relevant display interface of the terminal, such as: the function switch of the combined transmission of the Bluetooth and the WLAN in FIG. 1A or FIG. 1B.
And a second display mode: see FIG. 2B;
In the pull-down menu shown in fig. 2B, a function switch for quickly turning on the Wi-Fi P2P joint transmission is provided, and clicking on the icon triggers an instruction for bluetooth and Wi-Fi P2P joint transmission.
And a second triggering mode: selecting a Bluetooth and Wi-Fi P2P combined transmission mode to trigger during data sharing;
when the file sharing is carried out, the mode of jointly transmitting through Bluetooth and Wi-Fi P2P in the file sharing mode is selected to start the Bluetooth and Wi-Fi P2P joint transmission.
For example, the following steps are carried out: if the user a holds the mobile terminal 1, the user B holds the mobile terminal 2, and the user a needs to share a file named "work" with the user B through the mobile terminal 1, the specific operation flow is as follows:
the user a selects a file named "work" on the mobile terminal 1, selects a sharing button of the file or presses the file package for a long time to trigger the mobile terminal 1 to display a sharing interface as shown in fig. 2C, wherein the file sharing mode includes bluetooth and Wi-FiP2P joint transmission, mail, information, WeChat and other modes. After the user A selects the combined transmission of the Bluetooth and the Wi-Fi P2P, the mobile terminal 1 informs the user A whether to use the combined transmission of the Bluetooth and the Wi-Fi P2P through a popup window as shown in FIG. 2D, and after the user A clicks 'OK', the mobile terminal 1 is triggered to start the combined transmission function of the Bluetooth and the Wi-Fi P2P.
Correspondingly, if the mobile terminal 2 needs to receive the work file in a bluetooth and Wi-Fi P2P joint transmission manner, the mobile terminal 2 also needs to start a bluetooth and Wi-Fi P2P joint transmission function, and the starting manner may refer to specific operation steps of the mobile terminal 1, which is not described herein again.
And starting a Bluetooth and Wi-Fi P2P combined transmission function, and establishing Wi-Fi P2P connection between the mobile terminal 1 and the mobile terminal 2 through a BLE broadcast message.
The embodiment of the invention is based on the application of the non-connected BLE, the non-connected BLE application depends on BLE broadcast, the party sending BLE broadcast messages is called Broadcaster, and the party monitoring the BLE broadcast messages is called Observer. The following describes an interactive process involved in establishing a communication connection and data transmission, which is provided by the present invention, by taking the first terminal as an Observer and the second terminal as a Broadcaster as an example.
BLE broadcast types are four: connectable non-directional broadcasts, connectable directional broadcasts, non-connectable non-directional broadcasts, and scannable non-directional broadcasts. Embodiments of the present invention are based on a fourth scannable non-directional broadcast, also known as a discoverable broadcast, that cannot be used to initiate a connection, but allows other devices to scan for the broadcast device. This means that the device can be found, either sending BLE broadcast messages or sending scan reply data in response to the scanned device, but not establishing a connection.
BLE broadcasts are through the interactive data flow of BLE broadcast message, there are two kinds of messages in the bluetooth low energy standard: the type of the message is determined by a channel where the message is transmitted, 3 broadcast channels and 37 data channels are specified in a low-power-consumption Bluetooth specification, and if the message is transmitted in the broadcast channels, the message is a broadcast message; if the data message is transmitted in the data channel, the data message is the data message.
The two types of messages have two completely different purposes, and the intelligent device utilizes the broadcast messages to discover and connect other devices. Once the connection is established, the data packet can only be sent to the connected peer device through the data channel. The difference between the two is that the data message can only be understood by two devices (master and slave) in the connection, while the broadcast message can be broadcast to a plurality of listening devices or only sent to a specific device.
As shown in fig. 3, a schematic structural diagram of a BLE broadcast message format according to an embodiment of the present invention is provided.
The BLE broadcast message comprises the following four parts:
preamble (Preamble): the broadcast channel is fixed to 10101010b, the data channel is 10101010bor01010101 b;
access Address: the broadcast channel is fixed to 0x8E89BED6, the data channel is a random value, different connections have different values, and the data channel is used between two devices after the connection is established;
CRC: CRC checking;
PDU: as shown in FIG. 4, the PDU includes a PDU Header and PDU Payload data;
as shown in fig. 5, the PDU Header includes a PDU Type (Type) for representing the Type of the BLE broadcast packet, and the PDU Type is described in detail below:
as shown in table 1 below, the PDU Type includes four Advertising types, two Scanning types, and one initializing Type, which are distinguished by 1byte data.
Figure BDA0002046981570000131
TABLE 1 BLE broadcast message-PDU Type in PDU Header
Wherein, the adapting type comprises: ADV _ IND is connectable non-directional broadcast, ADV _ DIRECT _ IND is connectable directional broadcast, ADV _ non _ IND is non-connectable non-directional broadcast, and ADV _ SCAN _ IND is scannable non-directional broadcast;
scanning types include: SCAN _ REQ indicating that a broadcaster can be requested to broadcast more information through the PDU when receiving broadcast data of ADV _ IND or ADV _ SCAN _ IND type; SCAN _ RSP, which means that after the broadcaster receives the SCAN _ REQ request, more data is transmitted to the opposite terminal equipment through the PDU response;
the initialization type is CONNECT _ REQ, which indicates that when receiving broadcast data of ADV _ IND or ADV _ DIRECT _ IND type, connection with the other party can be requested through the PDU;
The embodiment of the present invention uses a scannable non-directional ADV _ SCAN _ IND Type PDU Payload, the flag bit of PDU Type is 0110, and as shown in table 2, it is a structural schematic diagram of an ADV _ SCAN _ IND Type PDU Payload, where the maximum length of this Type PDU Payload data packet is 37 bytes, where AdvA is a broadcast device address part, which contains a broadcast sender's bluetooth MAC address, and 6 bytes, and AdvData is a PDU data part, which contains two parts, namely, significant (valid data) and non-significant (invalid data), and 31 bytes in total.
Figure BDA0002046981570000141
TABLE 2 BLE BROADCAST MESSAGE-PDU Payload of ADV _ SCAN _ IND type
AdvData is described in detail below, and includes, but is not limited to, the following:
1, a valid data portion;
the valid Data part contains a number of broadcast Data units called AD Structure, which contains Length and Data. As shown in fig. 6, the composition of the AD Structure includes, but is not limited to, the following:
1) the Length indicates the Length of Data included after the Length in the AD Structure, that is, the Length of Data.
2) AD Type, which indicates the Type of content represented by AD Data, such as device name, UUID, etc.;
3) AD Data, specific Data content.
For example, the content 020106 of an AD Structure is 02 for Len (indicating that the next 2 bytes of content all belong to AD Structure 1), 01 for AD Type, and 06 for AD Data.
2, invalid data portion;
the length of AdvData in PDU Payload must be 31 bytes, if the valid data part is less than 31 bytes, then it is complemented with 0, and the data in this part is invalid.
The AD types involved in the embodiments of the present invention include, but are not limited to, the following types, which are described below:
type 1: incomplete 16-bit UUID information;
an important concept in BLE applications is UUID, which identifies bluetooth services and communication feature access attributes, with different access methods being used for different bluetooth services and attributes.
Three definitions of the service UUID format in the bluetooth broadcast are 16-bit UUID, 32-bit UUID and 128-bit UUID. The difference between complete and incomplete is that the device supports various service UUIDs, but only broadcasting a part of the services is called incomplete, and the embodiment of the invention adds a self-defined service in a broadcast data packet, so that the monitoring broadcaster Observer can determine an available device supporting combined transmission of bluetooth and Wi-Fi P2P by judging whether a scanned BLE broadcast message carries UUID information corresponding to the self-defined service.
In the embodiment of the invention, 0x02 represents incomplete 16-bit UUID information, and if the AD Type is 02, the content of ADData is incomplete UUID information.
Such as: the Service name defined by the invention is My _ Service _ UUID, and if the My _ Service _ UUID generated by using the UUID random generator is E953, when the UUID obtained by analyzing the received BLE broadcast message contains E953, the terminal broadcasting the BLE broadcast message is a valid terminal, namely a terminal supporting Bluetooth and Wi-Fi P2P combined transmission control.
For example, the following steps are carried out: the AD Structure 1 in the BLE broadcast message received by the first terminal is 030253E 9, where length is 03, 3 bytes after length belong to the AD Structure 1, AD Type is 02, the content of AD Data is UUID information, and the corresponding UUID information is E953, that is, My _ Service _ UUID, then the first terminal determines that the terminal broadcasting the BLE broadcast message is a terminal supporting bluetooth and Wi-Fi P2P joint transmission control.
It should be noted that the My _ Service _ UUID E953 is only an example, any value representing meaning or type is not limited to a fixed real number, and any value or length combination meeting the requirement of the condition is suitable for the present invention.
Type 2: a device name;
in the embodiment of the invention, 0x08 represents equipment abbreviation, 0x09 represents equipment full name, correspondingly, AD Data is a character string of names, and if AD Type is 08, the AD Data is the abbreviation of the names of the equipment; if the AD Type is 09, the AD Data device is called fully, and the added part is to enable the broadcast monitor Observer to obtain the device name of the Broadcaster, so as to display the device name, which is convenient for the user to view.
For example, the content of an AD Structure is 0E 09454 d 393330342046696E 646 d65, where Len is 0E (indicating that the contents of the next 14 bytes all belong to the AD Structure), AD Type is 09 for the device generic name, AD Data is 454 d 393330342046696E 646 d65 for 'E "M" 9 "3" 0 "4" space "F" i "n" d "M" E' (see ASCII code hexadecimal).
Type 3: customizing data;
in the embodiment of the invention, 0xFF represents vendor self-defined data, the first two bytes represent vendor ID, the default is 6F4D, and the rest are added according to requirements, so that the data content in the data can be self-defined.
The embodiment of the invention can represent the Wi-Fi P2PMAC address or the difference item of the Bluetooth MAC address and the Wi-Fi P2P MAC address of the broadcast sender Broadcaster through the custom data. That is, there are various ways for determining the Wi-Fi P2P MAC address information contained in the custom data, which are illustrated below:
The first method is as follows: the user-defined data comprises a difference item of a Bluetooth MAC address and a Wi-Fi P2P MAC address;
fig. 7A is a schematic diagram showing the bluetooth MAC address and the WLAN MAC address of terminal a.
Taking the terminal A as an example, the WLAN MAC address of the terminal A is EC: D0:9F: C6:50:8B, the Bluetooth address of the terminal A is EC: D0:9F: C6:50:8A, the difference item is 8A, the self-defined data part is the difference item 8A, and the content of the AdvData in the PDU payload is 04FF 4D 6F 8A;
fig. 7B is a diagram illustrating the bluetooth MAC address and the WLAN MAC address of the terminal B.
Taking terminal B as an example, the WLAN MAC address of terminal B is 10:44:00: a5: DE: CD, the bluetooth MAC address of terminal B is 10:44:00: a5: CF:65, if the difference item is the data portion defined here is the difference item DE CD, the content of AdvData in the pdupyload is 05FF 4D 6F DE CD;
correspondingly, the broadcast receiver Observer analyzes the received BLE broadcast message, determines the Bluetooth MAC address of the broadcast sender Broadcaster through the AdvA in the PDUpayload, determines the difference item between the Bluetooth MAC address of the broadcast sender Broadcaster and the WLAN MAC address through the AdvData in the PDU payload, and determines the WLAN MAC address of the broadcast sender Broadcaster according to the analyzed Bluetooth MAC address and the difference item between the Bluetooth MAC address and the WLAN MAC address.
It should be noted that, here, the WLAN MAC address is merely used as an example, and in the BLE broadcast message in the embodiment of the present invention, information capable of determining the Wi-Fi P2P MAC address is placed.
For example, the content of the PDU payload in the BLE broadcast message received by the broadcast receiver Observer is 104400 a5 CF 6505 FF 4D 6F DE CD, the first 6 bytes are AdvA, that is, the bluetooth MAC address 104400 a5 CF65, and the next content is 05 FF 4D 6F DE CD whose bytes are AdvData, so that part of the content can know that the difference item between the bluetooth MAC address and the Wi-Fi P2P MAC address is DE CD, and the Wi-Fi P2P MAC address 10:44:00: a5: DE CD of the broadcast sender Broadcaster is determined according to the analyzed bluetooth MAC address and the difference item between the two.
The second method comprises the following steps: the self-defining data comprises a Wi-Fi P2P MAC address;
if the BLE broadcast message contains a complete Wi-Fi P2P MAC address, the broadcast receiver Observer determines the Wi-Fi P2P MAC address of the broadcast sender Broadcaster according to the Wi-Fi P2P MAC address information obtained by analyzing the BLE broadcast message.
For example, the content of the PDU payload in the BLE broadcast message received by the broadcast receiver Observer is 104400 a5 CF 6509 FF 4D 6F 104400 a5 DE CD, and the Wi-Fi P2P MAC address 104400 a5 DE CD of the broadcast sender Broadcaster can be determined according to the content of the AdvData.
According to the embodiment of the invention, the first terminal and the second terminal establish Wi-Fi P2P connection through interactive BLE broadcast messages.
As shown in fig. 8, a flowchart of a method for establishing a communication connection and a data transmission at a first terminal according to an embodiment of the present invention includes the following steps;
step 800, starting a function switch for combined transmission of the Bluetooth and the Wi-Fi P2P of the first terminal, and starting Bluetooth and WLAN functions;
step 801, a first terminal scans BLE broadcast messages sent by other equipment;
step 802, the first terminal determines whether the received BLE broadcast message contains preset UUID information, if so, step 803 is executed, otherwise, the process is exited;
step 803, the first terminal determines a Wi-Fi P2P MAC address of the peer device according to the BLE broadcast message;
step 804, the first terminal initiates a Wi-Fi P2P connection request to the opposite terminal equipment according to the Wi-Fi P2P MAC address;
step 805, the first terminal receives a response that the opposite terminal equipment agrees to establish Wi-Fi P2P connection;
and step 806, the first terminal performs data transmission with the opposite terminal device through the Wi-Fi P2P connection.
It should be noted that, the first terminal determines a Wi-Fi P2P MAC address and an equipment name of an opposite-end equipment according to a received BLE broadcast message containing preset UUID information, adds the equipment name of the opposite-end equipment to a list interface locally representing connectable equipment, and after a user clicks and selects the equipment, the first terminal initiates a request for establishing Wi-Fi P2P connection according to a Wi-Fi P2P MAC address of the equipment, and when receiving a response agreeing to establish Wi-Fi P2P connection sent by the equipment (i.e., an opposite-end equipment establishing Wi-Fi P2P connection), the first terminal and the equipment successfully establish Wi-Fi P2P connection.
As shown in fig. 9, a flowchart of a method for establishing a communication connection and a data transmission at a second terminal according to an embodiment of the present invention includes the following steps;
step 900, a function switch of the combined transmission of the Bluetooth and the Wi-Fi P2P of the second terminal is turned on, and the Bluetooth and WLAN functions are turned on;
step 901, a second terminal sends a BLE broadcast message;
step 902, the second terminal determines whether a request for establishing Wi-Fi P2P connection initiated by the peer device is received; if so, go to step 903, otherwise exit the flow.
Step 903, the second terminal sends a response of agreeing to establish Wi-Fi P2P connection to the opposite terminal equipment;
and step 904, the second terminal performs data transmission with the opposite terminal device through Wi-Fi P2P connection.
It should be noted that the second terminal may periodically send BLE broadcast messages, and if the sent BLE broadcast messages are scanned by other terminals supporting bluetooth and Wi-Fi P2P joint transmission, the device names of the second terminal may be displayed on a list interface locally representing connectable devices. If the second terminal receives a request for establishing Wi-Fi P2P connection initiated by the opposite terminal device, a dialog box for informing the user whether to establish Wi-Fi P2P connection with the opposite terminal device is popped up, if the user clicks 'confirm', the second terminal can accept the connection request, and if the user clicks 'cancel', the second terminal rejects the connection request. If the connection request is accepted, after the second terminal sends a response of agreeing to establish Wi-Fi P2P connection to the opposite terminal device, the second terminal can perform data transmission with the opposite terminal device through Wi-Fi P2P connection.
Based on the same concept, as shown in fig. 10, an embodiment of the present invention provides a first terminal for establishing a communication connection and data transmission, where the first terminal includes: a processor 1000 and a memory 1001, wherein the memory 1001 stores program codes, and when one or more computer programs stored in the memory 1001 are executed by the processor 1000, the terminal is caused to perform the following processes:
determining Wi-Fi P2P MAC address information according to the scanned BLE broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type; establishing Wi-Fi P2P connection with opposite-end equipment through the Wi-Fi P2P MAC address information; and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
Optionally, the processor 1000 is specifically configured to:
determining Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
And determining Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
Optionally, the BLE broadcast packet includes preset UUID information.
As shown in fig. 11, another first terminal for establishing a communication connection and data transmission according to an embodiment of the present invention includes:
The first processing module 1100: the device comprises a scanning module, a scanning module and a processing module, wherein the scanning module is used for scanning BLE broadcast messages to determine Wi-Fi P2P MAC address information according to the scanned BLE broadcast messages, and the types of the BLE broadcast messages are scannable non-directional types;
first connection module 1101: the Wi-Fi P2P MAC address information is used for establishing Wi-FiP2P connection with opposite terminal equipment;
the first transmission module 1102: the terminal equipment is used for carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
Optionally, the first processing module 1100 is specifically configured to:
determining Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
And determining Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
Optionally, the BLE broadcast packet includes preset UUID information. .
Optionally, the first processing module 1100 is specifically configured to:
after receiving a Bluetooth and Wi-Fi P2P joint transmission instruction, determining that the received BLE broadcast message contains preset UUID information.
As shown in fig. 12, a third terminal 1200 for establishing a communication connection and data transmission according to the embodiment of the present invention includes: radio Frequency (RF) circuit 1210, power supply 1220, processor 1230, memory 1240, input unit 1250, display unit 1260, camera 1270, communication interface 1280, and Wireless Fidelity (Wi-Fi) module 1290. Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 12 is not intended to be limiting, and that the terminal provided by the embodiments of the present application may include more or less components than those shown, or some components may be combined, or a different arrangement of components may be provided.
The following describes the components of the first terminal 1200 in detail with reference to fig. 12:
the RF circuit 1210 may be used for receiving and transmitting data during a communication or conversation. In particular, the RF circuit 1210, after receiving downlink data of a base station, sends the downlink data to the processor 1230 for processing; and in addition, sending the uplink data to be sent to the base station. Generally, the RF circuit 1210 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
In addition, the RF circuit 1210 may also communicate with networks and other terminals through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
The Wi-Fi technology belongs to a short-distance wireless transmission technology, and the first terminal 1200 may connect to an Access Point (AP) through a Wi-Fi module 1290, thereby implementing Access to a data network. The Wi-Fi module 1290 may be used for receiving and transmitting data during communication.
The first terminal 1200 may be physically connected to other terminals through the communication interface 1280. Optionally, the communication interface 1280 is connected to the communication interfaces of the other terminals through a cable, so as to implement data transmission between the first terminal 1200 and the other terminals.
In this embodiment of the application, the first terminal 1200 can implement a communication service and send information to other contacts, so that the first terminal 1200 needs to have a data transmission function, that is, the first terminal 1200 needs to include a communication module inside. Although fig. 12 illustrates communication modules such as the RF circuit 1210, the Wi-Fi module 1290, and the communication interface 1280, it is to be understood that at least one of the above-described components or other communication modules (e.g., a bluetooth module) for implementing communication exists in the first terminal 1200 for data transmission.
For example, when the first terminal 1200 is a mobile phone, the first terminal 1200 may include the RF circuit 1210 and may further include the Wi-Fi module 1290; when the first terminal 1200 is a computer, the first terminal 1200 may include the communication interface 1280 and may further include the Wi-Fi module 1290; when the first terminal 1200 is a tablet computer, the first terminal 1200 may include the Wi-Fi module.
The memory 1240 may be used to store software programs and modules. The processor 1230 executes the software programs and modules stored in the memory 1240 to perform various functional applications and data processing of the first terminal 1200, and when the processor 1230 executes the program codes in the memory 1240, part or all of the processes in fig. 2A according to the embodiment of the present invention can be implemented.
Alternatively, the memory 1240 may mainly include a program storage area and a data storage area. The storage program area can store an operating system, various application programs (such as communication application), a face recognition module and the like; the storage data area may store data (such as various multimedia files like pictures, video files, etc., and face information templates) created according to the use of the terminal, etc.
Further, the memory 1240 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 1250 may be used to receive numeric or character information input by a user and generate key signal inputs related to user settings and function control of the first terminal 1200.
Alternatively, the input unit 1250 may include a touch panel 1251 and other input terminals 1252.
The touch panel 1251, also referred to as a touch screen, can collect touch operations performed by a user on or near the touch panel 1251 (for example, operations performed by the user on or near the touch panel 1251 using any suitable object or accessory such as a finger or a stylus), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 1251 may include two parts, namely, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1230, and can receive and execute commands sent by the processor 1230. In addition, the touch panel 1251 can be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave.
Optionally, the other input terminals 1252 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1260 may be used to display information input by a user or information provided to a user and various menus of the first terminal 1200. The display unit 1260 is a display system of the first terminal 1200, and is configured to present an interface to implement human-computer interaction.
The display unit 1260 may include a display panel 1261. Alternatively, the Display panel 1261 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-emitting diode (OLED), or the like.
Further, the touch panel 1251 can cover the display panel 1261, and when the touch panel 1251 detects a touch operation on or near the touch panel 1251, the touch panel 1251 transmits the touch operation to the processor 1230 to determine the type of the touch event, and then the processor 1230 provides a corresponding visual output on the display panel 1261 according to the type of the touch event.
Although in fig. 12, the touch panel 1251 and the display panel 1261 are implemented as two separate components to implement the input and output functions of the first terminal 1200, in some embodiments, the touch panel 1251 and the display panel 1261 may be integrated to implement the input and output functions of the first terminal 1200.
The processor 1230 is a control center of the first terminal 1200, connects each component using various interfaces and lines, performs various functions of the first terminal 1200 and processes data by operating or executing software programs and/or modules stored in the memory 1240 and calling data stored in the memory 1240, thereby implementing various services based on the terminal.
Optionally, the processor 1230 may include one or more processing units. Optionally, the processor 1230 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 1230.
The camera 1270 is configured to implement a shooting function of the first terminal 1200, and shoot pictures or videos. The camera 1270 may also be configured to implement a scanning function of the first terminal 1200, and scan a scanned object (two-dimensional code/barcode).
The first terminal 1200 also includes a power source 1220 (such as a battery) for powering the various components. Optionally, the power source 1220 may be logically connected to the processor 1230 through a power management system, so that the power management system may manage charging, discharging, power consumption, and the like.
It is to be noted that, according to an embodiment of the present invention, the processor 1230 may perform functions of the processor 1000 in fig. 10, and the memory 1240 may store contents of the processor 1001.
Based on the same concept, as shown in fig. 13, an embodiment of the present invention provides a second terminal for establishing a communication connection and data transmission, where the second terminal includes: a processor 1300 and a memory 1301, wherein the memory 1301 stores program code, and when one or more computer programs stored in the memory 1301 are executed by the processor 1300, the terminal is caused to perform the following processes:
sending a BLE broadcast message containing a MAC address used for determining Wi-Fi P2P, wherein the type of the BLE broadcast message is a scannable non-directional type; after receiving a request for establishing Wi-Fi P2P connection sent by opposite-end equipment, sending a response for agreeing to establish Wi-Fi P2P connection to the opposite-end equipment; and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
Optionally, the processor 1300 is further configured to:
placing own Wi-Fi P2P MAC address information in the BLE broadcast message; or
And placing the own Bluetooth MAC address and the difference information of the Bluetooth MAC address and the own Wi-Fi P2P MAC address in the BLE broadcast message.
Optionally, the BLE broadcast packet includes preset UUID information.
As shown in fig. 14, another second terminal for establishing a communication connection and data transmission according to an embodiment of the present invention includes:
the second processing module 1400: the device comprises a receiver and a transmitter, wherein the receiver is used for sending a BLE broadcast message containing a MAC address used for determining Wi-Fi P2P, and the type of the BLE broadcast message is a scannable non-directional type;
second connection module 1401: the terminal device is used for sending a response of agreeing to establish Wi-Fi P2P connection to the opposite terminal device after receiving a request of establishing Wi-Fi P2P connection sent by the opposite terminal device;
the second transmission module 1402: the terminal equipment is used for carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
Optionally, the second processing module 1400 is further configured to:
placing own Wi-Fi P2P MAC address information in the BLE broadcast message; or
And placing the own Bluetooth MAC address and the difference information of the Bluetooth MAC address and the own Wi-Fi P2P MAC address in the BLE broadcast message.
Optionally, the BLE broadcast packet includes preset UUID information.
As shown in fig. 15, a third terminal 1500 for establishing a communication connection and data transmission according to the embodiment of the present invention includes: radio Frequency (RF) circuitry 1510, a power source 1520, a processor 1530, a memory 1540, an input unit 1550, a display unit 1560, a camera 1570, a communication interface 1580, and a Wireless Fidelity (Wi-Fi) module 1590. Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 15 is not intended to be limiting, and that the terminal provided by the embodiments of the present application may include more or less components than those shown, or some components may be combined, or a different arrangement of components may be provided.
The following describes the components of the second terminal 1500 in detail with reference to fig. 15:
the RF circuitry 1510 may be used for receiving and transmitting data during a communication or conversation. Specifically, the RF circuit 1510 sends downlink data of a base station to the processor 1530 for processing after receiving the downlink data; and in addition, sending the uplink data to be sent to the base station. In general, the RF circuitry 1510 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
Further, the RF circuit 1510 may also communicate with a network and other terminals through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
The Wi-Fi technology belongs to a short-distance wireless transmission technology, and the second terminal 1500 may connect to an Access Point (AP) through a Wi-Fi module 1590, thereby implementing Access to a data network. The Wi-Fi module 1590 can be used for receiving and sending data during communication.
The second terminal 1500 can be physically connected to other terminals through the communication interface 1580. Optionally, the communication interface 1580 is connected to the communication interfaces of the other terminals through a cable, so as to implement data transmission between the second terminal 1500 and the other terminals.
In this embodiment of the application, the second terminal 1500 can implement a communication service to send information to other contacts, so that the second terminal 1500 needs to have a data transmission function, that is, the second terminal 1500 needs to include a communication module inside. Although fig. 15 shows communication modules such as the RF circuit 1510, the Wi-Fi module 1590, and the communication interface 1580, it is to be understood that at least one of the above-described components or other communication modules (e.g., a bluetooth module) for enabling communication exist in the second terminal 1500 for data transmission.
For example, when the second terminal 1500 is a mobile phone, the second terminal 1500 may include the RF circuit 1510 and may further include the Wi-Fi module 1590; when the second terminal 1500 is a computer, the second terminal 1500 may include the communication interface 1580 and may further include the Wi-Fi module 1590; when the second terminal 1500 is a tablet computer, the second terminal 1500 may include the Wi-Fi module.
The memory 1540 can be used to store software programs and modules. The processor 1530 executes various functional applications and data processing of the second terminal 1500 by executing the software programs and modules stored in the memory 1540, and after the processor 1530 executes the program codes in the memory 1540, part or all of the processes in fig. 2A according to the embodiment of the present invention can be implemented.
Alternatively, the memory 1540 may mainly include a program storage area and a data storage area. The storage program area can store an operating system, various application programs (such as communication application), a face recognition module and the like; the storage data area may store data (such as various multimedia files like pictures, video files, etc., and face information templates) created according to the use of the terminal, etc.
Further, the memory 1540 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1550 may be used to receive numeric or character information input by a user and generate key signal inputs related to user settings and function control of the second terminal 1500.
Optionally, the input unit 1550 may include a touch panel 1551 and other input terminals 1552.
The touch panel 1551, also referred to as a touch screen, can collect touch operations of a user (for example, operations of the user on or near the touch panel 1551 by using any suitable object or accessory such as a finger, a stylus pen, etc.) and drive the corresponding connection device according to a preset program. Optionally, the touch panel 1551 may include two parts, namely a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1530, and can receive and execute commands sent by the processor 1530. In addition, the touch panel 1551 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, a surface acoustic wave, and the like.
Optionally, the other input terminals 1552 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1560 may be used to display information input by a user or information provided to the user and various menus of the second terminal 1500. The display unit 1560 is a display system of the second terminal 1500, and is configured to present an interface to implement human-computer interaction.
The display unit 1560 may include a display panel 1561. Alternatively, the Display panel 1561 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-emitting diode (OLED), or the like.
Further, the touch panel 1551 may cover the display panel 1561, and when the touch panel 1551 detects a touch operation on or near the touch panel 1551, the touch operation is transmitted to the processor 1530 to determine the type of the touch event, and then the processor 1530 provides a corresponding visual output on the display panel 1561 according to the type of the touch event.
Although the touch panel 1551 and the display panel 1561 are shown in fig. 15 as two separate components to implement the input and output functions of the second terminal 1500, in some embodiments, the touch panel 1551 and the display panel 1561 can be integrated to implement the input and output functions of the second terminal 1500.
The processor 1530 is a control center of the second terminal 1500, connects each component using various interfaces and lines, and executes various functions and processes data of the second terminal 1500 by operating or executing software programs and/or modules stored in the memory 1540 and calling data stored in the memory 1540, thereby implementing various services based on the terminal.
Optionally, the processor 1530 may include one or more processing units. Optionally, the processor 1530 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 1530.
The camera 1570 is configured to implement a shooting function of the second terminal 1500, and shoot a picture or a video. The camera 1570 may also be configured to implement a scanning function of the second terminal 1500, and scan a scanned object (two-dimensional code/barcode).
The second terminal 1500 also includes a power source 1520 (e.g., a battery) for powering the various components. Optionally, the power source 1520 may be logically connected to the processor 1530 through a power management system, so as to manage charging, discharging, and power consumption functions through the power management system.
It is to be noted that, according to the embodiment of the present invention, the processor 1530 may execute the functions of the processor 1300 in fig. 13, and the memory 1540 stores the contents of the processor 1301.
An embodiment of the present invention further provides a computer-readable non-volatile storage medium, which includes a program code, and when the program code runs on a computing terminal, the program code is configured to enable the computing terminal to execute the steps of the method for establishing a communication connection and transmitting data according to the embodiment of the present invention.
Based on the same inventive concept, the embodiment of the present invention further provides a method for establishing a communication connection and data transmission, and since the device corresponding to the method is a method corresponding to the first terminal for establishing a communication connection and data transmission in the embodiment of the present invention, and the principle of the method for solving the problem is similar to that of the terminal, the implementation of the method can refer to the implementation of the first terminal in the interactive process for establishing a communication connection and data transmission, and repeated details are not repeated.
As shown in fig. 16, a method for establishing a communication connection and transmitting data according to an embodiment of the present invention includes:
step 1600, the first terminal determines Wi-Fi P2P MAC address information according to the scanned BLE broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type;
Step 1601, the first terminal establishes a Wi-FiP2P connection with a peer device through the Wi-Fi P2P MAC address information;
and 1602, the first terminal performs data transmission with an opposite terminal device through the established Wi-Fi P2P connection.
Optionally, the determining, by the first terminal, the Wi-Fi P2P MAC address information according to the scanned BLE broadcast packet includes:
the first terminal determines Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
And the first terminal determines Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
Optionally, the BLE broadcast packet includes preset UUID information.
Based on the same inventive concept, the embodiment of the present invention further provides a method for establishing a communication connection and data transmission, and since the device corresponding to the method is a method corresponding to the second terminal for establishing a communication connection and data transmission in the embodiment of the present invention, and the principle of the method for solving the problem is similar to that of the terminal, the implementation of the method can refer to the implementation of the second terminal in the interactive process for establishing a communication connection and data transmission, and repeated details are not repeated.
As shown in fig. 17, a method for establishing a communication connection and transmitting data according to an embodiment of the present invention includes:
step 1700, the second terminal sends a BLE broadcast message including an MAC address used for determining Wi-Fi P2P, wherein the type of the BLE broadcast message is a scannable non-directional type;
step 1701, after receiving a request for establishing Wi-Fi P2P connection sent by opposite-end equipment, the second terminal sends a response for agreeing to establish Wi-Fi P2P connection to the opposite-end equipment;
step 1702, the second terminal performs data transmission with an opposite terminal device through the established Wi-Fi P2P connection.
Optionally, before the second terminal sends a BLE broadcast message including a MAC address used for determining Wi-Fi P2P, the method further includes:
the second terminal places own Wi-Fi P2P MAC address information in the BLE broadcast message; or
And the second terminal places the own Bluetooth MAC address and the difference information of the Bluetooth MAC address and the own Wi-Fi P2P MAC address in the BLE broadcast message.
Optionally, the BLE broadcast packet includes preset UUID information.
The present application is described above with reference to block diagrams and/or flowchart illustrations of methods, apparatus (systems) and/or computer program products according to embodiments of the application. It will be understood that one block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, and/or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer and/or other programmable data processing apparatus, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the subject application may also be embodied in hardware and/or in software (including firmware, resident software, micro-code, etc.). Furthermore, the present application may take the form of a computer program product on a computer-usable or computer-readable storage medium having computer-usable or computer-readable program code embodied in the medium for use by or in connection with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for establishing a communication connection and data transmission, the method comprising:
The method comprises the steps that a first terminal determines wireless fidelity point-to-point media access control address Wi-Fi P2P MAC address information according to a scanned low-power-consumption Bluetooth BLE broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type;
the first terminal establishes Wi-Fi P2P connection with opposite terminal equipment through the Wi-Fi P2P MAC address information;
and the first terminal performs data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
2. The method of claim 1, wherein the determining, by the first terminal, Wi-Fi P2P MAC address information from the scanned BLE broadcast message comprises:
the first terminal determines Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
And the first terminal determines Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-FiP2P MAC address.
3. The method of claim 1, wherein the BLE broadcast message contains pre-determined Universally Unique Identifier (UUID) information.
4. A method for establishing a communication connection and data transmission, the method comprising:
the method comprises the steps that a second terminal sends a BLE broadcast message containing a Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type;
After receiving a request for establishing Wi-Fi P2P connection sent by opposite-end equipment, the second terminal sends a response for agreeing to establish Wi-Fi P2P connection to the opposite-end equipment;
and the second terminal performs data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
5. The method of claim 4, wherein before the second terminal sends a BLE broadcast message including information used to determine a Wi-Fi P2PMAC address, the method further comprises:
the second terminal places own Wi-Fi P2P MAC address information in the BLE broadcast message; or
And the second terminal places the own Bluetooth MAC address and the difference information of the Bluetooth MAC address and the own Wi-Fi P2P MAC address in the BLE broadcast message.
6. The method of claim 4, wherein the BLE broadcast message comprises preset UUID information.
7. A first terminal for establishing a communication connection and data transmission, the terminal comprising: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the terminal to perform the following:
determining Wi-Fi P2P MAC address information according to the scanned low-power-consumption Bluetooth BLE broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type;
Establishing Wi-Fi P2P connection with opposite-end equipment through the Wi-Fi P2P MAC address information;
and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
8. The first terminal of claim 7, wherein the processor is further configured to:
determining Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
And determining Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
9. A second terminal for establishing a communication connection and data transmission, the terminal comprising: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the terminal to perform the following:
sending a BLE broadcast message containing a MAC address used for determining Wi-Fi P2P, wherein the type of the BLE broadcast message is a scannable non-directional type;
after receiving a request for establishing Wi-Fi P2P connection sent by opposite-end equipment, sending a response for agreeing to establish Wi-Fi P2P connection to the opposite-end equipment;
and carrying out data transmission with the opposite terminal equipment through the established Wi-Fi P2P connection.
10. The second terminal of claim 9, wherein the processor is further configured to:
placing own Wi-Fi P2P MAC address information in the BLE broadcast message; or
And placing the own Bluetooth MAC address and the difference information of the Bluetooth MAC address and the own Wi-Fi P2P MAC address in the BLE broadcast message.
CN201910361577.8A 2019-04-30 2019-04-30 Method and equipment for establishing communication connection and data transmission Pending CN111866824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910361577.8A CN111866824A (en) 2019-04-30 2019-04-30 Method and equipment for establishing communication connection and data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910361577.8A CN111866824A (en) 2019-04-30 2019-04-30 Method and equipment for establishing communication connection and data transmission

Publications (1)

Publication Number Publication Date
CN111866824A true CN111866824A (en) 2020-10-30

Family

ID=72965616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910361577.8A Pending CN111866824A (en) 2019-04-30 2019-04-30 Method and equipment for establishing communication connection and data transmission

Country Status (1)

Country Link
CN (1) CN111866824A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113225714A (en) * 2021-04-16 2021-08-06 广州朗国电子科技有限公司 Screen projection method and system
CN114286324A (en) * 2021-12-31 2022-04-05 南京四维智联科技有限公司 Vehicle-mounted machine interconnection method, system, device and computer equipment
CN114928898A (en) * 2022-07-18 2022-08-19 荣耀终端有限公司 Method and device for establishing session based on WiFi direct connection
WO2022199491A1 (en) * 2021-03-22 2022-09-29 华为技术有限公司 Stereo networking method and system, and related apparatus
CN115250427A (en) * 2021-04-28 2022-10-28 海信集团控股股份有限公司 Bluetooth connection establishment method, mobile terminal and electronic household equipment
WO2023151377A1 (en) * 2022-02-10 2023-08-17 荣耀终端有限公司 File sharing method and terminal device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130336161A1 (en) * 2012-06-19 2013-12-19 Samsung Electronics Co., Ltd. Terminal and method for p2p connection in wifi network
CN104539324A (en) * 2014-12-25 2015-04-22 惠州Tcl移动通信有限公司 Bluetooth low-power-consumption networking interconnecting method and system
US20160353233A1 (en) * 2015-06-01 2016-12-01 Apple Inc. Bluetooth Low Energy Triggering NAN for Further Discovery and Connection
CN106412809A (en) * 2016-11-22 2017-02-15 任子行网络技术股份有限公司 MAC address acquisition method and system based on Bluetooth and WIFI
CN107018554A (en) * 2017-03-07 2017-08-04 广东欧珀移动通信有限公司 A kind of data transmission method, device and intelligent terminal
CN107864469A (en) * 2017-10-31 2018-03-30 青岛海信电器股份有限公司 Wireless connection method and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130336161A1 (en) * 2012-06-19 2013-12-19 Samsung Electronics Co., Ltd. Terminal and method for p2p connection in wifi network
CN104539324A (en) * 2014-12-25 2015-04-22 惠州Tcl移动通信有限公司 Bluetooth low-power-consumption networking interconnecting method and system
US20160353233A1 (en) * 2015-06-01 2016-12-01 Apple Inc. Bluetooth Low Energy Triggering NAN for Further Discovery and Connection
CN106412809A (en) * 2016-11-22 2017-02-15 任子行网络技术股份有限公司 MAC address acquisition method and system based on Bluetooth and WIFI
CN107018554A (en) * 2017-03-07 2017-08-04 广东欧珀移动通信有限公司 A kind of data transmission method, device and intelligent terminal
CN107864469A (en) * 2017-10-31 2018-03-30 青岛海信电器股份有限公司 Wireless connection method and equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022199491A1 (en) * 2021-03-22 2022-09-29 华为技术有限公司 Stereo networking method and system, and related apparatus
CN113225714A (en) * 2021-04-16 2021-08-06 广州朗国电子科技有限公司 Screen projection method and system
CN115250427A (en) * 2021-04-28 2022-10-28 海信集团控股股份有限公司 Bluetooth connection establishment method, mobile terminal and electronic household equipment
CN114286324A (en) * 2021-12-31 2022-04-05 南京四维智联科技有限公司 Vehicle-mounted machine interconnection method, system, device and computer equipment
WO2023151377A1 (en) * 2022-02-10 2023-08-17 荣耀终端有限公司 File sharing method and terminal device
CN114928898A (en) * 2022-07-18 2022-08-19 荣耀终端有限公司 Method and device for establishing session based on WiFi direct connection
CN114928898B (en) * 2022-07-18 2022-10-28 荣耀终端有限公司 Method and device for establishing session based on WiFi direct connection

Similar Documents

Publication Publication Date Title
CN111866824A (en) Method and equipment for establishing communication connection and data transmission
CN112118539B (en) Method and device for device information interaction between terminals
CN111867148B (en) Method and device for establishing device connection and data transmission
US6950645B1 (en) Power-conserving intuitive device discovery technique in a bluetooth environment
EP3627777B1 (en) Message transmission method and device, terminal and storage medium
CN110113739B (en) Information processing method and electronic equipment
CN110032512B (en) Debugging method of small program, related equipment and terminal
CN110121902B (en) Communication establishment method and terminal
CN108040091B (en) Data processing method, device and storage medium
CN105100141B (en) Multimedia content network sharing method, apparatus and system
JP7477589B2 (en) Method and terminal device for establishing a hotspot connection - Patents.com
EP3745260A1 (en) Software update management method, server, terminal, device, and storage medium
CN107147549B (en) Intelligent household equipment networking method and device
EP3179693B1 (en) Method, apparatus, storage medium and computer program product for establishing a data connection
CN106028266B (en) Information transmission method, device and system
CN111356209B (en) Multi-frequency WiFi hotspot opening method and device, storage medium and electronic equipment
CN112492569A (en) Intelligent device control method and terminal
CN109217995A (en) A kind of data processing method, terminal and base station
CN112691363A (en) Cross-terminal switching method and related device for cloud games
KR102596801B1 (en) PC5 link establishment methods, equipment and systems
CN112118538A (en) Method and device for device information interaction between terminals
CN104581993A (en) Wireless connection building method, data transmission method and terminal
CN110944313A (en) Bluetooth connection method, device, storage medium and terminal
CN109120507B (en) Mobile terminal and method and device for realizing instant messaging with fixed terminal
CN106470234B (en) Equipment discovery method and 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
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: Shandong City, Qingdao Province, Jiangxi City Road No. 11

Applicant after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: Shandong City, Qingdao Province, Jiangxi City Road No. 11

Applicant before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.

Country or region before: China