A method and apparatus for establishing a communication connection and transmitting data.
By scanning BLE broadcast messages to determine the Wi-Fi P2P MAC address and establish a Wi-Fi P2P connection, it solves the lack of joint transmission of Bluetooth and Wi-Fi in the existing technology and achieves high-speed and large-capacity data transmission.
Patent Information
- Application Number
- CN201910361577.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2039-04-30
AI Technical Summary
The existing technology fails to use Bluetooth and Wi-Fi to jointly transmit data, resulting in slow transmission speed and the inability to transmit large-capacity data files at high speed.
The Wi-Fi P2P MAC address information is determined by the scanned BLE broadcast packet, the Wi-Fi P2P connection is established, and data transmission is performed through this connection to achieve joint transmission of Bluetooth and Wi-Fi P2P.
This method avoids the time consumed by the Bluetooth pairing connection, simplifies the process of establishing a Wi-Fi P2P connection, and realizing high-speed large-capacity data transmission.
Smart Images

Figure CN111866824B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of terminal technology, and in particular to a method and device for establishing a communication connection and data transmission. Background Art
[0002] With the continuous development of communication technology, Bluetooth transmission and Wi-Fi (Wireless Fidelity) transmission are widely used in data transmission in the field of smart devices, including:
[0003] (1) Bluetooth is a wireless technology standard that enables short-range data exchange between fixed devices, mobile devices, and building personal area networks (using UHF (Ultra High Frequency) radio waves in the 2.4-2.485 GHz ISM (Industrial Scientific Medical) band). When using Bluetooth technology for data transmission, the transmission speed is slow and it is not possible to transmit data files with a capacity of tens of MB to GB at high speed.
[0004] (2) Wi-Fi is a technology that allows electronic devices to connect to a wireless local area network (WLAN), typically using the 2.4G UHF or 5G SHF ISM radio frequency bands. When using Wi-Fi for data transmission, high-speed and large-capacity data transmission can be achieved.
[0005] In summary, there is no solution for jointly transmitting data using Bluetooth and Wi-Fi. Summary of the invention
[0006] The present invention provides a method and device for establishing a communication connection and data transmission, so as to solve the problem that there is no solution for jointly performing data transmission using Bluetooth and Wi-Fi.
[0007] In a first aspect, an embodiment of the present invention provides a method for establishing a communication connection and transmitting data, including:
[0008] The first terminal determines Wi-Fi P2P MAC (Wi-Fi Peer-to-Peer Media Access Control Address) address information according to the scanned BLE (Bluetooth Low Energy) broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type;
[0009] The first terminal establishes a Wi-Fi P2P connection with the opposite device through the Wi-Fi P2P MAC address information;
[0010] The first terminal performs data transmission with the opposite terminal device through the established Wi-Fi P2P connection.
[0011] In the above method, the first terminal determines the Wi-Fi P2P MAC address of the second terminal by exchanging BLE broadcast messages with the second terminal, establishes a Wi-Fi P2P connection with the second terminal according to the Wi-Fi P2P MAC address, and transmits data with the second terminal through the Wi-Fi P2P connection, providing a solution for joint transmission of Bluetooth and Wi-Fi P2P. Furthermore, since the BLE broadcast message is a scannable non-directional type, the first terminal and the second terminal do not need to establish a Bluetooth pairing connection, and can establish a Wi-Fi P2P connection through the BLE broadcast message, thereby avoiding the time consumed by the Bluetooth pairing connection and simplifying the process of establishing a Wi-Fi P2P connection.
[0012] In an optional implementation, the first terminal determines the Wi-Fi P2P MAC address information according to the scanned BLE broadcast message, including:
[0013] The first terminal determines the Wi-Fi P2P MAC address information included in the BLE broadcast message; or
[0014] The first terminal determines the Wi-Fi P2P MAC address information according to the Bluetooth MAC address included in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
[0015] The above method places the Wi-Fi P2P MAC address in the BLE broadcast message. By parsing the BLE broadcast message, the party receiving the BLE broadcast message can more intuitively and quickly determine the Wi-Fi P2P MAC address. If the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address is placed in the BLE broadcast message, it is helpful to save the memory occupied by the valid data in the BLE broadcast message, and the workload of parsing the BLE broadcast message is small.
[0016] In an optional implementation, the BLE broadcast message includes preset UUID (Universally Unique Identifier) information.
[0017] In the above method, the first terminal can filter the received BLE broadcast message according to the preset UUID information. If the BLE broadcast message does not contain the preset UUID information, it is determined that the peer device does not support the Bluetooth and Wi-Fi P2P joint transmission function. The method of presetting UUID information is more flexible and simple to operate.
[0018] The second terminal sends a BLE broadcast message containing a message for determining a Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type;
[0019] After receiving the Wi-Fi P2P connection establishment request sent by the peer device, the second terminal sends a Wi-Fi P2P connection establishment agreement response to the peer device;
[0020] The second terminal performs data transmission with the opposite device through the established Wi-Fi P2P connection.
[0021] In an optional implementation manner, before the second terminal sends the BLE broadcast message containing the message for determining the Wi-Fi P2P MAC address, the method further includes:
[0022] The second terminal places its own Wi-Fi P2P MAC address information in the BLE broadcast message; or
[0023] The second terminal places its own Bluetooth MAC address and the Bluetooth MAC address and its own Wi-Fi P2P MAC address in the BLE broadcast message.
[0024] In an optional implementation, the BLE broadcast message includes preset UUID information.
[0025] In a third aspect, an embodiment of the present invention further provides a first terminal for establishing a communication connection and data transmission, the terminal comprising: a processor and a memory, wherein the memory stores a program code, and when one or more computer programs stored in the memory are executed by the processor, the terminal performs the following process:
[0026] Determine 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; establish a Wi-Fi P2P connection with a peer device through the Wi-Fi P2P MAC address information; and perform data transmission with the peer device through the established Wi-Fi P2P connection.
[0027] In a possible implementation manner, the processor is specifically configured to:
[0028] Determine the Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
[0029] The Wi-Fi P2P MAC address information is determined according to the Bluetooth MAC address included in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
[0030] In an optional implementation, the BLE broadcast message includes preset UUID information.
[0031] In a fourth aspect, an embodiment of the present invention further provides a second terminal for establishing a communication connection and data transmission, the terminal comprising: a processor and a memory, wherein the memory stores a program code, and when one or more computer programs stored in the memory are executed by the processor, the terminal performs the following process:
[0032] Sending a BLE broadcast message containing a message for determining a Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type;
[0033] After receiving the Wi-Fi P2P connection establishment request sent by the peer device, sending a Wi-Fi P2P connection establishment agreement response to the peer device;
[0034] Data is transmitted with the peer device via the established Wi-Fi P2P connection.
[0035] In an optional implementation, the processor is further configured to:
[0036] Put its own Wi-Fi P2P MAC address information into the BLE broadcast message; or
[0037] The Bluetooth MAC address and the difference between the Bluetooth MAC address and the Wi-Fi P2P MAC address are placed in the BLE broadcast message.
[0038] In an optional implementation, the BLE broadcast message includes preset UUID information.
[0039] In a fifth aspect, an embodiment of the present invention further provides a first terminal for establishing a communication connection and data transmission, the terminal comprising:
[0040] The first processing module is used to determine the 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;
[0041] A first connection module: used to establish a Wi-Fi P2P connection with a peer device through the Wi-Fi P2P MAC address information;
[0042] The first transmission module is used to transmit data with the peer device through the established Wi-Fi P2P connection.
[0043] In a fifth aspect, an embodiment of the present invention further provides a second terminal for establishing a communication connection and data transmission, the terminal comprising:
[0044] The second processing module is used to send a BLE broadcast message containing a message for determining a Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type;
[0045] The second connection module is configured to send a Wi-Fi P2P connection establishment response to the peer device after receiving a Wi-Fi P2P connection establishment request sent by the peer device;
[0046] The second transmission module is used to transmit data with the opposite device through the established Wi-Fi P2P connection.
[0047] 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, implements the steps of the method described in the first aspect.
[0048] In addition, the technical effects brought about by any implementation method in the second to sixth aspects can refer to the technical effects brought about by different implementation methods in the first or second aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1A A schematic diagram of a scenario for establishing a Wi-Fi P2P communication connection provided by an embodiment of the present invention;
[0051] Figure 1B A schematic diagram of another scenario for establishing a Wi-Fi P2P communication connection provided by an embodiment of the present invention;
[0052] Figure 2A A schematic diagram of an interactive system for establishing a communication connection and data transmission provided by an embodiment of the present invention;
[0053] Figure 2B A schematic diagram of an interface for pulling up a terminal to display shortcut icons provided by an embodiment of the present invention;
[0054] Figure 2C A schematic diagram of an interface of a terminal regarding a file sharing method provided by an embodiment of the present invention;
[0055] Figure 2D A schematic diagram of a pop-up window interface of a terminal provided in an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a custom BLE broadcast message format provided in an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of the structure of a PDU (Protocol Data Unit) in a custom BLE broadcast message provided in an embodiment of the present invention;
[0058] Figure 5 A schematic diagram of the structure of a PDU Header in a custom BLE broadcast message provided in an embodiment of the present invention;
[0059] Figure 6 A schematic diagram of the structure of PDU Payload (basic necessary data) in a custom BLE broadcast message provided in an embodiment of the present invention;
[0060] Fig. 7A A schematic diagram of an interface of configuration information of a terminal provided by an embodiment of the present invention;
[0061] Figure 7B A schematic diagram of another interface of terminal configuration information provided by an embodiment of the present invention;
[0062] Figure 8 A schematic flow chart of a method corresponding to a first terminal for establishing a communication connection and data transmission provided in an embodiment of the present invention;
[0063] Fig. 9 A schematic flow chart of a method corresponding to a second terminal for establishing a communication connection and data transmission provided by an embodiment of the present invention;
[0064] Fig.10 A schematic diagram of the structure of a first terminal for establishing a communication connection and data transmission provided by an embodiment of the present invention;
[0065] Fig.11 A schematic diagram of the structure of a first terminal for establishing a communication connection and data transmission according to a second embodiment of the present invention;
[0066] Fig.12 A schematic diagram of the structure of a first terminal for establishing a communication connection and data transmission according to a third embodiment of the present invention;
[0067] Fig.13 A schematic diagram of the structure of a second terminal for establishing a communication connection and data transmission provided by an embodiment of the present invention;
[0068] Fig.14A schematic diagram of the structure of a second terminal for establishing a communication connection and data transmission provided by an embodiment of the present invention;
[0069] Fig.15 A schematic diagram of the structure of a second terminal for establishing a communication connection and data transmission provided by a third embodiment of the present invention;
[0070] Fig.16 A schematic flow chart of a first terminal side method for establishing a communication connection and data transmission provided by an embodiment of the present invention;
[0071] Fig.17 A schematic flow chart of a third second terminal side method for establishing a communication connection and data transmission provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] The following are explanations of some of the terms that appear in the text:
[0074] 1. In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0075] 2. The term "Wi-Fi P2P" in the embodiments of the present invention, also known as WLAN direct connection, can achieve interconnection and high-speed data transmission between terminals without Wi-Fi hotspots and cellular networks.
[0076] 3. In the embodiments of the present invention, the terms "first terminal" and "second terminal" refer to smart devices with Wi-Fi and Bluetooth functions, such as mobile phones, tablets, smart cameras, smart printers, etc.
[0077] 4. In the embodiments of the present invention, the term "BLE" refers to a key technology proposed in the Bluetooth 4.0 specification, which is used to discover devices and perform some simple communications. It has the advantages of low operating power consumption and low standby power consumption. However, the transmission rate of BLE is relatively low and is not suitable for transmitting large amounts of data streams.
[0078] 5. In the embodiments of the present invention, the term "message" refers to a data unit exchanged and transmitted in a network, that is, a data block, which includes complete data information to be sent.
[0079] The application scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0080] The following takes a mobile phone as an example to introduce the solution of the present invention:
[0081] Assume that two mobile phones share files by using Bluetooth and Wi-Fi joint transmission, where the file sender is mobile terminal 1 and the file receiver is mobile terminal 2. Mobile terminal 1 and mobile terminal 2 are respectively provided with function switches for Bluetooth and Wi-Fi P2P joint transmission. Clicking the function switch will turn on the Bluetooth and WLAN functions at the same time, where the WLAN function includes Wi-Fi hotspot connection and Wi-Fi P2P connection.
[0082] After the WLAN function is turned on, the mobile terminal 1 determines the mobile terminal that supports Bluetooth and Wi-Fi P2P joint transmission through the scanned BLE broadcast message. For example, if the scanned BLE broadcast message contains the preset UUID information indicating support for Bluetooth and Wi-Fi P2P joint transmission, it is determined that the mobile terminal sending the BLE broadcast message has the Bluetooth and Wi-Fi P2P joint transmission function. The mobile terminal 1 parses the scanned BLE broadcast message containing the preset UUID information, obtains the device name of the mobile terminal that sends the BLE broadcast message, and adds the device name to the local device list that supports Bluetooth and Wi-Fi P2P joint transmission.
[0083] For example, see Figure 1A , mobile terminal 1 parses the scanned BLE broadcast message containing the preset UUID information, and the parsed device name is "mobile terminal 2", then mobile terminal 1 adds "mobile terminal 2" to the local "connectable devices I searched" list, where "Not connected" displayed behind "Mobile terminal 2" in the device list indicates that mobile terminal 1 and mobile terminal 2 are not connected.
[0084] At this time, if the user selects "Mobile Terminal 2" from the device list of Mobile Terminal 1, Mobile Terminal 1 sends a request to establish a Wi-Fi P2P connection to Mobile Terminal 2. If Mobile Terminal 1 receives a response from Mobile Terminal 2 agreeing to establish a Wi-Fi P2P connection, the Wi-Fi P2P connection between Mobile Terminal 1 and Mobile Terminal 2 is established. Mobile Terminal 1 transmits data with the peer device through the Wi-Fi P2P connection, i.e., shares files. In the above example, Mobile Terminal 2 is the peer device of Mobile Terminal 1. The following describes the entire process from the perspective of Mobile Terminal 2:
[0085] Correspondingly, after clicking to turn on the function switch of Bluetooth and Wi-Fi P2P joint transmission on mobile terminal 2, the Bluetooth and WLAN functions on mobile terminal 2 are turned on at the same time. After turning on the WLAN function, mobile terminal 2 sends a BLE broadcast message containing preset UUID information. When mobile terminal 2 receives the request to establish a Wi-Fi P2P connection sent by mobile terminal 1, if the user clicks the agree button, mobile terminal 2 sends a response to agree to establish a Wi-Fi P2P connection to mobile terminal 1, and mobile terminal 2 receives the shared files sent by mobile terminal 1 through the established Wi-Fi P2P connection.
[0086] It should be noted that the above-mentioned mobile terminal 1 is used as the initiator of establishing a Wi-Fi P2P connection, and the mobile terminal 2 is used as the opposite device passively waiting for the Wi-Fi P2P connection. This is only an example, and the embodiment of the present invention does not limit the operation of either party to all the functions integrated on the mobile terminal. That is, in this process, the mobile terminal 2 can also be used as the initiator of establishing a Wi-Fi P2P connection, and the mobile terminal 1 can be used as the receiver of the request to establish a Wi-Fi P2P connection.
[0087] It can be understood that when the mobile terminal 1 scans the BLE broadcast message, it also sends the BLE broadcast message containing the preset UUID information; when the mobile terminal 2 sends the BLE broadcast message containing the preset UUID information, it also scans the BLE broadcast message, that is, the mobile terminal 1 and the mobile terminal 2 are both bidirectional scanning. Therefore, the mobile terminal 1 can also perform the specific operation steps of the mobile terminal 2; the mobile terminal 2 can also perform the specific operation steps of the mobile terminal 1. Figure 1BIn the scenario shown, mobile terminal 1 will add mobile terminal 1 to the local list of connectable devices based on the scanned BLE broadcast message. While scanning the BLE broadcast message, mobile terminal 1 is also sending the BLE broadcast message. While sending the BLE broadcast message, mobile terminal 2 can also add mobile terminal 1 to the local "Connectable Devices I Searched" list of mobile terminal 2 based on the scanned BLE broadcast message containing preset UUID information sent by mobile terminal 1, so that the user can select the Wi-Fi P2P connection on the list and share files with the peer device through the Wi-Fi P2P connection.
[0088] Since the BLE broadcast message used in the embodiment of the present invention is a scannable non-directional BLE broadcast message based on the Bluetooth protocol, this type of BLE broadcast message only allows other devices to scan the message to obtain the information therein, but cannot initiate a Bluetooth connection request through the message. Therefore, in the embodiment of the present invention, there is no need to establish a Bluetooth pairing connection on both sides, and a Wi-Fi P2P connection is established through a BLE broadcast message, thereby realizing the joint transmission of Bluetooth and Wi-Fi P2P. At the same time, compared with the solution of first establishing a Bluetooth connection and then establishing Wi-Fi P2P connection information through Bluetooth channel interaction, this solution avoids a lot of time consumed by Bluetooth pairing connection and simplifies the process of establishing Wi-Fi P2P connection.
[0089] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0090] like Figure 2A As shown, an embodiment of the present invention provides an interactive system for establishing a communication connection and transmitting data, including: a first terminal 10 and a second terminal 20.
[0091] The first terminal 10 is used to determine Wi-Fi P2P MAC address information according to a scanned BLE broadcast message, wherein the type of the BLE broadcast message is a scannable non-directional type; establish a Wi-Fi P2P connection with a peer device through the Wi-Fi P2P MAC address information; and perform data transmission with the peer device through the established Wi-Fi P2P connection.
[0092] The second terminal 20 is used to send a BLE broadcast message containing a message for determining 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 a Wi-Fi P2P connection sent by a peer device, send a response to the peer device agreeing to establish a Wi-Fi P2P connection; and perform data transmission with the peer device through the established Wi-Fi P2P connection.
[0093] Through the above scheme, the first terminal determines the Wi-Fi P2P MAC address of the second terminal by exchanging BLE broadcast messages with the second terminal, establishes a Wi-Fi P2P connection with the second terminal according to the Wi-Fi P2P MAC address, and transmits data with the second terminal through the Wi-Fi P2P connection, thereby providing a solution for joint transmission of Bluetooth and Wi-Fi P2P. Furthermore, since the BLE broadcast message is of a scannable non-directional type, the first terminal and the second terminal do not need to establish a Bluetooth pairing connection, and a Wi-Fi P2P connection can be established through the BLE broadcast message, thereby avoiding the time consumed by the Bluetooth pairing connection and simplifying the process of establishing a Wi-Fi P2P connection.
[0094] In the embodiment of the present invention, there are multiple ways to trigger the first terminal to scan the BLE broadcast message containing the preset UUID information or trigger the second terminal to send the BLE broadcast containing the preset UUID information, which are specifically described by examples below:
[0095] Trigger method 1: Trigger by marking the function switch that supports Bluetooth and Wi-Fi P2P joint transmission;
[0096] The terminal is integrated with a function switch indicating support for Bluetooth and Wi-Fi P2P joint transmission. After turning on the function switch, an instruction for Bluetooth and Wi-Fi P2P joint transmission is triggered. After receiving the instruction, the terminal turns on the Bluetooth function and the WLAN function, and turns on Bluetooth scanning and Wi-Fi P2P direct connection scanning.
[0097] If a BLE broadcast message containing preset UUID information is scanned through Bluetooth, the Wi-Fi P2P MAC address of the peer device is determined according to the information in the BLE broadcast message, and a Wi-Fi P2P connection is established.
[0098] Among them, the function switch that indicates support for Bluetooth and Wi-Fi P2P joint transmission has multiple display forms, such as:
[0099] Display mode 1: See Figure 1A or Figure 1B ;
[0100] Set the function switch on a relevant display interface of the terminal, for example: Figure 1A or Figure 1B The function switch of Bluetooth and WLAN joint transmission in.
[0101] Display mode 2: See Figure 2B ;
[0102] In such Figure 2BIn the drop-down menu shown, there is a function switch for quickly turning on Wi-Fi P2P joint transmission. Clicking the icon triggers an instruction for Bluetooth and Wi-Fi P2P joint transmission.
[0103] Trigger method 2: Trigger by selecting Bluetooth and Wi-Fi P2P joint transmission when sharing data;
[0104] When sharing files, select the file sharing method and enable Bluetooth and Wi-Fi P2P joint transmission.
[0105] For example: If user A holds mobile terminal 1 and user B holds mobile terminal 2, user A wants to share a file named "work" with user B through mobile terminal 1. The specific operation process is as follows:
[0106] User A selects a file named "Work" on mobile terminal 1, selects the share button of the file or long presses the file package to trigger mobile terminal 1 to display the following information: Figure 2C The sharing interface shown in FIG. 1 includes file sharing methods such as Bluetooth and Wi-Fi P2P joint transmission, email, message, WeChat, etc. After user A selects Bluetooth and Wi-Fi P2P joint transmission, mobile terminal 1 uses the following method to share files: Figure 2D The pop-up window shown notifies user A whether to use Bluetooth and Wi-Fi P2P joint transmission. After user A clicks "OK", mobile terminal 1 is triggered to enable the Bluetooth and Wi-Fi P2P joint transmission function.
[0107] Correspondingly, if mobile terminal 2 wants to receive the "work" file via Bluetooth and Wi-Fi P2P joint transmission, mobile terminal 2 also needs to enable the Bluetooth and Wi-Fi P2P joint transmission function. The enabling method can refer to the specific operation steps of mobile terminal 1, which will not be repeated here.
[0108] Enable Bluetooth and Wi-Fi P2P joint transmission function Mobile terminal 1 and mobile terminal 2 establish a Wi-Fi P2P connection through BLE broadcast messages.
[0109] The embodiment of the present invention is based on a non-connected BLE application, which relies on BLE broadcasting. The party that sends the BLE broadcast message is called a Broadcaster, and the party that listens to the BLE broadcast message is called an Observer. The following takes the first terminal as an Observer and the second terminal as a Broadcaster as an example to introduce the interactive process involved in establishing a communication connection and data transmission provided by the present invention.
[0110] There are four types of BLE broadcasts: connectable non-directional broadcasts, connectable directional broadcasts, non-connectable non-directional broadcasts, and scannable non-directional broadcasts. The embodiments of the present invention are based on the fourth type of scannable non-directional broadcasts, also known as discoverable broadcasts, which cannot be used to initiate a connection, but allow other devices to scan the broadcasting device. This means that the device can be discovered, can send BLE broadcast messages, and can also respond to scanned devices to send scan response data, but cannot establish a connection.
[0111] BLE broadcasting exchanges data streams through BLE broadcast messages. There are two types of messages in the low-power Bluetooth specification: broadcast messages and data messages. The type of message is determined by the channel on which it is transmitted. The low-power Bluetooth specification specifies 3 broadcast channels and 37 data channels. If a message is transmitted on a broadcast channel, it is a broadcast message; if it is transmitted on a data channel, it is a data message.
[0112] The two types of messages have two completely different purposes. Smart devices use broadcast messages to discover and connect to other devices. Once the connection is established, data messages can only be sent to the connected peer device through the data channel. The difference between the two is that data messages can only be understood by the two connected devices (master and slave), while broadcast messages can be broadcast to multiple listening devices or only sent to a specific device.
[0113] like Figure 3 As shown, it is a structural diagram of the BLE broadcast message format provided by an embodiment of the present invention.
[0114] The BLE broadcast message consists of the following four parts:
[0115] Preamble: The broadcast channel is fixed to 10101010b, and the data channel is 10101010bor01010101b;
[0116] Access Address: The broadcast channel is fixed to 0x8E89BED6, and the data channel is a random value. Different connections have different values. It is used between two devices after the connection is established.
[0117] CRC: CRC check;
[0118] PDU: Figure 4 As shown, PDU includes PDU Header and PDU Payload data;
[0119] Among them, Figure 5 The PDU Header includes the PDU Type, which is used to characterize the type of the BLE broadcast message. The following is a detailed introduction to the PDU Type:
[0120] As shown in Table 1 below, PDU Type includes four Advertising types, two Scanning types and one Initiating type, and the above types are distinguished by 1 byte data.
[0121]
[0122] Table 1. BLE broadcast message -- PDU Type in PDU Header
[0123] Among them, the Advertising type includes: ADV_IND is a connectable non-directional broadcast, ADV_DIRECT_IND is a connectable directional broadcast, ADV_NONCONN_IND is a non-connectable non-directional broadcast, and ADV_SCAN_IND is a scannable non-directional broadcast;
[0124] Scanning types include: SCAN_REQ, which means that when receiving ADV_IND or ADV_SCAN_IND type broadcast data, the broadcaster can be requested to broadcast more information through this PDU; SCAN_RSP, which means that after receiving the SCAN_REQ request, the broadcaster responds through this PDU and transmits more data to the peer device;
[0125] The Initiating type is CONNECT_REQ, which means that when receiving ADV_IND or ADV_DIRECT_IND type broadcast data, you can use this PDU to request to establish a connection with the other party;
[0126] The embodiment of the present invention uses a scannable non-directional ADV_SCAN_IND type PDU Payload, and the flag bit of the PDU Type is 0110. The following Table 2 is a schematic diagram of the structure of the ADV_SCAN_IND type PDU Payload. The maximum length of this type of PDU Payload data packet is 37 bytes, where AdvA is the broadcast device address part, including the Bluetooth MAC address of the broadcast sender, which is 6 bytes, and AdvData is the PDU data part, including significant (valid data) and non-significant (invalid data) Two parts, a total of 31 bytes.
[0127]
[0128] Table 2. BLE broadcast message -- PDU Payload of ADV_SCAN_IND type
[0129] The following is a detailed introduction to AdvData, which includes but is not limited to the following parts:
[0130] 1. Valid data part;
[0131] The valid data part contains several broadcast data units, called AD Structure. ADStructure contains Length and Data. Figure 6 As shown, the AD Structure includes but is not limited to the following parts:
[0132] 1) Length: indicates the length of the data after Length in the AD Structure, that is, the length of Data.
[0133] 2) AD Type, indicating the content type represented by AD Data, such as device name, UUID, etc.;
[0134] 3)AD Data, specific data content.
[0135] For example, the content of an AD Structure is 02 01 06, Len is 02 (indicating that the content of the following 2 bytes belongs to this AD Structure 1), AD Type is 01, and AD Data is 06.
[0136] 2. Invalid data part;
[0137] The length of AdvData in PDU Payload must be 31 bytes. If the valid data portion is less than 31 bytes, it will be padded with 0 and the data in this portion is invalid.
[0138] The AD Type involved in the embodiments of the present invention includes but is not limited to the following types, which are described below respectively:
[0139] Type 1: Incomplete 16-bit UUID information;
[0140] An important concept in BLE applications is UUID, which is used to identify Bluetooth services and communication feature access attributes. Different Bluetooth services and attributes use different access methods.
[0141] There are three service UUID formats defined in Bluetooth broadcasting: 16-bit UUID, 32-bit UUID, and 128-bit UUID. The difference between complete and incomplete is that a device supports multiple service UUIDs, but only broadcasts a part of them, which is called incomplete. In the embodiment of the present invention, a custom service is added to the broadcast data packet, so that the Observer who monitors the broadcast can determine the available devices that support Bluetooth and Wi-Fi P2P joint transmission by judging whether the scanned BLE broadcast message carries the UUID information corresponding to the custom service.
[0142] In the embodiment of the present invention, 0x02 is used to represent incomplete 16-bit UUID information. If AD Type is 02, it means that the content of ADData is incomplete UUID information.
[0143] For example: the customized service name of the present invention is My_Service_UUID. Assuming that the My_Service_UUID generated by the UUID random generator is E953, when the UUID obtained by parsing the received BLE broadcast message contains E953, it means that the terminal broadcasting the BLE broadcast message is a valid terminal, that is, a terminal that supports Bluetooth and Wi-Fi P2P joint transmission control.
[0144] For example: the AD Structure 1 in the BLE broadcast message received by the first terminal is 03 0253E9, where length is 03, indicating that the 3 bytes after length belong to AD Structure 1, and AD Type is 02, indicating that the content of AD Data is UUID information, and the corresponding UUID information is E953, i.e. My_Service_UUID. The first terminal determines that the terminal broadcasting the BLE broadcast message is a terminal that supports Bluetooth and Wi-Fi P2P joint transmission control.
[0145] It should be noted that the My_Service_UUID E953 is only an example, and any numerical value representing a meaning or type in the present invention is not limited to a fixed real number, and any numerical value or length combination that meets the condition requirements is applicable to the present invention.
[0146] Type 2: device name;
[0147] In the embodiment of the present invention, 0x08 represents the abbreviation of the device, and 0x09 represents the full name of the device. Correspondingly, AD Data is a character string of the name. If AD Type is 08, AD Data is the abbreviation of the device name; if AD Type is 09, AD Data is the full name of the device. This part is added so that the broadcast listener Observer can obtain the device name of the broadcast sender Broadcaster for display, which is convenient for users to view.
[0148] For example, the content of an AD Structure is 0e 09 45 4d 39 33 30 34 20 46 69 6e 64 6d65, where Len is 0e (indicating that the following 14 bytes belong to this AD Structure), AD Type is 09, which represents the full name of the device, and AD Data is 45 4d 39 33 30 34 20 46 69 6e 64 6d 65, which represents 'E"M"9"3"0"4"space"F"i"n"d"m"e' (see ASCII hexadecimal code).
[0149] Type 3: custom data;
[0150] In the embodiment of the present invention, 0xFF represents manufacturer-defined data, the first two bytes represent the manufacturer ID, which is 6F4D by default, and the rest are added as required, and the data content therein can be customized.
[0151] In the embodiment of the present invention, the difference between the Wi-Fi P2P MAC address or Bluetooth MAC address of the broadcast sender and the Wi-Fi P2P MAC address can be represented by custom data. That is, there are multiple ways to determine the Wi-Fi P2P MAC address information contained in the custom data, and the following examples are given:
[0152] Method 1: The custom data contains the difference between the Bluetooth MAC address and the Wi-Fi P2P MAC address;
[0153] like Fig. 7A The figure shows a schematic diagram of the Bluetooth MAC address and WLAN MAC address of terminal A.
[0154] Taking terminal A as an example, the WLAN MAC address of terminal A is EC:D0:9F:C6:50:8B, the Bluetooth address of terminal A is EC:D0:9F:C6:50:8A, and the difference item is 8A. The customized data part here is the difference item 8A, and the content of AdvData in the PDU payload is 04FF 4D 6F 8A.
[0155] like Figure 7B The figure shows a schematic diagram of the Bluetooth MAC address and WLAN MAC address of terminal B.
[0156] 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, and the difference item is DE CD. The customized data part here is the difference item, and the content of AdvData in the PDUpayload is 05FF 4D 6F DE CD;
[0157] Correspondingly, the broadcast receiver Observer parses the received BLE broadcast message, determines the Bluetooth MAC address of the broadcast sender Broadcaster through AdvA in PDU payload, determines the difference between the Bluetooth MAC address and the WLAN MAC address of the broadcast sender Broadcaster through AdvData in PDU payload, and determines the WLAN MAC address of the broadcast sender Broadcaster according to the parsed Bluetooth MAC address and the difference between the Bluetooth MAC address and the WLAN MAC address.
[0158] It should be noted that only the WLAN MAC address is used as an example here, and the information placed in the BLE broadcast message in the embodiment of the present invention is the information that can determine the Wi-Fi P2P MAC address.
[0159] For example, the content of the PDU payload in the BLE broadcast message received by the broadcast receiver Observer is 1044 00 A5 CF 65 05 FF 4D 6F DE CD, the first 6 bytes are AdvA, that is, the Bluetooth MAC address 10 44 00 A5 CF65, and the following bytes are AdvData content 05 FF 4D 6F DE CD. From this part of the content, it can be known that the difference between the Bluetooth MAC address and the Wi-Fi P2P MAC address is DE CD. Based on the parsed Bluetooth MAC address and the difference between the two, the Wi-Fi P2P MAC address of the broadcast sender Broadcaster is determined to be 10:44:00:A5:DE:CD.
[0160] Method 2: The custom data contains the Wi-Fi P2P MAC address;
[0161] 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 based on the Wi-Fi P2P MAC address information parsed from the BLE broadcast message.
[0162] For example, the content of the PDU payload in the BLE broadcast message received by the broadcast receiver Observer is 1044 00 A5 CF 65 09 FF 4D 6F 10 44 00 A5 DE CD. According to the content of AdvData, the Wi-Fi P2P MAC address 10 44 00 A5 DE CD of the broadcast sender Broadcaster can be determined.
[0163] In the embodiment of the present invention, the first terminal and the second terminal establish a Wi-Fi P2P connection by exchanging BLE broadcast messages.
[0164] like Figure 8 As shown, it is a schematic flow chart of a method for establishing a communication connection and data transmission on a first terminal side provided by an embodiment of the present invention, comprising the following steps;
[0165] Step 800, turning on the function switch of Bluetooth and Wi-Fi P2P joint transmission of the first terminal, turning on the Bluetooth and WLAN functions;
[0166] Step 801: The first terminal scans BLE broadcast messages sent by other devices;
[0167] Step 802, the first terminal determines whether the received BLE broadcast message contains the preset UUID information, if yes, executes step 803, otherwise exits the process;
[0168] Step 803: The first terminal determines the Wi-Fi P2P MAC address of the peer device according to the BLE broadcast message;
[0169] Step 804: The first terminal initiates a Wi-Fi P2P connection request to the peer device according to the Wi-Fi P2P MAC address;
[0170] Step 805: the first terminal receives a response from the peer device agreeing to establish a Wi-Fi P2P connection;
[0171] Step 806: The first terminal performs data transmission with the peer device via a Wi-Fi P2P connection.
[0172] It should be noted that the first terminal determines the Wi-Fi P2P MAC address and device name of the peer device based on the received BLE broadcast message containing the preset UUID information, and adds the device name of the peer device to the local list interface representing connectable devices. When the user clicks to select the device, the first terminal initiates a request to establish a Wi-Fi P2P connection based on the Wi-Fi P2P MAC address of the device. When the first terminal receives a response from the device (i.e., the peer device establishing the Wi-Fi P2P connection) agreeing to establish the Wi-Fi P2P connection, the first terminal and the device successfully establish a Wi-Fi P2P connection.
[0173] like Fig. 9 As shown, it is a schematic flow chart of a method for establishing a communication connection and data transmission on the second terminal side provided by an embodiment of the present invention, comprising the following steps:
[0174] Step 900, turning on the function switch of Bluetooth and Wi-Fi P2P joint transmission of the second terminal, turning on the Bluetooth and WLAN functions;
[0175] Step 901: The second terminal sends a BLE broadcast message;
[0176] In step 902, the second terminal determines whether a request for establishing a Wi-Fi P2P connection initiated by the opposite device is received; if yes, step 903 is executed, otherwise the process is exited.
[0177] Step 903: The second terminal sends a response to the peer device indicating that it agrees to establish a Wi-Fi P2P connection.
[0178] Step 904: The second terminal performs data transmission with the peer device via a Wi-Fi P2P connection.
[0179] It should be noted that the second terminal can send BLE broadcast messages periodically. If the sent BLE broadcast messages are scanned by other terminals that support Bluetooth and Wi-Fi P2P joint transmission, the device name of the second terminal will be displayed on the local list interface of the connectable devices. If the second terminal receives a request to establish a Wi-Fi P2P connection initiated by the peer device, a dialog box pops up to notify the user whether to establish a Wi-Fi P2P connection with the peer device. If the user clicks "OK", it means that the second terminal accepts the connection request. If "Cancel" is clicked, it means that the second terminal rejects the connection request. If the connection request is accepted, the second terminal sends a response to the peer device agreeing to establish a Wi-Fi P2P connection. After that, the second terminal can transmit data with the peer device through the Wi-Fi P2P connection.
[0180] Based on the same concept, Fig.10As shown, an embodiment of the present invention provides a first terminal for establishing a communication connection and data transmission, the terminal comprising: a processor 1000 and a memory 1001, wherein the memory 1001 stores program code, and when one or more computer programs stored in the memory 1001 are executed by the processor 1000, the terminal performs the following process:
[0181] Determine 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; establish a Wi-Fi P2P connection with a peer device through the Wi-Fi P2P MAC address information; and perform data transmission with the peer device through the established Wi-Fi P2P connection.
[0182] Optionally, the processor 1000 is specifically configured to:
[0183] Determine the Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
[0184] The Wi-Fi P2P MAC address information is determined according to the Bluetooth MAC address included in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
[0185] Optionally, the BLE broadcast message includes preset UUID information.
[0186] like Fig.11 As shown, an embodiment of the present invention provides another first terminal for establishing a communication connection and data transmission, including:
[0187] The first processing module 1100 is used to determine the 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;
[0188] The first connection module 1101 is used to establish a Wi-Fi P2P connection with the peer device through the Wi-Fi P2P MAC address information;
[0189] The first transmission module 1102 is configured to perform data transmission with the peer device via the established Wi-Fi P2P connection.
[0190] Optionally, the first processing module 1100 is specifically used for:
[0191] Determine the Wi-Fi P2P MAC address information contained in the BLE broadcast message; or
[0192] The Wi-Fi P2P MAC address information is determined according to the Bluetooth MAC address included in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
[0193] Optionally, the BLE broadcast message includes preset UUID information.
[0194] Optionally, the first processing module 1100 is specifically used for:
[0195] After receiving the Bluetooth and Wi-Fi P2P joint transmission instruction, it is determined that the received BLE broadcast message contains preset UUID information.
[0196] like Fig.12 As shown, the embodiment of the present invention provides a third first terminal 1200 for establishing a communication connection and data transmission, including: a radio frequency (RF) circuit 1210, a power supply 1220, a processor 1230, a memory 1240, an input unit 1250, a display unit 1260, a camera 1270, a communication interface 1280, and a wireless fidelity (Wi-Fi) module 1290 and other components. Those skilled in the art can understand that Fig.12 The structure of the terminal shown in the figure does not constitute a limitation on the terminal. The terminal provided in the embodiment of the present application may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0197] Combine the following Fig.12 The components of the first terminal 1200 are described in detail:
[0198] The RF circuit 1210 can be used for receiving and sending data during communication or calls. In particular, after receiving downlink data from the base station, the RF circuit 1210 sends it to the processor 1230 for processing; in addition, the uplink data to be sent is 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, etc.
[0199] In addition, the RF circuit 1210 can also communicate with the network and other terminals through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (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), etc.
[0200] Wi-Fi technology is a short-range wireless transmission technology. The first terminal 1200 can connect to an access point (AP) through a Wi-Fi module 1290 to access a data network. The Wi-Fi module 1290 can be used for receiving and sending data during the communication process.
[0201] The first terminal 1200 can be physically connected to other terminals through the communication interface 1280. Optionally, the communication interface 1280 is connected to the communication interface of the other terminal through a cable to achieve data transmission between the first terminal 1200 and the other terminal.
[0202] Since in the embodiment of the present application, the first terminal 1200 can implement communication services and send information to other contacts, the first terminal 1200 needs to have a data transmission function, that is, the first terminal 1200 needs to include a communication module. Fig.12 Communication modules such as the RF circuit 1210, the Wi-Fi module 1290, and the communication interface 1280 are shown, but it is understandable that at least one of the above components or other communication modules (such as a Bluetooth module) for implementing communication exist in the first terminal 1200 to perform data transmission.
[0203] For example, when the first terminal 1200 is a mobile phone, the first terminal 1200 may include the RF circuit 1210 and may also 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 also 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.
[0204] The memory 1240 may be used to store software programs and modules. The processor 1230 executes various functional applications and data processing of the first terminal 1200 by running the software programs and modules stored in the memory 1240, and when the processor 1230 executes the program code in the memory 1240, the embodiments of the present invention may be implemented. Figure 2A part or all of the process.
[0205] Optionally, the memory 1240 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, various application programs (such as communication applications), and a face recognition module, etc.; the data storage area may store data created according to the use of the terminal (such as various multimedia files such as pictures and video files, and face information templates), etc.
[0206] In addition, the memory 1240 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0207] The input unit 1250 may be configured to receive digital or character information input by a user, and to generate key signal input related to user settings and function control of the first terminal 1200 .
[0208] Optionally, the input unit 1250 may include a touch panel 1251 and other input terminals 1252 .
[0209] Among them, the touch panel 1251, also known as a touch screen, can collect the user's touch operations on or near it (such as the user's operation on or near the touch panel 1251 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1251 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1230, and can receive and execute commands sent by the processor 1230. In addition, the touch panel 1251 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave.
[0210] Optionally, the other input terminals 1252 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0211] 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 used to present an interface to achieve human-computer interaction.
[0212] The display unit 1260 may include a display panel 1261. Optionally, 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.
[0213] Furthermore, the touch panel 1251 may cover the display panel 1261. When the touch panel 1251 detects a touch operation on or near it, it transmits it to the processor 1230 to determine the type of touch event. Then the processor 1230 provides corresponding visual output on the display panel 1261 according to the type of touch event.
[0214] Although in Fig.12 In the embodiment, the touch panel 1251 and the display panel 1261 are used as two independent components to implement the input and output functions of the first terminal 1200, but in some embodiments, the touch panel 1251 and the display panel 1261 can be integrated to implement the input and output functions of the first terminal 1200.
[0215] The processor 1230 is the control center of the first terminal 1200. It connects various components using various interfaces and lines, and executes various functions and processes data of the first terminal 1200 by running or executing software programs and / or modules stored in the memory 1240 and calling data stored in the memory 1240, thereby realizing various services based on the terminal.
[0216] 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, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1230.
[0217] The camera 1270 is used to realize the shooting function of the first terminal 1200, and to take pictures or videos. The camera 1270 can also be used to realize the scanning function of the first terminal 1200, and to scan the scanning object (QR code / bar code).
[0218] The first terminal 1200 also includes a power supply 1220 (such as a battery) for supplying power to various components. Optionally, the power supply 1220 can be logically connected to the processor 1230 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0219] It should be noted that the processor 1230 of the embodiment of the present invention may execute Fig.10 The memory 1240 stores the contents of the processor 1001.
[0220] Based on the same concept, Fig.13 As shown, an embodiment of the present invention provides a second terminal for establishing a communication connection and data transmission, the terminal comprising: 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 performs the following process:
[0221] Sending a BLE broadcast message containing a function for determining 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 a Wi-Fi P2P connection sent by a peer device, sending a response of consent to establish a Wi-Fi P2P connection to the peer device; and transmitting data with the peer device through the established Wi-Fi P2P connection.
[0222] Optionally, the processor 1300 is further configured to:
[0223] Put its own Wi-Fi P2P MAC address information into the BLE broadcast message; or
[0224] The Bluetooth MAC address and the difference between the Bluetooth MAC address and the Wi-Fi P2P MAC address are placed in the BLE broadcast message.
[0225] Optionally, the BLE broadcast message includes preset UUID information.
[0226] like Fig.14 As shown, an embodiment of the present invention provides another second terminal for establishing a communication connection and data transmission, including:
[0227] The second processing module 1400 is configured to send a BLE broadcast message containing a message for determining a Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type;
[0228] The second connection module 1401 is configured to send a Wi-Fi P2P connection establishment response to the opposite device after receiving a Wi-Fi P2P connection establishment request sent by the opposite device;
[0229] The second transmission module 1402 is configured to perform data transmission with the peer device via the established Wi-Fi P2P connection.
[0230] Optionally, the second processing module 1400 is further used for:
[0231] Put its own Wi-Fi P2P MAC address information into the BLE broadcast message; or
[0232] The Bluetooth MAC address and the difference between the Bluetooth MAC address and the Wi-Fi P2P MAC address are placed in the BLE broadcast message.
[0233] Optionally, the BLE broadcast message includes preset UUID information.
[0234] like Fig.15 As shown, the embodiment of the present invention provides a third second terminal 1500 for establishing a communication connection and data transmission, including: a radio frequency (RF) circuit 1510, a power supply 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 and other components. Those skilled in the art can understand that Fig.15 The structure of the terminal shown in the figure does not constitute a limitation on the terminal. The terminal provided in the embodiment of the present application may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0235] Combine the following Fig.15 The components of the second terminal 1500 are described in detail:
[0236] The RF circuit 1510 can be used for receiving and sending data during communication or calls. In particular, after receiving downlink data from the base station, the RF circuit 1510 sends it to the processor 1530 for processing; in addition, the uplink data to be sent is sent to the base station. Generally, the RF circuit 1510 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc.
[0237] In addition, the RF circuit 1510 can also communicate with the network and other terminals through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (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), etc.
[0238] Wi-Fi technology is a short-range wireless transmission technology. The second terminal 1500 can connect to an access point (AP) through a Wi-Fi module 1590 to access a data network. The Wi-Fi module 1590 can be used for receiving and sending data during the communication process.
[0239] 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 interface of the other terminal through a cable to achieve data transmission between the second terminal 1500 and the other terminal.
[0240] Since in the embodiment of the present application, the second terminal 1500 can implement communication services and send information to other contacts, the second terminal 1500 needs to have a data transmission function, that is, the second terminal 1500 needs to include a communication module. Fig.15 Communication modules such as the RF circuit 1510, the Wi-Fi module 1590, and the communication interface 1580 are shown, but it is understandable that at least one of the above components or other communication modules (such as a Bluetooth module) for implementing communication exist in the second terminal 1500 to perform data transmission.
[0241] For example, when the second terminal 1500 is a mobile phone, the second terminal 1500 may include the RF circuit 1510 and may also 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 also 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.
[0242] 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 running the software programs and modules stored in the memory 1540, and when the processor 1530 executes the program code in the memory 1540, the embodiment of the present invention can be implemented. Figure 2A part or all of the process.
[0243] Optionally, the memory 1540 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, various application programs (such as communication applications), and a face recognition module, etc.; the data storage area may store data created according to the use of the terminal (such as various multimedia files such as pictures and video files, and face information templates), etc.
[0244] In addition, the memory 1540 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0245] The input unit 1550 may be configured to receive digital or character information input by a user, and to generate key signal input related to user settings and function control of the second terminal 1500 .
[0246] Optionally, the input unit 1550 may include a touch panel 1551 and other input terminals 1552 .
[0247] Among them, the touch panel 1551, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on or near the touch panel 1551 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1551 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1530, and can receive and execute commands sent by the processor 1530. In addition, the touch panel 1551 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave.
[0248] Optionally, the other input terminals 1552 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0249] The display unit 1560 may be used to display information input by the 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 used to present an interface to achieve human-computer interaction.
[0250] The display unit 1560 may include a display panel 1561. Optionally, 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.
[0251] Furthermore, the touch panel 1551 may cover the display panel 1561. When the touch panel 1551 detects a touch operation on or near it, it transmits it to the processor 1530 to determine the type of touch event. Then the processor 1530 provides corresponding visual output on the display panel 1561 according to the type of touch event.
[0252] Although in Fig.15 In the embodiment, the touch panel 1551 and the display panel 1561 are used as two independent components to implement the input and output functions of the second terminal 1500, but 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.
[0253] The processor 1530 is the control center of the second terminal 1500. It connects various components using various interfaces and lines, and executes various functions and processes data of the second terminal 1500 by running or executing software programs and / or modules stored in the memory 1540 and calling data stored in the memory 1540, thereby realizing various services based on the terminal.
[0254] 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, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1530.
[0255] The camera 1570 is used to realize the shooting function of the second terminal 1500, and to take pictures or videos. The camera 1570 can also be used to realize the scanning function of the second terminal 1500, and to scan the scanning object (QR code / bar code).
[0256] The second terminal 1500 also includes a power supply 1520 (such as a battery) for supplying power to various components. Optionally, the power supply 1520 can be logically connected to the processor 1530 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0257] It should be noted that the processor 1530 of the embodiment of the present invention may execute Fig.13 In addition to the functions of the processor 1300, the memory 1540 stores the contents of the processor 1301.
[0258] An embodiment of the present invention also provides a computer-readable non-volatile storage medium, including program code. When the program code is executed on a computing terminal, the program code is used to enable the computing terminal to execute the steps of the method for establishing a communication connection and transmitting data in the above-mentioned embodiment of the present invention.
[0259] Based on the same inventive concept, an embodiment of the present invention also provides a method for establishing a communication connection and data transmission. Since the device corresponding to the method is the 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 solving the problem by the method 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 of establishing a communication connection and data transmission, and the repeated parts will not be repeated.
[0260] like Fig.16 As shown, the method for establishing a communication connection and data transmission provided by an embodiment of the present invention includes:
[0261] 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;
[0262] Step 1601: The first terminal establishes a Wi-Fi P2P connection with a peer device through the Wi-Fi P2P MAC address information;
[0263] Step 1602: The first terminal performs data transmission with a peer device through the established Wi-Fi P2P connection.
[0264] Optionally, the first terminal determines the Wi-Fi P2P MAC address information according to the scanned BLE broadcast message, including:
[0265] The first terminal determines the Wi-Fi P2P MAC address information included in the BLE broadcast message; or
[0266] The first terminal determines the Wi-Fi P2P MAC address information according to the Bluetooth MAC address included in the BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address.
[0267] Optionally, the BLE broadcast message includes preset UUID information.
[0268] Based on the same inventive concept, an embodiment of the present invention also provides a method for establishing a communication connection and data transmission. Since the device corresponding to the method is the 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 solving the problem by the method 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 of establishing a communication connection and data transmission, and the repeated parts will not be repeated.
[0269] like Fig.17 As shown, the method for establishing a communication connection and data transmission provided by an embodiment of the present invention includes:
[0270] Step 1700: The second terminal sends a BLE broadcast message containing a message for determining a Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type;
[0271] Step 1701: After receiving the request for establishing a Wi-Fi P2P connection sent by the opposite device, the second terminal sends a response to the opposite device for agreeing to establish a Wi-Fi P2P connection;
[0272] Step 1702: The second terminal performs data transmission with the opposite device through the established Wi-Fi P2P connection.
[0273] Optionally, before the second terminal sends the BLE broadcast message containing the message used to determine the Wi-Fi P2P MAC address, the method further includes:
[0274] The second terminal places its own Wi-Fi P2P MAC address information in the BLE broadcast message; or
[0275] The second terminal places its own Bluetooth MAC address and difference information between the Bluetooth MAC address and its own Wi-Fi P2P MAC address in the BLE broadcast message.
[0276] Optionally, the BLE broadcast message includes preset UUID information.
[0277] The present application is described above with reference to the block diagrams and / or flow charts showing the methods, devices (systems) and / or computer program products according to the embodiments of the present application. It should be understood that a block of the block diagram and / or flow chart diagram and a combination of blocks of the block diagram and / or flow chart diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer and / or other programmable data processing device to produce a machine, so that the instructions executed by the computer processor and / or other programmable data processing device create a method for implementing the functions / actions specified in the block diagram and / or flow chart block.
[0278] Accordingly, the present application may also be implemented with hardware and / or software (including firmware, resident software, microcode, etc.). Furthermore, the present application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium, for use by an instruction execution system or in conjunction with an instruction execution system. In the context of the present application, a computer-usable or computer-readable medium may be any medium that may contain, store, communicate, transmit, or convey a program for use by an instruction execution system, device, or apparatus, or in conjunction with an instruction execution system, device, or apparatus.
[0279] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these 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 these modifications and variations.
Claims
1. A method for establishing a communication connection and data transmission, characterized in that: The method includes: The first terminal determines Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the scanned Bluetooth Low Energy BLE broadcast message and the difference information between the Bluetooth MAC address and the Wireless Fidelity Point-to-Point Media Access Control Address Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type, and the scannable non-directional type of the BLE broadcast message supports the first terminal to discover the opposite device and is used for exchanging data streams; The first terminal establishes a Wi-Fi P2P connection with the opposite device through the Wi-Fi P2P MAC address information; The first terminal performs data transmission with the opposite terminal device through the established Wi-Fi P2P connection; The first terminal is triggered to scan the BLE broadcast message in the following manner: The first terminal is integrated with a function switch indicating support for Bluetooth and Wi-Fi P2P joint transmission, and is triggered in response to an operation of turning on the function switch; or It is triggered when the user selects Bluetooth and Wi-Fi P2P joint transmission in the file sharing method.
2. The method according to claim 1, characterized in that The BLE broadcast message includes a preset universal unique identifier UUID information.
3. A method for establishing a communication connection and data transmission, characterized in that: The method includes: The second terminal places its own Bluetooth MAC address and the difference information between the Bluetooth MAC address and its own Wi-Fi P2P MAC address in the BLE broadcast message; The second terminal sends the BLE broadcast message containing the message for determining the Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type, and the scannable non-directional type of the BLE broadcast message supports the peer device to discover the second terminal and is used for exchanging data streams; After receiving the Wi-Fi P2P connection establishment request sent by the peer device, the second terminal sends a Wi-Fi P2P connection establishment agreement response to the peer device; The second terminal performs data transmission with the opposite device through the established Wi-Fi P2P connection; The second terminal is triggered to send the BLE broadcast message in the following manner: The second terminal is integrated with a function switch indicating support for Bluetooth and Wi-Fi P2P joint transmission, and is triggered in response to an operation of turning on the function switch; or It is triggered when the user selects Bluetooth and Wi-Fi P2P joint transmission in the file sharing method.
4. The method according to claim 3, characterized in that The BLE broadcast message includes preset UUID information.
5. A first terminal for establishing a communication connection and data transmission, characterized in that: The terminal includes: a processor and a memory, wherein the memory stores program codes, and when one or more computer programs stored in the memory are executed by the processor, the terminal performs the following process: Determine the Wi-Fi P2P MAC address information according to the Bluetooth MAC address contained in the scanned low-power Bluetooth BLE broadcast message and the difference information between the Bluetooth MAC address and the Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type, and the scannable non-directional type of the BLE broadcast message supports the first terminal to discover the opposite device and is used for exchanging data streams; Establishing a Wi-Fi P2P connection with a peer device through the Wi-Fi P2P MAC address information; Performing data transmission with a peer device via the established Wi-Fi P2P connection; The first terminal is specifically configured to trigger scanning of the BLE broadcast message in the following manner: The first terminal is integrated with a function switch indicating support for Bluetooth and Wi-Fi P2P joint transmission, and is triggered in response to an operation of turning on the function switch; or It is triggered when the user selects Bluetooth and Wi-Fi P2P joint transmission in the file sharing method.
6. A second terminal for establishing a communication connection and data transmission, characterized in that: The terminal includes: a processor and a memory, wherein the memory stores program codes, and when one or more computer programs stored in the memory are executed by the processor, the terminal performs the following process: Put its own Bluetooth MAC address and the difference information between the Bluetooth MAC address and its own Wi-Fi P2P MAC address into the BLE broadcast message; Sending the BLE broadcast message containing the message used to determine the Wi-Fi P2P MAC address, wherein the type of the BLE broadcast message is a scannable non-directional type, the scannable non-directional type of the BLE broadcast message supports the peer device to discover the second terminal, and is used for exchanging data streams; After receiving the Wi-Fi P2P connection establishment request sent by the peer device, sending a Wi-Fi P2P connection establishment agreement response to the peer device; Performing data transmission with a peer device via the established Wi-Fi P2P connection; The second terminal is specifically configured to trigger sending the BLE broadcast message in the following manner: The second terminal is integrated with a function switch indicating support for Bluetooth and Wi-Fi P2P joint transmission, and is triggered in response to an operation of turning on the function switch; or It is triggered when the user selects Bluetooth and Wi-Fi P2P joint transmission in the file sharing method.
Citation Information
Patent Citations
Communication service in communication modes
CN105144757A
MAC address acquisition method and system based on Bluetooth and WIFI
CN106412809A
Wireless connection method and device
CN107864469A