CN112789934B - Bluetooth service query method and electronic equipment - Google Patents

Bluetooth service query method and electronic equipment Download PDF

Info

Publication number
CN112789934B
CN112789934B CN201880098126.3A CN201880098126A CN112789934B CN 112789934 B CN112789934 B CN 112789934B CN 201880098126 A CN201880098126 A CN 201880098126A CN 112789934 B CN112789934 B CN 112789934B
Authority
CN
China
Prior art keywords
electronic device
bluetooth
bluetooth service
electronic equipment
electronic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201880098126.3A
Other languages
Chinese (zh)
Other versions
CN112789934A (en
Inventor
唐能福
国珊珊
牛永民
李哲
索亚运
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN112789934A publication Critical patent/CN112789934A/en
Application granted granted Critical
Publication of CN112789934B publication Critical patent/CN112789934B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W74/00Wireless channel access
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

An inquiry method of Bluetooth service and electronic equipment relate to the technical field of communication and are used for reducing the possibility of abnormal Bluetooth connection. The method is applied to first electronic equipment, the Bluetooth function of the first electronic equipment is started, and a first application program is installed in the first electronic equipment. The method specifically comprises the following steps: the method comprises the steps that a first electronic device receives scanning results sent by at least one electronic device with a Bluetooth function, wherein each scanning result comprises a device identifier and at least one UUID; each UUID is used to identify a bluetooth service; storing the device identification and at least one UUID included in the scanning result as first Bluetooth service information; when detecting that the first application program requests to inquire the Bluetooth service of the second electronic equipment, inquiring the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information. The technical scheme is beneficial to reducing the times of directly inquiring the Bluetooth service from the Bluetooth device at the opposite terminal, thereby reducing the possibility of abnormity of the Bluetooth connection and improving the user experience.

Description

Bluetooth service query method and electronic equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a bluetooth service query method and an electronic device.
Background
Currently, bluetooth services are identified by a Universally Unique Identifier (UUID). Wherein, the bluetooth service of different UUID identifications is different. Before using the bluetooth service provided by the peer bluetooth device, the electronic device, such as a mobile phone or a tablet computer, needs to query a bluetooth service UUID list (service UUID list) of the peer bluetooth device to determine which bluetooth services are supported by the peer bluetooth device. Specifically, the service UUID list of the peer bluetooth device includes at least one UUID, and each UUID in the at least one UUID is used to identify a bluetooth service supported by one peer bluetooth device.
Taking bluetooth headsets as an example, the service UUID list of bluetooth headsets includes UUID1 and UUID2. The UUID1 is used to identify an advanced audio distribution profile (A2 DP), and the UUID2 is used to identify a hands-free profile (HFP). The A2DP means that after the Bluetooth earphone is connected with the mobile phone through Bluetooth, the Bluetooth earphone can be used as a microphone and a receiver of the mobile phone to perform voice communication, and can also be used as a playing device of the mobile phone to play audio files on the mobile phone. HFP means that after the bluetooth headset is connected with a mobile phone through bluetooth, the user can control to answer, reject or hang up the incoming call on the mobile phone, or control to use the mobile phone to make a call.
In practical application, the mobile phone queries the service UUID list of the peer bluetooth device through an application program (e.g., a system application, a third party application, etc.). Specifically, as shown in fig. 1, an application program sends a request for querying a bluetooth service of an opposite-end bluetooth device to a bluetooth chip in a mobile phone, the bluetooth chip in the mobile phone receives the request for querying the bluetooth service of the opposite-end bluetooth device, and then sends a query command for the bluetooth service to the opposite-end bluetooth device, the bluetooth chip of the opposite-end bluetooth device obtains a service UUID list after receiving the query command, and returns the obtained service UUID list to the bluetooth chip in the mobile phone, and then the bluetooth chip in the mobile phone returns the received service UUID list from the opposite-end bluetooth device to the application program. Through the inquiry mode of the Bluetooth service, when a plurality of application programs of the Bluetooth service of the Bluetooth device at the opposite terminal need to be inquired on the mobile phone, the Bluetooth device at the opposite terminal may receive inquiry commands of the Bluetooth service from the plurality of application programs at the same time, so that the processing capacity of the Bluetooth chip of the opposite terminal is exceeded, and the connection between the mobile phone and the Bluetooth device at the opposite terminal is abnormal. In addition, for some third-party applications installed on the mobile phone, an inquiry command of the bluetooth service may be frequently sent to the bluetooth chip of the peer bluetooth device, so that the peer bluetooth device may also disconnect the bluetooth connection with the mobile phone due to self protection.
In summary, in the prior art, the method for directly issuing the inquiry command to the peer bluetooth device to inquire the bluetooth service easily causes the abnormality of the bluetooth connection, and reduces the user experience.
Disclosure of Invention
The embodiment of the application provides a Bluetooth service query method and electronic equipment, which are beneficial to reducing the number of times of directly querying Bluetooth services for opposite-end Bluetooth equipment, so that the possibility of abnormal Bluetooth connection is reduced, and the user experience is improved.
In a first aspect, an inquiry method for a bluetooth service provided in an embodiment of the present application is applied to a first electronic device, where the first electronic device starts a bluetooth function and is installed with a first application program; the method comprises the following steps:
the first electronic equipment receives scanning results sent by at least one electronic equipment with a Bluetooth function, wherein each scanning result comprises an equipment identifier and at least one universal unique identifier UUID; each UUID is used for identifying a Bluetooth service supported by the electronic equipment identified by the equipment identification; and saving the device identification and the at least one UUID included in the received scanning result as the first Bluetooth service information. And when detecting that the first application program requests to inquire the Bluetooth service of the second electronic equipment, the first electronic equipment inquires the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information according to the identifier of the second electronic equipment.
In the embodiment of the application, because the first electronic device can inquire the bluetooth service of the second electronic device from the stored first bluetooth service information when the first electronic device requests to inquire the bluetooth service of the second electronic device, the number of times of directly inquiring the bluetooth service to the second electronic device in a chip transparent transmission mode is reduced, and the possibility of abnormal conditions caused by excessive number of times of inquiring the bluetooth service to the second electronic device in the bluetooth connection is reduced.
In one possible design, the first bluetooth service information is stored in the form of a database. For example uuid. Helping to simplify the implementation.
In a possible design, for one electronic device of the at least one electronic device with a bluetooth function, when the first electronic device receives a scanning result sent by the electronic device again, the first electronic device updates the first bluetooth service information according to the scanning result sent by the electronic device received again. Thereby contributing to the integrity of the stored first bluetooth service information.
In one possible design, when the electronic device with the bluetooth function is a classic bluetooth device, the scanning result is an extended acquired result; and/or when the electronic equipment with the Bluetooth function is low-power Bluetooth equipment, the scanning result is a broadcast packet. Helping to simplify the implementation.
In one possible design, the first electronic device sends a pairing request to an electronic device to be paired in the at least one electronic device with the bluetooth function turned on; receiving a pairing success response sent by the electronic equipment to be paired after receiving the pairing request, wherein the pairing success response comprises an identifier of the electronic equipment to be paired and at least one UUID; and then, storing the identifier of the electronic equipment to be paired and at least one UUID included in the pairing success response as the second Bluetooth service information.
In one possible design, the second bluetooth service information is stored in the form of a profile. Conf, for example, bt _ config. The complexity of saving the second Bluetooth service information is reduced, and the implementation is facilitated.
In a possible design, when the first electronic device detects that the first application program requests to inquire about the bluetooth service of the second electronic device, the first electronic device may also inquire about the bluetooth service supported by the second electronic device from the second bluetooth service information; and acquiring a union set of the Bluetooth service supported by the second electronic equipment inquired from the first Bluetooth service information and the Bluetooth service supported by the second electronic equipment inquired from the second Bluetooth service information to obtain the Bluetooth service supported by the second electronic equipment. Thereby improving the possibility that the first electronic device inquires the Bluetooth service supported by the second electronic device from the pre-stored Bluetooth service information.
In one possible design, the second electronic device is in a paired state with the first electronic device.
In a possible design, when the first electronic device detects that the first application requests to query a bluetooth service of a third electronic device, if the third electronic device and the first electronic device are in an unpaired state or in a paired state, the first electronic device queries, from the first bluetooth service information, a bluetooth service supported by the second electronic device according to an identifier of the third electronic device. And the method helps to save invalid signaling interaction inside the electronic equipment.
In one possible design, the first application is a third party application.
In a possible design, when the first electronic device detects that a system application requests to query a bluetooth service of the second electronic device, the bluetooth service supported by the second electronic device is queried from the second bluetooth service information according to an identifier of the second electronic device.
In a possible design, when the first electronic device does not inquire the bluetooth service supported by the second electronic device from the first bluetooth service information or the first bluetooth service information and the second bluetooth service information, the first electronic device may send an inquiry command of the bluetooth service to the second electronic device, or may determine whether to send the inquiry command of the bluetooth service to the second electronic device according to a pairing state of the second electronic device and the first electronic device. Through the technical scheme, the possibility that the first electronic equipment inquires the Bluetooth service supported by the second electronic equipment is improved.
In a second aspect, an embodiment of the present application provides a first electronic device, where the first electronic device starts a bluetooth function; wherein the first electronic device comprises at least one processor, at least one memory, and a transceiver;
the memory stores a first application and code instructions; the transceiver is used for receiving or transmitting data; the processor, when invoking the code instructions stored in the memory, in conjunction with the transceiver, performs:
receiving a scanning result sent by at least one electronic device with a Bluetooth function, and storing a device identifier and at least one UUID (user identifier) included in the received scanning result as first Bluetooth service information; when detecting that the first application program requests to inquire the Bluetooth service of the second electronic equipment, inquiring the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information according to the identifier of the second electronic equipment; each scanning result comprises an equipment identifier and at least one universal unique identifier UUID; each UUID is used to identify a bluetooth service supported by the electronic device identified by the device identification.
In one possible design, the first bluetooth service information is stored in the form of a database.
In one possible design, the code instructions further include: and the instruction is used for updating the first Bluetooth service information according to the scanning result sent by the electronic equipment when the scanning result sent by the electronic equipment is received again aiming at one electronic equipment in the at least one electronic equipment with the Bluetooth function.
In one possible design, when the electronic device with the bluetooth function is a classic bluetooth device, the scanning result is an extended acquired result; and/or when the electronic device with the Bluetooth function is a Bluetooth low energy device, the scanning result is a broadcast packet.
In one possible design, the code instructions further include: the instruction is used for sending a pairing request to the electronic equipment to be paired in the at least one electronic equipment with the Bluetooth function; the pairing request is sent to the electronic equipment to be paired, and the pairing request is sent to the electronic equipment to be paired; and the instruction is used for saving the identification of the electronic equipment to be paired and at least one UUID (user identifier) which are included in the pairing success response received by the communication interface as the second Bluetooth service information.
In one possible design, the second bluetooth service information is stored in the form of a profile.
In one possible design, the at least one memory includes a first memory for storing the first bluetooth service information and a second memory for storing the second bluetooth service information. The first memory and the second memory may be the same memory or different memories, and are not limited thereto.
In one possible design, the code instructions further include: when detecting that the first application program requests to inquire the Bluetooth service of the second electronic device, inquiring the Bluetooth service supported by the second electronic device from the second Bluetooth service information; and acquiring a union set of the Bluetooth service supported by the second electronic device inquired from the first Bluetooth service information and the Bluetooth service supported by the second electronic device inquired from the second Bluetooth service information to obtain the instruction of the Bluetooth service supported by the second electronic device.
In one possible design, the second electronic device is in a paired state with the first electronic device.
In one possible design, the code instructions further include: and when it is detected that the first application program requests to inquire about the bluetooth service of the third electronic device, if the third electronic device and the first electronic device are in an unpaired state or in a paired state, inquiring about the bluetooth service supported by the second electronic device from the first bluetooth service information according to the identifier of the third electronic device.
In one possible design, the first application is a third party application.
In one possible design, the code instructions further include: and when the system application request for inquiring the Bluetooth service of the second electronic equipment is detected, inquiring the Bluetooth service supported by the second electronic equipment from the second Bluetooth service information according to the identification of the second electronic equipment.
In one possible design, the code instructions further include: and instructions for sending an inquiry command of the bluetooth service to the second electronic device when the processor does not inquire the bluetooth service supported by the second electronic device from the first bluetooth service information or the first bluetooth service information and the second bluetooth service information. Or, the instruction is used for judging whether to send the inquiry command of the bluetooth service to the second electronic device through the communication interface according to the pairing state of the second electronic device and the first electronic device when the bluetooth service supported by the second electronic device is not inquired from the first bluetooth service information or the first bluetooth service information and the second bluetooth service information.
In a third aspect, an embodiment of the present application further provides a chip, where the interface is configured to receive a code instruction and transmit the received code instruction to the processor;
the processor is configured to execute the received code instruction sent by the interface, and execute:
receiving a scanning result sent by at least one electronic device with the Bluetooth function; each scanning result comprises an equipment identifier and at least one universal unique identifier UUID; each UUID is used for identifying a Bluetooth service supported by the electronic equipment identified by the equipment identification;
storing the device identification and at least one UUID included in the received scanning result as first Bluetooth service information;
and when a request that the first application program acquires the Bluetooth service of the second electronic equipment is received, inquiring the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information according to the identifier of the second electronic equipment.
In one possible design, the first bluetooth service information is stored in the form of a database.
In one possible design, the code instructions further include: and an instruction for updating the first bluetooth service information according to the scanning result sent by the electronic device when the scanning result sent by the electronic device is received again for one of the at least one electronic device with the bluetooth function.
In one possible design, when the electronic device with the bluetooth function is a classic bluetooth device, the scanning result is an extended acquired result; and/or when the electronic device with the Bluetooth function is a Bluetooth low energy device, the scanning result is a broadcast packet.
In one possible design, the code instructions further include: the instruction is used for sending a pairing request to the electronic equipment to be paired in the at least one electronic equipment with the Bluetooth function; the pairing request is sent to the electronic equipment to be paired, and the pairing request is sent to the electronic equipment to be paired; and storing the identifier of the electronic equipment to be paired and at least one UUID (UUID) which are included in the pairing success response received by the communication interface as the second Bluetooth service information.
In one possible design, the second bluetooth service information is stored in the form of a profile.
In one possible design, the at least one memory includes a first memory for storing the first bluetooth service information and a second memory for storing the second bluetooth service information. The first memory and the second memory may be the same memory or different memories, and are not limited thereto.
In one possible design, the code instructions further include: when a request that a first application program acquires Bluetooth services of a second electronic device is received, inquiring Bluetooth services supported by the second electronic device from the second Bluetooth service information; and acquiring a union set of the Bluetooth service supported by the second electronic device inquired from the first Bluetooth service information and the Bluetooth service supported by the second electronic device inquired from the second Bluetooth service information to obtain the Bluetooth service supported by the second electronic device.
In one possible design, the second electronic device is in a paired state with the first electronic device.
In one possible design, the code instructions further include: and when a request that a first application program acquires the bluetooth service of a third electronic device is received, if the third electronic device and the first electronic device are in an unpaired state or in a paired state, inquiring the bluetooth service supported by the second electronic device from the first bluetooth service information according to the identifier of the third electronic device.
In one possible design, the first application is a third party application.
In one possible design, the code instructions further include: and when a request that the system application acquires the Bluetooth service of the second electronic equipment is received, inquiring the Bluetooth service supported by the second electronic equipment from the second Bluetooth service information according to the identifier of the second electronic equipment.
In one possible design, the code instructions further include: and instructions for sending an inquiry command of the bluetooth service to the second electronic device when the processor does not inquire the bluetooth service supported by the second electronic device from the first bluetooth service information or the first bluetooth service information and the second bluetooth service information. Or, the instruction is configured to determine whether to send an inquiry command of the bluetooth service to the second electronic device through the communication interface according to a pairing state of the second electronic device and the first electronic device when the bluetooth service supported by the second electronic device is not inquired from the first bluetooth service information, or the first bluetooth service information and the second bluetooth service information.
In a fourth aspect, an embodiment of the present application further provides a computer storage medium, where the computer storage medium stores program instructions, and the program instructions, when executed on an electronic device, may implement the method provided by the first aspect or any one of the designs of the first aspect.
In addition, the technical effects brought by any one of the possible design manners in the second aspect to the fourth aspect can be referred to the technical effects brought by different design manners in the association of the method part, and are not described herein again.
Drawings
Fig. 1 is a schematic flowchart of a method for querying bluetooth services in the prior art;
fig. 2 is a diagram of a communication system architecture according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a user interface according to an embodiment of the present application;
FIG. 4 is a schematic view of another user interface of an embodiment of the present application;
FIG. 5 is a schematic diagram of an application scenario according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating a method for pre-storing Bluetooth services according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating a method for querying a Bluetooth service according to an embodiment of the present invention
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a chip according to an embodiment of the present application.
Detailed Description
It should be understood that "at least one" in the embodiments of the present application means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated object, and indicates that three relationships can exist. For example, a and/or B, may represent the following three relationships: a exists alone, A and B exist simultaneously, and B exists alone. Wherein A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b and c can be single or multiple.
The embodiment of the application can be applied to the electronic equipment supporting the Bluetooth function. The following describes an electronic deviceGraphical User Interfaces (GUIs) for such electronic devices, and embodiments for using such electronic devices. In some embodiments of the present application, the electronic device may be a portable electronic device, such as a mobile phone, a tablet computer, a wearable device with wireless communication function (e.g., a smart watch), an in-vehicle device, and the like. Exemplary embodiments of the portable electronic device include, but are not limited to, a mount
Figure GPA0000302558210000081
Or other operating system. The portable electronic device may also be a device such as a Laptop computer (Laptop) with a touch sensitive surface (e.g., a touch panel), etc. It should also be understood that in other embodiments of the present application, the electronic device may also be a desktop computer or the like having a touch-sensitive surface (e.g., a touch panel).
For example, as shown in fig. 2, a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application is shown. As shown, the electronic device 100 includes a processor 110, an internal memory 121, an external memory interface 122, an antenna 1, a mobile communication module 131, an antenna 2, a wireless communication module 132, an audio module 140, a speaker 140A, a receiver 140B, a microphone 140C, an earphone interface 140D, a display screen 151, a Subscriber Identification Module (SIM) card interface 152, a camera 153, keys 154, a sensor module 160, a Universal Serial Bus (USB) interface 170, a charging management module 180, a power management module 181, and a battery 182. In other embodiments, the electronic device 100 may also include motors, indicators, and the like.
The processor 110 may include an Application Processor (AP), a modem, a Graphic Processing Unit (GPU), an Image Signal Processor (ISP), a baseband processor, a video codec, a Digital Signal Processor (DSP), a neural Network Processor (NPU), and the like. The different processing units may be separate devices or may be integrated in one or more devices.
In some embodiments, a memory may also be provided in processor 110 for storing instructions and data. By way of example, the memory in the processor 110 may be a cache memory. The memory may be used to hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Thereby helping to avoid repeated accesses and reducing the latency of the processor 110, thereby increasing the efficiency of the system.
The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function and an image playing function) required by at least one function, and the like. The storage data area may store data (e.g., audio data, a phone book) created during use of the electronic device 100, and the like. The application processor may enable the electronic device 100 to implement various functions, data processing, and the like by calling programs such as an operating system stored in the storage program area. It is to be understood that the internal memory 121 may be a high speed random access memory, and may also be a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The external memory interface 122 may be used to connect an external memory card (e.g., a Micro SD card) to extend the memory capability of the electronic device 100.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
The mobile communication module 131 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 131 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 131 may receive the electromagnetic wave signal from the antenna 1, perform filtering, amplification, and other processing on the received electromagnetic wave signal, and transmit the electromagnetic wave signal to the modem for demodulation. The mobile communication module 131 can also amplify the signal modulated by the modem, and convert the signal into an electromagnetic wave signal through the antenna 1 to radiate the electromagnetic wave signal.
The modem may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 140A, the receiver 140B, etc.) or displays an image or video through the display screen 151.
The wireless communication module 132 may provide a solution for Bluetooth (BT) wireless communication applied to the electronic device 100. In addition, the wireless communication module 132 may also provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Network (WLAN) (e.g., wireless fidelity (WiFi) network), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 132 may be a chip or module that integrates at least one wireless communication technology including bluetooth. It should be noted that the chip or module for implementing the bluetooth wireless communication technology may be referred to as a bluetooth chip for short. In other embodiments, the bluetooth chip may also be integrated in the processor 110, or part of the functions of the bluetooth chip may also be integrated in the processor 110. The wireless communication module 132 receives the electromagnetic wave signal via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 132 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into an electromagnetic wave signal via the antenna 2 to radiate the signal.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 131 and antenna 2 is coupled to wireless communication module 132 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (TD-SCDMA), long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 may implement audio functions through the audio module 140, the speaker 140A, the receiver 140B, the microphone 140C, the headphone interface 140D, and the application processor, etc. Such as music playing, recording, etc.
The audio module 140 may be used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 140 may also be used to encode and decode audio signals. In some embodiments, the audio module 140 may be disposed in the processor 110, or some functional modules of the audio module 140 may be disposed in the processor 110.
The speaker 140A, also called a "horn", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or a hands-free call through the speaker 140A.
The receiver 140B, also called "earpiece", is used to convert the electrical audio signal into a sound signal. When the user answers the call using the electronic device 100, the user can listen to the voice received through the mobile communication module 131 or the wireless communication module 132 by placing the human ear close to the receiver 140B.
The microphone 140C, also known as a "microphone," is used to convert sound signals into electrical signals. When a user uses the electronic device 100 to make a call or send a voice, the user can speak by bringing his/her mouth close to the microphone 140C so that the microphone 140C can be used to pick up the user's voice, and then convert the user's voice into an electric signal. The electronic device 100 may be provided with at least one microphone 140C. In some embodiments, the electronic device 100 may be provided with two microphones 140C, which may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 140C for collecting sound signals, reducing noise, identifying sound sources, implementing directional recording functions, and the like.
The headphone interface 140D is used to connect wired headphones. The headset interface 140D may be a USB interface 170, or may be a 3.5mm open mobile electronic device 100 platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface, or the like.
The electronic device 100 may implement a display function through the GPU, the display screen 151, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 151 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute code instructions to generate or change display information.
The display screen 151 may be used to display images, videos, and the like. The display screen 151 may include a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 151, N being a positive integer greater than 1.
The electronic apparatus 100 may implement a photographing function through the ISP, the camera 153, the video codec, the GPU, the display screen 151, and the application processor, etc.
The keys 154 may include a power-on key, a volume key, and the like. The keys 154 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The sensor module 160 may include one or more sensors. For example, the touch sensor 160A, the fingerprint sensor 160B, the gyro sensor 160C, the pressure sensor 160D, the acceleration sensor 160E, and the like. In some embodiments, the sensor module 160 may also include environmental sensors, distance sensors, proximity light sensors, bone conduction sensors, and the like.
The touch sensor 160A may be disposed on the display screen 151, and the touch sensor 160A and the display screen 151 form a touch screen, which is also called a "touch screen". The touch sensor 160A is used to detect a touch operation applied thereto or therearound. Touch sensor 160A may pass the detected touch operation to an application processor to determine the touch event type. Visual output related to the touch operation may be provided through the display screen 151. In other embodiments, the touch sensor 160A may be disposed on the surface of the electronic device 100, different from the position of the display screen 151.
The fingerprint sensor 160B may be used to capture a fingerprint. The electronic device 100 may utilize the collected fingerprint characteristics to implement fingerprint unlocking, access to an application lock, fingerprint photographing, fingerprint answering, and the like.
The gyro sensor 160C may be used to determine a motion gesture of the electronic device 100, capture anti-shake, navigate, feel a game scene, and the like.
The pressure sensor 160D is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 160D may be disposed on the display screen 151. The pressure sensor 160D may be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like.
The acceleration sensor 160E can detect the magnitude of the terminal acceleration in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment 100 and applied to horizontal and vertical screen switching, pedometers and other applications.
In other embodiments, processor 110 may also include one or more interfaces. For example, the interface may be a SIM card interface 152. Also for example, the interface may be a USB interface 170. For example, the interface may also be an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, and the like. It is understood that the processor 110 may interface with different modules of the electronic device 100 according to the embodiment of the present application, so that the electronic device 100 can implement different functions. Such as taking a picture, processing, etc. In addition, the connection mode of the interface in the electronic device 100 is not limited in the embodiment of the present application.
The SIM card interface 152 may be used to connect a SIM card, among other things. The SIM card can be brought into and out of contact with the electronic device 100 by being inserted into the SIM card interface 152 or being pulled out of the SIM card interface 152. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 152 may support a Nano SIM card, a Micro SIM card, a SIM card, or the like. Multiple cards can be inserted into the same SIM card interface 152 at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 152 may also be compatible with different types of SIM cards. The SIM card interface 152 may also be compatible with an external memory card. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 may also employ esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100. For example, when only one SIM card can be inserted into the SIM card interface 152, the electronic device 100 can access a cellular network through the SIM card inserted into the SIM card interface 152. For another example, when the SIM card interface 152 is capable of inserting two SIM cards, the electronic device 100 can access a cellular network through the two SIM cards inserted in the SIM card interface 152 respectively.
The USB interface 170 is an interface conforming to the USB standard specification. For example, the USB interface 170 may include a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 170 may be used to connect a charger to charge the electronic device 100, to transmit data between the electronic device 100 and a peripheral device, or to connect an earphone to play audio through the earphone.
The charge management module 180 is configured to receive a charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 180 may receive charging input from a wired charger via the USB interface 170. In some wireless charging embodiments, the charging management module 180 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 180 may also supply power to the electronic device 100 through the power management module 181 while charging the battery 182.
The power management module 181 is used to connect the battery 182, the charging management module 180 and the processor 110. The power management module 181 receives an input of the battery 182 and/or the charging management module 180, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 151, the camera 153, the mobile communication module 131, the wireless communication module 132, and the like. The power management module 181 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), and the like. In some other embodiments, the power management module 181 may also be disposed in the processor 110. In other embodiments, the power management module 181 and the charging management module 180 may be disposed in the same device.
It should be understood that the hardware configuration of the electronic device 100 shown in fig. 2 is only one example. The electronic devices of embodiments of the application may have more or fewer components than shown in the figures, may combine two or more components, or may have different configurations of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes an embodiment of the present application in detail, taking the hardware configuration of the electronic device 100 shown in fig. 2 as an example.
It should be understood that the electronic device 100 in the embodiment of the present application generally provides various functions for the user through the application program. By way of example, the application program may be a system application (also referred to as a native application) or may be a third party application. Such as drawing, presentation, word processing, gaming, telephony, video player, music player, email, instant messaging, photo management, camera, browser, calendar, clock, payment, application marketplace, desktop, and health management applications. For example, the electronic device 100 in the embodiment of the present application may run a plurality of applications simultaneously.
Illustratively, fig. 3a is a schematic diagram of a graphical user interface according to an embodiment of the present application. The graphical user interface is referred to below simply as the user interface. The electronic device 100 displays a user interface through the display screen 151. Specifically, the user interface may be a main interface, a negative screen, or a user interface of an application. For example, the main interface may be the user interface 300 shown in FIG. 3 a. As shown, the user interface 300 may include a status bar 301, a time and weather Widget302, a concealable navigation bar 303, and icons for multiple applications, such as a settings icon 304. The status bar 301 may include the name of the operator (china mobile), the mobile network (e.g. 4G), the time and the remaining power. In some other embodiments of the present application, the status bar 301 may include the name of the operator (china mobile), the signal strength of the mobile network, the time and the remaining power. In other embodiments of the present application, the status bar 301 may further include one or more of a bluetooth icon, a WiFi icon, a screen lock icon, an add-on icon, and the like. For example, taking the bluetooth icon as an example, in the embodiment of the present application, the electronic device 100 may display the bluetooth icon in the status bar 301 after the bluetooth function is turned on, and may not display the bluetooth icon in the status bar 301 after the bluetooth function is turned off. The navigation bar 303 may include a back button (back button), a home screen button (home button), and a history task view button (menu button). It will also be appreciated that in other embodiments, the user interface 300 may also include a Dock bar. Icons of common applications, such as a telephone icon, a short message icon, a mail icon, a weather icon and the like, can be included in the Dock bar. It should be understood that the user can set icons of common applications in the Dock bar according to the requirement of the user.
In other embodiments, as shown in fig. 3a, electronic device 100 may also include a home screen key 305. The home screen key 305 may be a physical key or a virtual key. The home screen key 305 is used to return a user interface of an application or a user interface such as a minus screen displayed on the display screen 151 to the home interface according to a user operation, so that the user can conveniently view the home interface at any time and operate a control (e.g., an icon) on the home interface. The operation may be specifically the user pressing the home screen key 305. In some other embodiments of the present application, the home screen key 305 may further integrate the fingerprint sensor 160B, so that the user can perform fingerprint collection by the electronic device 100 when pressing the home screen key 305, and then confirm the user identity. In other embodiments, electronic device 100 may not include home screen key 305.
For example, when the user interface 300 is displayed on the display screen 151, the electronic apparatus 100 may display a system setting interface on the display screen 151 in response to a touch operation of the user on the setting icon 304. The system setting interface includes various function buttons for performing corresponding settings on the electronic device 100. For example, the system setup interface may be a user interface 310 as shown in fig. 3b, including a bluetooth button 311. In addition, the user interface 310 may further include function buttons for account login, cloud backup opening, screen locking, and the like. The electronic apparatus 100 may display a bluetooth setting interface on the display screen 151 in response to the user's operation of the bluetooth button 311. Wherein, the bluetooth setting interface is used for opening or closing the bluetooth function. For example, when the electronic device 100 is not turned on, the bluetooth setup interface may be the user interface 320 shown in fig. 3 c. As shown in fig. 3c, the user interface 320 includes a bluetooth button 321, and the bluetooth button 321 is in an OFF state. When the bluetooth button 321 is in the off state, the bluetooth function of the electronic device 100 is not turned on. The electronic apparatus 100 may turn ON the bluetooth function by turning ON (ON) the bluetooth button 321 in response to the user's operation of the bluetooth button 321. Furthermore, in other embodiments, the electronic device 100 may further display a shortcut setting user interface on the display screen 151 in response to a pull-down operation or a pull-up operation of a user when the display screen 151 displays a certain user interface (e.g., the user interface 300) after being locked or unlocked. Specifically, the shortcut setting interface includes a shortcut button for setting various functions, such as a shortcut button for turning on or off a bluetooth function. For example, the quick setup user interface may be the user interface 400 shown in FIG. 4. A bluetooth button 401 is included on the user interface 400. The electronic device 100 may turn the bluetooth function on or off in response to the user's operation of the bluetooth button 401. For example, the electronic apparatus 100 may turn on the bluetooth function in response to the user's operation of the bluetooth button 401 when the bluetooth function is not turned on. For another example, when the bluetooth function is turned on, the electronic device 100 may turn off the bluetooth function in response to the user's operation of the bluetooth button 401. In addition, in some embodiments, the user interface 400 may further include functional buttons such as WiFi, personal hotspot, flight mode, do-not-disturb, ring, move data, brightness adjustment, and so on, so that the user may quickly set the corresponding function. It should be noted that, in the embodiment of the present application, the electronic device 100 may also turn on or turn off the bluetooth function by other manners, such as a voice command, a shortcut gesture operation, and the like, which is not limited thereto.
It should be understood that, after the bluetooth function is turned on, the electronic device 100 may be scanned and found by an electronic device that has the bluetooth function nearby as a slave (slave), or may be scanned and found by an electronic device that has the bluetooth function nearby as a master (master). For example, as shown in fig. 5, if the electronic device 100 and the electronic device 200 both have bluetooth functions turned on and the electronic device 200 is located near the electronic device 100, the electronic device 100 and the electronic device 200 may scan each other for discovery, so that a bluetooth connection may be established.
A process of establishing a bluetooth connection between the electronic device 100 and the electronic device 200 will be described below by taking the electronic device 100 as a master device and the electronic device 200 as a slave device as an example.
After the bluetooth function is turned on, the electronic device 100 performs a device scanning process to find nearby electronic devices with the bluetooth function turned on. In addition, after the electronic device 100 has the bluetooth function turned on, the user interface 320 displayed on the display screen 151 may include a prompt, a list of available devices, etc. that the electronic device 100 is currently discoverable by nearby bluetooth devices. Wherein, the available device list includes at least one device identifier, each device identifier is used to identify an electronic device which is scanned and found by the electronic device 100 and has bluetooth function turned on nearby, thereby being helpful for prompting the user. In some embodiments, the device identification may include one or more of a device name, a device type, or a Media Access Control (MAC) address, among others. For example, device types may include cell phones, bluetooth headsets, bluetooth mice, tablets, laptops, desktops, display screens, bluetooth keyboards, bluetooth printers, bluetooth facsimile machines, and so forth. The device type may be presented to the user in the list of available devices 322 in graphical or textual form, or the like. In addition, it should be noted that, in the embodiment of the present application, the name of the device may be a model of the device, or may be set by a user, which is not limited herein. For example, if the electronic device 100 scans and discovers an electronic device a, an electronic device 200 and an electronic device b, where the identifier of the electronic device a is Sql, the identifier of the electronic device 200 is 200, and the identifier of the electronic device b is Watch, the user interface 320 displayed by the electronic device 100 may include Sql, 200 and Watch as shown in fig. 3d, and the available device list 322 includes Sql, 200 and Watch. Wherein the available devices list 322 can be updated according to the electronic devices scanned and discovered by the electronic device 100.
In some embodiments, electronic device 100 may perform the device scanning process in the following manner:
the method I comprises the following steps: after the electronic device 100 as a master device starts the bluetooth function, it broadcasts a scan request, and an electronic device (e.g., the electronic device 200) with a nearby bluetooth function started may receive the scan request and send a scan response to the electronic device 100 as a slave device, so that the electronic device 100 discovers the electronic device with a nearby bluetooth function started.
The second method comprises the following steps: the electronic apparatus 100 as a master may receive a broadcast message of a nearby electronic apparatus (slave) having a bluetooth function activated after the bluetooth function is activated, without transmitting a scan request. The nearby electronic equipment with the Bluetooth function can periodically broadcast messages, and scanning and discovering of other electronic equipment with the Bluetooth function are facilitated. For example, the electronic device 100 receives a broadcast message of the electronic device 200 after turning on the bluetooth function, and thereby scans for the electronic device 200.
It should be noted that, after the electronic device 200 is found by scanning, the electronic device 100 establishes a physical link with the electronic device 200.
In this embodiment of the application, after the electronic device 100 scans and discovers the electronic device 200, a device pairing process is executed to pair with the electronic device 200. Specifically, the electronic device 100 may send a pairing request to the electronic device 200 after scanning and discovering the electronic device 200, and after receiving the pairing request of the electronic device 100, the electronic device 200 performs device authentication on the electronic device 100, and after the device authentication is passed, sends a pairing success response to the electronic device 100, so that the electronic device 100 establishes a logical link control and adaptation protocol (L2 CAP) channel with the electronic device 200. For example, if the electronic device 100 has not established a bluetooth connection with the electronic device 200, the pairing request may be sent to the electronic device 200 in response to the user selecting the identification of the electronic device 200 from the list of available devices. For another example, if the electronic device 100 establishes a bluetooth connection with the electronic device 200, the pairing request may be automatically sent to the electronic device 200 after the electronic device 200 is found by scanning. In addition, in the embodiment of the present application, the electronic device 100 may be triggered to send the pairing request to the electronic device 200 by other means, which is not limited to this.
It should be noted that, in this embodiment of the application, the electronic device 100 may stop the device scanning process in response to an operation of triggering to send a pairing request to the electronic device 200, or may continuously execute the device scanning process after the bluetooth function is turned on by the electronic device 100 until the device scanning process is not executed any more after the bluetooth function is turned off by the electronic device 100.
It should be noted that, in this embodiment of the application, after the electronic device 100 and the electronic device 200 are paired, it is also necessary to query the bluetooth service supported by the electronic device 200, so that the electronic device 100 and the electronic device 200 can complete the establishment of the bluetooth connection. It should be understood that the bluetooth services supported by different types of electronic devices in the embodiment of the present application may be the same or different. For example, for a bluetooth headset, the supported bluetooth services may include A2DP, HFP, and audio/video remote control profile (AVRCP), a headset application model (HSP), and the like.
In some embodiments, the electronic device 100 performs Service Discovery Protocol (SDP) interaction with the electronic device 200, so that the electronic device 100 may directly send an inquiry command of a bluetooth service to a bluetooth chip of the electronic device 200 through its own bluetooth chip to obtain a service UUID list of the electronic device 200. In view of the above, the embodiment of the present application provides an inquiry method of a bluetooth service, which can enable an application installed in the electronic device 100 to inquire about bluetooth services supported by a certain electronic device from pre-stored bluetooth service information supported by the electronic device in the electronic device 100 when an application requests to inquire about bluetooth services supported by the certain electronic device by using information of the bluetooth services supported by the electronic device pre-stored in the electronic device 100, thereby helping to reduce the number of times of directly inquiring about bluetooth services from an opposite-end electronic device, and also helping to improve the efficiency of bluetooth service inquiry to a certain extent.
For example, as shown in fig. 6, a method for pre-storing information of a bluetooth service of an electronic device according to an embodiment of the present application includes the following steps.
Step 601, after the electronic device 100 starts the bluetooth function, receiving at least one scanning result, where each scanning result is sent by an electronic device that starts the bluetooth function near the electronic device 100, and the scanning result includes information of the bluetooth service supported by the electronic device. Illustratively, the information of the bluetooth service supported by the electronic device includes a device identification, and at least one UUID. Specifically, the device identifier is information for identifying the electronic device, such as one or more of a device type, a device name, a Media Access Control (MAC) address, and the like.
Taking the scan result sent by the electronic device 200 received by the electronic device 100 as an example, the scan result sent by the electronic device 200 includes bluetooth service information supported by the electronic device 200, such as an identifier of the electronic device 200 and at least one UUID supported by the electronic device 200. It should be understood that when the electronic device 100 receives the scanning result sent by the electronic device 200, the electronic device 100 scans to find the electronic device 200, and the identification of the electronic device 200 may be added to the list of available devices for presentation to the user.
It should be noted that, in the embodiment of the present application, the scanning result may be a message that is already in the device scanning process, for example, a scanning response, a broadcast message, and the like. For example, the implementation form of the scanning result may be different for different electronic devices. For example, for a classic bluetooth (BR/EDR) device, the scan Result may be an Extended requirement Result (Extended Inquiry Result), and for a Bluetooth Low Energy (BLE) device, the scan Result may be a broadcast packet. In addition, the scan result may also be a newly defined message.
Take the structure of the electronic device 100 shown in fig. 2 as an example. Specifically, the processor 110 (e.g., an application processor) detects that the bluetooth function is turned on, and sends a device scan command to the wireless communication module 132 (e.g., a bluetooth chip), and after receiving the device scan command, the wireless communication module 132 receives a scan result sent from at least one electronic device nearby. For example, the wireless communication module 132 may broadcast a scan request after receiving the device scan command. Some of the at least one electronic device in the vicinity may transmit the scan result to the wireless communication module 132 in response to receiving the scan request. After the Bluetooth function is started, part of electronic equipment in at least one piece of nearby electronic equipment can directly broadcast the scanning result without receiving a scanning request. In some embodiments, at least one electronic device in the vicinity may periodically broadcast the scan results after bluetooth functionality is turned on. The period of broadcasting the scanning result can be set according to actual conditions. Thereby facilitating scanning discovery by other bluetooth enabled electronic devices.
In step 602, the electronic device 100 obtains and stores information of the bluetooth service supported by at least one electronic device from at least one scan result. The information of the bluetooth service supported by the at least one electronic device may be stored in a form of a database, for example, the information of the bluetooth service supported by the at least one electronic device is stored as a database uuid.
Take the structure of the electronic device 100 shown in fig. 2 as an example. Specifically, after receiving the at least one scanning result, the wireless communication module 132 obtains information of the bluetooth service supported by the at least one electronic device from the at least one scanning result, and stores the information of the bluetooth service supported by the at least one electronic device in a corresponding storage form in a corresponding memory. For example, the wireless communication module 132 may store information of a bluetooth service supported by at least one electronic device in one or more of the internal memory 121, an external memory connected to the external memory interface 122, a memory provided in a functional module such as the processor 110 or the wireless communication module 132, and the like.
For example, the electronic device 100 receives a scan result 1, a scan result 2, and a scan result 3, where the scan result 1 includes information of bluetooth services supported by the electronic device a, such as device identifiers a, UUID1, and UUID2, the scan result 2 includes information of bluetooth services supported by the electronic device 200, such as device identifiers b and UUID3, and the scan result 3 includes information of bluetooth services supported by the electronic device c, such as device identifiers c and UUID2. If the UUID1, the UUID2, and the UUID3 are respectively used to indicate a bluetooth service, the information of the bluetooth service supported by at least one electronic device, which is obtained and stored by the electronic device 100 from the scanning result 1, the scanning result 2, and the scanning result 3, may be as shown in table 1.
TABLE 1
Figure GPA0000302558210000151
Taking table 1 as an example, when the electronic device 100 receives the scan result sent by the electronic device 200 again, the electronic device may update the information of the bluetooth services supported by the electronic device 200 in the stored information of the bluetooth services supported by at least one electronic device according to the scan result sent by the electronic device 200 received again. For example, if the scan result sent by the electronic device 200 and received again by the electronic device 100 includes the device identifier b, the UUID1, the UUID3, and the UUID4, the information of the bluetooth service supported by the electronic device as shown in table 1 may be updated by adding the UUID1 and the UUID4 to the service UUID list 2. The updated information of the bluetooth service supported by the electronic device may be as shown in table 2.
TABLE 2
Figure GPA0000302558210000161
For another example, after saving the information of the bluetooth service supported by the electronic device shown in table 1, the electronic device 100 may update the saved information of the bluetooth service supported by the electronic device according to the scan result sent by the electronic device d when receiving the scan result sent by the electronic device d. For example, if the scan result sent by the electronic device d includes the device identifier 4, the UUID1, and the UUID4, the information of the bluetooth service supported by the electronic device d may be added to the information of the bluetooth service supported by the electronic device as shown in table 1. The updated information of the bluetooth service supported by the electronic device may be as shown in table 3.
TABLE 3
Figure GPA0000302558210000162
Step 603, the electronic device 100 sends a pairing request to one or more electronic devices of the at least one scanned and discovered electronic device, where a manner in which the electronic device 100 triggers sending of the pairing request to one or more electronic devices of the at least one scanned and discovered electronic device may refer to a manner in which the electronic device 100 triggers sending of the pairing request to the electronic device 200 in the foregoing embodiment, which is not described herein again.
Step 604, after receiving the pairing request sent by the electronic device 100, one or more electronic devices of the at least one electronic device found by scanning authenticate the electronic device 100, and after the authentication passes, send a pairing success response to the electronic device 100. And the pairing success response comprises information of the Bluetooth service supported by the electronic equipment. For example, the information of the bluetooth service supported by the electronic device includes a device identification, and at least one UUID.
Step 605, after receiving the at least one pairing success response, the electronic device 100 acquires and stores information of the bluetooth service supported by the at least one electronic device from the at least one pairing success response.
The configuration of the electronic apparatus 100 shown in fig. 2 is taken as an example, and the electronic apparatus 100 is paired with the electronic apparatus 200. Specifically, the processor 110 sends a pairing notification with the electronic device 200 to the wireless communication module 132 in response to an operation of triggering pairing with the electronic device 200, and the wireless communication module 132 sends a pairing request to the electronic device 200 after receiving the pairing notification with the electronic device 200. After receiving the pairing request, the electronic device 200 authenticates the electronic device 100, and after the authentication is passed, sends a pairing success response to the electronic device 100. The pairing success response includes information of at least one bluetooth service supported by the electronic device 200. For example, the pairing success response includes the identification of the electronic device 200 and at least one UUID. Each UUID is used to identify a bluetooth service supported by the electronic device 200. After receiving the pairing success response, the wireless communication module 132 obtains information of at least one bluetooth service supported by the electronic device 200 from the pairing success response, and stores the information in a corresponding storage form into a corresponding memory. For example, the electronic apparatus 100 may store the information of the at least one bluetooth service supported by the electronic apparatus 200 acquired from the pairing success response in the form of a configuration file (e.g., bt _ config.conf) in one or more of the internal memory 121, the external memory connected to the external memory interface 122, the processor 110, or a memory provided in the wireless communication module 132.
It should be understood that, after the electronic device 100 is successfully paired with the electronic device 200 for the first time, the information of the bluetooth service supported by the electronic device 200 is stored in the electronic device 100, and when the electronic device 200 is paired with the electronic device 100 again, after receiving a pairing success response sent by the electronic device 200, the information of the bluetooth service supported by the electronic device 200 may not be obtained from the pairing success response any more, the information of the bluetooth service supported by the electronic device 200 may also be continuously obtained from the pairing success response, and the stored information of the bluetooth service supported by the electronic device 200 may be updated according to the obtained information of the bluetooth service supported by the electronic device 200.
For example, after the electronic device 100 and the electronic device 200 are successfully paired for the first time, the stored information of the bluetooth service supported by the electronic device 200 is shown in table 4. The device identifier b is an identifier of the electronic device 200, and the UUID1, the UUID2, and the UUID3 are respectively used for indicating a bluetooth service supported by the electronic device 200.
TABLE 4
Figure GPA0000302558210000171
When the electronic device 100 is paired with the electronic device 200 again, a pairing success response sent by the electronic device 200 is received, and if the pairing success response still includes the device identifier b, the UUID1, the UUID2, and the UUID3, the stored information of the bluetooth service supported by the electronic device 200 is not updated. If the pairing success response further includes the device identifier b, the UUID1, the UUID2, and the UUID4, the stored information of the bluetooth service supported by the electronic device 200 is updated, specifically, the UUID4 is added to the stored information of the bluetooth service supported by the electronic device 200, and the updated information of the bluetooth service supported by the electronic device 200 may be as shown in table 5.
TABLE 5
Figure GPA0000302558210000172
It should be noted that the method for pre-storing the information of the bluetooth service of the electronic device shown in fig. 6 is only an example, and in this embodiment, the electronic device 100 may further only store the information of the bluetooth service supported by the electronic device included in the scanning result, and does not store the information of the bluetooth service supported by the electronic device included in the pairing success response; alternatively, the electronic device 100 may not store the information of the bluetooth service supported by the electronic device included in the scan result, and may only store the information of the bluetooth service supported by the electronic device included in the pairing success response.
Further, in the embodiment of the present application, when saving both the information of the bluetooth service supported by the electronic device included in the scan result and the information of the bluetooth service supported by the electronic device included in the pairing success response, the electronic device 100 may save together the information of the bluetooth service supported by the electronic device included in the scan result and the information of the bluetooth service supported by the electronic device included in the pairing success response. It should be understood that, when the information of the bluetooth service supported by the electronic device included in the scan result and the information of the bluetooth service supported by the electronic device included in the pairing success response are stored together, the information of the bluetooth service supported by the electronic device included in the scan result and the information of the bluetooth service supported by the electronic device included in the pairing success response are stored in the same location and in the same form.
Taking the electronic device 200 as an example, the electronic device 100 receives a scanning result sent by the electronic device 200, where the scanning result includes the device identifier b, the UUID1, and the UUID2. The electronic apparatus 100 stores information of the bluetooth service supported by the electronic apparatus 200 according to the scanning result as shown in table 6.
TABLE 6
Figure GPA0000302558210000181
For example, the electronic device 100 receives a pairing success response of the electronic device 200, where the pairing success response includes the device identifier b, the UUID1, the UUID2, the UUID3, and the UUID4, and then the electronic device 100 updates the information of the bluetooth service supported by the electronic device 200 shown in table 6 according to the pairing success response of the electronic device 200, and the updated information of the bluetooth service supported by the electronic device 200 is shown in table 7.
TABLE 7
Figure GPA0000302558210000182
In other embodiments of the present application, when the electronic device 100 stores both the information of the bluetooth service supported by the electronic device included in the scan result and the information of the bluetooth service supported by the electronic device included in the pairing success response, the electronic device 100 may separately store the information of the bluetooth service supported by the electronic device included in the scan result and the information of the bluetooth service supported by the electronic device included in the pairing success response. For example, taking the electronic device 200 as an example, the electronic device 100 receives a scanning result sent by the electronic device 200, where the scanning result includes the device identifier b, the UUID1, and the UUID2. The electronic device 100 stores information of the bluetooth service supported by the electronic device 200 according to the scan result as shown in table 8.
TABLE 8
Figure GPA0000302558210000183
For example, if the electronic device 100 receives a pairing success response of the electronic device 200, and the pairing success response includes the device identifier b, the UUID1, the UUID2, the UUID3, and the UUID4, the electronic device 100 stores information of the bluetooth service supported by the electronic device 200 according to the pairing success response, as shown in table 9.
TABLE 9
Figure GPA0000302558210000191
For example, the information of the bluetooth service supported by the electronic device 200 shown in table 8 may be stored in the memory 1 in a first storage form, and the information of the bluetooth service supported by the electronic device 200 shown in table 9 may be stored in the memory 2 in a second storage form. The first storage form and the second storage form may be different, for example, the first storage form may be a database, the second storage form may be a configuration file, and the first storage form and the second storage form may also be the same. The memory 1 and the memory 2 may be the same or different.
In some other embodiments, the information of the bluetooth service supported by the electronic device, which is stored in the electronic device 100 in advance, may also be stored before the electronic device 100 leaves the factory. For example, the information of the bluetooth service supported by the electronic device, which is pre-stored in the electronic device 100, may include a device type and at least one UUID corresponding to the device type. For example, information of the bluetooth service supported by the electronic device, which is stored in advance in the electronic device 100, may be as shown in table 10.
TABLE 10
Figure GPA0000302558210000192
Based on the method for storing the bluetooth service supported by the electronic device 100, an embodiment of the present application provides an inquiry method for the bluetooth service. For example, as shown in fig. 7, a flowchart of an inquiry method for a bluetooth service provided in an embodiment of the present application is illustrated. Comprises the following steps.
In step 701, the electronic device 100 detects that the first application requests to obtain the bluetooth service of the electronic device 200.
In step 702, the electronic device 100 queries the bluetooth service supported by the electronic device 200 from the pre-stored information of the bluetooth service supported by the electronic device according to the identifier of the electronic device 200.
It should be noted that, in some embodiments, the first application may be a system application (e.g., system settings, etc.), and may be a third-party application (e.g., weChat, youke video, etc.), which is not limited thereto. In other embodiments, the first application is a third party application. When the system application requests to acquire the bluetooth service of the electronic device 200, the electronic device 100 may acquire the bluetooth service in a manner of querying the bluetooth service in the prior art.
Take the structure of the electronic device 100 shown in fig. 2 as an example. Specifically, when the processor 110 (e.g., an application processor) detects that the first application requests to acquire the bluetooth service of the electronic device 200, the processor may call an interface of the first application and send a request for acquiring the bluetooth service of the electronic device 200 to the wireless communication module 132 (e.g., a bluetooth chip). The wireless communication module 132 receives a request for acquiring the bluetooth service of the electronic device 200 from the processor 110 through the interface of the first application, acquires the bluetooth service of the electronic device 200 from the information of the bluetooth service supported by the electronic device, which is pre-stored in the corresponding memory, according to the identifier of the electronic device 200, and returns the acquired bluetooth service of the electronic device 200 to the processor 110 through the interface of the first application.
However, since the electronic device 200 and the electronic device 100 may be paired, paired or unpaired when the first application requests to query the bluetooth service of the electronic device 200, in some specific embodiments, the electronic device 100 may detect the pairing status of the electronic device 200 and the electronic device 100 after detecting that the first application requests to acquire the bluetooth service of the electronic device 200. When the electronic device 200 and the electronic device 100 are in the paired state, step 702 is executed, and when the electronic device 200 and the electronic device 100 are in the pairing state, step 702 may be executed after the electronic device 200 and the electronic device 100 are successfully paired. When the electronic device 200 is in an unpaired state with the electronic device 100, the step of querying the bluetooth service supported by the electronic device 200 may not be performed any more, thereby contributing to reduction of signaling processing of the electronic device 100.
For example, after receiving the request for acquiring the bluetooth service of the electronic device 200 sent by the processor 110 through the interface of the first application, the wireless communication module 132 may first detect a pairing status of the electronic device 100 and the electronic device 200, and then determine whether to perform the step of querying the bluetooth service supported by the electronic device 200 according to the pairing status of the electronic device 100 and the electronic device 200.
In other embodiments, the electronic apparatus 100 may transmit an inquiry command of the bluetooth service to the electronic apparatus 200 when the bluetooth service of the electronic apparatus 200 is not acquired from the information of the bluetooth service supported by the electronic apparatus previously stored in the corresponding memory. Thereby helping to increase the likelihood of success of the electronic device 100 in acquiring bluetooth services supported by the electronic device 200. It should be noted that the inquiry command of the bluetooth service sent by the electronic apparatus 100 to the electronic apparatus 200 may be an SDP command.
For example, when the bluetooth service of the electronic device 200 is not acquired from the information of the bluetooth service supported by the electronic device, which is pre-stored in the corresponding memory, the wireless communication module 132 may directly send an inquiry command of the bluetooth service to the electronic device 200, or may send a notification of an inquiry failure to the processor 110 through the interface of the first application, and the processor 110 determines whether to send the inquiry command of the bluetooth service to the electronic device 200 through the wireless communication module 132. Specifically, the policy for the processor 110 to determine whether the wireless communication module 132 sends the bluetooth query command to the electronic device 200 according to the embodiment of the present application may be set according to actual needs.
In particular, in the case that the electronic device 100 adopts the method shown in fig. 6 to store the information of the bluetooth service supported by the electronic device in advance, and the scan result and the information of the bluetooth service supported by the electronic device included in the pairing success response are stored separately, the electronic device 100 may also query the bluetooth service of the electronic device 200 in other ways when specifically implementing.
In the following, the detailed description will be given of the case where the electronic device 100 stores information of the bluetooth service supported by at least one electronic device as uuid.db in step 602, and the electronic device 100 stores information of the bluetooth service supported by the electronic device as bt _ config.conf file in step 605.
In some embodiments, the electronic apparatus 100 detects that the first application requests acquisition of the bluetooth service of the electronic apparatus 200, and determines whether to query the bluetooth service supported by the electronic apparatus 200 from uuid.d or bt _ config.conf according to the pairing state of the electronic apparatus 200 and the electronic apparatus 100.
The first application program may be a system application or a third-party application, which is not limited to this. In addition, in this embodiment of the application, when it is detected that the first application program requests to acquire the bluetooth service of the electronic device 200, if the first application program is a third-party application, the electronic device 100 may determine whether to query the bluetooth service supported by the electronic device 200 from uuid.d or bt _ config.conf according to the pairing state of the electronic device 200 and the electronic device 100. In some embodiments, when the electronic device 100 detects that the first application requests to acquire the bluetooth service of the electronic device 200, if the first application is a system application, the bluetooth service supported by the electronic device 200 may be directly queried from bt _ config.conf.
The following describes in detail whether the electronic apparatus 100 determines to inquire about the bluetooth service supported by the electronic apparatus 200 from uuid.d or bt _ config.conf according to the pairing state in which the electronic apparatus 200 and the electronic apparatus 100 are in.
For example, when the electronic apparatus 200 and the electronic apparatus 100 are in the paired state, the electronic apparatus 100 may query the bluetooth service supported by the electronic apparatus 200 from uuid.db and query the bluetooth service supported by the electronic apparatus 200 from bt _ config.conf, and obtain the bluetooth service supported by the electronic apparatus 200 by taking the bluetooth service supported by the electronic apparatus 200 respectively queried from uuid.db and the bluetooth service supported by the electronic apparatus 200 from bt _ config.conf.
Take the hardware structure of the electronic device 100 shown in fig. 2 as an example. Specifically, when the electronic device 200 and the electronic device 100 are in the paired state, the wireless communication module 132 may query the bluetooth service supported by the electronic device 200 from uuid.db and query the bluetooth service supported by the electronic device 200 from bt _ config.conf, and merge the bluetooth service supported by the electronic device 200 respectively queried from uuid.db and the bluetooth service supported by the electronic device 200 from bt _ config.conf, and then return the merged bluetooth service supported by the electronic device 200 to the processor 110. For example, the wireless communication module 132 may return the collected bluetooth services supported by the electronic device 200 to the processor 110 through an interface of the first application program, or the wireless communication module 132 may broadcast the collected bluetooth services supported by the electronic device 200 through an event, and the processor 110 calls the interface of the first application program to monitor the event broadcast to receive the bluetooth services supported by the electronic device 200 after collection.
For another example, the electronic device 100 may query the bluetooth service supported by the electronic device 200 from uuid.db when the electronic device 200 is in an unpaired state with the electronic device 100.
Take the hardware structure of the electronic device 100 shown in fig. 2 as an example. Specifically, the wireless communication module 132 may query the bluetooth service supported by the electronic device 200 from uuid.db when the electronic device 200 is in the unpaired state with the electronic device 100, and then return the queried bluetooth service supported by the electronic device 200 to the processor 110 through the interface of the first application. In some embodiments, when the electronic device 200 is in the unpaired state with the electronic device 100, the bluetooth service supported by the electronic device 200 is not queried from the uuid.db, and then a notification of the failure to query is returned to the processor 110 through the interface of the first application.
For another example, the electronic apparatus 100 may query the bluetooth service supported by the electronic apparatus 200 from uuid.db when the electronic apparatus 200 and the electronic apparatus 100 are in the pairing state.
Take the hardware structure of the electronic device 100 shown in fig. 2 as an example. Specifically, the wireless communication module 132 may query the bluetooth service supported by the electronic device 200 from uuid.db when the electronic device 200 and the electronic device 100 are in the pairing state, and then return the queried bluetooth service supported by the electronic device 200 to the processor 110 through the interface of the first application. In other embodiments, the wireless communication module 132 returns to the processor 110 through the interface of the first application that the electronic device 200 and the electronic device 100 are in the pairing state when the electronic device 200 and the electronic device 100 are in the pairing state and the bluetooth service supported by the electronic device 200 is not queried from uuid. After receiving the pairing status of the electronic device 200 and the electronic device 100 through the interface of the first application program, the processor 110 determines that the pairing status is busy mode, and after the pairing between the electronic device 200 and the electronic device 100 is successful, the processor transmits a request for acquiring the bluetooth service of the electronic device 200 to the wireless communication module 132 through the interface of the first application program. In addition, after receiving the pairing status of the electronic device 200 and the electronic device 100 through the interface of the first application, the processor 110 determines that the pairing status is busy mode, and may send a notification to the wireless communication module 132 through the interface of the first application to wait for the electronic device 200 to be successfully paired with the electronic device 100 to inquire about the bluetooth service of the electronic device 200.
The above embodiments can be used alone or in combination with each other to achieve different technical effects.
In the embodiments provided in the present application, the method provided in the embodiments of the present application is described from the perspective of an electronic device as an execution subject. In order to implement the functions in the method provided by the embodiments of the present application, the electronic device may include a hardware structure and/or a software module, and the functions are implemented in the form of a hardware structure, a software module, or a hardware structure and a software module. Whether any of the above-described functions is implemented as a hardware structure, a software module, or a hardware structure plus a software module depends upon the particular application and design constraints imposed on the technical solution.
Based on the same concept, fig. 8 illustrates an electronic device 800 provided in the present application. The electronic device 800 includes at least one processor 810, at least one memory 830, and a transceiver 820. The processor 810 is coupled with the transceiver 820 and the memory 830, and the coupling in this embodiment is indirect coupling or communication connection between devices, units or modules, which may be electrical, mechanical or other forms, and is used for information interaction between the devices, units or modules.
In particular, the transceiver 820 is used to receive or transmit data. For example, the transceiver 820 may be used to receive scan results, or pairing success responses, or send pairing requests, etc.
The memory 830 stores data related to the first application and code instructions. It should be understood that the memory for storing the first application and the memory for storing the code instructions may be the same or different and are not limited thereto. In addition, in some embodiments, the memory 830 further includes a first memory for storing the bluetooth service information supported by the electronic device obtained from the scan result, and a second memory for storing the bluetooth service information supported by the electronic device obtained from the pairing success response. It should be understood that the first memory and the second memory may be the same memory or two different memories, which is not limited thereto. The memory 830 may be the internal memory 121 shown in fig. 2, a memory connected to the external memory interface 122, a memory provided in the processor 110 or the wireless communication module 132, or the like.
The processor 810 is configured to call the code instructions and other related data stored in the memory 830, and execute the query method of the bluetooth service provided by the embodiment of the present application in combination with the transceiver 820. For example, the bluetooth service information supported by the electronic device included in the scan result and/or the bluetooth service information supported by the electronic device included in the pairing success response are saved, and the bluetooth service supported by the electronic device is queried from the saved bluetooth service information.
It should be understood that the electronic device 800 may be used to implement the query method of the bluetooth service in the embodiment of the present application, and reference may be made to the method portion for relevant features, which is not described herein again.
It should be noted that, in the embodiment of the present application, the functions of the processor 810 and the transceiver 820 may be integrated together, for example, the wireless communication module 132 shown in fig. 2, or the functions of the processor 810 may be integrated in the processor 110 (for example, an application processor) shown in fig. 2, the functions of the transceiver 820 may be integrated in the wireless communication module 132 shown in fig. 2, or a part of the functions of the processor 810 may be integrated in the processor 110 (for example, the application processor) shown in fig. 2, and another part of the functions may be integrated in the wireless communication module 132.
Illustratively, as shown in fig. 9, the present application provides a chip 900. Chip 900 includes at least one processor 910, interface 920. The interface 920 is configured to receive a code instruction, and send the received code instruction to the processor 910, and the processor 910 executes the received code instruction sent by the interface to execute the query method of the bluetooth service in this embodiment of the application, and a specific query method of the bluetooth service may refer to an embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that the embodiments of the present application may be implemented in hardware, firmware, or a combination thereof. When implemented in software, the functions described above may be stored on or transmitted over as one or more instructions 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 computer. Take this as an example but not limiting: the computer-readable medium may include RAM, ROM, an Electrically Erasable Programmable Read Only Memory (EEPROM), a compact disc read-Only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Furthermore. Any connection is properly termed a computer-readable medium. For example, if software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, the fiber optic cable, the twisted pair, the DSL, or the wireless technologies such as infrared, radio, and microwave are included in the fixation of the medium. Disk and disc, as used in the description of the embodiments, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
In short, the above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalents, improvements and the like made in accordance with the disclosure of the present application should be included in the scope of the present application.

Claims (14)

1. The inquiry method of a bluetooth service, characterized by, apply to the first electronic device, the said first electronic device has opened the bluetooth function, and install the first application program; the method comprises the following steps:
the first electronic equipment receives scanning results sent by at least one electronic equipment with a Bluetooth function, wherein each scanning result comprises an equipment identifier and at least one universal unique identifier UUID; each UUID is used for identifying a Bluetooth service supported by the electronic equipment identified by the equipment identification; the first electronic equipment saves the equipment identification and at least one UUID included in the received scanning result as first Bluetooth service information;
the first electronic equipment sends a pairing request to electronic equipment to be paired in the at least one electronic equipment with the Bluetooth function; the first electronic equipment receives a pairing success response sent by the electronic equipment to be paired after receiving the pairing request, wherein the pairing success response comprises an identifier of the electronic equipment to be paired and at least one UUID; the first electronic equipment saves the identifier of the electronic equipment to be paired and at least one UUID which are included in the pairing success response as second Bluetooth service information;
when the first electronic device detects that a first application program requests to inquire the Bluetooth service of second electronic device, the Bluetooth service supported by the second electronic device is inquired from the first Bluetooth service information and/or the second Bluetooth service information according to the pairing state of the first electronic device and the second electronic device and the identification of the second electronic device.
2. The method of claim 1, wherein the method further comprises:
and for one electronic device of the at least one electronic device with the Bluetooth function, when the first electronic device receives the scanning result sent by the electronic device again, the first electronic device updates the first Bluetooth service information according to the scanning result sent by the electronic device received again.
3. The method as claimed in claim 1 or 2, wherein the querying the bluetooth service supported by the second electronic device from the first bluetooth service information and/or the second bluetooth service information according to the pairing status of the first electronic device and the second electronic device and the identification of the second electronic device comprises:
if the pairing state of the first electronic device and the second electronic device is the paired state, the first electronic device inquires the Bluetooth service supported by the second electronic device from the first Bluetooth service information and inquires the Bluetooth service supported by the second electronic device from the second Bluetooth service information according to the identifier of the second electronic device;
and the first electronic equipment inquires the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information and inquires a Bluetooth service supported by the second electronic equipment from the second Bluetooth service information to obtain a Bluetooth service supported by the second electronic equipment.
4. The method as claimed in claim 1 or 2, wherein the querying the bluetooth service supported by the second electronic device from the first bluetooth service information and/or the second bluetooth service information according to the pairing status of the first electronic device and the second electronic device and the identification of the second electronic device comprises:
and if the second electronic equipment and the first electronic equipment are in an unpaired state or in a paired state, inquiring the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information according to the identifier of the second electronic equipment.
5. The method of claim 1 or 2, wherein the first application is a third party application.
6. A first electronic device, wherein the first electronic device has Bluetooth function turned on; wherein the first electronic device comprises a processor, a memory, and a transceiver;
the memory stores a first application program and code instructions;
the transceiver is used for receiving or transmitting data;
the processor is configured to invoke the code instructions stored by the memory, and in conjunction with the transceiver, perform:
receiving a scanning result sent by at least one electronic device with the Bluetooth function; each scanning result comprises an equipment identifier and at least one universal unique identifier UUID; each UUID is used for identifying a Bluetooth service supported by the electronic equipment identified by the equipment identification; storing the device identification and at least one UUID included in the received scanning result as first Bluetooth service information;
sending a pairing request to the electronic equipment to be paired in the at least one electronic equipment with the Bluetooth function; receiving a pairing success response sent by the electronic equipment to be paired after receiving the pairing request, wherein the pairing success response comprises the identification of the electronic equipment to be paired and at least one UUID; storing the identifier of the electronic equipment to be paired and at least one UUID included in the pairing success response as second Bluetooth service information;
when the first application program is detected to request for inquiring the Bluetooth service of the second electronic equipment, inquiring the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information and/or the second Bluetooth service information according to the pairing state of the first electronic equipment and the second electronic equipment and the identification of the second electronic equipment.
7. The first electronic device of claim 6, wherein the first Bluetooth service information is stored in the form of a database.
8. The first electronic device of claim 6 or 7, wherein the code instructions further comprise: and an instruction for updating the first bluetooth service information according to the scanning result sent by the electronic device when the scanning result sent by the electronic device is received again for one of the at least one electronic device with the bluetooth function.
9. The first electronic device according to claim 6 or 7, wherein when the electronic device with bluetooth function turned on is a classic bluetooth device, the scanning result is an extended acquired result; and/or when the electronic device with the Bluetooth function is a Bluetooth low energy device, the scanning result is a broadcast packet.
10. The first electronic device of claim 6 or 7, wherein the second Bluetooth service information is stored in the form of a profile.
11. The first electronic device of claim 6 or 7, wherein the code instructions further comprise:
if the pairing state of the first electronic device and the second electronic device is the paired state, inquiring the Bluetooth service supported by the second electronic device from the first Bluetooth service information according to the identifier of the second electronic device, and inquiring the Bluetooth service supported by the second electronic device from the second Bluetooth service information; and instructions for acquiring a union set of the bluetooth service supported by the second electronic device queried from the first bluetooth service information and the bluetooth service supported by the second electronic device queried from the second bluetooth service information, and obtaining the bluetooth service supported by the second electronic device.
12. The first electronic device of claim 6 or 7, wherein the code instructions further comprise:
and the instruction is used for inquiring the Bluetooth service supported by the second electronic equipment from the first Bluetooth service information according to the identification of the second electronic equipment if the second electronic equipment and the first electronic equipment are in an unpaired state or in a paired state.
13. The first electronic device of claim 6 or 7, wherein the first application program is a third party application.
14. A chip, wherein the chip comprises a processor and an interface;
the interface is used for receiving code instructions and transmitting the received code instructions to the processor;
the processor is configured to execute the received code instruction sent by the interface, and execute:
receiving a scanning result sent by at least one electronic device with the Bluetooth function; each scanning result comprises an equipment identifier and at least one universal unique identifier UUID; each UUID is used for identifying a Bluetooth service supported by the electronic equipment identified by the equipment identification; storing the device identification and at least one UUID included in the received scanning result as first Bluetooth service information;
sending a pairing request to the electronic equipment to be paired in the at least one electronic equipment with the Bluetooth function; receiving a pairing success response sent by the electronic equipment to be paired after receiving the pairing request, wherein the pairing success response comprises an identifier of the electronic equipment to be paired and at least one UUID; storing the identifier of the electronic equipment to be paired and at least one UUID included in the pairing success response as second Bluetooth service information;
when a request that a first application program acquires the Bluetooth service of second electronic equipment is received, the Bluetooth service supported by the second electronic equipment is inquired from the first Bluetooth service information and/or the second Bluetooth service information according to the pairing state of the first electronic equipment and the second electronic equipment and the identification of the second electronic equipment.
CN201880098126.3A 2018-12-25 2018-12-25 Bluetooth service query method and electronic equipment Active CN112789934B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/123556 WO2020132878A1 (en) 2018-12-25 2018-12-25 Bluetooth service query method and electronic device

Publications (2)

Publication Number Publication Date
CN112789934A CN112789934A (en) 2021-05-11
CN112789934B true CN112789934B (en) 2023-04-18

Family

ID=71127305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880098126.3A Active CN112789934B (en) 2018-12-25 2018-12-25 Bluetooth service query method and electronic equipment

Country Status (2)

Country Link
CN (1) CN112789934B (en)
WO (1) WO2020132878A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114466339B (en) * 2021-06-18 2023-05-23 荣耀终端有限公司 Bluetooth pairing method, system, storage medium and chip
CN113950034B (en) * 2021-10-14 2024-04-26 北京字节跳动网络技术有限公司 Bluetooth behavior simulation method, device and equipment
CN114143765B (en) * 2022-02-08 2022-07-08 荣耀终端有限公司 Bluetooth connection method, device and storage medium
CN116033333B (en) * 2022-08-31 2023-10-17 荣耀终端有限公司 Method for determining position information, electronic device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130071558A (en) * 2011-12-21 2013-07-01 전남대학교산학협력단 Method for discovery of bluetooth device
CN103840860A (en) * 2014-02-27 2014-06-04 天地融科技股份有限公司 Bluetooth communication method and device
WO2017041546A1 (en) * 2015-09-07 2017-03-16 深圳Tcl数字技术有限公司 Television bluetooth connection method and apparatus
CN106788612A (en) * 2016-12-15 2017-05-31 青岛海信电器股份有限公司 A kind of bluetooth mode method of adjustment and bluetooth equipment based on A2DP agreements

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100745999B1 (en) * 2004-12-17 2007-08-06 삼성전자주식회사 Bluetooth device and method for offering service determined by Bluetooth PIN
CN105792094B (en) * 2014-12-22 2019-11-05 南京中兴软件有限责任公司 A kind of method and device for realizing a card multimachine
CN104540190B (en) * 2014-12-30 2018-04-20 广州视源电子科技股份有限公司 With the method and system of bluetooth equipment pairing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130071558A (en) * 2011-12-21 2013-07-01 전남대학교산학협력단 Method for discovery of bluetooth device
CN103840860A (en) * 2014-02-27 2014-06-04 天地融科技股份有限公司 Bluetooth communication method and device
WO2017041546A1 (en) * 2015-09-07 2017-03-16 深圳Tcl数字技术有限公司 Television bluetooth connection method and apparatus
CN106788612A (en) * 2016-12-15 2017-05-31 青岛海信电器股份有限公司 A kind of bluetooth mode method of adjustment and bluetooth equipment based on A2DP agreements

Also Published As

Publication number Publication date
WO2020132878A1 (en) 2020-07-02
CN112789934A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
CN113613238B (en) SIM module management method and electronic equipment
CN111246545B (en) Method, medium, control terminal and system for guiding intelligent device to access network
CN112449328B (en) Bluetooth searching method, system and related device
WO2020041952A1 (en) Method and electronic apparatus for controlling express delivery cabinet on the basis of express delivery message
US20220039179A1 (en) Bluetooth Connection Method and Device
CN112789934B (en) Bluetooth service query method and electronic equipment
CN112822663B (en) Bluetooth connection method and related device
CN111491297B (en) Method and device for controlling intelligent household equipment to be connected with network
CN109327613B (en) Negotiation method based on voice call translation capability and electronic equipment
WO2020078330A1 (en) Voice call-based translation method and electronic device
CN110198362B (en) Method and system for adding intelligent household equipment into contact
CN110602686B (en) Method for using remote SIM module and electronic equipment
CN112887926B (en) Calling method and device
CN117014859A (en) Address book-based device discovery method, audio and video communication method and electronic device
CN112469011A (en) Bluetooth pairing method and related device
CN118018640A (en) Volume management method and electronic equipment
CN114697438B (en) Method, device, equipment and storage medium for carrying out call by utilizing intelligent equipment
CN115087134B (en) Bluetooth connection method and electronic equipment
CN117915308A (en) Power-off method and electronic equipment
CN115515112A (en) Bluetooth communication method and system
CN117812548A (en) Distributed communication method and electronic equipment
CN115703006A (en) Equipment connection method, device and system
CN117014884A (en) Number using method and related equipment
CN117289807A (en) Communication method, communication system and mouse
CN117014843A (en) Mobile communication method and electronic equipment

Legal Events

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