Equipment connection method and related device
By introducing a device connection method in electronic devices, allowing devices to directly establish connections with external devices while waiting for other connections to fail or timeout, solving the problem of slow or failure, achieving faster connections and a better user experience.
Patent Information
- Application Number
- CN202510028449.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-07
AI Technical Summary
During the process of establishing a connection between electronic devices and external devices, the connection may be slow or failed, affecting the user experience.
Through a device connection method, electronic devices can directly perform communication connection processes with external devices when they fail or time out when waiting for a connection to other devices, and adopt different connection methods to improve connection speed.
This method can establish connections with external devices more quickly, improve user experience, and notify users more quickly after successful connection, improving overall user experience.
Smart Images

Figure CN120018321A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a device connection method and related apparatus. Background Art
[0002] With the development of Internet technology, electronic devices logged in to the same account can establish a connection, and these electronic devices can also establish a connection with external devices in response to user operations. Among them, the electronic devices logged in to the same account to establish a connection means that the electronic device can find other electronic devices logged in to the same account as the electronic device. The user's operation may include enabling Bluetooth connection on the electronic device, etc. The electronic device may include mobile phones, computers, and tablets, etc., and the external device may include headphones, car computers, and keyboards, etc.
[0003] However, in the process of establishing a connection between an electronic device and an external device, a slow connection or even a connection failure may occur, which affects the user experience. Summary of the invention
[0004] The embodiments of the present application provide a device connection method and related apparatus, which are applied in the field of terminal technology and can enable an electronic device to establish a connection with an external device more quickly, thereby improving the user experience.
[0005] In a first aspect, an embodiment of the present application provides a device connection method. The method includes:
[0006] At a first moment, the first device uses a first connection method to request to establish a communication connection with a second device; at a second moment, the first device and the second device execute a communication connection process based on the first connection method; at a third moment, the first device uses the first connection method to request to establish a communication connection with a third device; at a fourth moment, the first device and the second device continue to execute the communication connection process based on the first connection method, and the first device does not execute the communication connection process with the third device; at a fifth moment, the first device receives a first operation from a user, and the first operation is used to instruct the first device to establish a communication connection with a fourth device; at a sixth moment, the first device uses a second connection method to execute a communication connection process with the fourth device, and the second connection method is different from the first connection method.
[0007] Among them, the second moment is later than the first moment, the third moment is later than the second moment, the fourth moment is later than the third moment, and the fifth moment is later than the fourth moment; between the first moment and the fifth moment, the first device continues to execute the communication connection process with the second device, and the first device has not completed the communication connection with the second device; between the third moment and the fifth moment, the first device has not established a communication connection with the third device; at the sixth moment, the first device suspends the communication connection process with the second device.
[0008] In this way, since the first device can execute the communication connection process with the fourth device without waiting for the failure or timeout of establishing a communication connection with the second device, the speed of establishing a communication connection between the first device and the fourth device can be improved. In addition, if the first device successfully establishes a communication connection with the fourth device, the first device can notify the user more quickly that the communication connection between the first device and the fourth device has been successfully established, which can improve the user experience.
[0009] In one possible implementation, at the sixth moment, the first device suspends the communication connection process with the second device, and can: add the service discovery protocol SDP information of the second device and the first remaining execution time to the SDP queue; the first remaining execution time includes: the difference between the execution time threshold and the first executed time, and the first executed time includes: the time used by the first device and the second device to execute the communication connection process between the first moment and the sixth moment; remove the communication connection established between the first device and the second device from the connection task queue; and add the communication connection established between the first device and the third device to the connection task queue.
[0010] In this way, adding the service discovery protocol SDP information of the second device and the first remaining execution time to the SDP queue can prepare for subsequently establishing a communication connection between the first device and the second device and adding the first remaining execution time to the connection task queue.
[0011] In one possible implementation, at the second moment, the first device and the second device execute a communication connection process based on the first connection method, and can: add the SDP information of the second device to the SDP queue, and add the establishment of a communication connection between the first device and the second device to the connection task queue; at the third moment, after the first device adopts the first connection method to request to establish a communication connection with the third device, it can: add the SDP information of the third device to the SDP queue; at the fifth moment, after the first device receives the user's first operation, it can also: establish a communication connection between the first device and the fourth device and add it to the connection task queue.
[0012] In this way, when the first device uses the first connection mode to request to establish a communication connection with the second device, by adding the communication connection establishment between the first device and the second device to the connection task queue, the first device can quickly execute the communication connection process with the second device.
[0013] In one possible implementation, after establishing a communication connection between the first device and the fourth device and adding them to the connection task queue, it is also possible to: determine whether the time used by the first device and the second device to execute the communication connection process based on the first connection method is greater than the execution threshold; if the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fourth device; if the time used is less than the execution threshold, the first device continues to execute the communication connection process with the second device until the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fourth device, and the first device suspends the communication connection process with the second device.
[0014] In this way, after the first device receives the user's first operation, if the time taken by the first device and the second device to execute the communication connection process based on the first connection method is greater than or equal to the execution threshold, indicating that the time taken by the first device and the second device to establish a communication connection may be longer, the first device can execute the communication connection process with the fourth device, so that the first device can establish a communication connection with the fourth device more quickly, thereby improving the user experience; if the time taken by the first device and the second device to execute the communication connection process based on the first connection method is less than the execution threshold, the first device can also continue to execute the communication connection process with the second device, which may enable the first device and the second device to achieve business flow.
[0015] In a possible implementation, it is also possible that: at the seventh moment, the first device successfully establishes a communication connection with the fourth device; at the eighth moment, the first device and the third device execute a communication connection process based on the first connection method; at the ninth moment, the first device and the third device execute the communication connection process successfully or timeout; at the tenth moment, the first device and the second device execute the communication connection process.
[0016] Among them, the seventh moment is later than the sixth moment, the eighth moment is later than the seventh moment, the ninth moment is later than the eighth moment, and the tenth moment is later than the ninth moment; between the eighth moment and the ninth moment, the first device continues to execute the communication connection process with the third device, and the first device has not completed the communication connection with the third device; between the seventh moment and the ninth moment, the first device has not established a communication connection with the second device; at the ninth moment, the communication connection between the first device and the second device and the first remaining execution time are added to the connection task queue.
[0017] In this way, when the first device successfully establishes a communication connection with the fourth device and the first device successfully or times out the communication connection process with the third device, the first device can also execute the communication connection process with the second device, which may enable the first device and the second device to achieve business flow.
[0018] In a possible implementation, at the tenth moment, the time taken by the first device and the second device to execute the communication connection process is less than or equal to the first remaining execution time.
[0019] In this way, more time can be provided for the first device to execute the communication connection process with the other device, which may make it possible for the first device to successfully establish a communication connection with the other device.
[0020] In one possible implementation, at the eleventh moment, the first device receives a second operation of the user, and the second operation is used to instruct the first device to establish a communication connection with the fifth device, and the first operation and the second operation may be the same or different; at the twelfth moment, the first device uses the second connection method to execute a communication connection process with the fifth device; at the thirteenth moment, the first device successfully establishes a connection with the fifth device; at the fourteenth moment, the first device and the second device continue to execute the communication connection process based on the first connection method.
[0021] Among them, the eleventh moment is later than the tenth moment, the twelfth moment is later than the eleventh moment, the thirteenth moment is later than the twelfth moment, and the fourteenth moment is later than the thirteenth moment; at the twelfth moment, the first device suspends the communication connection process with the second device.
[0022] In this way, by enabling the first device and the fifth device to execute the communication connection process, the speed of establishing a communication connection between the first device and the fifth device can be improved. In addition, if the first device and the fifth device successfully establish a communication connection, the first device can more quickly notify the user that the first device and the fifth device have successfully established a communication connection, thereby improving the user experience.
[0023] In one possible implementation, at the twelfth moment, the first device suspends the communication connection process with the second device, and can: add the SDP information of the second device and the second remaining execution time to the SDP queue, the second remaining execution time including: the difference between the first remaining execution time and the second executed time, the second executed time including: the time taken by the first device and the second device to execute the communication connection process between the ninth moment and the twelfth moment; remove the communication connection established between the first device and the second device from the connection task queue; and add the communication connection established between the first device and the second device and the second remaining execution time to the connection task queue.
[0024] In this way, adding the service discovery protocol SDP information of the second device and the second remaining execution time to the SDP queue can prepare for subsequently establishing a communication connection between the first device and the second device and adding the second remaining execution time to the connection task queue.
[0025] In a possible implementation, at the fourteenth moment, the time taken by the first device and the second device to continue to execute the communication connection process based on the first connection mode is less than or equal to the second remaining execution time.
[0026] In this way, more time can be provided for the first device to execute the communication connection process with the other device, which may make it possible for the first device to successfully establish a communication connection with the other device.
[0027] In a second aspect, an embodiment of the present application provides a device connection device, which may be an electronic device, or a chip or chip system in an electronic device. The device connection device may include a display unit and a processing unit. When the device connection device is an electronic device, the display unit may be a display screen. The display unit is used to perform the display step so that the electronic device implements a device connection method described in the first aspect or any possible implementation of the first aspect. When the device connection device is an electronic device, the processing unit may be a processor. The device connection device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the electronic device implements a device connection method described in the first aspect or any possible implementation of the first aspect. When the device connection device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the electronic device implements a device connection method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (eg, a register, a cache, etc.), or a storage unit within the electronic device that is located outside the chip (eg, a read-only memory, a random access memory, etc.).
[0028] Exemplarily, a processing unit is used for, at a first moment, a first device adopts a first connection mode to request to establish a communication connection with a second device; at a second moment, the first device and the second device execute a communication connection process based on the first connection mode; at a third moment, the first device adopts the first connection mode to request to establish a communication connection with a third device; at a fourth moment, the first device and the second device continue to execute the communication connection process based on the first connection mode, and the first device does not execute the communication connection process with the third device; at a fifth moment, the first device receives a first operation from a user, and the first operation is used to instruct the first device to establish a communication connection with a fourth device; at a sixth moment, the first device adopts a second connection mode to execute a communication connection process with the fourth device, and the second connection mode is different from the first connection mode.
[0029] Among them, the second moment is later than the first moment, the third moment is later than the second moment, the fourth moment is later than the third moment, and the fifth moment is later than the fourth moment; between the first moment and the fifth moment, the first device continues to execute the communication connection process with the second device, and the first device has not completed the communication connection with the second device; between the third moment and the fifth moment, the first device has not established a communication connection with the third device; at the sixth moment, the first device suspends the communication connection process with the second device.
[0030] In one possible implementation, at the sixth moment, the first device suspends the communication connection process with the second device, and the processing unit is used to: add the service discovery protocol SDP information of the second device and the first remaining execution time to the SDP queue; the first remaining execution time includes: the difference between the execution time threshold and the first executed time, and the first executed time includes: the time used by the first device and the second device to execute the communication connection process between the first moment and the sixth moment; remove the communication connection established between the first device and the second device from the connection task queue; and add the communication connection established between the first device and the third device to the connection task queue.
[0031] In one possible implementation, at the second moment, the first device and the second device execute a communication connection process based on the first connection method, and the processing unit is used to: add the SDP information of the second device to the SDP queue, and add the establishment of a communication connection between the first device and the second device to the connection task queue; at the third moment, after the first device adopts the first connection method to request to establish a communication connection with the third device, the method includes: adding the SDP information of the third device to the SDP queue; at the fifth moment, after the first device receives the first operation of the user, the method also includes: adding the establishment of a communication connection between the first device and the fourth device to the connection task queue.
[0032] In one possible implementation, after establishing a communication connection between the first device and the fourth device and adding them to the connection task queue, the processing unit is also used to: determine whether the time used by the first device and the second device to execute the communication connection process based on the first connection method is greater than the execution threshold; if the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fourth device; if the time used is less than the execution threshold, the first device continues to execute the communication connection process with the second device until the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fourth device, and the first device suspends the communication connection process with the second device.
[0033] In one possible implementation, the processing unit is also used for: at the seventh moment, the first device successfully establishes a communication connection with the fourth device; at the eighth moment, the first device and the third device execute a communication connection process based on the first connection method; at the ninth moment, the first device and the third device execute the communication connection process successfully or timeout; at the tenth moment, the first device and the second device execute the communication connection process.
[0034] Among them, the seventh moment is later than the sixth moment, the eighth moment is later than the seventh moment, the ninth moment is later than the eighth moment, and the tenth moment is later than the ninth moment; between the eighth moment and the ninth moment, the first device continues to execute the communication connection process with the third device, and the first device has not completed the communication connection with the third device; between the seventh moment and the ninth moment, the first device has not established a communication connection with the second device; at the ninth moment, the communication connection between the first device and the second device and the first remaining execution time are added to the connection task queue.
[0035] In a possible implementation, at the tenth moment, the time taken by the first device and the second device to execute the communication connection process is less than or equal to the first remaining execution time.
[0036] In one possible implementation, the processing unit is also used for: at the eleventh moment, the first device receives a second operation of the user, the second operation is used to instruct the first device to establish a communication connection with the fifth device, and the first operation and the second operation may be the same or different; at the twelfth moment, the first device uses the second connection method to execute a communication connection process with the fifth device; at the thirteenth moment, the first device successfully establishes a connection with the fifth device; at the fourteenth moment, the first device and the second device continue to execute the communication connection process based on the first connection method.
[0037] Among them, the eleventh moment is later than the tenth moment, the twelfth moment is later than the eleventh moment, the thirteenth moment is later than the twelfth moment, and the fourteenth moment is later than the thirteenth moment; at the twelfth moment, the first device suspends the communication connection process with the second device.
[0038] In one possible implementation, at the twelfth moment, the first device suspends the communication connection process with the second device, and the processing unit is used to: add the SDP information of the second device and the second remaining execution time to the SDP queue, the second remaining execution time includes: the difference between the first remaining execution time and the second executed time, the second executed time includes: the time used by the first device and the second device to execute the communication connection process between the ninth moment and the twelfth moment; remove the communication connection established between the first device and the second device from the connection task queue; establish the communication connection between the first device and the second device, and add the second remaining execution time to the connection task queue.
[0039] In a possible implementation, at the fourteenth moment, the time taken by the first device and the second device to continue to execute the communication connection process based on the first connection mode is less than or equal to the second remaining execution time.
[0040] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0043] In a sixth aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0044] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
[0045] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of a trust ring interface provided in an embodiment of the present application;
[0047] Figure 2 A schematic diagram of establishing a connection between a tablet computer and a headset provided in an embodiment of the present application;
[0048] Figure 3A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0049] Figure 4 A software structure block diagram of an electronic device provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of a device connection method provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of a device connection method provided in an embodiment of the present application;
[0052] Figure 7 A schematic diagram of a device connection apparatus provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0054] 1. Smart interconnection: The smart interconnection of electronic devices can be used to establish connections between electronic devices and other electronic devices, and smart interconnection can also be used to establish connections between electronic devices and external devices. Among them, electronic devices and other electronic devices can log in to the same account, and the connection between electronic devices and other electronic devices is used to indicate: in the smart interconnection of electronic devices, other electronic devices that log in to the same account as the electronic device can be found. By establishing connections, electronic devices and other electronic devices can support various business functions such as notification flow and call flow.
[0055] Smart Connect can be an application on any electronic device.
[0056] 2. Trust ring interface: In the smart interconnection of electronic devices, the trust ring interface can be displayed. The trust ring interface of the electronic device can be used to monitor and manage the electronic device, other electronic devices and external devices. Through the trust ring interface, the user can monitor the status of the electronic device, other electronic devices and external devices, and the status can include battery power, etc. Through the trust ring interface, the user can also establish a connection between the electronic device and the external device by dragging icons and other operations. The connection between the electronic device and the external device by dragging icons and other operations can be achieved on any electronic device with a trust ring interface.
[0057] For example, Figure 1 A schematic diagram of a trust ring interface provided in an embodiment of the present application, such as Figure 1 As shown, the trust ring interface includes the icon of the local device, the headset icon 101, and the tablet icon 102. Dragging the headset icon 101 to the tablet icon 102 indicates that the headset is connected to the tablet.
[0058] It should be understood that the trust ring interface can be any interface that can monitor and manage electronic devices, other electronic devices and external devices, and / or manage the trust ring network. The embodiment of the present application does not limit the style of the trust ring interface.
[0059] 3. Bluetooth socket connection and create bond connection: Bluetooth socket connection can be used by electronic devices to discover other electronic devices that are logged into the same account as the electronic device, that is, electronic devices establish connections with other electronic devices. Bluetooth socket connection is the core class for data exchange in the Bluetooth application programming interface (API).
[0060] Createbond connection can be used to establish a connection between an electronic device and an external device. Createbond connection is also the core class for data exchange in the Bluetooth API.
[0061] In an embodiment of the present application, a bluetooth socket connection may include a connection method used when an electronic device automatically initiates a communication connection with other electronic devices, and a createbond connection may include a connection method used when an electronic device initiates a communication connection with other electronic devices based on a user trigger.
[0062] In some implementations, before an electronic device establishes a connection with other electronic devices, it may be paired with other electronic devices through a createbond connection or other methods, or it may not be paired with other electronic devices. In the case of pairing with other electronic devices, the communication process of the Bluetooth socket connection may be encrypted, and in the case of not pairing with other electronic devices, the communication process of the Bluetooth socket connection is not encrypted. In the embodiment of the present application, there is no limitation on whether the electronic device is paired with other electronic devices. Next, the example of the electronic device not pairing with other electronic devices before the electronic device establishes a connection with other electronic devices is used for explanation.
[0063] 4. Other terms
[0064] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0065] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0066] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0067] 5. Electronic equipment
[0068] The electronic device of the embodiment of the present application may include a handheld device, a vehicle-mounted device, etc. with a device connection function. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, terminal devices in 5G networks or future evolved public land mobile communication networks (PLANs), and wireless terminals in smart cities. The embodiments of the present application do not limit this.
[0069] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0070] In addition, in the embodiments of the present application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0071] The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0072] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0073] When the electronic device establishes a connection with an external device, the connection may be slow or even fail. Next, take the example of dragging an icon in the trust ring interface of the electronic device to establish a connection with the external device, and the electronic device is a tablet, the other electronic device is a mobile phone, and the external device is a headset.
[0074] It should be understood that only when the icon of the headset appears in the trust ring interface of the tablet computer can the tablet computer and the headset be connected by dragging the icon, wherein there are multiple ways to make the icon of the headset appear in the trust ring interface of the tablet computer.
[0075] One implementation method is: after the mobile phone and the tablet computer are connected, the mobile phone and the headset are connected. When the mobile phone and the headset are connected successfully, the headset icon can appear on the trust ring interface of the tablet computer; another implementation method is: after the mobile phone and the headset are connected, the mobile phone and the tablet computer are connected. When the mobile phone and the tablet computer are connected successfully, the headset icon can appear on the trust ring interface of the tablet computer.
[0076] In some implementations, when the headset icon is visible in the trust ring interface of the tablet computer, the tablet computer and the headset can be connected by dragging the icon. Figure 2 The schematic diagram of establishing a connection between a tablet computer and a headset provided in an embodiment of the present application should be understood as follows: Figure 2 It is explained from the perspective of a tablet computer, such as Figure 2 As shown, the method includes:
[0077] S201, Smart Interconnect initiates a request to establish a connection with device A via a bluetooth socket connection.
[0078] It should be understood that before the tablet computer establishes a connection with the headset, the tablet computer may also need to establish connections with other electronic devices. For example, in an embodiment of the present application, it is taken as an example that the tablet computer may also need to establish connections with device A and device B. Since the system Bluetooth can process connection establishment requests serially, the system Bluetooth can first process the request to establish a connection with device A, and then process the request to establish a connection with device B.
[0079] In the embodiment of the present application, device A refers to other electronic devices that log in the same account as the tablet computer and are not displayed on the trust ring interface, indicating that device A has not established a connection with the tablet computer. It is understandable that when the tablet computer turns on smart interconnection, smart interconnection can initiate a request to establish a connection with other electronic devices that log in the same account as the tablet computer every preset time, and the preset time is, for example, 5 minutes (minutes, mins), or 3 minutes, etc.
[0080] S202: The socket management module sets the service discovery protocol (SDP) information of device A, and adds the SDP information of device A to the SDP queue.
[0081] The SDP information of device A can be used by the tablet computer to discover device A and establish a connection with device A. The SDP information of device A may include port information, transmission protocol and / or encoding method used by device A to establish a connection.
[0082] The SDP queue is used to store and manage the SDP information of one or more electronic devices. When the SDP module of the tablet computer processes the SDP message in the SDP queue, a serial method can be used so that the SDP information can be processed in a certain order. In the embodiment of the present application, the SDP information added to the SDP queue first can be processed first, and the SDP information added to the SDP queue later can be processed later. That is to say, in some implementations, the SDP information of device A is added to the SDP queue first, indicating that the SDP information of device A is processed first.
[0083] In a possible implementation, the socket management module sets the SDP information of device A, which may include: querying the SDP information of device A, and when device A returns the SDP information of device A to the socket management module, the socket management module may parse the SDP information. When the socket management module successfully parses the SDP information of device A, the SDP information of device A may be added to the SDP queue, so that the SDP module may process the information in the SDP queue in sequence.
[0084] S203: The SDP module adds the task of establishing a connection with device A to a connection task queue.
[0085] In a possible implementation, when the SDP information of device A exists in the SDP queue, the SDP module adds the task of establishing a connection with device A to the connection task queue.
[0086] S204: The link management module initiates a connection with device A.
[0087] In a possible implementation, when there is a task for establishing a connection with device A in the connection task queue, the link management module may initiate establishing a connection with device A.
[0088] S205, Smart Interconnect initiates a request to establish a connection with device B via a bluetooth socket connection.
[0089] In the embodiment of the present application, when the system Bluetooth processes the request to establish a connection with device A, the smart interconnection can initiate a request to establish a connection with device B through a bluetooth socket connection, and the system Bluetooth can process the request to establish a connection with device B. Among them, device B refers to other electronic devices that are logged in to the same account as the tablet computer and are not displayed on the trust ring interface, indicating that device B has not established a connection with the tablet computer.
[0090] S206. The socket management module sets the SDP information of device B and adds the SDP information of device B to the SDP queue.
[0091] The SDP information of device B may be used by the tablet computer to discover device B and establish a connection with device B. The SDP information of device B may include port information, transmission protocol and / or encoding method used by device B to establish a connection.
[0092] In an embodiment of the present application, the SDP information of device B is added to the SDP queue. At this time, the SDP information of device A and the SDP information of device B may exist in the SDP queue at the same time. Since the SDP information can be processed in a serial processing manner, that is, a possible implementation method includes: processing the SDP information according to the order of the SDP information in the SDP queue, and the SDP information of device A is added to the SDP queue earlier than the SDP information of device B. Therefore, the SDP module can process the SDP information of device B after completing the processing of the SDP information of device A.
[0093] In a possible implementation, the socket management module sets the SDP information of device B, which may include: querying the SDP information of device B, and when device B returns the SDP information of device B to the socket management module, the socket management module may parse the SDP information. When the socket management module successfully parses the SDP information of device B, the SDP information of device B may be added to the SDP queue, so that the SDP module may process the information in the SDP queue in sequence.
[0094] S207, the smart interconnection initiates a request to establish a connection with the headset through a createbond connection.
[0095] In a possible implementation, in response to a user dragging an icon on the trust ring interface, Smart Connect may initiate a request to establish a connection with the headset through a createbond connection.
[0096] S208: The device management module adds the task of establishing a connection with the headset to a connection task queue.
[0097] In an embodiment of the present application, when the device management module receives a request initiated by Smart Interconnect to establish a connection with the headset, the device management module can add the task of establishing a connection with the headset to the connection task queue. In a possible implementation, when the device management module adds the task of establishing a connection with the headset to the connection task queue, the task of establishing a connection with device A in the connection task queue has not been completed, that is, the connection with device A has not been successfully established. At this time, there can be tasks in the connection task queue at the same time: establishing a connection with device A and establishing a connection with the headset.
[0098] In relevant implementations, the link management module may process the link task queue in a serial processing manner, that is, a possible implementation method includes: the link management module executes the tasks according to the order of the tasks in the connection task queue, and the task of establishing a connection with device A is added to the connection task queue earlier than the task of establishing a connection with the headset. Therefore, the link management module can execute the task of establishing a connection with the headset only when the connection with device A is successfully established or the connection with device A times out.
[0099] Next, an example is given in which the link management module performs the task of establishing a connection with the headset when the connection with device A times out.
[0100] S209: When the unresponsive time for establishing a connection with device A reaches a first threshold, the link management module removes the task of establishing a connection with device A from the connection task queue, and initiates establishing a connection with the headset.
[0101] The first threshold is used to indicate the maximum permissible time for establishing a connection with device A. The first threshold is, for example, 8 seconds (s). When the no response time for establishing a connection with device A reaches 8s, it indicates that the connection with device A has timed out.
[0102] When the unresponsive time for establishing a connection with device A reaches a first threshold, the link management module can remove the task of establishing a connection with device A from the connection task queue. At this time, there may only be a task of establishing a connection with the headset in the connection task queue, and the link management module can start executing the task of establishing a connection with the headset. In other words, the link management module can initiate a connection with the headset.
[0103] S210 . The SDP module removes the SDP information of device A from the SDP queue, and adds the task of establishing a connection with device B to the connection task queue.
[0104] When the connection with device A times out, the SDP module may remove the SDP information of device A from the SDP queue. At this time, only the SDP information of device B may exist in the SDP queue. The SDP module may add the task of establishing a connection with device B to the connection task queue.
[0105] In a possible implementation, when the task of establishing a connection with device B is added to the connection task queue, the tablet computer has not successfully established a connection with the headset. At this time, there may be tasks in the connection task queue at the same time: establishing a connection with the headset, and establishing a connection with device B. The link management module can only execute the task of establishing a connection with device B when the connection with the headset is successfully established or the connection with the headset times out.
[0106] S211. The headset establishes a connection with the tablet computer and performs authentication and encryption.
[0107] In a possible implementation, in response to a request initiated by the link management module to establish a connection with the headset, the headset can establish a connection with the tablet computer and perform identity authentication. After completing the identity authentication, the connection between the headset and the tablet computer can be encrypted. The identity authentication is used to verify the identities of the headset and the tablet computer so that the headset and the tablet computer can establish a connection. The identity authentication can be achieved through a personal identification number (PIN) or a pairing code. The encryption is used to ensure that data transmission between the headset and the tablet computer is secure. The encryption can be achieved through a security manager protocol (SMP). The embodiment of the present application does not limit the methods of identity authentication and encryption.
[0108] S212. The tablet computer successfully establishes a connection with the headset. The link management module notifies the smart interconnection that the connection with the headset is successful, removes the task of establishing a connection with the headset from the connection task queue, and initiates a connection with device B.
[0109] Exemplarily, a successful connection between the tablet computer and the headset may indicate that a successful connection between the tablet computer and the headset is established within the Bluetooth system.
[0110] When the system Bluetooth successfully establishes a connection with the headset, the link management module can notify the device management module to successfully establish a connection with the headset, the device management module can notify Smart Connect to successfully establish a connection with the headset, Smart Connect can return the successful connection with the headset to the user, and the link management module can also remove the task of establishing a connection with the headset from the connection task queue. At this time, the connection task queue only has the task of establishing a connection with device B. The link management module can start executing the task of establishing a connection with device B and initiate a connection with device B.
[0111] S213: When the unresponsive time for establishing a connection with the headset reaches a second threshold, the smart interconnection notification system Bluetooth cancels the connection with the headset.
[0112] The second threshold is used to indicate the maximum permissible time for establishing a connection with the headset. The second threshold is, for example, 10 seconds. When the no response time for establishing a connection with the headset reaches 10 seconds, it indicates that the connection with the headset has failed.
[0113] It should be understood that the maximum allowable time for the tablet computer to establish a connection with the headset in a manner other than dragging the icon may be in the first time interval, and the first time interval is, for example, [3,4], indicating that if the time for the tablet computer to establish a connection with the headset exceeds 4s, the tablet computer and the headset fail to establish a connection.
[0114] However, in smart interconnection, the maximum allowable time for the tablet computer to establish a connection with the headset can be increased by a second time interval on the basis of the first time interval. For example, the second time interval is (0,8], indicating that the minimum time for the tablet computer to establish a connection with the headset can be 3s, and the maximum time can be 12s. That is to say, if the time for the tablet computer to establish a connection with the headset exceeds 12s, the tablet computer and the headset fail to establish a connection. In order to provide a better user experience, the second threshold value can be any value less than or equal to 12s. In the embodiment of the present application, the maximum allowable time for the tablet computer to establish a connection with the headset is 10s, that is, the second threshold value is 10s. For example,
[0115] In a possible implementation, when the unresponsive time for establishing a connection with the headset reaches a second threshold, within the system Bluetooth, the system Bluetooth tablet computer may successfully establish a connection with the headset, or the tablet computer may not successfully establish a connection with the headset.
[0116] In the system Bluetooth, if the tablet computer successfully establishes a connection with the headset, and the link management module also successfully notifies the smart interconnection that the connection with the headset is successfully established, the smart interconnection can notify the system Bluetooth to cancel the connection with the headset. That is to say, in the trust ring interface of the smart interconnection, it will be displayed that the connection with the headset fails. In the embodiment of the present application, the style of displaying the failure to establish a connection with the headset on the trust ring interface is not limited;
[0117] Within the system Bluetooth, if the tablet has not successfully established a connection with the headset, Smart Connect can also notify the system Bluetooth to cancel the connection with the headset.
[0118] S214: The system Bluetooth cancels the connection with the headset.
[0119] It should be understood that if the tablet computer and the headset are successfully connected within the system Bluetooth, canceling the connection with the headset means disconnecting the connection between the tablet computer and the headset; if the tablet computer and the headset have not been successfully connected within the system Bluetooth, canceling the connection with the headset means stopping the task of establishing a connection with the headset, and the tablet computer and the headset fail to establish a connection.
[0120] In the above embodiment, the system Bluetooth, socket management module, device management module, SDP module, and link management module can refer to the description in the subsequent embodiments, and will not be repeated here. Figure 2 The steps in the corresponding embodiments are all optional, the order of the steps can be exchanged, and the layers, modules or units executed by each step can be replaced by any achievable method without limitation.
[0121] Since the link management module can execute the tasks in the connection task queue in sequence, that is, the task of establishing a connection with the headset in the task queue can only be started when the task of establishing a connection with device A is completed or times out, the speed of establishing a connection with the headset will be slow, resulting in a poor user experience.
[0122] In addition, before the task of establishing a connection with device A is completed or times out, the user can request to establish a connection with the headset by dragging the icon in Smart Connect. If Smart Connect has not received the system Bluetooth notification of successful connection with the headset when the time for requesting to establish a connection with the headset exceeds the second threshold, Smart Connect will display to the user that the connection with the headset has failed, resulting in a poor user experience.
[0123] In view of this, an embodiment of the present application provides a device method and related apparatus. During the process of establishing a connection between an electronic device and other electronic devices, if the electronic device receives a request initiated by a user to establish a connection with an external device, the electronic device first executes the task of establishing a connection with the external device. In this way, there is no need to wait for the failure or timeout of establishing a connection with other electronic devices before initiating a connection with the external device, thereby being able to establish a connection with the external device more quickly. In addition, if the connection with the external device is successfully established, the system Bluetooth can also more quickly notify the application of the successful connection with the external device, thereby improving the user experience.
[0124] The device connection method provided in the embodiment of the present application can be implemented based on an electronic device. To facilitate understanding of the device connection method provided in the embodiment of the present application, the hardware structure of the electronic device provided in the embodiment of the present application is introduced below.
[0125] For example, Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0126] The electronic device may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, and a subscriber identification module (SIM) card interface, etc. The sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, a bone conduction sensor 380M, etc.
[0127] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented by hardware, software, or a combination of software and hardware.
[0128] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0129] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0130] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0131] In some embodiments, the processor 310 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc.
[0132] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0133] The camera 393 can be used to capture still images or videos. In some embodiments, the electronic device may include at least one camera 393. The internal memory 321 may be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 321 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as an image capture function, an image editing function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as image data, video streams, etc.), etc. In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 310 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 321, and / or instructions stored in a memory provided in the processor.
[0134] Illustratively, in an embodiment of the present application, by running the executable program code related to the device connection method provided in the embodiment of the present application by the processor 310, it is possible to initiate a connection with an external device without waiting for a connection with other electronic devices to succeed, fail, or time out, thereby establishing a connection with an external device more quickly.
[0135] Figure 4 A software structure block diagram of an electronic device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the operating system can be divided into four layers, namely, from top to bottom, the application layer (applications), the application framework layer (application framework), the native service layer (native) and the driver layer (driver).
[0136] The application layer can include a series of application packages, and the application layer runs applications by calling the API provided by the application framework layer. Figure 4 As shown, the application package may include applications such as smart interconnection, sports health, Bluetooth connection, wireless fidelity (wifi) connection, and camera application. Applications may include system applications and third-party applications.
[0137] The application framework layer provides API and programming framework for the application layer. The application framework layer includes some predefined functions. Figure 4As shown, the application framework layer may include a Bluetooth manager (bluetoothmanager), a wireless fidelity manager (wifi manager), and a camera manager (camera manager), etc.
[0138] The local layer is used to directly interact with the underlying functions of the hardware or operating system. The local layer may include an API provided by the operating system, such as Figure 4 As shown, the local layer includes a Bluetooth protocol stack, WiFi, and camera, etc. The SDP module and the link management module in the above embodiment may be in the Bluetooth protocol stack.
[0139] Among them, the SDP module is used to manage the connection task queue, and managing the connection task queue may include: adding the task of establishing a connection with other electronic devices to the connection task queue, removing the task of establishing a connection with other electronic devices from the connection task queue, adding the task of establishing a connection with an external device to the connection task queue, or removing the task of establishing a connection with an external device from the connection task queue; the SDP module can also manage the SDP queue, and managing the SDP queue may include: adding the SDP information of the electronic device or other electronic devices to the SDP queue, or removing the SDP information of the electronic device or other electronic devices from the SDP queue.
[0140] The link management module is used to serially execute tasks in the connection task queue.
[0141] The driver layer is the layer between hardware and software. Figure 4 As shown, the driver layer may include one or more of the following: a bluetooth driver, a wireless fidelity driver (wifi driver), and a camera device driver (cameradriver), etc.
[0142] The socket management module and the device management module in the above embodiments can be located in one or more layers of the application layer, the application framework layer, the local service layer and the driver layer. That is to say, the application layer, the application framework layer, the local service layer and / or the driver layer can be combined to implement the corresponding functions of the socket management module and the device management module.
[0143] Among them, the socket management module can be used to set the SDP information of other electronic devices, and the socket management module can also be used to manage the SDP queue.
[0144] The device management module may be used to receive a message indicating a successful or failed connection between the electronic device and the external device. The device management module may also be used to add a task of connecting to the external device to a connection task queue.
[0145] The system Bluetooth described in this application may include: a socket management module, a device management module, an SDP module, and a link management module. By combining these modules, the system Bluetooth can process requests initiated by Smart Interconnect to establish connections with other electronic devices, and requests initiated by Smart Interconnect to establish connections with external devices.
[0146] It should be understood that in some embodiments, the layers implementing the same function may be called by other names, or the layers capable of implementing the functions of multiple layers may be regarded as one layer, or the layers capable of implementing the functions of multiple layers may be divided into multiple layers. The embodiments of the present application are not limited to this.
[0147] It should be noted that the embodiments of the present application are only illustrated using the Android operating system as an example. In other operating systems (such as the Windows operating system, the iOS operating system, etc.), as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solutions of the present application can also be implemented.
[0148] The device connection method provided in the embodiment of the present application is described below in conjunction with specific embodiments. The following embodiments can be combined with each other, and the same or similar conceptual processes may not be described in detail in some embodiments.
[0149] Figure 5 A schematic diagram of a device connection method provided in an embodiment of the present application. Figure 5 As shown, the method includes:
[0150] S501, Smart Interconnect initiates a request to establish a connection with device A via a bluetooth socket connection.
[0151] S502: The socket management module sets the SDP information of device A and adds the SDP information of device A to the SDP queue.
[0152] S503: The SDP module adds the task of establishing a connection with device A to a connection task queue.
[0153] In the embodiment of the present application, the specific implementation of S501-S503 is consistent with S201-S203 and will not be repeated here.
[0154] S504: The link management module initiates a connection with device A and records a start time of initiating the connection with device A.
[0155] In a possible implementation, when there is a task to establish a connection with device A in the connection task queue, the link management module may initiate a connection with device A and may record the start time of initiating the connection with device A through a timer or other means.
[0156] For example, by recording the start time of initiating the connection with device A, in the subsequent execution method, when Smart Connect initiates a request to establish a connection with the headset through the createbond connection, the time used to establish the connection with device A can be judged. If the time is too long, the connection with device A is canceled, so that the link management module can execute the task of establishing a connection with the headset and initiate the connection with the headset.
[0157] In this way, the link management module can initiate a connection with the headset without failing to establish a connection with device A or timing out the connection with device A, which can speed up the speed of establishing a connection with the headset. In addition, if the connection with the headset is successfully established, the user experience can be further improved.
[0158] S505, Smart Interconnect initiates a request to establish a connection with device B via a bluetooth socket connection.
[0159] S506: The socket management module sets the SDP information of device B and adds the SDP information of device B to the SDP queue.
[0160] S507: Smart Connect initiates a request to establish a connection with the headset through a createbond connection.
[0161] S508: The device management module adds the task of establishing a connection with the headset to a connection task queue.
[0162] In the embodiment of the present application, the specific implementation of S505-S508 is consistent with S205-S208 and will not be repeated here.
[0163] When the application layer initiates a request to establish a connection with an external device through a createbond connection, the link management module can prioritize the task of initiating a connection with an external device through a createbond connection, and then initiate a connection with other electronic devices through a bluetoothsocket connection.
[0164] It should be understood that when the application layer initiates a request to establish a connection with an external device through a createbond connection, it is determined whether the time taken by the link management module to initiate the connection with other electronic devices is less than a third threshold. If it is less than the third threshold, the timer is started to wait. If it is equal to the third threshold, the initiation of establishing a connection with other electronic devices is canceled, and the establishment of a connection with the external device is initiated; if it is greater than the third threshold, the initiation of establishing a connection with other electronic devices is canceled, and the establishment of a connection with the external device is initiated. The specific implementation method can refer to S509-S514.
[0165] The third threshold may be set to any value that is less than or equal to the first threshold. In order to enable the user to obtain a better experience, the third threshold may be any value that is less than the first threshold.
[0166] In the embodiment of the present application, an external device, for example, includes headphones, and other electronic devices, for example, include device A.
[0167] It should be understood that, exemplarily, when there are both tasks of establishing a connection with device A and tasks of establishing a connection with headphones in the connection task queue, S509-S514 can be used to enable the tablet computer to establish a connection with the headphones more quickly, so that the system Bluetooth of the tablet computer can quickly notify the smart interconnect that the connection with the headphones is successfully established, thereby improving the user experience.
[0168] S509: When the unresponsive time for establishing a connection with device A reaches a third threshold, the link management module removes the task of establishing a connection with device A from the connection task queue, and initiates establishing a connection with the headset.
[0169] It should be understood that the description of the third threshold in the embodiment of the present application can refer to the description of the third threshold in the above embodiment. In the following embodiment, the third threshold of 2s is taken as an example for description.
[0170] In a possible implementation, when there is no response time for establishing a connection with device A is greater than or equal to 2s, the link management module can cancel the connection with device A and remove the task of establishing a connection with device A from the connection task queue. At this time, the connection task queue may only have the task of establishing a connection with the headset, and the link management module can initiate a connection with the headset.
[0171] S510. The SDP module adds the SDP information of the device A carrying the first remaining execution time to the SDP queue, and adds the task of establishing a connection with the device B to the connection task queue.
[0172] The first remaining execution time refers to the maximum allowable time for establishing a connection with device A when the link management module initiates establishing a connection with device A again in the subsequent execution method. In a possible implementation, the first remaining execution time may be the difference between the first threshold and the first executed time. The first executed time may include: the time used for the tablet computer to establish a connection with device A between executing S504-S509.
[0173] Exemplarily, if the first execution time is 2s and the first threshold is 8s, the first remaining execution time is 6s, indicating that if the link management module fails to successfully establish a connection with device A within 6s, the connection with device A times out.
[0174] In a possible implementation, between executing S504-S509, when the time to establish a connection with device A is greater than or equal to a third threshold, the SDP module may add the SDP information of device A carrying the first remaining execution time to the SDP queue. At this time, the SDP queue may simultaneously contain the SDP information of device B and the SDP information of device A carrying the first remaining execution time. The SDP module may process these SDP information according to the order of the SDP information in the SDP queue. Since the SDP information of device B is added to the SDP queue earlier than the SDP information of device A carrying the first remaining execution time, the SDP module may add the task of establishing a connection with device B to the connection task queue and wait for a successful connection with the headset. The link management module may then execute the task of establishing a connection with device B and initiate a connection with device B.
[0175] S511. The headset establishes a connection with the tablet computer and performs authentication and encryption.
[0176] S512: The tablet computer successfully establishes a connection with the headset. The link management module notifies the smart interconnection that the connection with the headset is successful, removes the task of establishing a connection with the headset from the connection task queue, and initiates a connection with device B.
[0177] In the embodiment of the present application, the specific implementation of S511-S512 is consistent with S211-S212 and will not be repeated here.
[0178] Since the link management module does not need to wait for the unresponsive time to reach the first threshold to establish a connection with device A, it can execute the task of establishing a connection with the headset and initiate a connection with the headset, which can increase the speed of establishing a connection with the headset. In addition, if the connection with the headset is successfully established, the link management module can also notify Smart Interconnect more quickly that the connection with the headset is successfully established, which can improve the user experience.
[0179] S513. When the connection with device B is successfully established or times out, the SDP module removes the SDP information of device B from the SDP queue, removes the task of establishing a connection with device B from the connection task queue, and adds the task of establishing a connection with device A with the first remaining execution time to the connection task queue.
[0180] In one possible implementation, when the connection with device B is successfully established or times out, the SDP module may remove the SDP information of device B from the SDP queue. At this time, the SDP queue may only contain the SDP information of device A carrying the first remaining execution time, and the task of establishing a connection with device A carrying the first remaining execution time may be added to the connection task queue so that the link management module can initiate a connection with device A.
[0181] S514: The link management module initiates a connection with device A and records a start time of initiating the connection with device A.
[0182] In one possible implementation, when there is a task for establishing a connection with device A with a first remaining execution time in the connection task queue, the link management module can initiate a connection with device A, and can record the start time of initiating the connection with device A through a timer or other means, so that in the following embodiments, when the smart interconnect initiates a request to establish a connection with other external devices through a createbond connection, the link management module can initiate a connection with other external devices more quickly. Next, other external devices including vehicle computers are used as examples for explanation.
[0183] S515. The third-party application initiates a request to establish a connection with the vehicle computer through the createbond connection.
[0184] In a possible implementation, the user may initiate a request to establish a connection with the vehicle computer through a createbond connection by enabling a Bluetooth connection in a third-party application of the vehicle computer.
[0185] S516. The device management module adds the task of establishing a connection with the vehicle computer to the connection task queue.
[0186] In an embodiment of the present application, when the device management module receives a request initiated by a third-party application to establish a connection with the vehicle computer, the device management module can add the task of establishing a connection with the vehicle computer to a connection task queue.
[0187] Exemplarily, when the device management module adds the task of establishing a connection with the vehicle computer to the connection task queue, the task of establishing a connection with device A in the connection task queue has not been completed. The time to establish a connection with device A may be greater than or equal to the third threshold, or may be less than the third threshold. For example, the time to establish a connection with device A is 3s. In the following embodiments, the time to establish a connection with device A is 3s as an example.
[0188] S517: When the unresponsive time for establishing a connection with device A reaches a third threshold, the link management module removes the task of establishing a connection with device A from the connection task queue, and initiates establishing a connection with the vehicle computer.
[0189] For example, when the time to establish a connection with device A is 3s, the link management module cancels the connection with device A and removes the task of establishing a connection with device A from the connection task queue. At this time, the connection task queue may only have the task of establishing a connection with the vehicle computer, and the link management module can initiate the connection with the vehicle computer.
[0190] Since the link management module does not need to wait for the unresponsive time to reach the first remaining execution time to establish a connection with device A, it can execute the task of establishing a connection with the vehicle computer and initiate a connection with the vehicle computer, which can improve the speed of establishing a connection with the vehicle computer. In addition, if the connection with the vehicle computer is successfully established, the link management module can also notify the third-party application more quickly that the connection with the vehicle computer is successfully established, which can improve the user experience.
[0191] S518. The SDP module adds the SDP information of device A carrying the second remaining execution time to the SDP queue, and adds the task of establishing a connection with device A carrying the second remaining execution time to the connection task queue.
[0192] The second remaining execution time may refer to the maximum permissible time for establishing a connection with device A when the link management module initiates establishing a connection with device A again in the following execution method. In a possible implementation, the second remaining execution time may be the difference between the first remaining execution time and the second executed time. The second executed time may include: the time taken by the tablet computer to establish a connection with device A between executing S514-S517. If the first remaining execution time is 6s and the second executed time is 3s, the second remaining execution time is 3s, indicating that if the link management module takes more than 3s to initiate establishing a connection with device A again, the connection establishment with device A will time out.
[0193] In a possible implementation, between executing S514-S517, when the time to establish a connection with device A is greater than or equal to the third threshold, the SDP module may add the SDP information of device A carrying the second remaining execution time to the SDP queue. At this time, the SDP queue may only contain the SDP information of device A carrying the second remaining execution time. The SDP module may add the task of establishing a connection with device A to the connection task queue, and wait for the connection to be successfully established with the vehicle computer. The link management module may then execute the task of establishing a connection with device A and initiate the establishment of a connection with device A.
[0194] S519: The vehicle computer establishes a connection with the tablet computer and performs authentication and encryption.
[0195] In a possible implementation manner, the specific implementation method of establishing a connection between the vehicle computer and the tablet computer and performing authentication encryption may refer to the specific implementation method of establishing a connection between the headset and the tablet computer and performing authentication encryption in S211, which will not be described in detail here.
[0196] S520, the tablet computer successfully establishes a connection with the vehicle computer, the link management module notifies the third-party application that the connection with the vehicle computer is successfully established, removes the task of establishing a connection with the vehicle computer from the connection task queue, initiates a connection with device A, and records the start time of initiating the connection with device A.
[0197] Since the link management module does not need to wait for the unresponsive time to reach the first remaining execution time to establish a connection with device A, it can execute the task of establishing a connection with the vehicle computer and initiate a connection with the vehicle computer, which can improve the speed of establishing a connection with the vehicle computer. In addition, if the connection with the vehicle computer is successfully established, the link management module can also notify the third-party application more quickly that the connection with the vehicle computer has been successfully established, thereby improving the user experience.
[0198] It should be understood that the logs generated by the embodiments of the present application can be stored in the host controller interface (HCI) log of the system Bluetooth, or in the logs of other paths, and the embodiments of the present application do not limit this; the link management module can use a Bluetooth low energy (BLE) link or other methods to establish a connection with other electronic devices, and the embodiments of the present application do not limit the method of establishing the connection.
[0199] It is understandable that in Figure 5 The steps in the corresponding embodiments are all optional, the order of the steps can be exchanged, and the layers, modules or units executed by each step can be replaced by any achievable method without limitation.
[0200] The following specific embodiments are used to describe the file reading method of the present application in detail. The following embodiments can be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0201] Figure 6 The present invention provides a flow chart of a device connection method according to an embodiment of the present invention. The method is applied to electronic devices such as Figure 6 As shown, the method includes:
[0202] S601. At a first moment, a first device requests to establish a communication connection with a second device using a first connection method.
[0203] In the embodiment of the present application, the first connection mode request may include the Bluetooth socket connection mode in the above embodiment, and the first device may be understood as Figure 5 In the embodiment, the second device can be understood as a tablet computer. Figure 5 For device A in the embodiment, the first moment can be understood as any moment of executing S501. In the smart interconnection of the first device, the first connection method can be used to request to establish a communication connection with the second device. It should be understood that the first device can use the first connection method to request to establish a communication connection with the second device or the third device every preset time period.
[0204] In the case where the first device uses the first connection mode to request to establish a communication connection with the second device, S602 to S606 may be executed.
[0205] S602: At a second moment, the first device and the second device execute a communication connection process based on the first connection mode.
[0206] In the embodiment of the present application, the second moment can be understood as any moment between executing S502-S504, and the specific implementation method of the first device and the second device executing the communication connection process based on the first connection method can refer to S502-S504 in the aforementioned embodiment.
[0207] Exemplarily, when the first device and the second device execute a communication connection process based on the first connection method, the start time of executing the communication connection process with the second device can be recorded. Exemplarily, the start time can be recorded by a timer or other methods. The specific implementation method can refer to S504 in the aforementioned embodiment.
[0208] S603: At a third moment, the first device uses the first connection mode to request to establish a communication connection with the third device.
[0209] In the embodiment of the present application, the third moment can be understood as any moment between executing S505-S506, and the second device can be understood as Figure 5For device B in the embodiment, when the first device adopts the first connection method to request to establish a communication connection with the third device, the first device can set the SDP information of the third device and add the SDP information of the third device to the SDP queue. The specific implementation method can refer to S506 in the aforementioned embodiment.
[0210] S604, at a fourth moment, the first device and the second device continue to execute the communication connection process based on the first connection mode, and the first device does not execute the communication connection process with the third device.
[0211] In the embodiment of the present application, the fourth moment can be understood as any moment between the execution of S507-S508 and earlier than the fifth moment. Since the establishment of the communication connection between the first device and the third device is actively initiated by the first device, the user is unaware of the success of the establishment of the communication connection between the first device and the third device. Therefore, the communication connection process can be executed with the second device based on the first connection method in the order of requesting to establish the communication connection.
[0212] S605. At the fifth moment, the first device receives a first operation from the user, where the first operation is used to instruct the first device to establish a communication connection with the fourth device. Between the first moment and the fifth moment, the first device continues to execute the communication connection process with the second device, and the first device has not completed the communication connection with the second device. Between the third moment and the fifth moment, the first device has not established a communication connection with the third device.
[0213] In the embodiment of the present application, the fifth moment can be understood as any moment of executing S507, the first operation can be understood as the operation of enabling Bluetooth connection in the above embodiment, or dragging an icon in the smart interconnection, etc., without limitation, and the fourth device can be understood as Figure 5 Headphones in an embodiment. Exemplarily, before the first device establishes a communication connection with the fourth device, the first device may perform a communication connection process with the second device, until the time taken by the first device and the second device to perform the communication connection process is greater than or equal to the execution threshold, the first device may perform the communication connection process with the fourth device, that is, S606 may be executed.
[0214] S606. At the sixth moment, the first device uses the second connection mode to execute the communication connection process with the fourth device, and the second connection mode is different from the first connection mode. The second moment is later than the first moment, the third moment is later than the second moment, the fourth moment is later than the third moment, the fifth moment is later than the fourth moment, and at the sixth moment, the first device suspends the communication connection process with the second device.
[0215] In an embodiment of the present application, the sixth moment can be understood as any moment between execution S508-S510, and the second connection mode request can include the createbond connection mode in the above embodiment. Since the link management module of the first device can execute the communication connection process serially, the first device suspends the communication connection process with the second device before executing the communication connection process with the fourth device.
[0216] Optional, in Figure 6 On the basis of the embodiment, at the sixth moment, the first device suspends the communication connection process with the second device, and the service discovery protocol SDP information of the second device and the first remaining execution time can also be added to the SDP queue; the first remaining execution time includes: the difference between the execution time threshold and the first executed time, and the first executed time includes: the time used by the first device and the second device to execute the communication connection process between the first moment and the sixth moment; the communication connection established between the first device and the second device is removed from the connection task queue; the communication connection established between the first device and the third device is added to the connection task queue.
[0217] In an embodiment of the present application, the execution time threshold may refer to the expression of the first threshold in the aforementioned embodiment, the first remaining execution time and the first executed time may refer to the expression in the aforementioned embodiment, and no further elaboration is given. The specific implementation method of adding the service discovery protocol SDP information of the second device and the first remaining execution time to the SDP queue may refer to S510 in the aforementioned embodiment, the specific implementation method of establishing a communication connection between the first device and the third device and adding the connection task queue may also refer to S510 in the aforementioned embodiment, and the specific implementation method of removing the communication connection between the first device and the second device from the connection task queue may refer to S509 in the aforementioned embodiment, and no further elaboration is given.
[0218] Optionally, at the second moment, the first device and the second device execute the communication connection process based on the first connection method, and can also: add the SDP information of the second device to the SDP queue, and add the communication connection established between the first device and the second device to the connection task queue; at the third moment, after the first device adopts the first connection method to request to establish a communication connection with the third device, it can also: add the SDP information of the third device to the SDP queue; at the fifth moment, after the first device receives the user's first operation, it can also: establish a communication connection between the first device and the fourth device and add it to the connection task queue.
[0219] In an embodiment of the present application, the specific implementation method of adding the SDP information of the second device to the SDP queue can refer to S502 in the aforementioned embodiment, the specific implementation method of establishing a communication connection between the first device and the second device and adding it to the connection task queue can refer to S503 in the aforementioned embodiment, and after the first device adopts the first connection method to request to establish a communication connection with the third device, the specific implementation method of adding the SDP information of the third device to the SDP queue can refer to S506 in the aforementioned embodiment, and after the first device receives the user's first operation, the specific implementation method of establishing a communication connection between the first device and the fourth device and adding them to the connection task queue can refer to S508 in the aforementioned embodiment.
[0220] Optionally, after establishing a communication connection between the first device and the fourth device and adding them to the connection task queue, it is also possible to: determine whether the time used by the first device and the second device to execute the communication connection process based on the first connection method is greater than the execution threshold; if the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fourth device; if the time used is less than the execution threshold, the first device continues to execute the communication connection process with the second device until the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fourth device, and the first device suspends the communication connection process with the second device.
[0221] In the embodiment of the present application, the execution threshold can be understood as the third threshold in the above embodiment.
[0222] Exemplarily, it is possible to determine whether the time taken by the first device and the second device to execute the communication connection process based on the first connection method is greater than the execution threshold based on the start time of the communication connection process executed by the first device and the second device recorded in S504. After the determination is made, the specific implementation method may refer to S508 in the aforementioned embodiment.
[0223] Optionally, at the seventh moment, the first device successfully establishes a communication connection with the fourth device; at the eighth moment, the first device and the third device execute a communication connection process based on the first connection method; at the ninth moment, the first device and the third device execute the communication connection process successfully or timeout; at the tenth moment, the first device and the second device execute the communication connection process; among them, the seventh moment is later than the sixth moment, the eighth moment is later than the seventh moment, the ninth moment is later than the eighth moment, and the tenth moment is later than the ninth moment.
[0224] Between the eighth moment and the ninth moment, the first device continues to execute the communication connection process with the third device, and the first device has not completed the communication connection with the third device; between the seventh moment and the ninth moment, the first device has not established a communication connection with the second device; at the ninth moment, the communication connection between the first device and the second device and the first remaining execution time are added to the connection task queue.
[0225] In the embodiment of the present application, the seventh moment can be understood as any moment between executing S511-S512, the eighth moment can be understood as any moment of executing S512, the ninth moment can be understood as any moment of executing S513, and the tenth moment can be understood as any moment of executing S514-S516.
[0226] In the embodiment of the present application, the first device successfully establishes a communication connection with the fourth device, which means that the system Bluetooth of the first device successfully notifies the first device's smart interconnection that the communication connection with the fourth device is successfully established. In the case where the first device successfully executes the communication connection process with the third device or times out, the first device can re-execute the communication connection process with the second device.
[0227] It should be understood that when the first device and the second device execute a communication connection process, the start time of the communication connection process with the first device and the second device can be recorded. Exemplarily, the start time can be recorded by a timer or other means. The specific implementation method can refer to S504 in the aforementioned embodiment, which will not be repeated here.
[0228] Optionally, at the tenth moment, the time taken by the first device and the second device to execute the communication connection process is less than or equal to the first remaining execution time.
[0229] In an embodiment of the present application, the maximum time used by the first device and the second device to execute the communication connection process may be less than or equal to the first remaining execution time. If it is greater than the first remaining execution time, the first device and the second device cannot execute the communication connection process.
[0230] Optionally, at the eleventh moment, the first device receives a second operation of the user, and the second operation is used to instruct the first device to establish a communication connection with the fifth device, and the first operation and the second operation may be the same or different; at the twelfth moment, the first device uses the second connection method to execute the communication connection process with the fifth device; at the thirteenth moment, the first device successfully establishes a connection with the fifth device; at the fourteenth moment, the first device and the second device continue to execute the communication connection process based on the first connection method.
[0231] Among them, the eleventh moment is later than the tenth moment, the twelfth moment is later than the eleventh moment, the thirteenth moment is later than the twelfth moment, and the fourteenth moment is later than the thirteenth moment; at the twelfth moment, the first device suspends the communication connection process with the second device.
[0232] In the embodiment of the present application, the eleventh moment can be understood as any moment of executing S515, the twelfth moment can be understood as any moment of executing S516-S519, the thirteenth moment can be understood as any moment of executing the first part of the method in S520, and the first part of the method can include: the tablet computer successfully establishes a connection with the vehicle computer, the link management module notifies the three-party application that the connection with the vehicle computer is successfully established, and removes the task of establishing a connection with the vehicle computer from the connection task queue, the fourteenth moment can be understood as any moment of executing the second part of the method in S520, and the second part of the method can include: initiating a connection with device A, and recording the starting time of initiating the connection with device A, as well as optional methods after S520.
[0233] In the embodiment of the present application, the second operation may include enabling a Bluetooth connection, etc., and the fifth device may be understood as Figure 5 The vehicle computer in the embodiment should be understood that before the twelfth moment, it can also: determine whether the time used by the first device and the second device to execute the communication connection process based on the first connection method is greater than the execution threshold; if the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fifth device; if the time used is less than the execution threshold, the first device continues to execute the communication connection process with the second device until the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fifth device, and the first device suspends the communication connection process with the second device.
[0234] Optionally, at the twelfth moment, the first device suspends the communication connection process with the second device, and can: add the SDP information of the second device and the second remaining execution time to the SDP queue, the second remaining execution time including: the difference between the first remaining execution time and the second executed time, the second executed time including: the time taken by the first device and the second device to execute the communication connection process between the ninth moment and the twelfth moment; remove the communication connection established between the first device and the second device from the connection task queue; add the communication connection established between the first device and the second device and the second remaining execution time to the connection task queue.
[0235] Optionally, at the fourteenth moment, the time taken by the first device and the second device to continue to execute the communication connection process based on the first connection mode is less than or equal to the second remaining execution time.
[0236] In an embodiment of the present application, the second remaining execution time and the second executed time can refer to the description in the aforementioned embodiment, the specific implementation method of adding the SDP information of the second device and the second remaining execution time to the SDP queue can refer to S518 in the aforementioned embodiment, the specific implementation method of establishing a communication connection between the first device and the second device and removing it from the connection task queue can refer to S517 in the aforementioned embodiment, and the specific implementation method of establishing a communication connection between the first device and the second device and adding the second remaining execution time to the connection task queue can refer to S518 in the aforementioned embodiment.
[0237] The embodiments of the present application have the same technical effects as the above embodiments, and reference may be made to the descriptions in the above embodiments, which will not be repeated here.
[0238] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.
[0239] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data 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 the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0240] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0241] The embodiment of the present application can divide the functional modules of the device implementing the method according to the above method example. Figure 7 This is a schematic diagram of a device connection device provided in an embodiment of the present application. Figure 7, the device connection device 700 includes a processor 701, a communication interface 702 and a memory 703. The processor 701, the communication interface 702 and the memory 703 communicate with each other through an internal connection path, the memory 703 is used to store instructions, and the processor 701 is used to execute the instructions stored in the memory 703. The communication interface 702 can be used to send signals to other devices (such as the processor 701 or the touch screen of the electronic device), and can also be used to receive signals from other devices (such as the memory 703). Exemplarily, the communication interface 702 reads the instructions stored in the memory 703 and sends the instructions to the processor 701.
[0242] It should be understood that the device 700 can be specifically an electronic device in the above-mentioned embodiment, and can be used to execute the various steps and / or processes corresponding to the electronic device in the above-mentioned method embodiment. Optionally, the memory 703 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type. The processor 701 may be used to execute instructions stored in the memory, and when the processor 701 executes instructions stored in the memory, the processor 701 is used to execute the various steps and / or processes of the above-mentioned method embodiment.
[0243] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0244] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor executes the instructions in the memory, and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0245] The device connection method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0246] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.
[0247] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0248] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0249] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0250] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0251] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0252] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A device connection method, characterized in that: include: At a first moment, the first device requests to establish a communication connection with the second device using a first connection mode; At a second moment, the first device and the second device perform a communication connection process based on the first connection mode; At a third moment, the first device uses the first connection mode to request to establish a communication connection with a third device; At a fourth moment, the first device and the second device continue to perform the communication connection process based on the first connection mode, and the first device does not perform the communication connection process with the third device; At a fifth moment, the first device receives a first operation of the user, where the first operation is used to instruct the first device to establish a communication connection with a fourth device; At a sixth moment, the first device performs a communication connection process with the fourth device using a second connection mode, where the second connection mode is different from the first connection mode; The second moment is later than the first moment, the third moment is later than the second moment, the fourth moment is later than the third moment, and the fifth moment is later than the fourth moment; Between the first moment and the fifth moment, the first device continues to execute the communication connection process with the second device, and the first device has not completed the communication connection with the second device; Between the third moment and the fifth moment, the first device does not establish a communication connection with the third device; At the sixth moment, the first device suspends the communication connection process with the second device.
2. The method according to claim 1, characterized in that At the sixth moment, the first device suspends the communication connection process with the second device, including: Adding the service discovery protocol SDP information of the second device and the first remaining execution time to the SDP queue; the first remaining execution time includes: the difference between the execution time threshold and the first executed time, and the first executed time includes: the time used by the first device and the second device to execute the communication connection process between the first moment and the sixth moment; Remove the communication connection established between the first device and the second device from the connection task queue; Establishing a communication connection between the first device and the third device is added to the connection task queue.
3. The method according to any one of claims 1 to 2, characterized in that: At the second moment, the first device and the second device perform a communication connection process based on the first connection mode, including: adding the SDP information of the second device to the SDP queue, and adding the establishment of a communication connection between the first device and the second device to the connection task queue; At the third moment, after the first device uses the first connection mode to request to establish a communication connection with the third device, the method includes: adding the SDP information of the third device to the SDP queue; At the fifth moment, after the first device receives the first operation of the user, the method further includes: establishing a communication connection between the first device and the fourth device and adding the connection to the connection task queue.
4. The method according to claim 3, characterized in that After the communication connection between the first device and the fourth device is established and added to the connection task queue, the method further includes: determining whether the time taken by the first device and the second device to execute the communication connection process based on the first connection mode is greater than an execution threshold; If the time used is greater than or equal to the execution threshold, the first device uses the second connection mode to perform a communication connection process with the fourth device; If the time used is less than the execution threshold, the first device continues to execute the communication connection process with the second device until the time used is greater than or equal to the execution threshold, the first device uses the second connection method to execute the communication connection process with the fourth device, and the first device suspends the communication connection process with the second device.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: At the seventh moment, the first device successfully establishes a communication connection with the fourth device; At an eighth moment, the first device and the third device perform a communication connection process based on the first connection mode; At a ninth moment, the first device and the third device execute a communication connection process successfully or timeout; At the tenth moment, the first device and the second device perform a communication connection process; The seventh time is later than the sixth time, the eighth time is later than the seventh time, the ninth time is later than the eighth time, and the tenth time is later than the ninth time; Between the eighth moment and the ninth moment, the first device continues to execute the communication connection process with the third device, and the first device has not completed the communication connection with the third device; Between the seventh moment and the ninth moment, the first device does not establish a communication connection with the second device; At the ninth moment, establishing a communication connection between the first device and the second device, and adding the first remaining execution time to the connection task queue.
6. The method according to claim 5, characterized in that At the tenth moment, the time taken by the first device and the second device to execute the communication connection process is less than or equal to the first remaining execution time.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: At the eleventh moment, the first device receives a second operation of the user, where the second operation is used to instruct the first device to establish a communication connection with a fifth device, and the first operation and the second operation may be the same or different; At the twelfth moment, the first device performs a communication connection process with the fifth device using the second connection mode; At the thirteenth moment, the first device successfully establishes a connection with the fifth device; At the fourteenth moment, the first device and the second device continue to perform the communication connection process based on the first connection mode; The eleventh time is later than the tenth time, the twelfth time is later than the eleventh time, the thirteenth time is later than the twelfth time, and the fourteenth time is later than the thirteenth time; At the twelfth moment, the first device suspends the communication connection process with the second device.
8. The method according to any one of claims 5 to 7, characterized in that: At the twelfth moment, the first device suspends the communication connection process with the second device, including: Adding the SDP information of the second device and the second remaining execution time to the SDP queue, wherein the second remaining execution time includes: the difference between the first remaining execution time and the second executed time, and the second executed time includes: the time taken by the first device and the second device to perform the communication connection process between the ninth moment and the twelfth moment; removing the communication connection established between the first device and the second device from the connection task queue; Establishing a communication connection between the first device and the second device, and adding the second remaining execution time to the connection task queue.
9. The method according to any one of claims 7-8, characterized in that: At the fourteenth moment, the time taken by the first device and the second device to continue to execute the communication connection process based on the first connection mode is less than or equal to the second remaining execution time.
10. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method according to any one of claims 1 to 9.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
12. A chip system, characterized in that: The method comprises at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is used to run a computer program or instruction to execute the method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for building wireless communication connection
CN108702605A
Ue with multiple subscriber identity modules with improved pause / resume operation
CN115361673A
Bluetooth connection method and device and readable storage medium
CN117580192A
Radio Communication Apparatus, Computer Readable Medium, Peripheral, And Central
US20150256968A1