Method, device, equipment and storage medium for connecting external device to terminal

By detecting the adsorption status of external devices and using wireless charging protocol to obtain Bluetooth address information, and automatically establishing Bluetooth connections, the problem of cumbersome Bluetooth connection process in the existing technology is solved and the connection efficiency is improved.

CN114531741BActive Publication Date: 2025-02-18GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210168476.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-23
Publication Date
2025-02-18
Estimated Expiration
2042-02-23

AI Technical Summary

Technical Problem

In the prior art, the process of establishing a Bluetooth connection between the stylus pen and the touch device is cumbersome, and users need to perform preset operations to trigger Bluetooth pairing.

Method used

By detecting the adsorption status of the external device, using the wireless charging protocol to obtain Bluetooth address information, and automatically detect the working status of the Bluetooth module. If it is turned on, a Bluetooth connection will be directly established.

Benefits of technology

The process of establishing Bluetooth connection between terminals and external devices is simplified, and the connection efficiency is improved without the need for preset operations by users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114531741B_ABST
    Figure CN114531741B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, equipment and storage medium for connecting an external device to a terminal, and belongs to the field of terminal technology. The method includes: in response to a first external device being adsorbed onto the terminal, obtaining the Bluetooth address information of the first external device through a wireless charging protocol; if the working state of the Bluetooth module is on, establishing a Bluetooth connection with the first external device based on the Bluetooth address information. Through the above scheme, the terminal does not need to perform preset operations on the first external device or the terminal, and the terminal can establish a Bluetooth connection with the first external device only by adsorbing the first external device onto the terminal, thereby simplifying the process of establishing a Bluetooth connection between the terminal and the first external device, and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a method, device, equipment and storage medium for connecting an external device to a terminal. Background Art

[0002] With the development of terminal technology, the external devices of terminals are becoming more and more abundant. For example, with the popularity of touch devices such as smart phones and tablet computers, the use of stylus pens has gradually become more widespread. Connecting stylus pens with touch devices through convenient and fast connection methods has become the most urgent need of users.

[0003] In the related art, a preset operation (for example, double-clicking, triple-clicking, or long pressing a designated part of the stylus) is used to trigger the stylus to pair with an unconnected touch device via Bluetooth to establish a Bluetooth connection.

[0004] In the above-mentioned related technologies, the touch pen needs to be pre-set before Bluetooth pairing and Bluetooth connection can be achieved. The process of establishing Bluetooth connection between the touch pen and the touch device is cumbersome. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, device and storage medium for connecting an external device to a terminal, which can improve the efficiency of establishing a Bluetooth connection between the external device and the terminal. The technical solution is as follows:

[0006] On the one hand, a method for connecting an external device to a terminal is provided, the method being applied to the terminal, the method comprising:

[0007] In response to the first external device being attached to the terminal, obtaining Bluetooth address information of the first external device through a wireless charging protocol;

[0008] If the working state of the Bluetooth module is turned on, a Bluetooth connection is established with the first external device based on the Bluetooth address information.

[0009] On the other hand, a device for connecting an external device to a terminal is provided, the device being applied to the terminal, and the device comprising:

[0010] an acquisition module, configured to acquire Bluetooth address information of the first external device through a wireless charging protocol in response to the first external device being attached to the terminal;

[0011] The Bluetooth connection module is used to establish a Bluetooth connection with the first external device based on the Bluetooth address information if the working state of the Bluetooth module is turned on.

[0012] On the other hand, an electronic device is provided, comprising a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the method for connecting an external device to a terminal as described in the above aspect.

[0013] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the method for connecting an external device and a terminal as described in the above aspects.

[0014] On the other hand, a computer program product is provided, wherein the computer program product stores at least one program code, and the at least one program code is used to be executed by a processor to implement the method for connecting an external device and a terminal as described in the above aspect.

[0015] In an embodiment of the present application, if the terminal detects that the first external device is adsorbed onto the terminal, the Bluetooth address information of the first external device is obtained through the wireless charging protocol, and then the working state of the Bluetooth module of the terminal is automatically detected. If the working state of the Bluetooth module is on, the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information. In this way, the terminal does not need to perform preset operations on the first external device or the terminal. The terminal and the first external device can establish a Bluetooth connection only by adsorbing the first external device onto the terminal, thereby simplifying the process of establishing a Bluetooth connection between the terminal and the first external device and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 An implementation environment involved in the connection between an external device and a terminal shown in an exemplary embodiment of the present application is shown;

[0017] Figure 2 A schematic diagram showing an adsorption state according to an exemplary embodiment of the present application is shown;

[0018] Figure 3 A flow chart showing a method for connecting an external device to a terminal according to an exemplary embodiment of the present application is shown;

[0019] Figure 4 A flow chart showing a method for connecting an external device to a terminal according to an exemplary embodiment of the present application is shown;

[0020] Figure 5 A flow chart showing a method for connecting an external device to a terminal according to an exemplary embodiment of the present application is shown;

[0021] Figure 6A flow chart showing a method for connecting an external device to a terminal according to an exemplary embodiment of the present application is shown;

[0022] Figure 7 A flow chart showing a method for connecting an external device to a terminal according to an exemplary embodiment of the present application is shown;

[0023] Figure 8 A flow chart showing a method for connecting an external device to a terminal according to an exemplary embodiment of the present application is shown;

[0024] Fig. 9 A flow chart showing a method for connecting an external device to a terminal according to an exemplary embodiment of the present application is shown;

[0025] Fig.10 A structural block diagram showing a connection between an external device and a terminal shown in an exemplary embodiment of the present application;

[0026] Fig.11 A structural block diagram of a terminal shown in an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0028] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0029] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the Bluetooth address information involved in this application is obtained with full authorization.

[0030] Please refer to Figure 1 , which shows an implementation environment involved in a method for connecting an external device to a terminal shown in an exemplary embodiment of the present application. The implementation environment includes: a terminal 100 and an external device 200. Among them, the external device 200 can be adsorbed on the terminal 100, so as to be charged through the terminal 100. The external device 200 can also establish a Bluetooth connection with the terminal 100, so as to communicate through the Bluetooth communication link.

[0031] In some embodiments, the terminal 100 may be any electronic device such as a smart phone, a tablet computer, a laptop computer, an e-book reader, a multimedia player, a wearable device, a PC (Personal Computer), or a smart home appliance that can wirelessly charge other devices. The external device 200 may be any device that can establish a Bluetooth connection with the terminal 100 and can be charged by wireless charging. For example, the external device 200 is a stylus pen, a headset, etc.

[0032] In some embodiments, see Figure 2 , the external device 200 and the terminal 100 are provided with a magnetic structure, and the external device 200 and the terminal 100 can be adsorbed and connected based on the magnetic structure. Through the magnetic connection, the terminal 100 can wirelessly charge the external device 200. The wireless charging process is implemented based on the wireless charging protocol between the terminal 100 and the first external device 200.

[0033] Please refer to Figure 3 , which shows a flow chart of a method for connecting an external device to a terminal according to an exemplary embodiment of the present application. The method includes:

[0034] Step S301: in response to a first external device being attached to a terminal, the terminal obtains Bluetooth address information of the first external device through a wireless charging protocol.

[0035] The wireless charging protocol is a protocol predetermined between the first external device and the terminal, and is used by the terminal to wirelessly charge the first external device. The wireless charging protocol can be any type of wireless charging protocol, for example, the wireless charging protocol is any one of the QI charging protocol (a wireless charging protocol withdrawn by the International Wireless Charging Alliance), the Power Matters Alliance (PMA) charging protocol, or the Alliance for Wireless Power (A4WP) charging protocol. The Bluetooth address information is the address information used by the first external device for Bluetooth connection. For example, the Bluetooth address information is Bluetooth physical (Media Access Control Address, MAC) address information.

[0036] When an external device is adsorbed onto the terminal, Hall induction is generated. Accordingly, the terminal determines whether an external device is adsorbed onto the terminal by detecting the Hall induction. In some embodiments, a Hall sensor is provided on the terminal, and the terminal detects whether an external device is adsorbed onto the terminal through the Hall sensor. In this step, in response to the Hall sensor detecting the Hall induction, a wireless connection notification is sent to the terminal, and the terminal determines that the first external device is adsorbed onto the terminal based on the wireless connection notification. In some embodiments, the Hall sensor sends the wireless connection notification to the power management module of the terminal, so that the terminal obtains the Bluetooth address information of the first external device through the power management module based on the wireless charging protocol.

[0037] Step S302: If the working state of the Bluetooth module is turned on, the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information.

[0038] The terminal sends a Bluetooth connection request (Initiating) to the first external device based on the initiating connection request, and adjusts the state of the Bluetooth module to the initiating connection state. In response to the terminal receiving the broadcast data packet (ADV_IND) sent by the first external device, the terminal sends a connection request (CONNECT_REQ) to the first external device, and the connection request carries Bluetooth communication parameters, such as the time point when the terminal receives data from the first external device and the physical channel (Physical Channel) for receiving data. After sending the CONNECT_REQ request, the terminal adjusts the working state of the Bluetooth module to the connected (Connection) state. Correspondingly, after receiving the CONNECT_REQ request, the first external device also adjusts the working state of its own Bluetooth module to the connected (Connection) state. Afterwards, the first external device and the terminal send and receive data through the parameters carried by the CONNECT_REQ request until the Bluetooth connection is disconnected.

[0039] Prior to this step, the terminal obtains the working state of the Bluetooth module of the terminal. The working state of the Bluetooth module indicates whether the Bluetooth module is in an on state. In some embodiments, the terminal detects the working state of the Bluetooth module. If the working state of the Bluetooth module is in an on state, the terminal executes step S302. If the working state of the Bluetooth module is in an off state, the terminal turns on the Bluetooth module and then executes step S302. In an embodiment of the present application, when the Bluetooth module is in an off state, the terminal automatically starts the Bluetooth module so as to establish a Bluetooth connection with the first external device, so that the user does not need to operate the terminal, thereby simplifying the operation process of establishing a Bluetooth connection between the terminal and the first external device and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device. In some embodiments, if the working state of the Bluetooth module is in an off state, the terminal displays a prompt to turn on Bluetooth, and in response to receiving a Bluetooth turn-on operation, turns on the Bluetooth module and executes step S303. For example, the prompt to turn on Bluetooth is "the first external device requests to turn on the Bluetooth connection". In some embodiments, the prompt to turn on Bluetooth also includes an on option, and in response to the on option being triggered, the terminal determines that a Bluetooth turn-on operation is received. In an embodiment of the present application, the Bluetooth information is turned on to turn on the Bluetooth module by turning on the Bluetooth prompt, so that the Bluetooth module of the terminal can be turned on without calling the Bluetooth setting interface, thereby improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.

[0040] In some embodiments, before this step, the terminal also determines the working status of the terminal, and accordingly, the terminal determines the working status of the terminal; if the working status of the terminal is a locked screen state, an unlock notification is sent; if the working status of the terminal is an unlocked state, the step of obtaining the working status of the Bluetooth module of the terminal is executed.

[0041] The working state of the terminal includes a locked screen state and an unlocked state. In the embodiment of the present application, the terminal first displays an unlock notification in the locked screen state to remind the user to unlock the terminal in order to connect the first external device. In the embodiment of the present application, by sending an unlock notification to remind the user to unlock the terminal, the problem of the terminal being unable to establish a Bluetooth connection in the locked screen state is prevented, and the Bluetooth connection is established only when the terminal is in the unlocked state, which prevents other users from establishing a Bluetooth connection between the terminal and an unknown device in the locked screen state, thereby improving the security of the terminal in establishing a Bluetooth connection.

[0042] In some embodiments, before detecting the working state of the terminal, the terminal also detects the screen state of the terminal. Accordingly, the terminal obtains the screen state of the terminal; if the screen state is the screen-off state, the screen is turned on, and the step of determining the working state of the terminal is performed; if the screen state is the screen-on state, the step of determining the working state of the terminal is performed.

[0043] The terminal screen status includes the screen off status and screen on status. Figure 4 In the embodiment of the present application, after obtaining the Bluetooth address information, it is first detected whether the terminal is in the screen-off state. If the terminal is in the screen-off state, the screen is turned on, and then it is detected whether the terminal is in the screen-locked state. If the terminal is in the screen-locked state, the user is notified to unlock the device. In the unlocked state, the working state of the Bluetooth module is determined. When the Bluetooth module is turned on, a Bluetooth connection is automatically established with the first external device. In this way, while automatically establishing a Bluetooth connection with the external device, it is ensured that the terminal establishes a Bluetooth connection only when it is in the unlocked state, thereby improving the security of the terminal.

[0044] In some embodiments, see Figure 4 , after the terminal establishes a connection with the first external device, it obtains the operating status information of the first external device and displays the operating status information on the display interface. Correspondingly, the terminal obtains the operating status information of the first external device; and displays the operating status information of the first external device. Among them, the operating status information is any status information of the first external device, for example, the operating status information is the power information of the first external device, etc. It should be noted that the terminal can obtain the operating status information of the first external device through a Bluetooth connection. The terminal can also obtain the operating status information of the first external device through a wireless charging communication connection. In the embodiment of the present application, the manner in which the terminal obtains the operating status information of the first external device is not specifically limited.

[0045] In an embodiment of the present application, the terminal obtains the operating status information of the external device for display so that the user can understand the operating status information of the external device in real time, thereby optimizing the user experience.

[0046] In an embodiment of the present application, if the terminal detects that the first external device is adsorbed onto the terminal, the Bluetooth address information of the first external device is obtained through the wireless charging protocol, and then the working state of the Bluetooth module of the terminal is automatically detected. If the working state of the Bluetooth module is on, the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information. In this way, the terminal does not need to perform preset operations on the first external device or the terminal. The terminal and the first external device can establish a Bluetooth connection only by adsorbing the first external device onto the terminal, thereby simplifying the process of establishing a Bluetooth connection between the terminal and the first external device and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.

[0047] Please refer to Figure 5 , which shows a flow chart of a method for connecting an external device to a terminal shown in an exemplary embodiment of the present application. In the embodiment of the present application, the terminal obtains the Bluetooth address information of the first external device based on the wireless charging protocol as an example. The method includes:

[0048] Step S501: in response to a first external device being attached to the terminal, the terminal establishes a wireless charging communication connection with the first external device based on the wireless charging protocol.

[0049] The wireless charging communication connection can be used to transmit digital information. The terminal and the first external device determine the data format and communication channel for communication based on the wireless charging protocol, and the terminal and the first external device establish a wireless charging communication connection based on the data format and communication channel corresponding to the wireless charging protocol, thereby realizing data transmission.

[0050] Step S502: the terminal obtains Bluetooth address information of the first external device based on the wireless charging communication connection.

[0051] In this step, the terminal receives a data packet in a corresponding data format sent by the first external device through a communication channel corresponding to the wireless charging connection, and the data packet carries Bluetooth address information of the first external device.

[0052] In some embodiments, after the first external device establishes a wireless charging communication connection with the terminal, the first external device sends a data packet carrying Bluetooth address information to the terminal. In some embodiments, after the first external device establishes a wireless charging communication connection with the terminal, the terminal sends an address information acquisition request to the first external device, and the first external device sends a data packet carrying Bluetooth address information to the terminal based on the address information acquisition request. Accordingly, the process is implemented by the following steps (1)-(3), including:

[0053] (1) The terminal sends an address information acquisition request to the first external device through the wireless charging communication connection, where the address information acquisition request is used to request the first external device to send the Bluetooth address information of the first external device to the terminal.

[0054] In some embodiments, the terminal communicates with the first external device via a wireless charging communication connection. During the communication between the terminal and the first external device, the address information acquisition request is added to the data packet transmitted based on the wireless charging communication connection, thereby sending the address information acquisition request to the first external device. Accordingly, the terminal encodes the address information acquisition request based on the data format corresponding to the wireless charging protocol between the terminal and the first external device to obtain the corresponding data packet, thereby sending the data packet carrying the address information acquisition request to the first external device based on the communication channel corresponding to the wireless charging protocol.

[0055] (2) In response to the address information acquisition request, the first external device sends Bluetooth address information to the terminal based on the wireless charging protocol.

[0056] After receiving the address information acquisition request, the first external device acquires its own Bluetooth address information and sends the Bluetooth address information to the terminal based on the wireless charging communication connection. The principle of the first external device sending the Bluetooth address information based on the wireless charging communication connection is the same as the principle of the terminal sending the address information acquisition request to the first external device based on the wireless charging communication connection in step (1), and will not be repeated here.

[0057] (3) The terminal receives the Bluetooth address information fed back by the first external device through the wireless charging communication connection.

[0058] In an embodiment of the present application, the terminal communicates with the first external device based on the wireless charging communication protocol, so that the terminal can obtain the Bluetooth address information through the wireless charging protocol. In this way, the terminal can obtain the Bluetooth address information of the first external device without performing Bluetooth scanning, thereby improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.

[0059] In some embodiments, the terminal includes a power management module. In this step, the terminal obtains the Bluetooth address information of the first external device through the wireless charging protocol based on the power management module of the terminal. Accordingly, in the above embodiment, the terminal establishes a wireless charging communication connection with the first external device through the power management module, and obtains the Bluetooth address information of the first external device based on the wireless charging communication connection.

[0060] Step S503: If the working state of the Bluetooth module is turned on, the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information.

[0061] The principle of this step is the same as that of step S302 and will not be repeated here.

[0062] In an embodiment of the present application, if the terminal detects that the first external device is adsorbed onto the terminal, the Bluetooth address information of the first external device is obtained through the wireless charging protocol, and then the working state of the Bluetooth module of the terminal is automatically detected. If the working state of the Bluetooth module is on, the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information. In this way, the terminal does not need to perform preset operations on the first external device or the terminal. The terminal and the first external device can establish a Bluetooth connection only by adsorbing the first external device onto the terminal, thereby simplifying the process of establishing a Bluetooth connection between the terminal and the first external device and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.

[0063] Please refer to Figure 6 , which shows a flow chart of a method for connecting an external device to a terminal shown in an exemplary embodiment of the present application. In the embodiment of the present application, the terminal is taken as an example to establish a Bluetooth connection with a first external device. The method includes:

[0064] Step S601: In response to a first external device being attached to the terminal, the terminal obtains Bluetooth address information of the first external device through a wireless charging protocol.

[0065] The principle of this step is the same as that of step S301 and will not be repeated here.

[0066] Step S602: If the working state of the Bluetooth module is on, the terminal calls the Bluetooth connection service.

[0067] In some embodiments, the Bluetooth connection service may be a service provided by a peripheral management application installed in the terminal. The peripheral management application is used to manage external devices. In this step, the terminal starts the peripheral management application, thereby calling the Bluetooth connection service provided by the peripheral management application.

[0068] Step S603: the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information through the Bluetooth connection service.

[0069] In some embodiments, the terminal includes a power management module and an application layer. Accordingly, the terminal calls the peripheral management application through the application layer. The process is implemented by the following steps (1)-(3), including:

[0070] (1) The terminal sends an event notification carrying the Bluetooth address information to the application layer of the touch device through the power management module.

[0071] The event notification is used to implement event information for communication between the power management module and the application layer of the terminal. For example, the event notification is a UEvent event. Figure 7 After the power management module detects that the first external device is adsorbed, it obtains the Bluetooth address information of the first external device and sends an event notification carrying the Bluetooth address information to the application layer of the terminal.

[0072] (2) The terminal decodes the received event notification through the application layer to obtain the Bluetooth address information.

[0073] Please continue to see Figure 7 The application layer monitors the event notification in real time, decodes the monitored event notification, and obtains the Bluetooth address information. In some embodiments, the application layer monitors the event notification through a target service process, for example, the target service process is an ExService process.

[0074] (3) The terminal calls the peripheral management application through the application layer, and establishes a Bluetooth connection with the first external device based on the Bluetooth address information through the Bluetooth connection service provided by the peripheral management application.

[0075] Please continue to see Figure 7The terminal calls the peripheral management application through the application layer. The process of the terminal establishing a Bluetooth connection with the first external device based on the Bluetooth address information through the peripheral management application is the same as the principle of step S302, which will not be repeated here.

[0076] It should be noted that when the terminal calls the peripheral management application to establish a Bluetooth connection, the terminal can send a notification message to the terminal through the peripheral management application when detecting the working status and screen status of the terminal, so as to manage the connection status of the first external device.

[0077] In an embodiment of the present application, a process of automatically establishing a Bluetooth connection based on the Bluetooth address information of the first external device is implemented through data transmission between various modules inside the terminal. In this way, the terminal does not need to perform preset operations on the first external device or the terminal. The terminal and the first external device can establish a Bluetooth connection simply by adsorbing the first external device onto the terminal, thereby simplifying the process of establishing a Bluetooth connection between the terminal and the first external device and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.

[0078] Please refer to Figure 8 , which shows a flow chart of a method for connecting an external device to a terminal shown in an exemplary embodiment of the present application. In the embodiment of the present application, the terminal has established a Bluetooth connection with other devices as an example, and the method includes:

[0079] Step S801: In response to a first external device being attached to the terminal, the terminal obtains Bluetooth address information of the first external device through a wireless charging protocol.

[0080] The principle of this step is the same as that of step S301 and will not be repeated here.

[0081] Step S802: the terminal obtains the working status of the Bluetooth module of the terminal.

[0082] The principle of this step is the same as that of step S302 and will not be repeated here.

[0083] Step S803: If the working state of the Bluetooth module is turned on, and the terminal device has established a Bluetooth connection with the second external device, the terminal device disconnects the Bluetooth connection with the second external device.

[0084] See also Fig. 9 After obtaining the Bluetooth address information of the first external device, the terminal first determines whether a second external device of the same type is currently connected. If a second external device of the same type is already connected, the current second external device is first disconnected, and then the pairing is canceled. At this time, there is no connection record of the second external device in the Bluetooth list. At this time, the Bluetooth address information of the first external device is used for pairing and connection, and the first external device is successfully connected.

[0085] In an embodiment of the present application, the connection with the second external device is automatically disconnected, so that the first external device can successfully establish a connection with the terminal. In this way, when a conflict occurs when multiple external devices establish Bluetooth connections with the terminal, the user's manual operation of removing external devices from the Bluetooth list can be reduced, thereby realizing the establishment of a Bluetooth connection based on the adsorption state, making it more convenient for the terminal to establish a Bluetooth connection with the external device.

[0086] In some embodiments, the terminal includes multiple Bluetooth modules, and accordingly, the terminal can establish Bluetooth connections with multiple external devices of the same type based on different Bluetooth modules. Then this step can also be: the terminal obtains the working status of other Bluetooth modules, and executes step S804 when other Bluetooth modules have not established Bluetooth connections with other external devices.

[0087] Step S804: the terminal establishes a Bluetooth connection with the external device based on the Bluetooth address information.

[0088] The principle of this step is the same as that of step S303 and will not be repeated here.

[0089] In an embodiment of the present application, if the terminal detects that the first external device is adsorbed onto the terminal, the Bluetooth address information of the first external device is obtained through the wireless charging protocol, and then the working state of the Bluetooth module of the terminal is automatically detected. If the working state of the Bluetooth module is on, the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information. In this way, the terminal does not need to perform preset operations on the first external device or the terminal. The terminal and the first external device can establish a Bluetooth connection only by adsorbing the first external device onto the terminal, thereby simplifying the process of establishing a Bluetooth connection between the terminal and the first external device and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.

[0090] Please refer to Fig.10 , which shows a structural block diagram of a device for connecting an external device to a terminal provided by an embodiment of the present application. The device for connecting an external device to a terminal can be implemented as all or part of a processor through software, hardware, or a combination of both. The device includes:

[0091] A first acquisition module 1001 is configured to acquire Bluetooth address information of the first external device through a wireless charging protocol in response to the first external device being attached to the terminal;

[0092] The Bluetooth connection module 1002 is configured to establish a Bluetooth connection with the first external device based on the Bluetooth address information if the working state of the Bluetooth module is turned on.

[0093] In some embodiments, the first acquisition module 1001 includes:

[0094] An establishing unit, configured to establish a wireless charging communication connection with the first external device based on the wireless charging protocol;

[0095] The acquiring unit is used to acquire the Bluetooth address information of the first external device based on the wireless charging communication connection.

[0096] In some embodiments, the acquisition unit is used to send an address information acquisition request to the first external device through the wireless charging communication connection, and the address information acquisition request is used to request the first external device to send the Bluetooth address information of the first external device to the terminal; and receive the Bluetooth address information fed back by the first external device through the wireless charging communication connection.

[0097] In some embodiments, the first acquisition module 1001 is used to send the address information acquisition request to the first external device through the wireless charging protocol based on the power management module of the terminal.

[0098] In some embodiments, the Bluetooth connection module 1002 includes:

[0099] A calling unit, used for calling a Bluetooth connection service;

[0100] A Bluetooth connection unit is used to establish a Bluetooth connection with the first external device based on the Bluetooth address information through the Bluetooth connection service.

[0101] In some embodiments, the apparatus further comprises:

[0102] A calling module, used to call the peripheral management application to send an unlock notification if the working state of the terminal is the lock screen state;

[0103] The Bluetooth connection module 1002 is used to establish a Bluetooth connection with the first external device based on the Bluetooth address information if the working state of the terminal is unlocked and the working state of the Bluetooth module is turned on.

[0104] In some embodiments, the Bluetooth connection module 1002 is further used to disconnect the Bluetooth connection with the second external device if the terminal device has established a Bluetooth connection with the second external device, and to establish a Bluetooth connection with the first external device based on the Bluetooth address information.

[0105] In some embodiments, the apparatus further comprises:

[0106] A second acquisition module, used to acquire the operation status information of the first external device;

[0107] The display module is used to display the operation status information of the first external device.

[0108] In an embodiment of the present application, if the terminal detects that the first external device is adsorbed onto the terminal, the Bluetooth address information of the first external device is obtained through the wireless charging protocol, and then the working state of the Bluetooth module of the terminal is automatically detected. If the working state of the Bluetooth module is on, the terminal establishes a Bluetooth connection with the first external device based on the Bluetooth address information. In this way, the terminal does not need to perform preset operations on the first external device or the terminal. The terminal and the first external device can establish a Bluetooth connection only by adsorbing the first external device onto the terminal, thereby simplifying the process of establishing a Bluetooth connection between the terminal and the first external device and improving the efficiency of establishing a Bluetooth connection between the terminal and the first external device.

[0109] In the embodiment of the present application, the device may be provided as a terminal or an external device. In the case where the electronic device is provided as a terminal, please refer to Fig.11 , which shows a block diagram of a terminal 1100 provided by an exemplary embodiment of the present application. In some embodiments, the terminal 1100 is any electronic device such as a smart phone, a tablet computer, a laptop computer, an e-book reader, a multimedia player, a wearable device, a PC (Personal Computer), or a smart home appliance that can wirelessly charge other devices. The terminal 1100 in the present application may include one or more of the following components: a processor 1110, a memory 1120, a power management module 1130, and a Bluetooth module 1140.

[0110] In some embodiments, the processor 1110 includes one or more processing cores. The processor 1110 uses various interfaces and lines to connect the various parts of the entire terminal 1100, and executes various functions and processes data of the terminal 1100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1120, and calling data stored in the memory 1120. Optionally, the processor 1110 is implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1110 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a neural network processor (Neural-network Processing Unit, NPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content that needs to be displayed on the display screen 1130; the NPU is used to implement artificial intelligence (Artificial Intelligence, AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 1110, but may be implemented by a separate chip.

[0111] In some embodiments, the memory 1120 includes a random access memory (RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1120 includes a non-transitory computer-readable storage medium. The memory 1120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data (such as audio data, a phone book), etc., created according to the use of the terminal 1100.

[0112] In some embodiments, the power management module 1130 can detect whether the external device is attached to the external device, and when the external device is attached, wirelessly charge the external device through a wireless charging protocol.

[0113] In some embodiments, the Bluetooth module 1140 is used to establish a Bluetooth connection with other electronic devices. It should be noted that the number of Bluetooth modules 1140 in the terminal 1100 is set as needed, and in the embodiment of the present application, this is not specifically limited. When the terminal 1100 includes multiple Bluetooth modules 1140, each Bluetooth module 1140 can establish a Bluetooth connection with other electronic devices.

[0114] In some embodiments, the terminal 1100 further includes a display screen. The display screen is a display component for displaying a user interface. Optionally, the display screen is a display screen with a touch function, through which the user can use any suitable object such as a finger or a touch pen to perform touch operations on the display screen. The display screen is usually arranged on the front panel of the terminal 1100. The display screen can be designed as a full screen, a curved screen, a special-shaped screen, a double-sided screen or a folding screen. The display screen can also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which is not limited in this embodiment.

[0115] In addition, those skilled in the art can understand that the structure of the terminal 1100 shown in the above drawings does not constitute a limitation on the terminal 1100, and the terminal 1100 may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the terminal 1100 also includes at least one of a microphone, a speaker, a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (Wireless Fidelity, Wi-Fi) module, and a power supply, which will not be described in detail here.

[0116] It should be noted that when the device is provided as an external device, the structure of the external device is similar to that of the terminal 1100, and may also include at least one or more of the following components: a processor, a memory, a power management module, and a Bluetooth module. The structure of the external device will not be described in detail here.

[0117] An embodiment of the present application further provides a computer-readable medium storing at least one instruction, which is loaded and executed by the processor to implement the method for connecting an external device and a terminal as shown in the above embodiments.

[0118] An embodiment of the present application further provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for connecting an external device and a terminal as shown in the above embodiments.

[0119] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0120] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for connecting an external device to a terminal, characterized in that: The method is applied to a terminal, the terminal includes a power management module and an application layer, and the method includes: In response to detecting, by the power management module, that the first external device is attached to the terminal, obtaining Bluetooth address information of the first external device through a wireless charging protocol; If the working state of the Bluetooth module of the terminal is turned on, an event notification carrying the Bluetooth address information is sent to the application layer through the power management module, and the event notification is event information used to realize communication between the power management module and the application layer; Decoding the event notification through the application layer to obtain the Bluetooth address information; The application layer calls the peripheral management application installed in the terminal, and establishes a Bluetooth connection with the first external device based on the Bluetooth address information through the Bluetooth connection service provided by the peripheral management application. The peripheral management application is used to manage the external devices of the terminal.

2. The method according to claim 1, characterized in that The obtaining the Bluetooth address information of the first external device through the wireless charging protocol includes: Based on the wireless charging protocol, establishing a wireless charging communication connection with the first external device; Based on the wireless charging communication connection, Bluetooth address information of the first external device is obtained.

3. The method according to claim 2, characterized in that The acquiring the Bluetooth address information of the first external device based on the wireless charging communication connection includes: Sending an address information acquisition request to the first external device through the wireless charging communication connection, wherein the address information acquisition request is used to request the first external device to send the Bluetooth address information of the first external device to the terminal; The Bluetooth address information fed back by the first external device is received through the wireless charging communication connection.

4. The method according to claim 1, characterized in that: The obtaining the Bluetooth address information of the first external device through the wireless charging protocol includes: Based on the power management module of the terminal, the Bluetooth address information of the first external device is obtained through the wireless charging protocol.

5. The method according to claim 1, characterized in that Before establishing a Bluetooth connection with the first external device based on the Bluetooth address information, the method further includes: If the working state of the terminal is the screen lock state, calling the peripheral management application to send an unlock notification; If the working state of the terminal is unlocked and the working state of the Bluetooth module is turned on, the step of establishing a Bluetooth connection with the first external device based on the Bluetooth address information is performed.

6. The method according to claim 1, characterized in that Before establishing a Bluetooth connection with the first external device based on the Bluetooth address information, the method further includes: If the terminal has established a Bluetooth connection with the second external device, the Bluetooth connection with the second external device is disconnected, and the step of establishing a Bluetooth connection with the first external device based on the Bluetooth address information is performed.

7. The method according to claim 1, characterized in that After establishing a Bluetooth connection with the first external device based on the Bluetooth address information, the method further includes: Acquire the operation status information of the first external device; Display the operating status information of the first external device.

8. A device for connecting an external device to a terminal, characterized in that: The device is applied to a terminal, the terminal includes a power management module and an application layer, and the device includes: an acquisition module, configured to acquire Bluetooth address information of the first external device through a wireless charging protocol in response to detecting that the first external device is attached to the terminal through the power management module; A Bluetooth connection module, which is used to send an event notification carrying the Bluetooth address information to the application layer through the power management module if the working state of the Bluetooth module of the terminal is on, and the event notification is event information used to realize communication between the power management module and the application layer; decode the event notification through the application layer to obtain the Bluetooth address information; call the peripheral management application installed in the terminal through the application layer, and establish a Bluetooth connection with the first external device based on the Bluetooth address information through the Bluetooth connection service provided by the peripheral management application, and the peripheral management application is used to manage the external devices of the terminal.

9. An electronic device, characterized in that: The electronic device comprises a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the method for connecting an external device and a terminal as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the method for connecting an external device and a terminal according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for utilizing wireless charging interface for automatically pairing Bluetooth peripheral and host

    CN105208515A

  • Bluetooth connection method, device and system

    CN110191442A

  • Communication method and device

    CN113518331A