CN113766477A - Device connection method, device, electronic device and computer readable medium - Google Patents

Device connection method, device, electronic device and computer readable medium Download PDF

Info

Publication number
CN113766477A
CN113766477A CN202111117328.8A CN202111117328A CN113766477A CN 113766477 A CN113766477 A CN 113766477A CN 202111117328 A CN202111117328 A CN 202111117328A CN 113766477 A CN113766477 A CN 113766477A
Authority
CN
China
Prior art keywords
user terminal
connection
user
bluetooth
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111117328.8A
Other languages
Chinese (zh)
Inventor
包建全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111117328.8A priority Critical patent/CN113766477A/en
Publication of CN113766477A publication Critical patent/CN113766477A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

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

Abstract

The application discloses a device connection method, a device, electronic equipment and a computer readable medium, and relates to the technical field of Internet of things, wherein the method comprises the following steps: under the condition that the electronic equipment and at least one first user terminal establish Bluetooth connection and are in a connectable state, maintaining the Bluetooth connection with the at least one first user terminal, and acquiring a connection request sent by a second user terminal for establishing the Bluetooth connection, wherein the connectable state refers to a state that the electronic equipment can respond to the connection request sent by external equipment; and establishing Bluetooth connection with the second user terminal based on the connection request. Therefore, the electronic device can be prevented from being disconnected from the first user terminal due to the connection of the second user terminal, that is, the bluetooth connection between the electronic device and the first user terminal is not disconnected due to the pairing between the second user terminal and the electronic device.

Description

Device connection method, device, electronic device and computer readable medium
Technical Field
The present application relates to the field of internet of things technology, and more particularly, to an apparatus connection method, an apparatus, an electronic device, and a computer-readable medium.
Background
Along with the abundance of life contents of people, more and more electronic equipment owned by users are provided, and the technology of Bluetooth communication is rapidly improved. Currently, one device can be connected with other devices through bluetooth, however, due to the problem of bluetooth communication mechanism, the user experience is poor when the devices are connected.
Disclosure of Invention
The application provides a device connection method, a device, an electronic device and a computer readable medium, so as to overcome the defects.
In a first aspect, an embodiment of the present application provides a device connection method, which is applied to an electronic device, and the method includes: under the condition that the electronic equipment and at least one first user terminal establish Bluetooth connection and are in a connectable state, maintaining the Bluetooth connection with the at least one first user terminal, and acquiring a connection request sent by a second user terminal for establishing the Bluetooth connection, wherein the connectable state refers to a state that the electronic equipment can respond to the connection request sent by external equipment; and establishing Bluetooth connection with the second user terminal based on the connection request.
In a second aspect, an embodiment of the present application further provides an apparatus connecting device, which is applied to an electronic apparatus, where the apparatus connecting device includes: an acquisition unit and a connection unit. The device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for keeping Bluetooth connection with at least one first user terminal and acquiring a connection request for establishing the Bluetooth connection sent by a second user terminal under the condition that the electronic equipment and the at least one first user terminal establish Bluetooth connection and are in a connectable state, and the connectable state refers to a state that the electronic equipment can respond to the connection request sent by external equipment. And the connection unit is used for establishing Bluetooth connection with the second user terminal based on the connection request.
In a third aspect, an embodiment of the present application further provides an electronic device, including: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the above-described method.
In a fourth aspect, the present application also provides a computer-readable storage medium, where a program code executable by a processor is stored, and when executed by the processor, the program code causes the processor to execute the above method.
According to the device connection method, the device, the electronic device and the computer readable medium, under the condition that the electronic device and at least one first user terminal are in Bluetooth connection, the electronic device is in a connectable state, the Bluetooth connection with all the first user terminals is not completely disconnected at the moment, the second user terminal sends the connection request to the electronic device, the electronic device can further acquire the connection request sent by the second user terminal under the condition that the Bluetooth connection with at least one first user terminal is maintained, and then the Bluetooth connection with the second user terminal is established based on the connection request. Therefore, the electronic equipment can be prevented from being disconnected from the first user terminal due to the connection of the second user terminal, namely the Bluetooth connection between the electronic equipment and the first user terminal is not disconnected due to the pairing between the second user terminal and the electronic equipment, so that the convenience and the comfort of the user for the equipment use are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating an application scenario provided in an embodiment of the present application;
fig. 2 illustrates a schematic connection diagram between an electronic device and a user terminal according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a connection between an electronic device and a user terminal according to another embodiment of the present application;
FIG. 4 is a schematic diagram illustrating an application scenario provided by another embodiment of the present application;
FIG. 5 is a flow chart of a method for connecting devices according to an embodiment of the present application;
fig. 6 shows a schematic connection diagram between an electronic device and a user terminal according to another embodiment of the present application;
FIG. 7 is a flow chart illustrating a method for device connection according to another embodiment of the present application;
fig. 8 is a schematic diagram illustrating a connection between an electronic device and a user terminal according to still another embodiment of the present application;
FIG. 9 is a flow chart illustrating a method of device connection provided by a further embodiment of the present application;
FIG. 10 is a flow chart illustrating a method of device connection provided by yet another embodiment of the present application;
FIG. 11 is a flow chart illustrating a method of connecting devices according to yet another embodiment of the present application;
FIG. 12 is a block diagram illustrating an apparatus for connecting devices provided by an embodiment of the present application;
fig. 13 is a block diagram illustrating an electronic device according to an embodiment of the present application;
fig. 14 is a storage unit according to an embodiment of the present application, configured to store or carry program code for implementing a device connection method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Internet Of Things (IOT) is a network concept that extends and expands its user end to any article to article for information exchange and communication based on the Internet concept. With the development of the internet of things technology, some scenes can be configured in the internet of things system. For a configured scene, a plurality of intelligent devices can be involved, and the plurality of intelligent devices have a certain linkage relation and can work cooperatively. For example, a configured scenario may include at least one of the two devices performing a specified operation when the one device is in close proximity to the other device. Or when one device executes a certain operation, part of data of the operation is processed by the device, and the other part of data is processed by the other device.
Along with the abundance of life contents of people, more and more electronic equipment owned by users are provided, and the technology of Bluetooth communication is rapidly improved. Currently, in order to facilitate work and life of a user, a certain electronic device may be bluetooth connected to an external device so that the user can control the electronic device to transmit data to the connected device. The electronic equipment can be a smart phone, a tablet computer, an electronic book, wireless audio playing equipment, a display and the like, wherein the electronic equipment is internally provided with a Bluetooth module, can establish Bluetooth connection with other Bluetooth equipment and is used for interacting data, and the wireless audio playing equipment can comprise a Bluetooth earphone or a Bluetooth sound box and the like.
In the embodiment of the present application, the electronic device is taken as a bluetooth headset, but other devices may also be used, and are not limited herein. As shown in fig. 1, the bluetooth headset 210 may be connected to the first user terminal 101 and the second user terminal 102 at the same time, where each of the first user terminal 101 and the second user terminal 102 may be a smart phone, a tablet computer, an e-book reader, or other devices capable of running an application program. The bluetooth headset 210 includes a pairing state, when the bluetooth headset 210 is in the pairing state, the bluetooth headset 210 can be discovered by other devices, when the other devices do not establish bluetooth connection with the bluetooth headset 210 once, or when the other devices do not acquire a bluetooth address of the bluetooth headset 210 in advance, the other devices need to be paired with the bluetooth headset 210, that is, in a pairing manner, communication information is exchanged between the bluetooth headset 210 and a device requesting connection, where the communication information includes data used for establishing connection such as a communication address, and therefore, for a new device, only when the bluetooth headset 210 enters the pairing state, the other devices can scan, and then can complete pairing with the other devices, so as to acquire the bluetooth address.
The connection procedure of the bluetooth headset 210 with the first user terminal 101 and the second user terminal 102 is described as follows.
Assume that both the first user terminal 101 and the second user terminal 102 belong to new devices for the bluetooth headset 210, that is, neither the bluetooth headset 210 has established a bluetooth connection with the first user terminal 101 and the second user terminal 102, nor the first user terminal 102 and the second user terminal 102 have acquired the address of the bluetooth headset 210.
As shown in fig. 2, when the bluetooth headset 210 does not establish a bluetooth connection with any device, and the first user terminal 101 desires to establish a bluetooth connection with the bluetooth headset 210, the bluetooth headset 210 enters a pairing state so that the first user terminal 101 can scan the bluetooth headset 210, and then the first user terminal 101 acquires a bluetooth address of the bluetooth headset 210 to establish a connection with the bluetooth headset. As shown in fig. 2, when the bluetooth headset 210 enters the pairing state, the first user terminal 101 starts scanning the bluetooth headset 210, for example, a scanning request may be sent in a broadcast manner, where the scanning request carries a bluetooth address of the first user terminal 101, the bluetooth headset 210 sends a scanning response to the first user terminal 101 based on the bluetooth address of the first user terminal 101 in response to the scanning request, the first user terminal 101 parses the scanning response to obtain the bluetooth address of the bluetooth headset 210, then the first user terminal 101 sends a connection request based on the bluetooth address of the bluetooth headset 210, and the bluetooth headset 210 establishes a bluetooth connection with the first user terminal 101 in response to the connection request.
As shown in fig. 3, in the case that the bluetooth headset 210 has already established a bluetooth connection with the first user terminal 101, the second user terminal 102 desires to establish a bluetooth connection with the bluetooth headset 210, and the second user terminal 102 needs to acquire a bluetooth address of the bluetooth headset 210 as a new device, then the bluetooth headset 210 enters a pairing state so that the second user terminal 102 can scan the bluetooth headset 210. The bluetooth headset 210 enters the pairing state and is disconnected from the first user terminal 101, then the second user terminal 102 starts scanning the bluetooth headset 210, for example, a scanning request may be sent in a broadcast manner, the scanning request carries a bluetooth address of the second user terminal 102, the bluetooth headset 210 responds to the scanning request, sends a scanning response to the second user terminal 102 based on the bluetooth address of the second user terminal 102, the second user terminal 102 parses the scanning response to obtain the bluetooth address of the bluetooth headset 210, then the second user terminal 102 sends a connection request based on the bluetooth address of the bluetooth headset 210, and the bluetooth headset 210 responds to the connection request to establish a bluetooth connection with the second user terminal 102. However, at this time, although the bluetooth headset 210 establishes a connection with the second user terminal 102, the bluetooth headset 210 is disconnected from the first user terminal 101.
Therefore, after the bluetooth headset 210 establishes the bluetooth connection with the second user terminal 102, the bluetooth headset 210 and the first user terminal 101 have established the bluetooth connection once, that is, the first user terminal 101 and the bluetooth headset 210 have already recorded the connection, so the bluetooth headset 210 may not enter the pairing state, and at this time, there are two ways to connect the first user terminal 101 and the bluetooth headset 210 again: after the bluetooth headset 210 establishes a bluetooth connection with the second user terminal 102, the bluetooth headset 210 automatically connects back to the first user terminal 101; alternatively, the user may click the bluetooth headset 210 again on the first user terminal 101.
Through the above operation, it is possible to realize that the bluetooth headset 210 simultaneously maintains bluetooth connection with the first user terminal 101 and the second user terminal 102.
However, the inventors have found in their research that, in the case where the bluetooth headset 210 has already established a bluetooth connection with the first user terminal 101, if a connection needs to be established with another device (e.g. the second user terminal 102), the bluetooth connection between the bluetooth headset 210 and the first user terminal 101 may be disconnected, which may affect the experience of the first user terminal 101 in using the bluetooth headset. In addition, after the bluetooth headset 210 establishes the bluetooth connection with the second user terminal 102, the user may be required to operate the first user terminal 101 to enable the first user terminal 101 to establish the connection with the bluetooth headset 210 again, which may cause the user to operate too complicated, and therefore, when the user connects multiple devices, the user experience may be reduced due to the bluetooth communication mechanism problem.
Therefore, in order to overcome the above-mentioned drawbacks, embodiments of the present application provide a device connection method, an apparatus, an electronic device, and a computer-readable medium, which can avoid that the electronic device disconnects the bluetooth connection with the first user terminal due to the connection of the second user terminal, that is, the bluetooth connection between the electronic device and the first user terminal is not disconnected due to the pairing between the second user terminal and the electronic device, when the bluetooth connection between the electronic device and the first user terminal is already established.
It should be noted that the bluetooth headset 210 shown in fig. 1 is a single headset, and in other embodiments, the bluetooth headset may also be a headset composed of a plurality of bluetooth headsets, as shown in fig. 4, the master headset 210 is connected to the slave headset 220, and the master headset 210 may be connected to the first user terminal 101 and the second user terminal 102 at the same time. It is understood that the number of the slave earphones 220 may be multiple, and the number of the devices that the master earphone 210 can be connected to may also be multiple, in this embodiment, the master earphone 210 may be connected to at least two user terminals at the same time.
Referring to fig. 5, fig. 5 shows a device connection method provided in an embodiment of the present application, where the method is applied to the electronic device, and in the embodiment of the present application, taking the electronic device as a bluetooth headset as an example, the method includes: s501 to S502.
S501: and under the condition that the electronic equipment and at least one first user terminal establish Bluetooth connection and are in a connectable state, keeping the Bluetooth connection with the first user terminal, and acquiring a connection request sent by a second user terminal for requesting to establish the Bluetooth connection.
The connectable state refers to a state where the electronic device is capable of responding to a connection request sent by an external device, and reference may be made to the foregoing description for a manner in which the electronic device establishes a bluetooth connection with the first user terminal. In some embodiments, after the electronic device is started, the electronic device enters a connectable state, that is, a bluetooth communication module of the electronic device can respond to a connection request sent by another device and establish a bluetooth connection with the other device based on the connection request.
As an embodiment, the connection request may be sent by the second user terminal when the electronic device is connected back, that is, the connection request may be a connection back request, and the electronic device and the second user terminal have established a bluetooth connection once. After the electronic device establishes the bluetooth connection with the second user terminal, the second user terminal may generate a connection record, which may include the bluetooth address of the electronic device, so that the second user terminal can directly connect back to the electronic device based on the bluetooth address next time. The loopback refers to that the second user terminal sends a page packet to the electronic device to request to establish a communication connection with the electronic device, where the page is usually called connection (paging), and the operation of connecting/activating the user terminal is called page, where the page refers to that the device (the master device) initiating the connection knows the address of the device to be connected, and can directly page.
As another embodiment, the connection request may be generated by the second user terminal after scanning the electronic device in the pairing state, and the second user terminal does not know the bluetooth address of the electronic device, for example, the terminal does not store the bluetooth address of the electronic device, and the terminal does not have a connection record with the electronic device, and the electronic device needs to enter the pairing state. It can be understood that, in the case that the electronic device has established a bluetooth connection with at least one first user terminal and is in a connectable state, the electronic device enters a pairing state, maintains the bluetooth connection with at least one first user terminal, and obtains a connection request sent by at least one second user terminal to request establishment of the bluetooth connection. When the electronic device enters the pairing state, the electronic device needs to be in a connectable state, that is, the electronic device enters the pairing state in the connectable state.
As an embodiment, the electronic device is provided with a pairing control, and a user can trigger the electronic device to enter a pairing state by operating the pairing control. It can be understood that the pairing control may be a physical key arranged on the electronic device, or may be a virtual key arranged on a touch screen in a case that the electronic device is provided with the touch screen. The electronic equipment can detect whether the pairing control is operated or not, and if the pairing control is operated or the operation duration is longer than the specified duration, the electronic equipment enters a pairing state, so that the electronic equipment can be found on a Bluetooth channel by other equipment.
As another embodiment, the electronic device may enter the pairing state by acquiring a voice instruction input by the user or another manipulation instruction, where the other manipulation instruction may be a manipulation instruction triggered by the user inputting a specified operation to the electronic device, and the specified operation may include all operations of pressing, vibrating, moving, and the like to the electronic device, which can be converted into an electrical signal by the sensor.
As another implementation manner, the first user terminal may control the electronic device to enter the pairing state, and in some embodiments, when the electronic device has established a bluetooth connection with the first user terminal, the electronic device acquires a pairing instruction sent by the first user terminal, and enters the pairing state in response to the pairing instruction. In some embodiments, the user of the first user terminal needs to use the second user terminal, and desires to establish a connection between the second user terminal and the electronic device, so the user of the first user terminal operates the first user terminal to send a pairing instruction to the electronic device to trigger the electronic device to enter a pairing state. In other embodiments, the second user terminal is connected to the first user terminal, but the second user terminal does not establish a bluetooth connection with the electronic device, or does not acquire a bluetooth address of the electronic device in advance, the second user terminal sends a pairing instruction to the first user terminal, and the first user terminal forwards the pairing instruction to the electronic device.
It can be understood that the bluetooth headset can be searched by another bluetooth device by turning on the inquiry scan mode. And other bluetooth devices can start the Inquiry mode and enter a mode of discovering surrounding bluetooth devices, and the return value of the mode is the signals of the surrounding bluetooth devices. In the embodiment of the present application, the pairing state may be understood as an inquiry scan mode that is turned on so as to be searched by other bluetooth devices. Then, the two devices can acquire the Bluetooth address of the other party so as to establish Bluetooth connection subsequently.
It should be noted that the electronic device supports simultaneous connection of N user terminals. The number of the first user terminals may be multiple, or may be one, where the number of the first user terminals is at least two, the number of the second user terminals is one, after the second user terminal establishes a bluetooth connection with the electronic device, the second user terminal becomes the first user terminal, that is, the first user terminal refers to a user terminal that has already established a bluetooth connection with the electronic device, the second user terminal refers to a user terminal that currently desires to establish a bluetooth connection with the electronic device, and the number of the first user terminal and the second user terminal is not limited. If the number of the first user terminals is one, and N is greater than 1, the electronic device keeps the connection with the first user terminal when entering the pairing state, because the electronic device can continue to connect with other user terminals and does not reach the upper connection limit of the connected user terminals. If the number of the first user terminals is multiple, at least part of the first user terminals may need to be disconnected, so as to ensure that the connection upper limit of the electronic equipment for connecting the user terminals is not exceeded.
S502: and establishing Bluetooth connection with the second user terminal based on the connection request.
In this embodiment, after the second user terminal scans the electronic device, the identifier of the electronic device may be displayed on a screen of the second user terminal, for example, a bluetooth list interface may be displayed on the screen of the second user terminal, identifiers of all bluetooth devices scanned by the second user terminal are displayed in the bluetooth list interface, the user clicks the identifier of the electronic device, and the second user terminal sends a connection request to the electronic device.
As an embodiment, the connection request may be a request sent when the second user terminal performs a reconnection, that is, a reconnection request, or may be a request generated and sent by the second user terminal after the electronic device is in a pairing state and scanning the electronic device in the pairing state to establish a connection with the electronic device.
In the current bluetooth connection mechanism, when the electronic device enters the pairing state, the electronic device disconnects all devices currently having bluetooth connection established, and in this embodiment of the present application, for example, when the electronic device enters the pairing state, a connection request is a request sent by a second user terminal received by the electronic device in the pairing state, how to establish connection with the second user terminal is described in a case where a first user terminal maintaining bluetooth connection established currently continues to maintain bluetooth connection with the electronic device, but the present application is not limited to this scenario.
As shown in fig. 6, when the electronic device enters the connectable state, the bluetooth connection already established with the first user terminal is not disconnected, but the bluetooth connection with the first user terminal is maintained, that is, the bluetooth connection between the electronic device and the first user terminal is maintained. In some embodiments, the electronic device is in a pairing state, and the second user terminal scans the electronic device and completes pairing, and it is understood that the process of completing pairing may include the second user device sending a scanning request, the electronic device returning a bluetooth address of the electronic device based on the scanning request, the second user terminal sending a connection request based on the bluetooth address, and the electronic device establishing a bluetooth connection with the second user terminal based on the connection request. As can be seen from comparing fig. 4 and fig. 6, according to the device connection method provided in the embodiment of the present application, when the electronic device enters the connectable state, the bluetooth connection with the first user terminal is not disconnected, and after the bluetooth connection is established between the electronic device and the second user terminal, the first user terminal does not need to be reconnected again, so that the user experience is improved.
In addition, for the implementation of the second user terminal sending the connection request and the electronic device establishing the bluetooth connection with the second user terminal based on the connection request, reference may be made to the foregoing embodiments in fig. 3 and fig. 4, which are not described herein again.
Taking the electronic device as an example of a wireless headset, the first user terminal has an audio playing function, and the wireless headset is used for playing audio data sent by the first user terminal. The audio data may be an audio stream in an audio file or a video file being played by the first user terminal, or may be audio of a voice call or a video call. The process that the second user terminal is used as a new device to establish connection with the wireless headset when the first user terminal has established bluetooth connection with the wireless headset and audio data is played by using the wireless headset does not result in disconnection of the bluetooth connection between the wireless headset and the first user terminal, so that the first user terminal can continue to use the audio data played by the electronic device.
Assuming that the second user terminal is similar to the first user terminal and also has an audio playing function, the audio data requested to be played by the second user terminal is the second audio data, and the electronic device can continue to play the second audio data when the first user terminal plays the first audio data by using the bluetooth headset and the playing of the first audio data is not interrupted. For example, the first audio data is call audio, the call audio may be audio data during a voice call or a video call, and the second audio data may be a song or an audio stream in a video, so that a user can play a video and can hear audio in the video using the second user terminal while listening to voice of the first user terminal during the call using the wireless headset.
Therefore, according to the device connection method provided by the application, when the electronic device has established bluetooth connection with at least one first user terminal, the electronic device is in a connectable state, and at this time, the bluetooth connection with all the first user terminals is not completely disconnected, and the second user terminal sends the connection request to the electronic device, so that the electronic device can also acquire the connection request sent by the second user terminal while maintaining the bluetooth connection with at least one first user terminal, and then establish bluetooth connection with the second user terminal based on the connection request. Therefore, the electronic equipment can be prevented from being disconnected from the first user terminal due to the connection of the second user terminal, namely the Bluetooth connection between the electronic equipment and the first user terminal is not disconnected due to the pairing between the second user terminal and the electronic equipment, so that the convenience and the comfort of the user for the equipment use are improved.
Referring to fig. 7, fig. 7 illustrates a device connection method provided in an embodiment of the present application, where the method is applied to the electronic device, and the number of the first user terminals is multiple, at least one first user terminal needs to be disconnected based on the maximum number of user terminals that can be connected by the electronic device, so that a second user terminal can establish a connection. The method comprises the following steps: s701 to S707.
S701: and entering a pairing state under the condition that the electronic equipment and the first user terminal establish Bluetooth connection.
S702: determining a target number of the first user terminals which have currently established Bluetooth connection with the electronic equipment.
In this embodiment, the electronic device may be a single earphone or an earphone set, and the electronic device supports simultaneous connection with N user terminals, for example, the electronic device is an earphone set, and N is 2, so that the earphone set may simultaneously connect with 2 user terminals.
S703: it is determined whether the target number is equal to a specified number.
Wherein the specified number is set based on a maximum value of the user terminals allowed by the electronic device to establish the Bluetooth connection, and the specified number is less than or equal to the maximum value. It will be appreciated that the maximum value may be an upper limit value for the user terminals that the electronic device allows to establish bluetooth connections simultaneously, e.g. N as described above.
As an embodiment, the electronic device may determine the specified number based on current operational information of the electronic device. The operation information includes at least one of remaining power, power consumption and resource utilization, the resource utilization can be determined based on at least one of CPU utilization and memory utilization, the CPU utilization is positively correlated with the resource utilization, that is, the higher the CPU utilization, the higher the resource utilization, the positive the memory utilization is correlated with the resource utilization, that is, the higher the memory utilization, the higher the resource utilization, the resource utilization can be CPU utilization or memory utilization, or the resource utilization can be determined in a weighted summation manner based on the CPU utilization and the memory utilization. Under the condition of high resource utilization rate, the CPU utilization rate and the memory utilization rate are high, the current remaining resources are less, and the smoothness of the operation of the electronic device is affected by connecting too many user terminals, so that the resource utilization rate is negatively related to the specified quantity, that is, the higher the resource utilization rate is, the smaller the specified quantity is.
In addition, the remaining capacity is positively correlated with the specified quantity, i.e., the higher the remaining capacity, the larger the specified quantity. The remaining capacity of the battery of the electronic device is larger, so the electronic device has more sufficient capacity to connect with more user terminals and interact with data. The power consumption is inversely related to the specified amount, i.e. the higher the remaining capacity, the smaller the specified amount. When the power consumption is relatively large, the power consumption of the electronic device is relatively large, and therefore, it is necessary to reduce data interaction between the electronic device and another device to reduce the power consumption.
As an embodiment, a corresponding relationship between the operation information and the designated number may be established based on the positive or negative correlation, and if the operation information includes multiple items of data, for example, when the operation information includes multiple items of data such as remaining power, power consumption, and resource utilization, the respective corresponding designated number may be determined based on the corresponding relationship of the multiple items of data, and then the final designated number is obtained by a weighted summation based on the respective designated numbers, and is used as the designated number for the step S703 this time.
In one embodiment, the specified number is less than or equal to a maximum number of user terminals allowed by the electronic device to establish the bluetooth connection. It is understood that the specified number may be a maximum value or less, and is set according to the actual use condition. In the embodiment of the present application, the specified number may be the maximum number.
Therefore, after the electronic device enters the pairing state, the target number of the first user terminals currently connected with the electronic device is determined, and if the target number is equal to the specified number, that is, the number of the first user terminals currently connected with the electronic device is the maximum number of the user terminals allowed to be connected with the bluetooth of the electronic device. For example, with the maximum value of 2, in the case where the electronic device has connected two first user terminals, the user terminal connected to the electronic device has reached the upper limit of the number of user terminals capable of bluetooth connection, and if the second user terminal is to be connected continuously, at least one of the currently connected first user terminals needs to be disconnected. Therefore, in the case where the result of S703 is yes, S705 is executed, and in the case where the result of S703 is no, S704 is executed.
S704: and keeping the Bluetooth connection with the first user terminal, and acquiring a connection request which is sent by a second user terminal and used for requesting to establish the Bluetooth connection, wherein the connection request is generated after the second user terminal scans the electronic equipment in the pairing state.
Assuming that the electronic device is a bluetooth headset, the target number of the first user terminals connected to the bluetooth headset is 1, and the designated number of the user terminals allowed to be connected to the bluetooth headset is 2, so that the target number is less than the designated number, it indicates that the electronic device is connected to other user terminals, so that the bluetooth connection with the first user terminal is maintained, and a connection request for establishing the bluetooth connection sent by the second user terminal is obtained, so as to enable connection with the second user terminal.
S705: and determining a target user terminal from a plurality of first user terminals.
Assuming that the electronic device is a bluetooth headset, the target number of the first user terminals connected to the bluetooth headset is 2, and the specified number of the user terminals allowed to be connected to the bluetooth headset is 2, so that the target number is equal to the specified number, it indicates that the number of the user terminals currently connected to the bluetooth of the electronic device has reached the connection upper limit, and it is necessary to disconnect at least one first user terminal to be able to connect to the second user terminal.
Therefore, it is necessary to determine a target ue from the plurality of first ues in order to disconnect the target ue later.
It is understood that the manner of determining the target user terminal may be determined based on the priority of each first user terminal, and determining the priority of a plurality of first user terminals; and determining a target user terminal from the plurality of first user terminals based on the priorities of the plurality of first user terminals, wherein in some embodiments, the first user terminal with the lowest priority can be used as the target user terminal, so that when subsequent operations are performed, the first user terminal with the lowest priority can be disconnected and the Bluetooth connection of the user terminal with higher priority can be maintained. In the embodiment of the present application, the determination of the priority may be set based on the operating state of the ue, the type or content of the transmitted data, and the user's popularity and importance, which will be described in the following embodiments as examples.
S706: and disconnecting the Bluetooth connection with the target user terminal, keeping the Bluetooth connection with at least one first user terminal except the target user terminal, and acquiring a connection request for establishing the Bluetooth connection, which is sent by a second user terminal.
S707: and establishing Bluetooth connection with the second user terminal based on the connection request.
Assuming that the electronic device is a bluetooth headset, the number of the first user terminals currently connected to the bluetooth headset is 2, and the number of the user terminals allowed to be connected to the bluetooth headset is 2, therefore, the user terminals currently connected to the bluetooth headset have reached the connection upper limit. When the electronic device enters a pairing state, one first user terminal is determined as a target user terminal and one second user terminal is determined from the two first user terminals, and if the two first user terminals are device a and device B in decibels and the second user terminal is device C, the electronic device needs to disconnect the device a or the device B so that the electronic device can be connected with the device C.
As shown in fig. 8, if the electronic device determines that the priority of the device a is lower than that of the device B based on the priority described above, the device a is used as the target user terminal, the bluetooth connection of the device a is disconnected and maintained, then, the device C scans the electronic device, and then, the electronic device acquires the connection request of the device C, thereby completing the connection with the device C.
Therefore, according to the embodiment of the application, when the electronic device is connected with a plurality of first user terminals, at least one first user terminal can be disconnected based on the priorities of the plurality of first user terminals, and the bluetooth connection of other first user terminals is maintained, so that the bluetooth connection can be established with a second user terminal.
Referring to fig. 9, fig. 9 illustrates a device connection method provided in an embodiment of the present application, where the method is applied to the electronic device, and the number of the first user terminals is multiple, at least one first user terminal needs to be disconnected based on the maximum number of user terminals that can be connected by the electronic device, so that a second user terminal can establish a connection. The method comprises the following steps: s901 to S906.
S901: and entering a pairing state under the condition that the electronic equipment and the first user terminal establish Bluetooth connection.
S902: determining a target number of the first user terminals which have currently established Bluetooth connection with the electronic equipment.
Wherein, the implementation of S901 and S902 can refer to the foregoing embodiments.
S903: and if the target number is equal to the designated number, searching the first user terminal in an idle state from the plurality of first user terminals to be used as an alternative terminal.
The idle state indicates that there is no data interaction between the first user terminal and the electronic device, for example, it may be detected whether there is data interaction between the first user terminal and the electronic device in the current time period, if no data interaction occurs, it is determined that the first user terminal is in the idle state, and if data interaction occurs, it is determined that the first user terminal is in the non-idle state. And taking the first user terminal in the idle state as an alternative terminal. Here, the current time period may be a time period of a specified time length before the current time, and the specified time length may be set according to actual use, and may be, for example, 1 to 5 seconds.
It should be noted that, the electronic device may determine whether the first user terminal is in an idle state, for example, the electronic device detects whether data interaction occurs with the first user terminal in a current time period, so as to be able to determine the first user terminal in the idle state, that is, determine the selected terminal.
S904: and determining a target user terminal from the alternative terminals.
And if only one alternative terminal is available, namely only one of the first user terminals connected with the current Bluetooth of the electronic equipment is in an idle state, taking the first user terminal in the idle state as a target user terminal.
If the alternative terminals are multiple (i.e. at least two), the electronic device determines the target user terminal from the multiple alternative terminals. As an embodiment, a priority of each candidate terminal may be determined, and a target user terminal may be determined from the plurality of candidate terminals based on the priority of each candidate terminal, for example, the candidate terminal with the lowest priority may be used as the target user terminal. The determination of the priority may refer to the foregoing embodiment, for example, a corresponding relationship may be preset, where the corresponding relationship includes a plurality of terminal identifiers and a priority corresponding to each terminal identifier, and after the electronic device establishes a connection with the first user terminal, the electronic device may obtain the identifier of the first user terminal, so that the priority of the first user terminal can be determined through the corresponding relationship.
As another implementation, a connection time at which each of the candidate terminals establishes a bluetooth connection with the electronic device is obtained. In some embodiments, after establishing a connection with the first user terminal, the electronic device generates a connection record, and records a time at which a bluetooth connection is established with the first user terminal into the connection record, that is, a time at which each bluetooth-connected first user terminal has the latest connection, that is, a connection time, can be recorded.
Then, a priority of each of the first user terminals is determined based on the connection time of each of the first user terminals, thereby determining a target terminal based on the connection time of each of the candidate terminals. In some embodiments, the priority of the first user terminal may be determined according to the connection time sequence, for example, the priority is positively related to the connection time, that is, the earlier the connection time is, the lower the priority is, the later the connection time is, the higher the priority is, or the priority is negatively related to the connection time, that is, the earlier the connection time is, the higher the priority is, the later the connection time is, the lower the priority is, which is not limited herein. In the embodiment of the present application, the priority of the first user terminal corresponding to the earliest connection time may be set to be the lowest, so that the candidate terminal corresponding to the earliest connection time may be used as the target user terminal. The first user terminal with the earliest connection time is more likely to serve as the first user terminal with the lower current use requirement of the user, because the user may select to connect one first user terminal based on some current requirement, the connection time of the first user terminal is the latest, so the use requirement of the user is greater for the first user terminal with the later connection time, and therefore the first user terminal with the earliest connection time is taken as the target user terminal, so that the first user terminal with the earliest connection time is disconnected later, and the first user terminal with the lower user use requirement is more likely to be disconnected without affecting the use experience of the user. The earlier the connection time is, in this embodiment, the lower the priority of the first user terminal.
In other embodiments, the priority of the first user terminal corresponding to the latest connection time may be set to be the lowest, so that the candidate terminal corresponding to the latest connection time can be used as the target user terminal. Thus, when the second user terminal requests connection with the electronic device, the newly connected first user terminal can be disconnected. If the electronic device is a bluetooth headset, considering that most of the users are aiming at listening to audio when using the headset, for example, watching video or listening to music through the user terminals, the time for connecting the first user terminal with the earlier connection may be longer, while the first user terminal using the bluetooth headset for calling is often used for a shorter time, and disconnection is often selected after the call is ended, so that maintaining the connection of the first user terminal with the earlier connection can maintain the bluetooth connection of the first user terminal using the bluetooth headset for a long time, and disconnect the first user terminal which is newly connected and in an idle state. The later the connection time is, in this embodiment, the lower the priority of the first user terminal.
It can be understood that, the present application is not limited to selecting the candidate terminal at the earliest or latest connection time as the target user terminal, and may specifically be set according to actual use requirements.
S905: and disconnecting the Bluetooth connection with the target user terminal, keeping the Bluetooth connection with a first user terminal except the target user terminal, and acquiring a connection request for establishing the Bluetooth connection, which is sent by a second user terminal.
S906: and establishing Bluetooth connection with the second user terminal based on the connection request.
It should be noted that, for the parts of the above steps that are not described in detail, reference may be made to the foregoing embodiments, and details are not described herein again.
Therefore, according to the embodiment of the application, when the first user terminals connected with the electronic device obtain the maximum number of the user terminals allowed to be connected, one target user terminal is determined from the first user terminals in the idle state and is disconnected, and other first user terminals are kept connected, so that the electronic device can be connected with the second user terminal, and meanwhile, the influence on the use of the first user terminal by a user can be reduced.
It should be noted that the priority determined by the connection time may be applied not only to determine the target terminal from the candidate terminals, but also to determine the target terminal from the plurality of first user terminals based on the priorities of the plurality of first user terminals, and the setting manner of the priority referred to in the following embodiments may also be applied to determine the target terminal from the candidate terminals or to determine the target terminal from the plurality of first user terminals based on the priorities of the plurality of first user terminals, which is not limited herein.
Referring to fig. 10, fig. 10 illustrates a device connection method provided in an embodiment of the present application, where the method is applied to the electronic device, and the number of the first user terminals is multiple, at least one first user terminal needs to be disconnected based on the maximum number of user terminals that the electronic device can connect, so that the second user terminal can establish a connection. The method comprises the following steps: s1001 to S1006.
S1001: and entering a pairing state under the condition that the electronic equipment and the first user terminal establish Bluetooth connection.
S1002: determining a target number of the first user terminals which have currently established Bluetooth connection with the electronic equipment.
S1003: and if the target number is equal to the designated number, determining attribute information of the data transmitted to the electronic equipment by each first user terminal.
The attribute information of the data may include a data type, a transmission time, a reception time, and a data transmission rate, wherein the data transmission rate may be the number of data transmissions per unit time.
S1004: and determining a target user terminal from a plurality of first user terminals based on the attribute information corresponding to the first user terminal.
It can be understood that, the priority of each first user terminal is determined based on the attribute information corresponding to each first user terminal, and the target user terminal is determined from the plurality of first user terminals based on the priorities of the plurality of first user terminals.
As an embodiment, the attribute information may be a data transmission rate, and the priority of each first user terminal is determined based on the data transmission rate corresponding to each first user terminal, in some embodiments, the priority is positively correlated with the data transmission rate, that is, the lower the data transmission rate, the lower the priority, the higher the data transmission rate, and the higher the priority, or the priority is negatively correlated with the data transmission rate, that is, the lower the data transmission rate, the higher the priority, the higher the data transmission rate, and the lower the priority. In some embodiments, the low data transmission rate indicates that the first user terminal has a relatively low data interaction amount with the electronic device in the current time period, and may be taken as a target user terminal so as to be disconnected later, thereby reducing the influence on the use of the first user terminal with a relatively large data transmission amount. The lower the priority of the first user terminal in this embodiment, the smaller the data transfer amount.
As another embodiment, the attribute information may also be a data type. It is understood that after the electronic device establishes a bluetooth Connection with the first user terminal, the bluetooth Connection may be a physical link therebetween, and when data transmission is performed, both need to establish a logical link (ACL), different logical links may be established for different data types or service requirements, for example, if the first user terminal uses a bluetooth headset to play music, the link between the first user terminal and the bluetooth headset is an audio playing link, i.e., an A2DP link, and the A2DP is a bluetooth protocol for playing music between bluetooth devices. If the first user terminal uses the bluetooth headset for a call, the link between the first user terminal and the bluetooth headset is a call link, i.e., HFP link, which makes a bluetooth protocol used for a call scenario between bluetooth devices. Thus, by determining the type of link between the first user terminal and the electronic device, the data type of the data transmitted between the first user terminal and the electronic device can be determined. For example, the data type corresponding to the link A2DP is an audio type, and the data type corresponding to the HFP link is a call type. In addition, the data type of the data may also be determined by analyzing the data transmitted between the first user terminal and the electronic device.
Then, the priority of each first user terminal is determined based on the data type corresponding to each first user terminal, in some embodiments, the correspondence between the data type and the priority may be preset according to the actual use requirement, and as an implementation manner, the priority of the first user terminal corresponding to the data type belonging to the specified type is the lowest. Therefore, the first user terminal with the data type of the data transmitted between the electronic equipment and the electronic equipment as the designated type can be used as the target user terminal. Wherein the specified type may be an audio type. In this embodiment, the priority of each first user terminal is related to the data type corresponding to each first user terminal, and the priority of the data type of the designated type is the lowest.
In still another embodiment, the attribute information may be a transmission time of the latest transmission data. It can be understood that the latest data transmission refers to a time when the electronic device receives the data with the start flag bit that is latest transmitted by the first user terminal, and may also be a time when the electronic device receives the data with the end flag bit that is latest transmitted by the first user terminal. In this embodiment of the present application, a priority of each first user terminal is determined based on a transmission time corresponding to each first user terminal, and in some embodiments, the priority is positively correlated with the transmission time, that is, the earlier the transmission time is, the lower the priority is, the later the transmission time is, the higher the priority is, or the priority is negatively correlated with the transmission time, that is, the earlier the transmission time is, the higher the priority is, the later the transmission time is, the lower the priority is, in this embodiment of the present application, the priority of the first user terminal with the earliest transmission time is the lowest, so that the first user terminal corresponding to the earliest transmission time can be used as the target user terminal. Since the earlier transmission time of the latest transmission data is, the higher the possibility that the user may not use the first user terminal for a long time is, the first user terminal corresponding to the earliest transmission time is set as the target user terminal so as to disconnect the first user terminal that is not used for a long time as much as possible.
S1005: and disconnecting the Bluetooth connection with the target user terminal, keeping the Bluetooth connection with a first user terminal except the target user terminal, and acquiring a connection request for establishing the Bluetooth connection, which is sent by a second user terminal.
S1006: and establishing Bluetooth connection with the second user terminal based on the connection request.
It should be noted that, for the parts of the above steps not described in detail, please refer to the foregoing embodiments, and further description is omitted here.
Therefore, according to the embodiment of the application, when the first user terminals connected with the electronic device obtain the maximum number of the user terminals allowed to be connected, one target user terminal is determined based on the data transmitted between each first user terminal and the electronic device, and the target user terminal is disconnected, and other first user terminals are kept connected, so that the electronic device can be connected with the second user terminal, and meanwhile, the influence on the user using the first user terminal can be reduced.
Referring to fig. 11, fig. 11 illustrates a device connection method provided in an embodiment of the present application, where the method is applied to the electronic device, and the number of the first user terminals is multiple, at least one first user terminal needs to be disconnected based on the maximum number of user terminals that can be connected by the electronic device, so that a second user terminal can establish a connection. The method comprises the following steps: s1001 to S1006.
S1101: and entering a pairing state under the condition that the electronic equipment and the first user terminal establish Bluetooth connection.
S1102: determining a target number of the first user terminals which have currently established Bluetooth connection with the electronic equipment.
S1103: and if the target number is equal to the designated number, determining the user importance of each first user terminal.
As an embodiment, a user importance may be set for each first user terminal, and the user importance may be used as a measure of the importance of the user using the first user terminal. It will be appreciated that the user importance of the first user terminal may be determined in dependence on the terminal type of the first user terminal. In some embodiments, when the first user terminal sends the connection request, the device name of the first user terminal may be sent to the electronic device, and the electronic device determines the terminal type of the first user terminal based on the device name, and then determines the user importance of the first user terminal based on a preset correspondence between the terminal type and the user importance.
As another implementation, the user importance of the first user terminal may also be determined according to the service type currently executed by the first user terminal using the electronic device. In some embodiments, a service type of a service module corresponding to each first user terminal is determined, where the service module corresponding to each first user terminal sends data to the electronic device based on a bluetooth connection of the first user terminal; and determining the user importance of each first user terminal based on the service type corresponding to each first user terminal.
In some embodiments, the service module may be a function module in an application program in the first user terminal, for example, the application program is a game application program, and then a video playing module may be included in the game application program for playing some game pictures and audio. The service type of the service module may be an application type of an application program corresponding to the service module, or may be a function type of the service module. For example, a certain service module is a video playing module in a game application program, the type of the application program corresponding to the service module, i.e., the game type, may be used as the service type of the service module, and the function type of the service module, i.e., the audio type corresponding to the video playing module, may also be used as the function type of the service module.
In this embodiment, the service type of the service module may be a program type of an application program corresponding to the service module. And then, according to a first corresponding relation between the preset program type and the user importance, determining the user importance corresponding to the service module, and further determining the user terminal reading of each first application program. In some embodiments, the user importance of video, game, audio, and call types increases in order in the first correspondence. Therefore, after the service type corresponding to each first user terminal is determined, the user importance corresponding to the service type of each first user terminal is determined.
It should be noted that the functions of some application programs may include multiple functions, for example, one application program may include functions of audio playing (e.g., song playing), video playing (e.g., video file playing), call, and the like, and then the frequency of the application program executing different functions within a preset time period may be counted, and the type corresponding to the function with the highest frequency is taken as the program type of the application program. For example, if the frequency of playing an audio file is the highest in a preset time period, the type of the application program is the audio type, and if the frequency of playing a video file is the highest in a preset time period, the type of the application program is the video type.
S1104: and taking the first user terminal with the lowest user importance as a target user terminal.
As an embodiment, determining a user importance of each of the first user terminals; and determining the priority of each first user terminal based on the user importance of each first user terminal, and determining a target user terminal from the plurality of first user terminals based on the priorities of the plurality of first user terminals. In some embodiments, the priority is positively correlated with the user importance, that is, the higher the user importance, the lower the priority, the lower the user importance, and the higher the priority, or the priority is negatively correlated with the user importance, that is, the higher the user importance, the higher the priority, the lower the user importance, and the lower the priority.
It can be understood that a service type of a service module corresponding to each of the first user terminals may be determined, where the service module corresponding to each of the first user terminals transmits data to the electronic device based on the bluetooth connection of the first user terminal, so as to determine a user importance of each of the first user terminals based on the service type corresponding to each of the first user terminals. For example, the electronic device is a bluetooth headset, the bluetooth headset is currently connected to a first user terminal (assumed to be device a), the user uses the device a to make a call, then the user controls the bluetooth headset to connect to another first user terminal (assumed to be device B), the user uses the device B to play a video file, then the device C wishes to connect to the bluetooth headset, at this time, the service type corresponding to the device a is a call type, the service type corresponding to the device B is a video type, and the user importance of the call type is greater than that of the video type, so the device a is used as a target user terminal, so that the device a is subsequently disconnected, and the bluetooth headset can be connected to the device C.
S1105: and disconnecting the Bluetooth connection with the target user terminal, keeping the Bluetooth connection with a first user terminal except the target user terminal, and acquiring a connection request for establishing the Bluetooth connection, which is sent by a second user terminal.
S1106: and establishing Bluetooth connection with the second user terminal based on the connection request.
It should be noted that, for the parts of the above steps not described in detail, please refer to the foregoing embodiments, and further description is omitted here.
Therefore, according to the embodiment of the application, under the condition that the first user terminals connected with the electronic equipment obtain the maximum number of the user terminals allowed to be connected, one target user terminal is determined based on the service type of each first user terminal and is disconnected, and other first user terminals are kept connected, so that the electronic equipment can be connected with the second user terminal, and meanwhile, the influence on the user using the first user terminals can be reduced.
Referring to fig. 12, a block diagram of a device connection apparatus 1200 according to an embodiment of the present disclosure is shown, where the apparatus may include: an acquisition unit 1201 and a connection unit 1202.
An obtaining unit 1202, configured to, when the electronic device and at least one first user terminal have established a bluetooth connection and are in a connectable state, maintain the bluetooth connection with the at least one first user terminal, and obtain a connection request that requests establishment of the bluetooth connection and is sent by a second user terminal, where the connectable state is a state where the electronic device is capable of responding to a connection request sent by an external device.
Further, the obtaining unit 1202 is further configured to enter a pairing state when the electronic device and a first user terminal have established a bluetooth connection, maintain the bluetooth connection with the first user terminal, and obtain a connection request, sent by a second user terminal, for establishing the bluetooth connection, where the connection request is generated by the second user terminal after scanning the electronic device in the pairing state.
Further, the obtaining unit 1202 is further configured to determine a target number of the first user terminals currently having established bluetooth connection with the electronic device; if the target number is equal to a specified number, determining a target user terminal from the plurality of first user terminals, wherein the specified number is smaller than or equal to the maximum value of the user terminals which are allowed by the electronic equipment to establish the Bluetooth connection; and disconnecting the Bluetooth connection with the target user terminal, keeping the Bluetooth connection with a first user terminal except the target user terminal, and acquiring a connection request for establishing the Bluetooth connection, which is sent by a second user terminal.
Further, the obtaining unit 1202 is further configured to search, from the multiple first user terminals, a first user terminal in an idle state as an alternative terminal; and determining a target user terminal from the alternative terminals.
Further, the obtaining unit 1202 is further configured to obtain a connection time at which each of the candidate terminals establishes a bluetooth connection with the electronic device; and determining a target terminal based on the connection time of each alternative terminal.
Further, the obtaining unit 1202 is further configured to use the candidate terminal corresponding to the earliest connection time as the target user terminal.
Further, the obtaining unit 1202 is further configured to determine attribute information of data transmitted by each of the first user terminals to the electronic device; and determining a target user terminal from a plurality of first user terminals based on the attribute information corresponding to the first user terminal.
Further, the obtaining unit 1202 is further configured to use the first user terminal corresponding to the earliest transmission time as the target user terminal.
Further, the obtaining unit 1202 is further configured to use the first user terminal corresponding to the data type belonging to the specified type as the target user terminal.
Further, the obtaining unit 1202 is further configured to determine a user importance of each of the first user terminals; and taking the first user terminal with the lowest user importance as a target user terminal.
Further, the obtaining unit 1202 is further configured to determine a service type of a service module corresponding to each first user terminal, where the service module corresponding to each first user terminal sends data to the electronic device based on the bluetooth connection of the first user terminal; and determining the user importance of each first user terminal based on the service type corresponding to each first user terminal.
A connection unit 1203, configured to establish a bluetooth connection with the second user terminal based on the connection request.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 13, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 200 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application program. The electronic device 200 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the entire electronic device 200 using various interfaces and lines, and performs various functions of the electronic device 200 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
Referring to fig. 14, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer readable medium 1400 has stored therein program code that can be invoked by a processor to perform the methods described in the method embodiments above.
The computer-readable storage medium 1400 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, computer-readable storage medium 1400 includes a non-volatile computer-readable storage medium. The computer readable storage medium 1400 has storage space for program code 1410 for performing any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 1410 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (16)

1. A device connection method is applied to an electronic device, and the method comprises the following steps:
under the condition that the electronic equipment and at least one first user terminal establish Bluetooth connection and are in a connectable state, maintaining the Bluetooth connection with the at least one first user terminal, and acquiring a connection request sent by a second user terminal for establishing the Bluetooth connection, wherein the connectable state refers to a state that the electronic equipment can respond to the connection request sent by external equipment;
and establishing Bluetooth connection with the second user terminal based on the connection request.
2. The method according to claim 1, wherein in a case where the electronic device has established a bluetooth connection with at least one first user terminal and is in a connectable state, maintaining the bluetooth connection with at least one first user terminal, and acquiring a connection request sent by at least one second user terminal for requesting establishment of the bluetooth connection comprises:
the method comprises the steps that when the electronic equipment is in a connectable state with at least one first user terminal, the electronic equipment enters a pairing state, the Bluetooth connection with the at least one first user terminal is maintained, and a connection request for establishing the Bluetooth connection is acquired from at least one second user terminal, wherein the connection request sent by the second user terminal is generated after the second user terminal scans the electronic equipment in the pairing state.
3. The method according to claim 1 or 2, wherein the maintaining of the bluetooth connection with the at least one first user terminal and the obtaining of the connection request sent by the second user terminal requesting the establishment of the bluetooth connection comprises:
determining the target number of the first user terminals which have established Bluetooth connection with the electronic equipment currently;
if the target number is equal to a specified number, determining a target user terminal from the plurality of first user terminals, wherein the specified number is smaller than or equal to the maximum value of the user terminals which are allowed by the electronic equipment to establish the Bluetooth connection;
and disconnecting the Bluetooth connection with the target user terminal, keeping the Bluetooth connection with a first user terminal except the target user terminal, and acquiring a connection request for establishing the Bluetooth connection, which is sent by a second user terminal.
4. The method of claim 3, wherein the determining a target user terminal from the plurality of first user terminals comprises:
determining priorities of a plurality of the first user terminals;
and determining a target user terminal from the plurality of first user terminals based on the priorities of the plurality of first user terminals.
5. The method of claim 4, wherein determining the target user terminal based on the priorities of the plurality of first user terminals comprises:
and taking the first user terminal with the lowest priority as a target user terminal from the plurality of first user terminals.
6. The method of claim 3, wherein the determining the target user terminal from the plurality of first user terminals based on the priorities of the plurality of first user terminals comprises:
searching a first user terminal in an idle state from a plurality of first user terminals to be used as an alternative terminal;
and if the number of the alternative terminals is multiple, determining a target user terminal from the multiple alternative terminals based on the priority of each alternative terminal.
7. The method of claim 3, wherein the determining the priorities of the plurality of first user terminals comprises:
acquiring the connection time of each first user terminal and the electronic equipment for establishing Bluetooth connection;
determining the priority of each first user terminal based on the connection time of each first user terminal, wherein the priority of the first user terminal corresponding to the earliest connection time is the lowest.
8. The method of claim 3, wherein the determining the priorities of the plurality of first user terminals comprises:
determining attribute information of data transmitted to the electronic equipment by each first user terminal;
and determining the priority of each first user terminal based on the attribute information corresponding to each first user terminal.
9. The method of claim 8, wherein the attribute information includes a transmission time of the latest transmission data, and wherein determining the priority of each of the first user terminals based on the attribute information corresponding to each of the first user terminals comprises:
and determining the priority of each first user terminal based on the corresponding sending time of each first user terminal, wherein the priority of the first user terminal corresponding to the earliest sending time is the lowest.
10. The method of claim 9, wherein the attribute information includes a data type of data that was most recently transmitted to the electronic device, and wherein determining the priority of each of the first user terminals based on the attribute information corresponding to each of the first user terminals comprises:
and determining the priority of each first user terminal based on the data type corresponding to each first user terminal, wherein the priority of the first user terminal corresponding to the data type belonging to the specified type is the lowest.
11. The method of claim 3, wherein the determining the priorities of the plurality of first user terminals comprises:
determining a user importance of each of the first user terminals;
and determining the priority of each first user terminal based on the user importance of each first user terminal, wherein the priority of the first user terminal with the lowest user importance is the lowest priority.
12. The method of claim 11, wherein the determining the user importance of each of the first user terminals comprises:
determining the service type of a service module corresponding to each first user terminal, wherein the service module corresponding to each first user terminal sends data to the electronic equipment based on the Bluetooth connection of the first user terminal; and determining the user importance of each first user terminal based on the service type corresponding to each first user terminal.
13. The method of claim 1 or 2, wherein the electronic device is a bluetooth headset.
14. An apparatus connecting device, applied to an electronic apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for keeping Bluetooth connection with at least one first user terminal and acquiring a connection request sent by a second user terminal for requesting to establish the Bluetooth connection under the condition that the electronic equipment and the at least one first user terminal establish the Bluetooth connection and are in a connectable state, and the connectable state refers to a state that the electronic equipment can respond to the connection request sent by external equipment;
and the connection unit is used for establishing Bluetooth connection with the second user terminal based on the connection request.
15. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1-13.
16. A computer-readable medium having stored program code executable by a processor, the program code causing the processor to perform the method of any one of claims 1-13 when executed by the processor.
CN202111117328.8A 2021-09-23 2021-09-23 Device connection method, device, electronic device and computer readable medium Pending CN113766477A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111117328.8A CN113766477A (en) 2021-09-23 2021-09-23 Device connection method, device, electronic device and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111117328.8A CN113766477A (en) 2021-09-23 2021-09-23 Device connection method, device, electronic device and computer readable medium

Publications (1)

Publication Number Publication Date
CN113766477A true CN113766477A (en) 2021-12-07

Family

ID=78797150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111117328.8A Pending CN113766477A (en) 2021-09-23 2021-09-23 Device connection method, device, electronic device and computer readable medium

Country Status (1)

Country Link
CN (1) CN113766477A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923641A (en) * 2021-12-07 2022-01-11 荣耀终端有限公司 Connection method and device
CN114245362A (en) * 2022-02-25 2022-03-25 荣耀终端有限公司 Device reconnection method and Bluetooth peripheral
CN114915957A (en) * 2022-07-13 2022-08-16 荣耀终端有限公司 Bluetooth headset reconnection control method and control device
WO2023185171A1 (en) * 2022-03-31 2023-10-05 哲库科技(上海)有限公司 Data transmission method and apparatus, electronic device and computer-readable storage medium
CN117155736A (en) * 2023-10-28 2023-12-01 南京德克威尔自动化有限公司 Timing communication method between bus master station and slave station
CN117615466A (en) * 2023-01-04 2024-02-27 广州星际悦动股份有限公司 Connection control method, device, equipment and medium for oral care equipment and terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112399396A (en) * 2021-01-19 2021-02-23 深圳市汇顶科技股份有限公司 Bluetooth connection switching method, Bluetooth chip and Bluetooth device
CN113225693A (en) * 2019-04-18 2021-08-06 华为技术有限公司 Bluetooth connection method, equipment and system
WO2021169147A1 (en) * 2020-02-26 2021-09-02 深圳市岍丞技术有限公司 Method and system for connecting bluetooth earphones to terminal, and storage medium
CN113411794A (en) * 2021-06-01 2021-09-17 Oppo广东移动通信有限公司 Connection method, Bluetooth headset, terminal and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113225693A (en) * 2019-04-18 2021-08-06 华为技术有限公司 Bluetooth connection method, equipment and system
WO2021169147A1 (en) * 2020-02-26 2021-09-02 深圳市岍丞技术有限公司 Method and system for connecting bluetooth earphones to terminal, and storage medium
CN112399396A (en) * 2021-01-19 2021-02-23 深圳市汇顶科技股份有限公司 Bluetooth connection switching method, Bluetooth chip and Bluetooth device
CN113411794A (en) * 2021-06-01 2021-09-17 Oppo广东移动通信有限公司 Connection method, Bluetooth headset, terminal and computer storage medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923641A (en) * 2021-12-07 2022-01-11 荣耀终端有限公司 Connection method and device
CN113923641B (en) * 2021-12-07 2022-05-06 荣耀终端有限公司 Connection method and device
CN114245362A (en) * 2022-02-25 2022-03-25 荣耀终端有限公司 Device reconnection method and Bluetooth peripheral
CN114245362B (en) * 2022-02-25 2022-11-15 荣耀终端有限公司 Device reconnection method and Bluetooth peripheral
WO2023185171A1 (en) * 2022-03-31 2023-10-05 哲库科技(上海)有限公司 Data transmission method and apparatus, electronic device and computer-readable storage medium
CN114915957A (en) * 2022-07-13 2022-08-16 荣耀终端有限公司 Bluetooth headset reconnection control method and control device
CN114915957B (en) * 2022-07-13 2022-11-29 荣耀终端有限公司 Bluetooth headset reconnection control method and control device
CN117615466A (en) * 2023-01-04 2024-02-27 广州星际悦动股份有限公司 Connection control method, device, equipment and medium for oral care equipment and terminal
CN117615466B (en) * 2023-01-04 2024-05-03 广州星际悦动股份有限公司 Connection control method, device, equipment and medium for oral care equipment and terminal
CN117155736A (en) * 2023-10-28 2023-12-01 南京德克威尔自动化有限公司 Timing communication method between bus master station and slave station
CN117155736B (en) * 2023-10-28 2024-01-02 南京德克威尔自动化有限公司 Timing communication method between bus master station and slave station

Similar Documents

Publication Publication Date Title
CN113766477A (en) Device connection method, device, electronic device and computer readable medium
WO2020063761A1 (en) Data transmitting method and system
WO2019090726A1 (en) Method for selecting bluetooth device, terminal, and system
CN108848567B (en) Content sharing method and device
CN113411793A (en) Bluetooth communication method and terminal
US11991612B2 (en) Bluetooth data transmission method and apparatus, terminal and storage medium
US20150119011A1 (en) Information processing method and device
WO2023040517A1 (en) Audio data playback method, device, electronic equipment, and storage medium
WO2024016948A1 (en) Information updating method and apparatus, audio sharing method and system, and electronic device
JP2021521737A (en) Access control method, message broadcasting method and related equipment
JP2023508739A (en) Multicast service transmission method, transmission processing method and related equipment
WO2018161788A1 (en) Multimedia data sharing method and device
CN113840269B (en) Multimedia data transmission method and device, electronic equipment and storage medium
CN110602683A (en) Bluetooth control method, device, mobile terminal and storage medium
EP3805938B1 (en) Server node selection method and terminal device
WO2024119947A1 (en) Bluetooth communication method and apparatus, electronic device, and computer-readable medium
CN111182597B (en) Processing method and device
WO2023061273A1 (en) Device connection method and apparatus, and electronic device and storage medium
CN115665671A (en) Audio data sharing method and device, electronic equipment and storage medium
JP2018527765A (en) Method, apparatus, program and recording medium for establishing service connection
WO2021239032A1 (en) Bluetooth protocol connection method and apparatus, storage medium, and related device
CN115580944A (en) Audio device connection method and device, storage medium and device
CN114885261A (en) Earphone assembly, wireless audio playing system and communication method thereof
CN114363876A (en) Connection establishing method, device, equipment, storage medium and program product
CN108712280B (en) Network function management method and device, storage medium and intelligent terminal

Legal Events

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