CN113490194A - Bluetooth-based equipment connection method and device, electronic equipment and storage medium - Google Patents

Bluetooth-based equipment connection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113490194A
CN113490194A CN202110881093.3A CN202110881093A CN113490194A CN 113490194 A CN113490194 A CN 113490194A CN 202110881093 A CN202110881093 A CN 202110881093A CN 113490194 A CN113490194 A CN 113490194A
Authority
CN
China
Prior art keywords
response
electronic device
version information
bluetooth connection
bluetooth
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
CN202110881093.3A
Other languages
Chinese (zh)
Inventor
吕生义
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110881093.3A priority Critical patent/CN113490194A/en
Publication of CN113490194A publication Critical patent/CN113490194A/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
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Abstract

The application relates to a Bluetooth-based equipment connection method and device, electronic equipment and a storage medium, and belongs to the technical field of terminals. The method comprises the following steps: performing equipment scanning in a network environment, and acquiring a scanning response message of scanned electronic equipment; determining a response mode used by scanning the response message; determining version information of a Bluetooth connection protocol used by the electronic equipment based on the response mode, storing the version information, and enabling the Bluetooth connection protocols of different versions to correspond to scanning response messages of different response modes; in response to a bluetooth connection operation with the electronic device, a bluetooth connection is established with the electronic device based on the stored version information. By the scheme, the protocol version information can not be determined in the process of establishing the Bluetooth connection due to temporary interception failure, the failure risk of the Bluetooth connection is reduced, and the success rate of the Bluetooth connection is improved.

Description

Bluetooth-based equipment connection method and device, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of terminals, in particular to a Bluetooth-based device connection method and device, an electronic device and a storage medium.
Background
When connection is established between electronic devices based on Bluetooth, an authentication mode needs to be negotiated by means of a Bluetooth connection protocol, and the Bluetooth connection protocols of different versions use different authentication modes. Therefore, the first electronic device needs to determine the protocol version of the bluetooth connection protocol used by the second electronic device. Therefore, the process of establishing the bluetooth connection between the first electronic device and the second electronic device is as follows: the first electronic device determines an authentication mode used for establishing Bluetooth connection with the second electronic device according to a protocol version of a Bluetooth connection protocol used by the second electronic device, and establishes Bluetooth connection with the second electronic device based on the authentication mode.
In the related art, when a first electronic device and a second electronic device establish a connection based on bluetooth, a Name acquisition Request (RNR) is sent to the second electronic device, and a protocol version of a bluetooth connection protocol used by the second electronic device is acquired based on the RNR, so that the bluetooth connection is established with the second electronic device based on an authentication method corresponding to the protocol version.
In the related art, when the first electronic device and the second electronic device establish a connection based on bluetooth, it is necessary to determine a protocol version of a bluetooth connection protocol of the second electronic device by initiating the RNR, which results in a cumbersome process of establishing the bluetooth connection and low efficiency of the bluetooth connection.
Disclosure of Invention
The embodiment of the application provides a Bluetooth-based device connection method, a Bluetooth-based device connection device, an electronic device and a storage medium, and the Bluetooth connection efficiency can be improved. The technical scheme is as follows:
in one aspect, a bluetooth-based device connection method is provided, the method including:
performing equipment scanning in a network environment, and acquiring a scanning response message of scanned electronic equipment;
determining a response mode used by the scanning response message;
determining version information of a Bluetooth connection protocol used by the electronic equipment based on the response mode, and storing the version information, wherein the Bluetooth connection protocols of different versions correspond to scanning response messages of different response modes;
and responding to the Bluetooth connection operation with the electronic equipment, and establishing Bluetooth connection with the electronic equipment based on the stored version information.
In another aspect, there is provided a bluetooth-based device connection apparatus, the apparatus including:
the acquisition module is used for scanning the equipment in a network environment and acquiring the scanning response message of the scanned electronic equipment;
a first determining module, configured to determine a response mode used by the scan response message;
the second determining module is used for determining the version information of the Bluetooth connection protocol used by the electronic equipment based on the response mode, storing the version information, and enabling the Bluetooth connection protocols of different versions to correspond to the scanning response messages of different response modes;
and the connection establishing module is used for responding to the Bluetooth connection operation with the electronic equipment and establishing Bluetooth connection with the electronic equipment based on the stored version information.
In another aspect, an electronic device is provided, the electronic device comprising a processor and a memory; the memory stores at least one program code for execution by the processor to implement the bluetooth based device connection method as described in the above aspect.
In another aspect, a computer readable storage medium is provided, the storage medium storing at least one program code for execution by a processor to implement the bluetooth based device connection method as described in the above aspect.
In another aspect, a computer program product is provided, which stores at least one program code, which is loaded and executed by a processor to implement the bluetooth-based device connection method of the above aspect.
In the embodiment of the application, the protocol version information of the bluetooth connection protocol used by the second electronic device is determined according to the scanning response message of the second electronic device in the process of scanning the second electronic device, so that the process of determining the protocol version information does not need to be initiated again in the process of establishing the bluetooth connection, the protocol version information cannot be determined in the process of establishing the bluetooth connection due to temporary interception failure is prevented, the failure risk of the bluetooth connection is reduced, and the success rate of the bluetooth connection is improved.
Drawings
Fig. 1 is a schematic diagram illustrating an implementation environment related to a bluetooth-based device connection method according to an exemplary embodiment of the present application;
FIG. 2 illustrates a flowchart of a Bluetooth-based device connection method in accordance with an exemplary embodiment of the present application;
FIG. 3 illustrates a flowchart of a Bluetooth-based device connection method in accordance with an exemplary embodiment of the present application;
FIG. 4 illustrates a flowchart of a Bluetooth-based device connection method in accordance with an exemplary embodiment of the present application;
FIG. 5 illustrates a flowchart of a Bluetooth-based device connection method in accordance with an exemplary embodiment of the present application;
FIG. 6 illustrates a flowchart of a Bluetooth-based device connection method in accordance with an exemplary embodiment of the present application;
FIG. 7 illustrates a flowchart of a Bluetooth-based device connection method in accordance with an exemplary embodiment of the present application;
fig. 8 is a block diagram illustrating a structure of a bluetooth-based device connection apparatus according to an exemplary embodiment of the present application;
fig. 9 shows a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Reference herein to "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. In addition, the version information, the device identifier, and other information referred to in the present application may be information authorized by the user or sufficiently authorized by each party.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an implementation environment related to a bluetooth-based device connection method according to an exemplary embodiment of the present application. Referring to fig. 1, the implementation environment includes a first electronic device 10 and at least one second electronic device 20 at a home terminal. Wherein, bluetooth modules are installed in the first electronic device 10 and the second electronic device 20. The first electronic device 10 is capable of establishing a bluetooth connection with a second electronic device 20 within a preset range.
The first electronic device 10 broadcasts a bluetooth search request to the network environment via the bluetooth module. After receiving the bluetooth search request, the second electronic device 20 in the network environment responds to the first electronic device 10 based on the bluetooth search request, that is, the second electronic device 20 generates a scan response message and sends the scan response message to the first electronic device 10, and the first electronic device 10 receives the scan response message and establishes a bluetooth connection with the second electronic device 20 that transmits the scan response message based on the scan response message.
The preset range is set according to a range of the bluetooth module broadcast message in the first electronic device 10, and in the embodiment of the present application, the preset range is not particularly limited.
The first electronic device 10 and the second electronic device 20 are both devices having bluetooth modules. For example, the first electronic device 10 and the second electronic device 20 may each be a cell phone, a tablet, a wearable device, or the like. It should be noted that the first electronic device 10 and the second electronic device 20 are the same type of electronic device or different types of electronic devices. For example, the first electronic device 10 is a mobile phone, and the second electronic device 20 is a bluetooth headset.
Referring to fig. 2, a flowchart illustrating a bluetooth-based device connection method according to an exemplary embodiment of the present application is shown. The execution subject in the embodiment of the present application is the first electronic device, and may also be a bluetooth module of the first electronic device, a processor of the first electronic device, or an operating system of the first electronic device. For the steps executed by the second electronic device, the execution subject is the second electronic device, a bluetooth module of the second electronic device, a processor of the second electronic device, or an operating system of the second electronic device. The present embodiment takes the first electronic device and the second electronic device as the execution main body as an example for explanation. The method comprises the following steps:
step S21: the first electronic equipment performs equipment scanning in a network environment and acquires a scanning response message of the scanned second electronic equipment.
The first electronic device initiates a second electronic device discovery procedure, based on which a second electronic device capable of establishing a bluetooth connection is determined. The first electronic equipment broadcasts a Bluetooth search request to a network environment; a scan reply message based on the bluetooth search request in the network environment is received. The first electronic equipment broadcasts a Bluetooth search request to a network environment; after receiving a bluetooth search request broadcast in a network environment, the second electronic device generates a scanning response message based on a bluetooth connection protocol of the second electronic device, feeds the scanning response message back to the first electronic device, and the first electronic device receives the scanning response message sent by the second electronic device.
The scanning response message is generated by the second electronic device based on a Bluetooth connection protocol used by the second electronic device. The bluetooth connection protocol includes multiple protocol versions, and the protocol versions used by different second electronic devices are the same or different, which is not specifically limited in this embodiment of the application.
Step S22: the first electronic device determines a reply mode used for scanning the reply message.
The response mode comprises an expanded query response and a non-expanded query response.
In this step, the response mode of the scanning response message is determined based on the message content of the scanning response message. As shown in fig. 3, the process is realized by the following steps S22-1 to S22-2, including:
step S22-1: and the first electronic equipment analyzes the scanning response message to obtain the message content of the scanning response message.
Wherein the message content of the scanning response message generated by the second electronic equipment supporting EIR is different from that of the second electronic equipment not supporting EIR.
In this step, the first electronic device parses the received scanning response message to obtain the message content of the scanning response message. After the first electronic device obtains the scanning response message, the information field carried by the scanning response message is determined, the information field is analyzed, and the information content carried by the information field is obtained, so that the information content of the scanning response message is obtained.
The scanning response message received by the first electronic device is a scanning response message fed back by at least one second electronic device in the current network environment. In some embodiments, the first electronic device determines a scan reply message to be parsed from the at least one scan reply message, and parses the scan reply message to be parsed. The first electronic device determines the earliest received scanning response message as the scanning response message to be analyzed based on the receiving time of the scanning response message. Or the first electronic device determines distance information between the second electronic device and the first electronic device, determines a scanning response message fed back by the second electronic device closest to the first electronic device from at least one scanning response message, and determines the scanning response message as a scanning response message to be analyzed.
In some real-time, the first electronic device parses the at least one scan reply message, respectively. And the first electronic equipment analyzes the at least one scanning response message according to a random sequence. Or the first electronic device analyzes the at least one scanning response message in sequence according to the receiving time of the at least one scanning response message. Or the first electronic device analyzes the at least one scanning response message in sequence according to the distance between the at least one second electronic device and the first electronic device. In the embodiment of the present application, the manner and the sequence of parsing the scan reply message are not particularly limited.
Step S22-2: the first electronic equipment determines a response mode used by the scanning response message based on the message content and the reference message content.
And the reference message content comprises message content corresponding to the expanded query result. In some embodiments, the message content corresponding to the expanded query result includes the message content corresponding to the unexpanded query result and the target message content. In some embodiments, the message content corresponding to the expanded query result includes the target message content. The target message content is the message content not included in the non-expanded query result. For example, the expanded query result includes a device name of the electronic device.
In this step, the message content based on the scan response message is compared with the reference message content, and the response mode used by the message response message is determined based on the comparison result. Referring to fig. 4, the process is realized by the following steps (1) - (3), including:
(1) the first electronic device compares the message content of the scan reply message with the reference message content.
In this step, the first electronic device compares the message content of the scan response message with the field corresponding to the reference message content to obtain a comparison result.
(2) And if the message content is matched with the reference message content, the first electronic equipment determines that the response mode is an expanded query response.
Wherein, the matching of the message content and the reference message content means that the fields included in the message content are the same as the fields included in the reference message content. Or, the matching of the message content and the reference message content means that the field corresponding to the message content includes the field corresponding to the reference message content.
In this step, if the message content matches the reference message content, it is determined that the message content includes the extended query result, i.e., the response mode used by the message content is an extended query response.
(3) And if the message content is not matched with the reference message content, the first electronic equipment determines that the response mode is the non-expanded query response.
In this step, if the message content does not match the reference message, it is determined that the message content does not include the extended query result, i.e., the message content and the used response mode are non-extended query responses.
Step S23: the first electronic equipment determines the version information of the Bluetooth connection protocol used by the electronic equipment based on the response mode, and stores the version information.
Wherein, the bluetooth connection protocol of different editions corresponds the scanning answer message of different answer modes.
In the embodiment of the present application, the protocol versions of the bluetooth connection protocol are divided into a version before the bluetooth connection protocol 2.0 and a version after the bluetooth connection protocol 2.0. Wherein, the version before the bluetooth connection protocol 2.0 does not support Extended Inquiry Results (EIR), that is, the scan response message corresponding to the version before the bluetooth connection protocol 2.0 is a non-Extended Inquiry response; the version after the bluetooth connection protocol 2.0 supports EIR, that is, the scanning response message corresponding to the version after the bluetooth connection protocol 2.0 is an extended inquiry response.
In this step, if the response mode is an extended query response, the first electronic device determines that the version information is the first version information.
In some embodiments, if the response mode is the non-extended query response, the first electronic device determines that the version information is the second version information.
In some embodiments, referring to fig. 5, if the response mode is a non-extended query response, the first electronic device further confirms the version information. Referring to FIG. 6, the process is implemented by the following steps S23-1 to S23-4, including:
step S23-1: and if the response mode is a non-extended query response, the first electronic equipment sends an equipment name acquisition request to the second electronic equipment.
The device name obtaining request is an RNR, and the device name obtaining request is used for obtaining a device name of the second electronic device. In this step, a temporary bluetooth connection is established between the first electronic device and the second electronic device, where the temporary bluetooth connection is used for the first electronic device to obtain the device name of the second electronic device. The first electronic device sends a name acquisition request to the second electronic device through the temporary bluetooth connection.
Step S23-2: the first electronic equipment receives a request response message sent by the second electronic equipment.
In the RNR procedure, the second electronic device using the bluetooth connection protocol corresponding to the second version information does not exchange feature information (feature) with the first electronic device, and the second electronic device using the bluetooth connection protocol corresponding to the first version information exchanges function information with the home device. Therefore, the version information of the bluetooth connection protocol used by the second electronic device can be determined based on whether the request response message carries the feature information of the second electronic device.
In this step, the second electronic device transmits the generated request response message to the first electronic device based on the temporary bluetooth connection.
Step S23-3: if the request response message includes the feature information of the electronic device, the first electronic device determines that the version information is the first version information.
If the request response message includes the feature information of the second electronic device, it is determined that the second electronic device can exchange the feature information in the RNR process, and it is determined that the protocol used by the second electronic device is the bluetooth connection protocol corresponding to the first version information. For example, if there is a "remote host supported features notification event" in the request response message, the first electronic device determines that the version information is the first version information.
Step S23-4: and if the request response message does not comprise the characteristic information of the electronic equipment, the first electronic equipment determines that the version information is the second version information.
If the request response message does not include the feature information of the second electronic device, the second electronic device is determined not to exchange the feature information in the RNR process, and the first electronic device determines that the version information is the second version information.
In this implementation manner, if the content of the scanning response message fed back by the second electronic device is not matched with the content of the reference message, the second electronic device reconfirms the version information of the bluetooth connection protocol used by the second electronic device through the request response message of the device name acquisition request of the second electronic device, thereby ensuring the accuracy of the acquired version information of the bluetooth connection protocol.
Step S24: in response to a bluetooth connection operation with the electronic device, the first electronic device establishes a bluetooth connection with the electronic device based on the stored version information.
When the first electronic device and the second electronic device establish Bluetooth connection, the first electronic device calls a Bluetooth connection protocol of the second electronic device, matches the first electronic device with the second electronic device based on version information of the Bluetooth connection protocol, and establishes Bluetooth connection with the second electronic device if matching is successful. Referring to fig. 7, the process is implemented by the following steps S24-1 to S24-2, including:
step S24-1: and the first electronic equipment determines the authentication mode of the Bluetooth connection protocol corresponding to the version information.
The bluetooth connection protocol corresponding to the first version information adopts a Secure Simple Pairing (SSP) authentication mode, and the bluetooth connection protocol corresponding to the second version information adopts a Personal Identification Number (PIN) code authentication mode.
In this step, the first electronic device determines, based on the version information, bluetooth connection information corresponding to the version information, and further determines an authentication method corresponding to the bluetooth connection protocol.
Before the step, the first electronic device locally stores the acquired version information of the second electronic device. Accordingly, in this step, the first electronic device determines the version information of the second electronic device based on the corresponding relationship between the second electronic device and the version information.
The process of the first electronic device for storing the corresponding relation between the version information and the second electronic device is as follows: the method comprises the steps that a first electronic device obtains a scanned device identifier of at least one second electronic device; and storing the corresponding relation between the equipment identification and the version information of each second electronic equipment.
For each second electronic device, the process of the first electronic device determining the version information corresponding to the second electronic device is similar to the above steps S21-S23, and is not repeated here.
Accordingly, in this step, the first electronic device determines version information corresponding to the second electronic device from the stored version information based on the correspondence relationship. The process is as follows: the method comprises the steps that a first electronic device determines a device identification of a second electronic device to be connected through Bluetooth; based on the device identifier of the second electronic device, determining version information corresponding to the device identifier from the corresponding relation between the device identifier and the version information; and establishing Bluetooth connection with the second electronic equipment based on the Bluetooth connection protocol corresponding to the version information.
The first electronic equipment stores the scanned version information of the second electronic equipment locally in the process of scanning the electronic equipment, and the version information of the second electronic equipment is called locally when connection is established with the second electronic equipment. Correspondingly, before the step, the first electronic device stores the bluetooth version used by the second electronic device locally, and correspondingly, the first electronic device stores the corresponding relationship between the second electronic device and the version information.
The first electronic device correspondingly stores the scanned version information of at least one second electronic device and the second electronic device in the process of scanning the electronic devices. The first electronic device displays the scanned device name of at least one second electronic device, responds to the received trigger operation of the target device name, and calls the stored version information of the second electronic device corresponding to the target device name based on the target device name.
Step S24-2: the first electronic device establishes Bluetooth connection with the electronic device based on the authentication mode.
It should be noted that, after the first electronic device establishes a bluetooth connection with the second electronic device, the version information corresponding to the second electronic device scanned this time is deleted locally, and the version information of the second electronic device is determined again in the next scanning. Or the local electronic device retains the version information corresponding to the scanned second electronic device, and the version information of the existing second electronic device is not determined again in the next scanning.
In the embodiment of the application, in the process of scanning the second electronic device, the version information of the bluetooth connection protocol used by the second electronic device is determined according to the scanning response message of the second electronic device, so that the process of determining the version information does not need to be initiated again in the process of establishing the bluetooth connection, the situation that the version information cannot be determined in the process of establishing the bluetooth connection due to temporary interception failure is prevented, the failure risk of the bluetooth connection is reduced, and the success rate of the bluetooth connection is improved.
Referring to fig. 8, a block diagram of a bluetooth-based device connection apparatus according to an exemplary embodiment of the present application is shown. The apparatus may be implemented as all or part of a processor, in software, hardware, or a combination of both. The device includes:
an obtaining module 801, configured to perform device scanning in a network environment, and obtain a scanning response message of a scanned electronic device;
a first determining module 802, configured to determine a response mode used by the scan response message;
a second determining module 803, configured to determine, based on the response mode, version information of a bluetooth connection protocol used by the electronic device, store the version information, where bluetooth connection protocols of different versions correspond to scanning response messages of different response modes;
a connection establishing module 804, configured to establish a bluetooth connection with the electronic device based on the stored version information in response to a bluetooth connection operation with the electronic device.
In some embodiments, the first determining module 802 includes:
the analysis unit is used for analyzing the scanning response message to obtain the message content of the scanning response message;
and the first determining unit is used for determining a response mode used by the scanning response message based on the message content and a reference message content, wherein the reference message content comprises the message content corresponding to the expanded query result.
In some embodiments, the first determining unit is configured to compare the message content of the scan response message with the reference message content; if the message content is matched with the reference message content, determining that the response mode is an extended query response; and if the message content is not matched with the reference message content, determining that the response mode is a non-expanded query response.
In some embodiments, the extended query result includes a device name of the electronic device.
In some embodiments, the second determining module 803 includes:
and the third determining unit is used for determining that the version information is the first version information if the response mode is an extended query response.
In some embodiments, the apparatus further comprises:
and the third determining module is used for determining that the version information is the second version information if the response mode is the non-extended query response.
In some embodiments, the apparatus further comprises:
the sending module is used for sending an equipment name acquisition request to the electronic equipment if the response mode is a non-extended query response;
the receiving module is used for receiving a request response message sent by the electronic equipment;
a fourth determining module, configured to determine that the version information is the first version information if the request response message includes the feature information of the electronic device;
a fifth determining module, configured to determine that the version information is the second version information if the request response message does not include the feature information of the electronic device.
In some embodiments, the connection establishing module 804 includes:
a fourth determining unit, configured to determine an authentication method of a bluetooth connection protocol corresponding to the version information;
and the connection establishing unit is used for establishing Bluetooth connection with the electronic equipment based on the authentication mode.
In the embodiment of the application, in the process of scanning the second electronic device, the version information of the bluetooth connection protocol used by the second electronic device is determined according to the scanning response message of the second electronic device, so that the process of determining the version information does not need to be initiated again in the process of establishing the bluetooth connection, the situation that the version information cannot be determined in the process of establishing the bluetooth connection due to temporary interception failure is prevented, the failure risk of the bluetooth connection is reduced, and the success rate of the bluetooth connection is improved.
Referring to fig. 9, a block diagram of an electronic device according to an exemplary embodiment of the present application is shown. The electronic device may be the first electronic device or the second electronic device. The electronic device 900 is an electronic device having a bluetooth module. For example, the electronic device 900 may be a cell phone, a tablet, a wearable device, a bluetooth headset, and so on. The electronic device 900 in the present application may include one or more of the following components: a processor 910, a memory 920, and a bluetooth module 930.
Processor 910 may include one or more processing cores. The processor 910 connects various portions within the overall wireless communication module 900 using various interfaces and lines to perform various functions of the electronic device 900 and process data by running or executing program code, programs, code sets, or program code sets stored in the memory 920 and invoking data stored in the memory 920. Alternatively, the processor 910 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 910 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural-Network Processing Unit (NPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the NPU is used for realizing an Artificial Intelligence (AI) function; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 910, but may be implemented by a single chip.
The Memory 920 may include a Random Access Memory (RAM) or a Read-Only Memory (ROM). Optionally, the memory 920 includes a non-transitory computer-readable medium. The memory 920 may be used to store program code, programs, code, sets of code, or sets of program codes. The memory 920 may include a storage program area and a storage data area, wherein the storage program area may store program codes for implementing an operating system, program codes for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), program codes for implementing various method embodiments described below, and the like; the stored data area may store data (e.g., audio data, a phonebook) created according to the use of the electronic device 900, and the like.
The bluetooth module 930 is used to establish a connection with a bluetooth module of another electronic device, and to broadcast and receive bluetooth signals. For example, the bluetooth module 930 may be a bluetooth host (host) or the like.
In some embodiments, the electronic device 900 also includes a display screen. A display screen is a display component for displaying a user interface. Optionally, the display screen is a display screen with a touch function, and through the touch function, a user may use any suitable object such as a finger or a touch pen to perform a touch operation on the display screen.
The display screen is typically provided on the front panel of the electronic device 900. The display screen may be designed as a full-face screen, curved screen, odd-shaped screen, double-face screen, or folding screen. The display screen may also be designed as a combination of a full screen and a curved screen, a combination of a special screen and a curved screen, and the like, which is not limited in this embodiment.
In addition, those skilled in the art will appreciate that the configuration of the electronic device 900 illustrated in the above-described figures does not constitute a limitation of the electronic device 900, and that the electronic device 900 may include more or fewer components than illustrated, or some components may be combined, or a different arrangement of components. For example, the electronic device 900 further includes a microphone, a speaker, a radio frequency circuit, an input unit, a sensor, an audio circuit, a Wireless Fidelity (Wi-Fi) module, a power supply, and other components, which are not described herein again.
The present embodiments also provide a computer-readable medium, which stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the bluetooth-based device connection method as shown in the above embodiments.
The present application further provides a computer program product, where at least one program code is stored, and the at least one program code is loaded and executed by the processor to implement the bluetooth-based device connection method as shown in the above embodiments.
In some embodiments, the computer program according to the embodiments of the present application may be deployed to be executed on one computer device or on multiple computer devices located at one site, or may be executed on multiple computer devices distributed at multiple sites and interconnected by a communication network, and the multiple computer devices distributed at the multiple sites and interconnected by the communication network may constitute a block chain system.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more program codes or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (11)

1. A Bluetooth-based device connection method, the method comprising:
performing equipment scanning in a network environment, and acquiring a scanning response message of scanned electronic equipment;
determining a response mode used by the scanning response message;
determining version information of a Bluetooth connection protocol used by the electronic equipment based on the response mode, and storing the version information, wherein the Bluetooth connection protocols of different versions correspond to scanning response messages of different response modes;
and responding to the Bluetooth connection operation with the electronic equipment, and establishing Bluetooth connection with the electronic equipment based on the stored version information.
2. The method of claim 1, wherein determining the reply mode used by the scan reply message comprises:
analyzing the scanning response message to obtain the message content of the scanning response message;
and determining a response mode used by the scanning response message based on the message content and a reference message content, wherein the reference message content comprises the message content corresponding to the expanded query result.
3. The method of claim 2, wherein determining the response mode used by the scan response message based on the message content and a preset message content comprises:
comparing the message content of the scanning response message with the reference message content;
if the message content is matched with the reference message content, determining that the response mode is an extended query response;
and if the message content is not matched with the reference message content, determining that the response mode is a non-expanded query response.
4. The method of any of claim 2, wherein the extended query result includes a device name of the electronic device.
5. The method according to claim 1, wherein the determining version information of a bluetooth connection protocol used by the electronic device based on the answering mode comprises:
and if the response mode is an extended query response, determining that the version information is the first version information.
6. The method of claim 5, further comprising:
and if the response mode is a non-extended query response, determining that the version information is second version information.
7. The method of claim 5, further comprising:
if the response mode is a non-extended query response, sending a device name acquisition request to the electronic device;
receiving a request response message sent by the electronic equipment;
if the request response message comprises the characteristic information of the electronic equipment, determining that the version information is first version information;
and if the request response message does not comprise the characteristic information of the electronic equipment, determining that the version information is second version information.
8. The method of claim 1, wherein establishing a bluetooth connection with the electronic device based on the stored version information comprises:
determining an authentication mode of a Bluetooth connection protocol corresponding to the version information;
and establishing Bluetooth connection with the electronic equipment based on the authentication mode.
9. An apparatus for bluetooth-based device connection, the apparatus comprising:
the acquisition module is used for scanning the equipment in a network environment and acquiring the scanning response message of the scanned electronic equipment;
a first determining module, configured to determine a response mode used by the scan response message;
the second determining module is used for determining the version information of the Bluetooth connection protocol used by the electronic equipment based on the response mode, storing the version information, and enabling the Bluetooth connection protocols of different versions to correspond to the scanning response messages of different response modes;
and the connection establishing module is used for responding to the Bluetooth connection operation with the electronic equipment and establishing Bluetooth connection with the electronic equipment based on the stored version information.
10. An electronic device, comprising a processor and a memory; the memory stores at least one program code for execution by the processor to implement the bluetooth based device connection method as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium storing at least one program code for execution by a processor to implement the bluetooth based device connection method of any one of claims 1 to 8.
CN202110881093.3A 2021-08-02 2021-08-02 Bluetooth-based equipment connection method and device, electronic equipment and storage medium Pending CN113490194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110881093.3A CN113490194A (en) 2021-08-02 2021-08-02 Bluetooth-based equipment connection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110881093.3A CN113490194A (en) 2021-08-02 2021-08-02 Bluetooth-based equipment connection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113490194A true CN113490194A (en) 2021-10-08

Family

ID=77944004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110881093.3A Pending CN113490194A (en) 2021-08-02 2021-08-02 Bluetooth-based equipment connection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113490194A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150043427A1 (en) * 2011-07-25 2015-02-12 Vishwanath . K.M. Method and apparatus for connection in a bluetooth communication system
CN107770762A (en) * 2017-11-20 2018-03-06 飞天诚信科技股份有限公司 A kind of method and device for establishing bluetooth connection
CN107889092A (en) * 2017-11-30 2018-04-06 广东欧珀移动通信有限公司 Bluetooth devices control method, device, terminal device and storage medium
CN110191450A (en) * 2019-04-02 2019-08-30 华为技术有限公司 Business connection establishment method, bluetooth master, chip and Bluetooth system
CN112105009A (en) * 2020-09-02 2020-12-18 中移(杭州)信息技术有限公司 Device discovery and Bluetooth broadcasting method, device, electronic device and storage medium
CN112469011A (en) * 2019-09-06 2021-03-09 华为技术有限公司 Bluetooth pairing method and related device
CN113132962A (en) * 2019-04-16 2021-07-16 华为技术有限公司 Bluetooth scanning method and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150043427A1 (en) * 2011-07-25 2015-02-12 Vishwanath . K.M. Method and apparatus for connection in a bluetooth communication system
CN107770762A (en) * 2017-11-20 2018-03-06 飞天诚信科技股份有限公司 A kind of method and device for establishing bluetooth connection
CN107889092A (en) * 2017-11-30 2018-04-06 广东欧珀移动通信有限公司 Bluetooth devices control method, device, terminal device and storage medium
CN110191450A (en) * 2019-04-02 2019-08-30 华为技术有限公司 Business connection establishment method, bluetooth master, chip and Bluetooth system
CN113132962A (en) * 2019-04-16 2021-07-16 华为技术有限公司 Bluetooth scanning method and electronic equipment
CN112469011A (en) * 2019-09-06 2021-03-09 华为技术有限公司 Bluetooth pairing method and related device
CN112105009A (en) * 2020-09-02 2020-12-18 中移(杭州)信息技术有限公司 Device discovery and Bluetooth broadcasting method, device, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN112020048B (en) Bluetooth device pairing method, device and storage medium
KR100530233B1 (en) Wireless communication device notifying the connectable device and communication method in the device
CN112312586B (en) WiFi direct connection establishing method, device, equipment and storage medium
US20070141989A1 (en) Proximity facilitate device pairing
CN108347512B (en) Identity recognition method and mobile terminal
CN113316131B (en) Connection establishment method, device, electronic equipment and storage medium
WO2023020618A1 (en) Bluetooth-based device connection method and apparatus, electronic device and storage medium
CN109379735B (en) eSIM card operation method, mobile terminal and eSIM card device
WO2023020253A1 (en) Data acquisition method and apparatus, electronic device, and storage medium
CN111431734A (en) Network distribution method of intelligent equipment and related device
WO2023020187A1 (en) Data obtaining methods and apparatuses, electronic device and storage medium
US20200213844A1 (en) Communication method, communication apparatus and electronic device
CN111885571A (en) Bluetooth device pairing method, device and storage medium
CN111641938B (en) Wireless pairing connection method and device, host and slave
CN113677039A (en) Bluetooth-based equipment connection method and device, electronic equipment and storage medium
CN113490194A (en) Bluetooth-based equipment connection method and device, electronic equipment and storage medium
CN109089258B (en) eSIM card operation method, mobile terminal and eSIM card device
CN109257739B (en) eSIM card operation method, mobile terminal and eSIM card device
US20220053585A1 (en) Method for pc5 link establishment, device, and system
CN107027126B (en) Data communication method and system, terminal equipment and control equipment
KR20020029028A (en) Method for establishing a fast connection between two bluetooth devices
CN109660988B (en) Communication authentication processing method and device and electronic equipment
CN111601364B (en) Method for sending and receiving network identification information and communication equipment
CN107071750B (en) Information transmission method and device, terminal equipment and storage medium
CN113691964A (en) Connection method and device of Bluetooth equipment and storage medium

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