Bluetooth equipment adaptive connection method and device, equipment and medium
Through the adaptive connection method in the Bluetooth device, the connection method is determined according to the type of the target remote device, and the user experience problem of existing Bluetooth technology when supporting both the terminal and the device end is solved, and efficient connection without switching between modes is achieved.
Patent Information
- Application Number
- CN202510425504.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-06-24
AI Technical Summary
When existing Bluetooth technology needs to support both Bluetooth terminal and device, it usually needs to connect through switching modes, resulting in system reset and poor user experience.
When a local device initiates a Bluetooth connection request, the target remote device is determined based on the search results, and the corresponding connection method is determined according to its device type, an adaptive connection without switching between modes is achieved.
Improve user experience, and determine different connection methods based on the target remote device, avoid system reset and improve connection efficiency.
Smart Images

Figure CN120201399A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Bluetooth communication, and in particular to a method, device, equipment and medium for adaptive connection of Bluetooth devices. Background Art
[0002] Bluetooth technology is a wireless technology standard, and Bluetooth devices include terminals and device ends.
[0003] Normally, a device is either a Bluetooth terminal or a Bluetooth device end, but there are also scenarios that require supporting both types of devices. For example, in a vehicle Bluetooth system, it is necessary to connect to a mobile phone to play music and make calls, and at the same time support connecting to headphones to play local music. In this case, existing Bluetooth technologies all use the method of switching modes, and the entire system usually needs to be reset, which brings a lot of inconveniences and a poor user experience in applications. Summary of the Invention
[0004] The present invention provides a method, device, equipment and medium for adaptive connection of Bluetooth devices, which can determine different connection methods according to the target remote device, without switching between modes, and improve the user experience.
[0005] According to one aspect of the present invention, there is provided a method for adaptive connection of Bluetooth devices, including:
[0006] When a local device initiates a Bluetooth connection request, search according to the Bluetooth connection request to obtain a search result; wherein, the search result includes a remote address, a remote name, and a remote device type;
[0007] Determine a target remote device based on the search result;
[0008] Determine a corresponding connection method according to the target remote device to obtain a connection result and store the connection result in a storage medium.
[0009] According to another aspect of the present invention, there is provided a device for adaptive connection of Bluetooth devices, including:
[0010] A search module, configured to search according to the Bluetooth connection request to obtain a search result when the local device initiates a Bluetooth connection request;
[0011] A device determination module, configured to determine a target remote device based on the search result;
[0012] A connection module, configured to determine a corresponding connection method according to the target remote device to obtain a connection result and store the connection result in a storage medium.
[0013] According to another aspect of the present invention, there is provided an electronic device, and the electronic device includes:
[0014] At least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein
[0016] the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the Bluetooth device adaptive connection method according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the Bluetooth device adaptive connection method according to any embodiment of the present invention when executed.
[0018] In the technical solution of the embodiment of the present invention, when a local device initiates a Bluetooth connection request, a search result is obtained according to the Bluetooth connection request; a target remote device is determined based on the search result; and a corresponding connection method is determined according to the target remote device to obtain a connection result and store the connection result in a storage medium. This technical solution can determine different connection methods according to the target remote device, without switching between modes, thus improving the user experience.
[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0021] Figure 1 is a flowchart of a Bluetooth device adaptive connection method according to Embodiment 1 of the present invention;
[0022] Figure 2 is a flowchart of a Bluetooth device adaptive connection method according to Embodiment 2 of the present invention;
[0023] Figure 3 is a schematic structural diagram of a Bluetooth device adaptive connection device according to Embodiment 3 of the present invention;
[0024] Figure 4It is a schematic structural diagram of an electronic device provided according to Embodiment 4 of the present invention. Detailed implementation manners
[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0026] It should be noted that the terms "first", "second", and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0027] Embodiment 1
[0028] Figure 1 It is a flowchart of a method for adaptive connection of a Bluetooth device provided according to Embodiment 1 of the present invention. This embodiment is applicable to the situation of adaptive connection between a Bluetooth terminal and a device end. This method can be executed by a device for adaptive connection of a Bluetooth device. The device for adaptive connection of a Bluetooth device can be implemented in the form of hardware and / or software, and the device for adaptive connection of a Bluetooth device can be configured in an electronic device with data processing capabilities. As Figure 1 shown, the method includes:
[0029] In this embodiment, it can be applied to standard devices corresponding to Bluetooth connections. Since mobile phone devices or computer devices have a single and fixed corresponding device type, multiple different connection service types can be registered at the same time, so that the device type to be connected can be automatically selected. Among them, the device type can include a Bluetooth terminal and a Bluetooth device end.
[0030] S110. When the local device initiates a Bluetooth connection request, search according to the Bluetooth connection request to obtain a search result.
[0031] Among them, the search results include the remote address, remote name, and remote device type. The local device can be considered as the currently actively connected device. The Bluetooth connection request can be considered as a request for Bluetooth connection based on Bluetooth technology. In this embodiment, the Bluetooth connection request can be a request actively initiated by the local device. The search results can be considered as the information corresponding to the Bluetooth devices obtained by searching for devices through the Bluetooth connection request. In this embodiment, the search results can include information such as the remote address, remote name, and remote device type. The remote address can include the searched Bluetooth address. The remote name can refer to the name of the searched Bluetooth device. The remote device type can refer to the corresponding device type (Class of Device, COD) of the searched Bluetooth device, which can be used to identify the type and function of the device. The device type in this embodiment can refer to the Bluetooth terminal device type and the Bluetooth device type.
[0032] In this embodiment, when the current device connects to a device for the first time, the local device can actively initiate a Bluetooth connection request, search for nearby devices according to the Bluetooth request device sent, so as to obtain information such as the remote address, remote name, and remote device type corresponding to the searched Bluetooth device.
[0033] Furthermore, in this embodiment, when the local device is connected by other devices, the peer device will automatically establish relevant connections directly according to the services to be connected. Specifically, if the local device is searched and connected by the peer device, the peer device can initiate a search request to search for information such as the address and device type of the local device, then establish an ACL connection, send a service discovery request through the Service Discovery Protocol (SDP) of the device, receive an SDP service discovery reply, then establish the corresponding protocol, and store connection information such as the connection address and device type in the storage medium.
[0034] S120. Determine the target remote device based on the search results.
[0035] Among them, the target remote device can be considered as the remote device determined by the local device to be connected. In this embodiment, a search can be initiated through the Bluetooth connection request to search for nearby Bluetooth devices and identify information such as the name, address, and type of the remote device, and then determine the target remote device to be connected from the remote address, remote name, and remote device type included in the search results, so as to establish a connection.
[0036] S130. Determine the corresponding connection method according to the target remote device to obtain the connection result and store the connection result in the storage medium.
[0037] Among them, the connection result may include information such as the connection address and the type of the connected device. The storage medium can be regarded as the carrier for finally storing data and information. The storage medium in this embodiment can be used to store information related to the Bluetooth connection result. In this embodiment, the types of the target remote devices are different, and the corresponding connection methods are different. The target remote devices in this embodiment may include terminal devices and audio devices, and different connection methods can be established according to the type of the determined target remote device, so as to obtain the type of the connected device and the device type, and store information such as the type of the connected device and the device type in the storage medium.
[0038] In the technical solution of the embodiment of the present invention, when a local device initiates a Bluetooth connection request, a search result is obtained according to the Bluetooth connection request; a target remote device is determined based on the search result; a corresponding connection method is determined according to the target remote device to obtain a connection result and store the connection result in the storage medium. This technical solution can determine different connection methods according to the target remote device, without switching between modes, and improve the user experience.
[0039] Embodiment 2
[0040] Figure 2 is a flowchart of a Bluetooth device adaptive connection method provided according to Embodiment 2 of the present invention. This embodiment is optimized based on the above embodiment. The specific optimization is as follows: determining a corresponding connection method according to the target remote device includes: determining whether the target remote device is a device connected for the first time; if the target remote device is a device connected for the first time, obtaining the device type corresponding to the target remote device from the search result; determining a corresponding connection method according to the device type. As Figure 2 shown, the method includes:
[0041] S210. When a local device initiates a Bluetooth connection request, a search result is obtained according to the Bluetooth connection request.
[0042] Among them, the search result includes a remote address, a remote name, and a remote device type.
[0043] S220. Determine a target remote device based on the search result.
[0044] Determining a corresponding connection method according to the target remote device includes:
[0045] S230. Determine whether the target remote device is a device connected for the first time.
[0046] Among them, the first - connected device can be understood as the device that the current target remote device connects to the local device for the first time. In this embodiment, it can be determined whether the target remote device is a first - connected device by whether relevant information of the target remote device is stored in the storage medium. It can be understood that in this embodiment, if the name, address, and other information of the target remote device are stored in the corresponding storage medium, then the target remote device can be considered a non - first - connected device; if the name, address, and other information of the target remote device are not stored in the corresponding storage medium, then the target remote device can be considered a first - connected device.
[0047] S240. If the target remote device is a first - connected device, obtain the device type corresponding to the target remote device from the search results.
[0048] Among them, the device type can refer to the Bluetooth terminal device type and the Bluetooth device type. Among them, the device type can refer to any audio device. Exemplarily, in this embodiment, the Bluetooth terminal can refer to devices such as mobile phones, tablets, and computers, while the Bluetooth device end can refer to devices such as headphones and watches.
[0049] In this embodiment, if it is determined that the target remote device is a first - connected device, the device type corresponding to the target remote device can be obtained from the search results, so as to suggest the connection method between it and the local device according to the device type.
[0050] S250. Determine the corresponding connection method according to the device type to obtain the connection result and store the connection result in the storage medium.
[0051] In this embodiment, the Bluetooth terminal device type needs to support the AG role (Hand - Free Profile) and the AudioSink (A2DP Profile) protocol, and the Bluetooth device end type needs to support the HF role and the Audio Source protocol. Therefore, the corresponding connection methods for different device types are different, and the corresponding connection methods can be established according to the device type.
[0052] In this embodiment, optionally, determining the corresponding connection method according to the device type includes: if the device type is the terminal device type, establish the first connection method corresponding to the terminal device; if the device type is the audio device type, establish the second connection method corresponding to the audio device.
[0053] Among them, the first connection method can be considered the connection method corresponding to the terminal device type. In this embodiment, the first connection method can specifically be the operation of establishing an AG connection and an Audio sink protocol connection. The second connection method can be considered the connection method corresponding to the audio device. The second connection method in this embodiment can specifically be the operation of establishing an HF connection and an Audiosource connection.
[0054] Specifically, in this embodiment, if the device type corresponding to the determined target remote device is a terminal device type, an AG connection and an Audio sink protocol connection operation can be established, and the address and device type of the terminal device can be stored to receive the audio data transmitted by the terminal device; if the device type corresponding to the determined target remote device is an audio device type, an HF connection and an Audio source connection can be established, and the address and device type of the terminal device can be stored to send audio data to the terminal device.
[0055] In this embodiment, by setting in this way, different connection modes can be adaptively switched according to the different device types corresponding to the determined target remote devices, thereby eliminating the need to switch between modes and improving the efficiency of Bluetooth device connection.
[0056] In this embodiment, optionally, the method further includes: if the target remote device is not a device connected for the first time, acquiring a connection address and a device type of the target remote device from a storage medium.
[0057] In this embodiment, if the target remote device is not the first connected device, the last connected address and device type of the target remote device can be obtained from the storage medium, so that the corresponding connection mode can be established according to the device type.
[0058] Through such a setting in this embodiment, for a remote device that has been connected, the connection address and device type of the target remote device can be directly obtained from the storage medium, thereby facilitating a quick connection operation.
[0059] In this embodiment, optionally, before the local device initiates a Bluetooth connection request, the process further includes: registering a Bluetooth terminal type service and an audio device type service with a device service discovery protocol.
[0060] Among them, the Device Service Discovery Protocol SDP is a protocol defined by the Bluetooth Technology Alliance, which is used to identify or publish all available services on a Bluetooth device in a Bluetooth network, and is used for service discovery and connection establishment between Bluetooth devices. Bluetooth terminal type services can refer to the AG role (Hands-Free Profile) and Audio Sink (A2DP Profile) service protocols. Audio device type services can refer to the HF role (Hands-Free Profile) and Audio Source (A2DP Source) service protocols.
[0061] In this embodiment, the HF role, AG role, A2DP Sink service protocol, and A2DP Source service protocol can be registered with the Service Discovery Protocol (SDP) of the device at the same time, so that the peer device can find the service type it needs to connect to.
[0062] In this embodiment, through such a setting, by integrating two types of devices for simultaneous registration, it is convenient to adaptively select different service protocols for connection during the Bluetooth connection process, avoiding the inconvenience caused by various role switches and reducing the development difficulty for users.
[0063] In this embodiment, optionally, searching based on a Bluetooth connection request to obtain search results includes: searching for multiple Bluetooth devices within a set range according to the Bluetooth connection request, and using the multiple Bluetooth devices as search results.
[0064] Among them, the set range can be a specific communication range set based on the local device. In this embodiment, the set range can be set in the Bluetooth connection request. Exemplarily, the set range can be a range between 10 meters and 100 meters, or can be set according to actual needs, and this embodiment does not limit this.
[0065] In this embodiment, when the local device first connects to other remote devices, it can send an inquiry to search for each Bluetooth device within the set range through the Bluetooth connection request, so as to obtain information such as the names, address information, and device types of multiple Bluetooth devices. Through such a setting in this embodiment, through the search in the Bluetooth connection request, it is possible to detect and collect information of other Bluetooth devices within its communication range, so as to determine the target remote device for connection.
[0066] In this embodiment, optionally, the Bluetooth connection request includes a service search request; searching based on the Bluetooth connection request to obtain search results includes: finding the service type of the remote device according to the service search request; determining the corresponding search results according to the service type.
[0067] Among them, the service search request can refer to the SDP Service Search Request. In this embodiment, when the local device needs to search for a specific type of service, it will construct an SDP Service Search Request PDU and send it to the Bluetooth remote device for corresponding connection operations.
[0068] In the Bluetooth connection request in this embodiment, the service search request is to initiate an SDP service search request after the local device has established an ACL connection with the remote device. Therefore, in this embodiment, during the process of connecting to the remote device, if the Bluetooth connection request contains a service search request, the SDP Service Search Request can be directly sent to find the service types supported by the remote device, and then the searched device service types are used as the corresponding search results to facilitate the local device to establish the corresponding connection operation.
[0069] In this embodiment, through such a setting, the service records matching the specified service search graph can be searched by sending a specific request PDU, so as to support mutual discovery and interoperability between Bluetooth devices, facilitating the local device to connect to the required remote device.
[0070] The technical solution of the embodiment of the present invention is as follows: when the local device initiates a Bluetooth connection request, search according to the Bluetooth connection request to obtain a search result; determine the target remote device based on the search result; determine whether the target remote device is a device connected for the first time; if the target remote device is a device connected for the first time, obtain the device type corresponding to the target remote device from the search result; determine the corresponding connection method according to the device type to obtain a connection result and store the connection result in the storage medium. This technical solution can determine different connection methods according to the target remote device, without switching between modes, improving the user experience.
[0071] Embodiment III
[0072] Figure 3 It is a schematic structural diagram of a Bluetooth device adaptive connection device provided according to Embodiment III of the present invention. As Figure 3 shown, the device includes:
[0073] A search module 310, configured to search according to the Bluetooth connection request when the local device initiates a Bluetooth connection request to obtain a search result; wherein, the search result includes a remote address, a remote name, and a remote device type;
[0074] A device determination module 320, configured to determine a target remote device based on the search result;
[0075] A connection module 330, configured to determine a corresponding connection method according to the target remote device to obtain a connection result and store the connection result in the storage medium.
[0076] Optionally, the connection module 330 includes:
[0077] A judgment unit, configured to judge whether the target remote device is a device connected for the first time;
[0078] A setting type determination unit, configured to obtain the device type corresponding to the target remote device from the search results if the target remote device is a device connected for the first time;
[0079] A connection method establishment unit, configured to determine the corresponding connection method according to the device type.
[0080] Optionally, the connection module further includes:
[0081] A data acquisition unit, configured to obtain the connection address and device type of the target remote device from the storage medium if the target remote device is a non-first-connected device.
[0082] Optionally, the connection method establishment unit is specifically configured to:
[0083] If the device type is a terminal device type, establish a first connection method corresponding to the terminal device;
[0084] If the device type is an audio device type, establish a second connection method corresponding to the audio device.
[0085] Optionally, the device further includes a registration module, configured to register a Bluetooth terminal type service and an audio device type service with the device service discovery protocol before the local device initiates a Bluetooth connection request.
[0086] Optionally, the search module 310 is specifically configured to:
[0087] Search for multiple Bluetooth devices within a set range according to the Bluetooth connection request, and use the multiple Bluetooth devices as search results.
[0088] Optionally, the Bluetooth connection request includes a service search request; the search module 310 is specifically configured to:
[0089] Find the service type of the remote device according to the service search request;
[0090] Determine the corresponding search results according to the service type.
[0091] The Bluetooth device adaptive connection device provided by the embodiments of the present invention can execute the Bluetooth device adaptive connection method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0092] Embodiment 4
[0093] Figure 4It is a schematic structural diagram of an electronic device provided according to Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, for example, personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0094] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0095] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0096] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the Bluetooth device adaptive connection method.
[0097] In some embodiments, the Bluetooth device adaptive connection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by the processor 11, one or more steps of the Bluetooth device adaptive connection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the Bluetooth device adaptive connection method by any other suitable means (e.g., by means of firmware).
[0098] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.
[0100] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0101] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0102] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0103] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0104] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0105] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for adaptively connecting a Bluetooth device, characterized in that: include: When the local device initiates a Bluetooth connection request, a search is performed according to the Bluetooth connection request to obtain search results; wherein the search results include a remote address, a remote name, and a remote device type; Determining a target remote device based on the search results; A corresponding connection mode is determined according to the target remote device to obtain a connection result and store the connection result in a storage medium.
2. The method according to claim 1, characterized in that The determining a corresponding connection mode according to the target remote device includes: Determine whether the target remote device is a first-time connected device; If the target remote device is a device that is connected for the first time, obtaining a device type corresponding to the target remote device from the search result; A corresponding connection mode is determined according to the device type.
3. The method according to claim 2, characterized in that Also includes: If the target remote device is not a device connected for the first time, the connection address and device type of the target remote device are obtained from the storage medium.
4. The method according to claim 2, characterized in that: Determine a corresponding connection method according to the device type, including: If the device type is a terminal device type, establishing a first connection mode corresponding to the terminal device; If the device type is an audio device type, a second connection mode corresponding to the audio device is established.
5. The method according to claim 1, characterized in that When the local device initiates a Bluetooth connection request, before searching according to the Bluetooth connection request to obtain search results, the method further includes: Register the Bluetooth terminal type service and the audio device type service with the device service discovery protocol.
6. The method according to claim 1, characterized in that Searching based on the Bluetooth connection request to obtain search results includes: A plurality of Bluetooth devices within a set range are searched according to the Bluetooth connection request, and the plurality of Bluetooth devices are used as search results.
7. The method according to claim 1, characterized in that The Bluetooth connection request includes a service search request; Searching based on the Bluetooth connection request to obtain search results includes: Finding the service type of the remote device according to the service search request; A corresponding search result is determined according to the service type.
8. A Bluetooth device adaptive connection device, characterized in that: include: A search module, configured to search and obtain search results according to the Bluetooth connection request when the local device initiates a Bluetooth connection request; wherein the search results include a remote address, a remote name, and a remote device type; A device determination module, used to determine a target remote device based on the search results; The connection module is used to determine a corresponding connection mode according to the target remote device to obtain a connection result and store the connection result in a storage medium.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the Bluetooth device adaptive connection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the Bluetooth device adaptive connection method according to any one of claims 1 to 7 when executed.