WO2022222877A1 - 通信连接控制方法、装置、计算机设备及可读存储介质 - Google Patents

通信连接控制方法、装置、计算机设备及可读存储介质 Download PDF

Info

Publication number
WO2022222877A1
WO2022222877A1 PCT/CN2022/087324 CN2022087324W WO2022222877A1 WO 2022222877 A1 WO2022222877 A1 WO 2022222877A1 CN 2022087324 W CN2022087324 W CN 2022087324W WO 2022222877 A1 WO2022222877 A1 WO 2022222877A1
Authority
WO
WIPO (PCT)
Prior art keywords
external device
communication connection
target terminal
short
event
Prior art date
Application number
PCT/CN2022/087324
Other languages
English (en)
French (fr)
Inventor
张莉
周依鸽
章欣
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022222877A1 publication Critical patent/WO2022222877A1/zh

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
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/23Manipulation of direct-mode connections

Definitions

  • the present application relates to the technical field of short-distance communication, and in particular, to a communication connection control method, apparatus, computer device, and readable storage medium.
  • the short-distance communication technology can realize the transmission of communication information between different devices within a short distance.
  • a terminal is connected to a headset for short-distance communication, and the headset can play audio files in the terminal.
  • some terminals can be connected to two pairs of earphones for short-distance communication at the same time.
  • a short-distance communication connection between the terminal and two pairs of earphones is established manually by the user in the terminal, so that the two pairs of earphones can play audio files in the terminal at the same time.
  • the embodiments of the present application provide a communication connection control method, apparatus, computer device, and readable storage medium, which can improve the efficiency of short-distance communication connection between a terminal device and an external device.
  • a communication connection control method comprising:
  • first impact event for the first external device If a first impact event for the first external device is detected, detecting whether the first impact event is a mutual impact event between the first external device and the second external device;
  • the first impact event is the mutual impact event
  • the first external device has established a short-range communication connection with the target terminal
  • the second external device has not established a short-range communication connection with the target terminal
  • a communication connection control device comprising:
  • a detection module configured to detect whether the first impact event is a mutual impact event between the first external device and the second external device if a first impact event for the first external device is detected
  • the sending module is used for if the first collision event is the mutual collision event, and the first external device has established a short-distance communication connection with the target terminal, and the second external device has not established a short-distance communication connection with the target terminal.
  • distance communication connection send a target short-range communication connection address to the target terminal or the second external device, wherein the target short-range communication connection address is used for the second external device and the target terminal to establish short-range communication connection.
  • a computer device including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the communication connection control method as described in the first aspect above is implemented.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the communication connection control method described in the above-mentioned first aspect.
  • the first impact event for the first external device is a mutual impact event between the first external device and the second external device
  • the first impact event is a mutual impact event
  • the first external device and the target terminal have established a short-distance communication connection
  • the second external device has not established a short-distance communication connection with the target terminal
  • send the target short-distance communication connection address to the target terminal or the second external device, so that the target
  • the terminal or the second external device can quickly establish a short-distance communication connection between the target terminal and the second external device based on the target short-distance communication connection address, so that in the case of the short-distance communication connection between the first external device and the target terminal,
  • the short-distance communication connection between the target terminal and the second external device can be quickly established, so that the user does not need to manually configure the target terminal to establish the short-distance communication connection between the target terminal and the second external device, so it can improve the communication between the target terminal and the second external device.
  • FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a communication connection control method provided by an embodiment of the present application
  • FIG. 3 is a flowchart of a method for sending a target short-range communication connection address to a second external device according to an embodiment of the present application
  • FIG. 4 is a flowchart of a method for sending a target short-range communication connection address to a target terminal according to an embodiment of the present application
  • FIG. 5 is a flowchart of another communication connection control method provided by an embodiment of the present application.
  • FIG. 6 is a flowchart of a method for establishing a short-range communication connection with a target terminal provided by an embodiment of the present application
  • FIG. 7 is a flowchart of a method for detecting whether a first impact event is a mutual impact event provided by an embodiment of the present application
  • FIG. 8 is a flowchart of a method for detecting whether an event feature similarity is greater than an event feature similarity threshold provided by an embodiment of the present application
  • FIG. 9 is a flowchart of another method for detecting whether an event feature similarity is greater than an event feature similarity threshold provided by an embodiment of the present application.
  • FIG. 11 is a block diagram of a communication connection control apparatus provided by an embodiment of the present application.
  • FIG. 12 is a block diagram of a computer device according to an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an implementation environment involved in a communication connection control method provided by an embodiment of the present application.
  • the implementation environment may include a target terminal 101 , a first external device 102 and a second external device 103 , wherein the target terminal 101 and the first external device 102 can communicate through a wired network or a wireless network, the target terminal 101 and the second external device 103 can communicate through a wired network or a wireless network, and the first external device 102 Communication with the second external device 103 may be performed through a wired network or a wireless network.
  • the target terminal 101 may be a smart phone, a tablet computer, a notebook computer, a smart TV, a vehicle-mounted device, etc.
  • the first external device 102 and the second external device 103 may be wearable devices (such as headphones, watches, glasses, massagers, etc. ), smart speakers, MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, mouse , keyboard, etc.
  • the first external device 102 detects a first impact event for the first external device 102 , it detects whether the first impact event is between the first external device 102 and the second external device 103 . If the first collision event is a mutual collision event, and the first external device 102 has established a short-range communication connection with the target terminal 101, and the second external device 103 has not established a short-range communication connection with the target terminal 101, the first An external device 102 sends the target short-range communication connection address to the target terminal 101 or the second external device 103 , wherein the target short-range communication connection address is used for the second external device 103 and the target terminal 101 to establish a short-range communication connection.
  • the first collision event is a mutual collision event
  • the first external device 102 has established a short-range communication connection with the target terminal 101
  • the second external device 103 has not established a short-range communication connection with the target terminal 101
  • the first An external device 102 sends the target short-range communication connection address to the target terminal 101 or the second external
  • FIG. 2 shows a flowchart of a communication connection control method provided by an embodiment of the present application.
  • the communication connection control method may be applied to the first external device 102 described above.
  • the communication connection control method may include the following steps:
  • Step 201 If the first external device detects a first impact event against the first external device, it detects whether the first impact event is a mutual impact event between the first external device and the second external device.
  • the first impact event may be an impact operation between the first external device and other devices, objects, or human bodies, and the other devices may be, for example, other external devices, electronic devices, communication devices, routing devices, and terminal devices other than the first external device.
  • the object may be, for example, a table, a chair, a wall, etc.
  • the number of impact operations corresponding to the first impact event may be one, two, three, etc., which are not specifically limited herein.
  • the process of how the first external device detects the first impact event for the first external device will be described below through two different implementation manners.
  • a shake detection sensor may be provided in the first external device, and the shake detection sensor is used to detect whether the first external device shakes. If the jitter detection sensor detects that the first external device vibrates once, it will output a jitter signal. first impact event.
  • the shake detection sensor may be a motion state sensor such as an acceleration sensor and a gyroscope.
  • a sound pickup component may be provided in the first external device, and the sound pickup component is used to collect audio data. If the first external device collects audio data through the sound pickup assembly, then the collected audio data is input into the audio type classification model to obtain the type of audio data output by the audio type classification model. If the type is set, the first external device determines that the first impact event is detected, and the preset type may be, for example, a single-click audio type, a double-click audio type, and the like.
  • the audio type classification model may be obtained by adding audio data type labels to different sample audio data to obtain a training sample set, and then using the training sample set to train a neural network model.
  • the first external device can detect whether there is a first impact event. If the first external device detects the first impact event, it will detect whether the first impact event is a mutual impact event between the first external device and the second external device, that is, detect whether the first impact event is the first external device and the second external device. The impact event generated by the second external devices colliding with each other.
  • the second external device when the second external device detects a second impact event for the second external device, the second external device may broadcast the second impact time of the second impact event, wherein the second impact
  • the definition of the event is similar to that of the first impact event, and it can be an impact operation between the second external device and other devices, objects or human bodies.
  • the first external device receives the second impact time broadcast by the second external device, and the first external device can obtain the first impact time of the first impact event, and compare the first impact time with the second impact time. If the impact time and the second impact time are the same or close to each other, it is determined that the first impact event is a mutual impact event between the first external device and the second external device.
  • the second external device when the second external device detects a second impact event against the second external device, the second external device may also broadcast the position of the second external device, so that the first external device receives The position of the second external device broadcasted by the second external device, the first external device can obtain the position of the first external device, and compare the position of the first external device with the position of the second external device, if the position of the first external device is If the positions of the first external device and the second external device are the same or close to each other, it is determined that the first impact event is a mutual impact event between the first external device and the second external device.
  • Step 202 if the first impact event is a mutual impact event, and the first external device has established a short-range communication connection with the target terminal, and the second external device has not established a short-range communication connection with the target terminal, the first external device sends the target terminal to the target terminal. Or the second external device sends the target short-range communication connection address.
  • Short-range communication is also called short-range communication, which can realize the transmission of communication information between different devices within a short distance.
  • short-range communication may be Bluetooth (Bluetooth) communication, infrared communication, and the like.
  • the first external device detects whether a short-range communication connection is established between the first external device and the target terminal. Including, it is determined that a short-distance communication connection is established between the first external device and the target terminal.
  • the first external device searches the Bluetooth list of the first external device to find out whether the Bluetooth name of the target terminal is recorded, and if the Bluetooth name exists, it is determined that the first external device and the target terminal have established a short-distance communication connection.
  • the first external device may also read the short-distance communication connection status of the first external device from the short-distance communication connection status interface, and if the state is the connected state, determine the first external device A short-range communication connection is established with the target terminal.
  • the first external device can determine whether the first external device has established a short-distance communication connection with the target terminal.
  • the first external device determines that the second external device does not establish a short-distance communication connection with the target terminal, and the first external device may send a confirmation request to the second external device or the target terminal, and the confirmation request is used to request the second external device or the target terminal. Detect whether a short-distance communication connection is established between the second external device and the target terminal, and return a confirmation result. According to the confirmation result, the first external device can determine whether a short-distance communication connection is established between the second external device and the target terminal.
  • the second external device or the target terminal detects whether the second external device establishes a short-distance communication connection with the target terminal, and determines whether the first external device establishes a short-distance communication connection with the target terminal with the first external device. Similar, and will not be repeated here.
  • the second external device has not established a short-distance communication connection with the target terminal, and detects that the first impact event is a mutual impact event, in order to establish a second external device.
  • a short-distance communication connection between the external device and the target terminal so that the target terminal can communicate with the first external device and the second external device in a short distance, and the first external device sends the target short-range communication to the target terminal or to the second external device.
  • a distance communication connection address, the target short distance communication connection address is used for establishing a short distance communication connection between the second external device and the target terminal. In this way, based on the target short-range communication connection address, the second external device and the target terminal can automatically and quickly establish a short-range communication connection.
  • the target terminal can communicate with both the first external device and the second external device in a short distance, so that the communication information in the target terminal can be sent to the first external device at the same time.
  • the second external device to realize the sharing of communication information between the first external device and the second external device, and the communication information may be, for example, audio and video data, text data, and the like.
  • the target terminal when the target terminal needs to play audio data, it can send the audio data to the first earphone and the second earphone, the first earphone and the second earphone. Both the two earphones can play the audio data, so as to realize the sharing of the audio data between the first earphone and the second earphone.
  • the target short-range communication connection address is sent to the target terminal or the second external device, In this way, the target terminal or the second external device can quickly establish a short-distance communication connection between the target terminal and the second external device based on the target short-distance communication connection address, so that the short-distance communication connection between the first external device and the target terminal is achieved.
  • the short-distance communication connection between the target terminal and the second external device can be quickly established, so that the user does not need to manually configure the target terminal to establish the short-distance communication connection between the target terminal and the second external device.
  • Efficiency of short-range communication connections between the target terminal and the external device can be quickly established, so that the user does not need to manually configure the target terminal to establish the short-distance communication connection between the target terminal and the second external device.
  • this embodiment relates to how the first external device communicates with the target terminal when a short-distance communication connection is established between the first external device and the target terminal.
  • the target terminal or the process of sending the target short-range communication connection address to the second external device may include steps 301 and 302:
  • Step 301 the first external device obtains the communication connection address of the target terminal.
  • the communication connection address refers to an address used to identify the corresponding short-range communication device.
  • the communication connection address of the target terminal may be, for example, the Bluetooth address of the target terminal, and other short-range communication devices (such as a second external device) can identify the target terminal based on the communication connection address of the target terminal.
  • the communication connection address of the target terminal may be sent by the target terminal to the first external device during the process of establishing a short-distance communication connection between the first external device and the target terminal.
  • Step 302 The first external device sends the communication connection address of the target terminal to the second external device as the target short-range communication connection address.
  • the communication connection address of the target terminal is used for the second external device to initiate a short-distance communication connection process with the target terminal based on the communication connection address of the target terminal, that is, after the second external device receives the communication connection address of the target terminal, Then actively initiate a short-distance communication connection process with the target terminal.
  • the second external device may send a short-distance communication connection request to the target terminal based on the communication connection address of the target terminal; after receiving the short-distance communication connection request, the target terminal may send a request to the second external connection The device sends a short-range communication connection confirmation command, and after receiving the short-range communication connection confirmation command, the second external device establishes a short-range communication connection with the target terminal.
  • the first external device determines the communication connection address of the target terminal as the target short-distance communication connection address, and can send the communication connection address of the target terminal to the second external device through ultrasonic waves.
  • Ultrasound is a sound wave with a frequency higher than 20KHz.
  • the first external device can perform signal modulation on the communication connection address of the target terminal.
  • the ultrasonic wave is sent to the second external device, and the second external device receives the communication connection address of the target terminal through its sound pickup assembly.
  • Ultrasonic transmission does not require additional hardware or pairing devices, and only needs speakers and pickup components, and the implementation is simple and convenient; and the distance of ultrasonic transmission is less than that of Bluetooth transmission, which can prevent the first external device from mistakenly identifying the target terminal
  • the communication connection address of the target terminal is sent to other devices far away, so as to avoid the mistransmission of the communication connection address of the target terminal.
  • this embodiment relates to how the first external device has a short-range communication connection with the target terminal. Another embodiment of sending the target short-range communication connection address to the target terminal or to the second external device. As shown in FIG. 4 , this method may include steps 401 and 402:
  • Step 401 the first external device receives the communication connection address of the second external device broadcasted by the second external device when the second impact event is detected.
  • the communication connection address of the second external device may be, for example, the Bluetooth address of the second external device, and the second external device can be identified based on the communication connection address of the second external device.
  • the second external device can detect whether a second impact event for the second external device occurs. Similar to the process of the first external device detecting the first impact event described above, the second external device can be set to shake detection. The sensor can be used for detection, or the second external device can also be detected by using the audio type classification model, which will not be repeated here.
  • the second external device detects the second impact event, the second external device broadcasts information such as the second impact time of the second impact event and the communication connection address of the second external device. In this way, the first external device receives the communication connection address of the second external device.
  • Step 402 the first external device sends the communication connection address of the second external device as the target short-range communication connection address to the target terminal.
  • the communication connection address of the second external device is used for the target terminal to initiate a short-distance communication connection process with the second external device based on the communication connection address of the second external device. That is, after receiving the communication connection address of the second external device, the target terminal actively initiates a short-distance communication connection process with the second external device.
  • the target terminal may send a short-range communication connection request to the second external device based on the communication connection address of the second external device, and after receiving the short-range communication connection request, the second external device may send a request to the second external device.
  • the target terminal sends a short-distance communication connection confirmation instruction, and after receiving the short-distance communication connection confirmation instruction, the target terminal establishes a short-distance communication connection with the second external device.
  • the first external device uses the communication connection address of the second external device as the target short-distance communication connection address, and the communication connection address of the second external device can be sent by ultrasonic waves. sent to the target terminal. In this way, it can be avoided that the first external device mistakenly sends the communication connection address of the second external device to other devices far away, and the wrong transmission of the communication connection address of the second external device is avoided.
  • FIG. 5 shows a flowchart of another communication connection control method provided by an embodiment of the present application.
  • the communication connection control method of this embodiment further includes step 203:
  • Step 203 if the collision event is a mutual collision event, and the first external device does not establish a short-distance communication connection with the target terminal, and the second external device establishes a short-distance communication connection with the target terminal, the first external device establishes a short-distance communication connection with the target terminal. short-range communication connection.
  • the first external device is not connected to the target terminal for short-distance communication, but the second external device is connected to the target terminal for short-distance communication, in this way, it is necessary to establish a short-distance communication between the first external device and the target terminal communication connection.
  • the target terminal can communicate with both the first external device and the second external device in a short distance, so that the communication information in the target terminal can be sent to the first external device at the same time. and the second external device to realize the sharing of communication information between the first external device and the second external device.
  • the first external device can implement the process of establishing a short-distance communication connection with the target terminal by performing steps 601, 602 and 603 shown in FIG. 6:
  • Step 601 the first external device receives the communication connection address of the target terminal broadcast by the second external device when the second impact event is detected.
  • the communication connection address of the target terminal may be sent by the target terminal to the second external device during the process of establishing a short-distance communication connection between the second external device and the target terminal.
  • the second external device can detect whether a second impact event against the second external device occurs, and if a second impact event is detected, the second external device broadcasts the target The communication connection address of the terminal, in this way, the first external device receives the communication connection address of the target terminal.
  • the first external device may receive, through ultrasonic waves, the communication connection address of the target terminal broadcast by the second external device when the second impact event is detected.
  • the second external device can perform signal modulation and other operations on the communication connection address of the target terminal. After modulation to the frequency band where the ultrasonic wave is located, it is sent to the first external device in the form of ultrasonic waves through the speaker in the second external device.
  • the sound pickup assembly receives the communication connection address of the target terminal, so that the mistransmission of the communication connection address of the target terminal can be avoided.
  • Step 602 the first external device sends a short-range communication connection request to the target terminal based on the communication connection address of the target terminal.
  • the first external device After receiving the communication connection address of the target terminal, the first external device actively initiates a short-range communication connection process to the target terminal, and the first external device sends a short-range communication connection request to the target terminal based on the communication connection address of the target terminal.
  • Step 603 the first external device establishes a short-range communication connection with the target terminal in response to the short-range communication connection confirmation instruction sent by the target terminal.
  • the short-range communication connection confirmation instruction is sent by the target terminal after receiving the short-range communication connection request. That is, after receiving the short-range communication connection request, the target terminal sends a short-range communication connection confirmation instruction to the first external device. In this way, after the first external device receives the short-range communication connection confirmation instruction, it establishes a connection with the target terminal. short-range communication connection.
  • the first external device when the first external device is not connected to the target terminal for short-distance communication, and the second external device is connected to the target terminal for short-distance communication, the first external device detects the second impact event by receiving the second external device.
  • the broadcasted communication connection address of the target terminal and based on the communication connection address of the target terminal, a short-distance communication connection request is sent to the target terminal, and a short-distance communication connection is established with the target terminal in response to the short-distance communication connection confirmation instruction sent by the target terminal,
  • the fast short-distance communication connection between the first external device and the target terminal is realized, and the user does not need to manually configure in the target terminal to establish the short-distance communication connection between the target terminal and the first external device.
  • the efficiency of short-range communication links between devices are examples of short-range communication links between devices.
  • this embodiment relates to how the first external device detects whether the first impact event is between the first external device and the second external device.
  • the process of collision events As shown in Figure 7, the process includes steps 701, 702 and 703:
  • Step 701 the first external device acquires the first event feature corresponding to the first impact event.
  • the first event feature corresponding to the first impact event is acquired.
  • the first event feature may include a first impact time
  • the first external device acquires the first event feature, and the time at which the first impact event is detected may be determined as the first impact time.
  • the first event signature may include a first impact sound signature.
  • the first external device can collect audio data corresponding to the first impact event through the sound pickup assembly in the first external device, and then the first external device uses an energy detection algorithm to perform spectrum sensing on the audio data to obtain the corresponding energy peaks. time, the first external device calculates the first time interval according to the time corresponding to each energy peak, and determines the first time interval as the first impact sound feature.
  • the first external device can obtain the time corresponding to the two energy peaks by using an energy detection algorithm, and the first external device can obtain the time corresponding to the two energy peaks by using an energy detection algorithm. Calculate the difference at the moment corresponding to the energy peak value and take the absolute value of the difference to obtain the first time interval.
  • the first external device may also calculate the inverse of the first time interval to obtain the first frequency feature, and determine the first frequency feature as the first impact sound feature, and so on.
  • Step 702 the first external device receives the second event feature corresponding to the second impact event broadcast by the second external device when the second impact event is detected.
  • the second external device after the second external device detects the second impact event for the second external device, the second external device acquires the second event feature corresponding to the second impact event, and the second external device broadcasts a short-distance connection request
  • the short-distance connection request may carry the second event feature corresponding to the second impact event.
  • the short-distance connection request may also carry other information, such as a communication connection address, and the like.
  • the manner in which the second external device acquires the second event feature corresponding to the second impact event is similar to the manner in which the first external device acquires the first event feature corresponding to the first impact event in step 701, and will not be repeated here.
  • the second external device may determine the time when the second impact event is detected as the second impact time, the second time interval as the second impact sound feature, or the second frequency feature as the first impact sound. Two impact sound signatures, etc.
  • the first external device receives the second event feature corresponding to the second impact event broadcast by the second external device, and the first external device detects whether the event feature similarity between the first event feature and the second event feature is greater than a preset Event feature similarity threshold.
  • the first external device may execute step 801 shown in FIG. 8 .
  • step 802 realize the process of detecting whether the event feature similarity between the first event feature and the second event feature is greater than a preset event feature similarity threshold:
  • Step 801 the first external device detects whether the time difference between the first impact time and the second impact time is less than a preset time difference threshold.
  • the first external device calculates the time difference between the first impact time and the second impact time, and the time difference may be the difference between the first impact time and the second impact time calculated by the first external device, and the The absolute value of the difference is obtained.
  • the first external device detects whether the time difference is smaller than a preset time difference threshold, and the time difference threshold can be set by itself during implementation.
  • Step 802 If the time difference is less than the time difference threshold, the first external device determines that the event feature similarity is greater than the event feature similarity threshold.
  • the first external device can perform the operation shown in FIG. 9 .
  • Step 901 the first external device detects whether the sound feature similarity between the first impact sound feature and the second impact sound feature is greater than a preset sound feature similarity threshold.
  • the first external device can calculate the absolute value of the difference between the first time interval and the second time interval, if the difference If the absolute value of the value is smaller than the preset threshold, it is determined that the sound feature similarity between the first impact sound feature and the second impact sound feature is greater than the preset sound feature similarity threshold.
  • Step 902 if the sound feature similarity is greater than the sound feature similarity threshold, the first external device determines that the event feature similarity is greater than the event feature similarity threshold.
  • Step 703 if the event feature similarity between the first event feature and the second event feature is greater than a preset event feature similarity threshold, the first external device determines that the first impact event is a mutual impact event.
  • the first external device determines that the event feature similarity between the first event feature and the second event feature is greater than the preset event feature similarity threshold, the first external device determines that the first impact event is a mutual impact event. It refers to an operation in which the first external device and the second external device collide with each other, that is, it indicates that the first impact event and the second impact event are the same impact event.
  • the first external device acquires the first event feature corresponding to the first impact event, and the first external device receives the second event feature corresponding to the second impact event broadcast by the second external device when the second impact event is detected.
  • the event feature similarity between the first event feature and the second event feature is greater than the preset event feature similarity threshold, and the first external device determines that the first impact event is a mutual impact event, that is, determines the shared device of the first external device It is the second external device.
  • the first external device establishes a short-distance communication connection with the target terminal, the first external device sends the target short-distance communication connection address to the target terminal or the second external device for the second external device.
  • a short-distance communication connection is established with the target terminal based on the target short-distance communication connection address, so as to realize the sharing of communication information in the target terminal between the first external device and the second external device.
  • FIG. 10 shows a flowchart of an exemplary communication connection control method provided by an embodiment of the present application, and the method can be applied to the implementation environment shown in FIG. 1 .
  • the method may include the following steps:
  • Step 1001 If the first external device detects a first impact event for the first external device, acquire a first event feature corresponding to the first impact event.
  • Step 1002 The first external device receives the second event feature corresponding to the second impact event broadcast by the second external device when the second impact event is detected.
  • the first event feature includes a first impact time
  • the second event feature includes a second impact time
  • the first external device detects whether the time difference between the first impact time and the second impact time is less than a preset time difference. Threshold, if the time difference is less than the time difference threshold, the first external device determines that the event feature similarity is greater than the event feature similarity threshold.
  • the first event feature includes a first crash sound feature
  • the second event feature includes a second crash sound feature
  • the first external device detects whether the sound feature similarity between the first crash sound feature and the second crash sound feature is is greater than the preset sound feature similarity threshold. If the sound feature similarity is greater than the sound feature similarity threshold, the first external device determines that the event feature similarity is greater than the event feature similarity threshold.
  • Step 1003 if the event feature similarity between the first event feature and the second event feature is greater than a preset event feature similarity threshold, the first external device determines that the first impact event is a mutual impact event.
  • Step 1004 if the first impact event is a mutual impact event, and the first external device has established a short-distance communication connection with the target terminal, and the second external device has not established a short-distance communication connection with the target terminal, the first external device sends the target terminal to the target terminal. Or the second external device sends the target short-range communication connection address.
  • sending the target short-range communication connection address to the target terminal or the second external device including:
  • Step a the first external device obtains the communication connection address of the target terminal
  • the first external device determines the communication connection address of the target terminal as the target short-distance communication connection address, and sends the communication connection address of the target terminal to the second external device through ultrasonic waves, and the communication connection address of the target terminal is used for the first external device.
  • the second external device initiates a short-distance communication connection process with the target terminal based on the communication connection address of the target terminal.
  • sending the target short-range communication connection address to the target terminal or the second external device including:
  • Step c the first external device receives the communication connection address of the second external device broadcasted by the second external device when the second impact event is detected;
  • Step d the first external device sends the communication connection address of the second external device as the target short-range communication connection address to the target terminal, and the communication connection address of the second external device is used for the target terminal based on the communication connection address of the second external device. , and initiate a short-distance communication connection process with the second external device.
  • the target short-range communication connection address is used for establishing a short-range communication connection between the second external device and the target terminal
  • Step 1005 if the collision event is a mutual collision event, and the first external device does not establish a short-distance communication connection with the target terminal, and the second external device establishes a short-distance communication connection with the target terminal, the first external device establishes a short-distance communication connection with the target terminal. short-range communication connection.
  • establishing a short-range communication connection with the target terminal includes:
  • the first external device receives, through ultrasonic waves, the communication connection address of the target terminal broadcast by the second external device when the second impact event is detected;
  • the first external device sends a short-range communication connection request to the target terminal based on the communication connection address of the target terminal.
  • the first external device establishes a short-range communication connection with the target terminal in response to a short-range communication connection confirmation command sent by the target terminal, wherein the short-range communication connection confirmation command is sent by the target terminal after receiving the short-range communication connection request.
  • TWS Truste Wireless Stereo, true wireless stereo
  • TWS headset A has established a short-distance communication connection with the target terminal
  • TWS headset B has not established a short-distance communication connection with the target terminal
  • the short-distance communication connection is specifically a Bluetooth connection.
  • the first external device as TWS headset A and the second external device as TWS headset B as an example, that is, the first external device has been connected to the target terminal via Bluetooth, and a Bluetooth connection between the second external device and the target terminal needs to be established:
  • TWS earphone A and TWS earphone B tap, TWS earphone A detects through the shake detection sensor (accelerometer, gyroscope, etc.) set in TWS earphone A that the shake detection sensor outputs one or more outputs within a preset time period.
  • the shake detection sensor accelerometer, gyroscope, etc.
  • TWS headset A inputs the collected audio data into the audio type classification model to obtain the type of audio data (the type of audio data is, for example, double-clicking the audio type, that is, double-clicking TWS headset A and TWS headset B), and TWS headset A determines to detect For the first impact event of the TWS headset A, the TWS headset A obtains the first event feature corresponding to the first impact event.
  • the first event feature may include the first impact time (that is, the time when the TWS headset A and the TWS headset B are struck by the TWS headset A), or the first event feature may include the first impact sound feature (ie, the TWS headset The characteristics of the sound of TWS earphone A and TWS earphone B tapping detected by A).
  • TWS headset B Similar to TWS headset A, TWS headset B will also detect the second impact event for TWS headset B, and obtain the second event feature corresponding to the second impact event. TWS headset B broadcasts the first event in the form of a Bluetooth private connection request. Two event characteristics.
  • the second event feature may include the second impact time (that is, the time when the TWS headset A and the TWS headset B are tapped by the TWS headset B), or the second event feature may include the second impact sound feature (ie, the TWS headset Characteristic of the sound of TWS earphone A and TWS earphone B tapped by B).
  • TWS headset A receives the second event feature broadcast by TWS headset B.
  • the first impact event is determined to be a mutual impact event, that is, the TWS headset A is determined.
  • the shared device is TWS headset B.
  • the TWS headset A detects whether the time difference between the first impact time and the second impact time is less than a preset time. Time difference threshold. If the time difference value is less than the time difference threshold, TWS headset A determines that the event feature similarity is greater than the event feature similarity threshold.
  • the TWS headset A detects whether the sound feature similarity between the first crash sound feature and the second crash sound feature is is greater than the preset sound feature similarity threshold. If the sound feature similarity is greater than the sound feature similarity threshold, TWS headset A determines that the event feature similarity is greater than the event feature similarity threshold.
  • the TWS headset A After the TWS headset A determines that the shared device of the TWS headset A is the TWS headset B, the TWS headset A sends the Bluetooth address of the TWS headset B to the target terminal.
  • the Bluetooth address of the TWS headset B may be broadcast by the TWS headset B when the second impact event is detected, and the TWS headset A receives the Bluetooth address of the TWS headset B.
  • the target terminal establishes a Bluetooth connection with the TWS headset B according to the Bluetooth address of the TWS headset B, so that the audio stream information of the target terminal can be sent to the TWS headset A and the TWS headset B at the same time.
  • the first external device as TWS (True Wireless Stereo) headset B and the second external device as TWS headset A as an example, that is, the second external device has been connected to the target terminal via Bluetooth, and the first external device needs to be established.
  • TWS Truste Wireless Stereo
  • TWS earphone A and TWS earphone B tap, if TWS earphone B detects the first impact event for TWS earphone B, TWS earphone B acquires the first event feature corresponding to the first impact event.
  • TWS headset A Similar to TWS headset B, TWS headset A also detects the second impact event for TWS headset A, and obtains the second event feature corresponding to the second impact event. TWS headset A broadcasts the first event in the form of a Bluetooth private connection request. Two event characteristics.
  • TWS headset B receives the second event feature broadcast by TWS headset A.
  • the TWS headset B detects that the event feature similarity between the first event feature and the second event feature is greater than the preset event feature similarity threshold, then the first impact event is determined to be a mutual impact event, that is, the TWS headset B is determined
  • the shared device is TWS headset A.
  • the manner in which the TWS earphone B determines that the shared device of the TWS earphone B is the TWS earphone A is similar to the relevant implementation manner of the first aspect in the foregoing example, and will not be repeated here.
  • TWS headset B After TWS headset B determines that the shared device of TWS headset B is TWS headset A, TWS headset B establishes a Bluetooth connection with the target terminal based on the received Bluetooth address of the target terminal broadcast by TWS headset A.
  • the Bluetooth address of the target terminal may be broadcast by the TWS headset A when the second impact event is detected, and the TWS headset B receives the Bluetooth address of the target terminal through ultrasonic waves.
  • the audio stream information of the target terminal can be sent to the TWS headset A and the TWS headset B at the same time.
  • steps in the flowcharts of FIGS. 2-10 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIGS. 2-10 may include multiple steps or multiple stages. These steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. The execution of these steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the steps or phases within the other steps.
  • FIG. 11 shows a block diagram of a communication connection control apparatus provided by an embodiment of the present application.
  • the communication connection control apparatus may be configured in the first external device 102 shown in FIG. 1 .
  • the communication connection control apparatus may include a detection module 110 and a transmission module 120 .
  • the detection module 110 is configured to detect whether the first impact event is a mutual impact event between the first external device and the second external device if a first impact event against the first external device is detected;
  • the sending module 120 is used for if the first impact event is the mutual impact event, and the first external device has established a short-distance communication connection with the target terminal, and the second external device has not established the target terminal.
  • short-range communication connection send a target short-range communication connection address to the target terminal or the second external device, wherein the target short-range communication connection address is used for the second external device and the target terminal Establish a short-range communication connection.
  • the sending module 120 includes:
  • a first obtaining unit configured to obtain the communication connection address of the target terminal
  • a first sending unit configured to send the communication connection address of the target terminal as the target short-range communication connection address to the second external device, and the communication connection address of the target terminal is used for the second external connection
  • the device initiates a short-range communication connection process with the target terminal based on the communication connection address of the target terminal.
  • the first sending unit is specifically configured to determine the communication connection address of the target terminal as the target short-distance communication connection address, and send the communication connection address of the target terminal to the second external connection through ultrasonic waves. equipment.
  • the sending module 120 includes:
  • a first receiving unit configured to receive the communication connection address of the second external device broadcasted by the second external device when the second impact event is detected
  • a second sending unit configured to send the communication connection address of the second external device as the target short-range communication connection address to the target terminal, and the communication connection address of the second external device is used for the target terminal
  • the terminal initiates a short-distance communication connection process with the second external device based on the communication connection address of the second external device.
  • the apparatus further includes:
  • a connection establishment module is used for if the collision event is the mutual collision event, and the first external device and the target terminal have not established a short-distance communication connection, and the second external device has established a connection with the target terminal. If the short-distance communication connection is established, the short-distance communication connection with the target terminal is established.
  • connection establishment module includes:
  • a second receiving unit configured to receive the communication connection address of the target terminal broadcasted by the second external device when the second impact event is detected
  • the third sending unit is configured to send a short-distance communication connection request to the target terminal based on the communication connection address of the target terminal.
  • a connection establishment unit configured to establish a short-range communication connection with the target terminal in response to a short-range communication connection confirmation instruction sent by the target terminal, wherein the short-range communication connection confirmation instruction is received by the target terminal Sent after the short-range communication connection request.
  • the second receiving unit is specifically configured to receive, through ultrasonic waves, the communication connection address of the target terminal broadcast by the second external device when the second impact event is detected.
  • the detection module 110 includes:
  • a second acquiring unit configured to acquire the first event feature corresponding to the first impact event
  • a third receiving unit configured to receive the second event feature corresponding to the second impact event broadcast by the second external device when the second impact event is detected
  • a determining unit configured to determine that the first impact event is the mutual impact event if the event feature similarity between the first event feature and the second event feature is greater than a preset event feature similarity threshold .
  • the first event feature includes a first impact time
  • the second event feature includes a second impact time
  • the determining unit is further configured to detect the difference between the first impact time and the second impact time. Whether the time difference between them is less than a preset time difference threshold; if the time difference is less than the time difference threshold, it is determined that the event feature similarity is greater than the event feature similarity threshold.
  • the first event feature includes a first crash sound feature
  • the second event feature includes a second crash sound feature
  • the determining unit is further configured to detect the first crash sound feature and the second crash sound feature. Whether the sound feature similarity between the impact sound features is greater than a preset sound feature similarity threshold; if the sound feature similarity is greater than the sound feature similarity threshold, it is determined that the event feature similarity is greater than the event feature Similarity threshold.
  • the communication connection control device provided by the embodiments of the present application can implement the above method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • Each module in the above-mentioned communication connection control device may be implemented in whole or in part by software, hardware and combinations thereof.
  • the above modules may be embedded in or independent of the processor in the terminal in the form of hardware, or may be stored in the memory in the terminal in the form of software, so that the processor can call and execute operations corresponding to the above modules.
  • a computer device in an embodiment of the present application, the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 12 .
  • the computer equipment includes a processor, memory, a communication interface, a display screen, and an input device connected by a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium.
  • the communication interface of the computer device is used for wired or wireless communication with an external terminal, and the wireless communication can be realized by WIFI, operator network, NFC (Near Field Communication) or other technologies.
  • the computer program implements a communication connection control method when executed by a processor.
  • the display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
  • FIG. 12 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device in an embodiment of the present application, includes a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
  • first impact event for the first external device If a first impact event for the first external device is detected, detecting whether the first impact event is a mutual impact event between the first external device and the second external device;
  • the first impact event is the mutual impact event
  • the first external device has established a short-range communication connection with the target terminal
  • the second external device has not established a short-range communication connection with the target terminal
  • the processor further implements the following steps when executing the computer program: acquiring the communication connection address of the target terminal; sending the communication connection address of the target terminal as the target short-range communication connection address to For the second external device, the communication connection address of the target terminal is used for the second external device to initiate a short-distance communication connection process with the target terminal based on the communication connection address of the target terminal.
  • the processor when the processor executes the computer program, the following steps are further implemented: determining the communication connection address of the target terminal as the target short-distance communication connection address, and transmitting the communication of the target terminal through ultrasonic waves.
  • a connection address is sent to the second external device.
  • the processor further implements the following steps when executing the computer program: receiving the communication connection address of the second external device broadcasted by the second external device when the second impact event is detected; The communication connection address of the second external device is sent to the target terminal as the target short-range communication connection address, and the communication connection address of the second external device is used for the target terminal based on the second external device.
  • the communication connection address initiates a short-distance communication connection process with the second external device.
  • the processor further implements the following steps when executing the computer program: if the collision event is the mutual collision event, and the first external device and the target terminal have not established a short-distance communication connection .
  • the second external device establishes a short-distance communication connection with the target terminal, and then establishes a short-distance communication connection with the target terminal.
  • the processor further implements the following steps when executing the computer program: receiving the communication connection address of the target terminal broadcast by the second external device when the second impact event is detected; based on the target The communication connection address of the terminal sends a short-range communication connection request to the target terminal.
  • the following step is further implemented: receiving, through ultrasonic waves, the communication connection address of the target terminal broadcast by the second external device when the second impact event is detected.
  • the processor further implements the following steps when executing the computer program: establishing a short-range communication connection with the target terminal in response to a short-range communication connection confirmation instruction sent by the target terminal, wherein the The short-range communication connection confirmation instruction is sent by the target terminal after receiving the short-range communication connection request.
  • the processor when the processor executes the computer program, the following steps are further implemented: acquiring a first event feature corresponding to the first impact event; receiving a broadcast from the second external device when the second impact event is detected the second event feature corresponding to the second impact event; if the event feature similarity between the first event feature and the second event feature is greater than a preset event feature similarity threshold, then determine the first event feature A crash event is the mutual crash event.
  • the processor further implements the following steps when executing the computer program: detecting whether the time difference between the first impact time and the second impact time is less than a preset time difference threshold; If the time difference value is smaller than the time difference threshold, it is determined that the event feature similarity is greater than the event feature similarity threshold.
  • the processor executes the computer program, the following step is further implemented: detecting whether the sound feature similarity between the first impact sound feature and the second impact sound feature is greater than a preset sound feature Similarity threshold; if the sound feature similarity is greater than the sound feature similarity threshold, it is determined that the event feature similarity is greater than the event feature similarity threshold.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • first impact event for the first external device it is detected whether the first impact event is a mutual impact event between the first external device and the second external device; if the first impact event is In the mutual collision event, and the first external device has established a short-distance communication connection with the target terminal, and the second external device has not established a short-distance communication connection with the target terminal, then the target terminal or the target terminal
  • the second external device sends a target short-range communication connection address, wherein the target short-range communication connection address is used for the second external device and the target terminal to establish a short-range communication connection.
  • the following steps are further implemented: acquiring the communication connection address of the target terminal; sending the communication connection address of the target terminal as the target short-range communication connection address To the second external device, the communication connection address of the target terminal is used for the second external device to initiate a short-distance communication connection process with the target terminal based on the communication connection address of the target terminal.
  • the following steps are further implemented: determining the communication connection address of the target terminal as the target short-range communication connection address, and using ultrasonic waves to transmit the communication connection address of the target terminal to the target terminal.
  • the communication connection address is sent to the second external device.
  • the following steps are further implemented: receiving the communication connection address of the second external device broadcasted by the second external device when the second impact event is detected;
  • the communication connection address of the second external device is sent to the target terminal as the target short-range communication connection address, and the communication connection address of the second external device is used for the target terminal based on the second external device.
  • the communication connection address initiates a short-distance communication connection process with the second external device.
  • the following steps are further implemented: if the collision event is the mutual collision event, and the first external device and the target terminal have not established short-distance communication If a short-distance communication connection is established between the second external device and the target terminal, a short-distance communication connection with the target terminal is established.
  • the following steps are further implemented: receiving the communication connection address of the target terminal broadcasted by the second external device when a second impact event is detected;
  • the communication connection address of the target terminal sends a short-range communication connection request to the target terminal.
  • the following step is further implemented: receiving, through ultrasonic waves, the communication connection address of the target terminal broadcast by the second external device when the second impact event is detected .
  • the following steps are further implemented: establishing a short-range communication connection with the target terminal in response to a short-range communication connection confirmation instruction sent by the target terminal, wherein the The short-range communication connection confirmation instruction is sent by the target terminal after receiving the short-range communication connection request.
  • the following steps are further implemented: acquiring the first event feature corresponding to the first impact event; receiving the second external device when the second impact event is detected the second event feature corresponding to the broadcasted second impact event; if the event feature similarity between the first event feature and the second event feature is greater than a preset event feature similarity threshold, determine the The first impact event is the mutual impact event.
  • the following steps are further implemented: detecting whether the time difference between the first impact time and the second impact time is less than a preset time difference threshold; if If the time difference value is smaller than the time difference threshold, it is determined that the event feature similarity is greater than the event feature similarity threshold.
  • the following step is further implemented: detecting whether the sound feature similarity between the first impact sound feature and the second impact sound feature is greater than a preset sound feature similarity threshold; if the sound feature similarity is greater than the sound feature similarity threshold, it is determined that the event feature similarity is greater than the event feature similarity threshold.
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (SyMchliMk) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

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

Abstract

一种通信连接控制方法、装置、计算机设备及可读存储介质。包括:检测第一撞击事件是否为第一外接设备与第二外接设备的相互撞击事件;若是,且第一外接设备与目标终端建立短距离通信连接、第二外接设备与目标终端未建立短距离通信连接,则向目标终端或第二外接设备发送目标短距离通信连接地址。本申请提高了通信连接的效率。

Description

通信连接控制方法、装置、计算机设备及可读存储介质
本申请要求于2021年04月20日提交中华人民共和国国家知识产权局、申请号为202110424479.1、发明名称为“通信连接控制方法、装置、计算机设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及短距离通信技术领域,特别是涉及一种通信连接控制方法、装置、计算机设备及可读存储介质。
背景技术
短距离通信技术能够实现短距离内不同设备之间通信信息的传输,例如,终端与耳机短距离通信连接,耳机则可以播放终端中的音频文件。
目前,为了实现终端中音频文件的共享,部分终端可以同时与两对耳机短距离通信连接。相关技术中,均是由用户在终端中手动配置来建立终端与两对耳机之间的短距离通信连接,这样,两对耳机则可以同时播放终端中的音频文件。
然而,这样的方式较为繁琐,导致终端与耳机的短距离通信连接的耗时较久。
发明内容
基于此,本申请实施例提供了一种通信连接控制方法、装置、计算机设备及可读存储介质,可以提高终端设备与外接设备之间短距离通信连接的效率。
第一方面,提供了一种通信连接控制方法,该方法包括:
若检测到针对第一外接设备的第一撞击事件,则检测所述第一撞击事件是否为所述第一外接设备与第二外接设备之间的相互撞击事件;
若所述第一撞击事件为所述相互撞击事件,且所述第一外接设备与目标终端建立有短距离通信连接、所述第二外接设备与所述目标终端未建立短距离通信连接,则向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,其中,所述目标短距离通信连接地址用于供所述第二外接设备和所述目标终端建立短距离通信连接。
第二方面,提供了一种通信连接控制装置,该装置包括:
检测模块,用于若检测到针对第一外接设备的第一撞击事件,则检测所述第一撞击事件是否为所述第一外接设备与第二外接设备之间的相互撞击事件;
发送模块,用于若所述第一撞击事件为所述相互撞击事件,且所述第一外接设备与目标终端建立有短距离通信连接、所述第二外接设备与所述目标终端未建立短距离通信连接,则向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,其中,所述目标短距离通信连接地址用于供所述第二外接设备和所述目标终端建立短距离通信连接。
第三方面,提供了一种计算机设备,包括存储器和处理器,该存储器存储有计算机程序,该计算机程序被该处理器执行时实现如上述第一方面所述的通信连接控制方法。
第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述第一方面所述的通信连接控制方法。
本申请实施例提供的技术方案带来的有益效果至少包括:
通过若检测到针对第一外接设备的第一撞击事件,则检测该第一撞击事件是否为第一外接设备与第二外接设备之间的相互撞击事件,若该第一撞击事件为相互撞击事件,且第一外接设备与目标终端建立有短距离通信连接、第二外接设备与目标终端未建立短距离通信连接,则向目标终端或第二外接设备发送目标短距离通信连接地址,这样,目标终端或第二外接设备则可以基于该目标短距离通信连接地址快速建立目标终端和第二外接设备之间的短距离通信连接,从而在第一外接设备与目标终端短距离通信连接的情况下,可以快速建立目标终端和第二外接设备之间的短距离通信连接,这样,用户则不必在目标终端中手动配置来建立目标终端与第二外接设备的短距离通信连接,故而可以提高目标终端与 外接设备之间短距离通信连接的效率。
附图说明
图1为本申请实施例提供的一种实施环境的示意图;
图2为本申请实施例提供的一种通信连接控制方法的流程图;
图3为本申请实施例提供的一种向第二外接设备发送目标短距离通信连接地址的方法流程图;
图4为本申请实施例提供的一种向目标终端发送目标短距离通信连接地址的方法流程图;
图5为本申请实施例提供的另一种通信连接控制方法的流程图;
图6为本申请实施例提供的一种建立与目标终端的短距离通信连接的方法流程图;
图7为本申请实施例提供的一种检测第一撞击事件是否为相互撞击事件的方法流程图;
图8为本申请实施例提供的一种检测事件特征相似度是否大于事件特征相似度阈值的方法流程图;
图9为本申请实施例提供的另一种检测事件特征相似度是否大于事件特征相似度阈值的方法流程图;
图10为本申请实施例提供的另一种通信连接控制方法的流程图;
图11为本申请实施例提供的一种通信连接控制装置的框图;
图12为本申请实施例提供的一种计算机设备的框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
下面,将对本申请实施例提供的通信连接控制方法所涉及到的实施环境进行简要说明。
图1为本申请实施例提供的通信连接控制方法所涉及到的一种实施环境的示意图,如图1所示,该实施环境可以包括目标终端101、第一外接设备102和第二外接设备103,其中,目标终端101与第一外接设备102之间可以通过有线网络或无线网络进行通信、目标终端101与第二外接设备103之间可以通过有线网络或无线网络进行通信、第一外接设备102与第二外接设备103之间可以通过有线网络或无线网络进行通信。
其中,目标终端101可以为智能手机、平板电脑、笔记本电脑、智能电视,车载设备等,第一外接设备102和第二外接设备103可以是可穿戴设备(如耳机、手表、眼镜、按摩仪等)、智能音箱、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、鼠标、键盘等。
在图1所示的实施环境中,第一外接设备102若检测到针对第一外接设备102的第一撞击事件,则检测第一撞击事件是否为第一外接设备102与第二外接设备103之间的相互撞击事件;若第一撞击事件为相互撞击事件,且第一外接设备102与目标终端101建立有短距离通信连接、第二外接设备103与目标终端101未建立短距离通信连接,第一外接设备102则向目标终端101或第二外接设备103发送目标短距离通信连接地址,其中,目标短距离通信连接地址用于供第二外接设备103和目标终端101建立短距离通信连接。
请参考图2,其示出了本申请实施例提供的一种通信连接控制方法的流程图,该通信连接控制方法可以应用于上文所述的第一外接设备102中。如图2所示,该通信连接控制方法可以包括以下步骤:
步骤201,第一外接设备若检测到针对第一外接设备的第一撞击事件,则检测第一撞击事件是否为第一外接设备与第二外接设备之间的相互撞击事件。
第一撞击事件可以是第一外接设备与其他设备、物体或人体之间的撞击操作,其他设备例如可以是第一外接设备之外的其他外接设备、电子设备、通信设备、路由设备、终端设备等,物体例如可以是桌子、椅子、墙体等,第一撞击事件对应的撞击操作的次数可以是一次、两次、三次等,在此均不做具体限制。
以下通过两种不同的实施方式,对第一外接设备如何检测针对第一外接设备的第一撞击事件的过程进行说明。
在一种可能的实施方式中,第一外接设备中可以设置抖动检测传感器,抖动检测传感器用于检测第一外接设备是否发生抖动。抖动检测传感器若检测到第一外接设备发生一次抖动,则输出一个抖动信号,第一外接设备若在预设的时间段内检测到抖动检测传感器输出的一个或多个抖动信号,则确定检测到第一撞击事件。
例如,第一外接设备若在一秒内检测到抖动检测传感器输出的两个抖动信号,第一外接设备则确定检测到第一撞击事件。抖动检测传感器可以是加速度传感器、陀螺仪等运动状态传感器。
在另一种可能的实施方式中,第一外接设备中可以设置拾音组件,拾音组件用于采集音频数据。第一外接设备若通过该拾音组件采集到音频数据,则将采集的音频数据输入至音频类型分类模型中,得到该音频类型分类模型输出的音频数据的类型,若该音频数据的类型为预设类型,第一外接设备则确定检测到第一撞击事件,该预设类型例如可以是单击音频类型、双击音频类型,等等。
本申请实施例中,音频类型分类模型可以是对不同的样本音频数据添加音频数据类型标签,得到训练样本集,而后,采用该训练样本集训练神经网络模型得到的。
这样,通过上述任一种实施方式,第一外接设备则可以检测出是否存在第一撞击事件。第一外接设备若检测到第一撞击事件,则检测第一撞击事件是否为第一外接设备与第二外接设备之间的相互撞击事件,即检测该第一撞击事件是否为第一外接设备与第二外接设备相互撞击所产生的撞击事件。
在一种可能的实施方式中,第二外接设备在检测到针对第二外接设备的第二撞击事件的情况下,可以向外广播第二撞击事件的第二撞击时间,其中,该第二撞击事件与第一撞击事件的定义类似,可以是第二外接设备与其他设备、物体或人体之间的撞击操作。
这样,第一外接设备接收第二外接设备广播的第二撞击时间,第一外接设备可以获取第一撞击事件的第一撞击时间,并比较该第一撞击时间和第二撞击时间,若第一撞击时间和第二撞击时间相同或者接近,则确定述第一撞击事件是第一外接设备与第二外接设备之间的相互撞击事件。
在另一种可能的实施方式中,第二外接设备在检测到针对第二外接设备的第二撞击事件的情况下,还可以向外广播第二外接设备的位置,这样,第一外接设备接收第二外接设备广播的第二外接设备的位置,第一外接设备可以获取第一外接设备的位置,并比较该第一外接设备的位置和第二外接设备的位置,若第一外接设备的位置和第二外接设备的位置相同或者接近,则确定述第一撞击事件是第一外接设备与第二外接设备之间的相互撞击事件。
步骤202,若第一撞击事件为相互撞击事件,且第一外接设备与目标终端建立有短距离通信连接、第二外接设备与目标终端未建立短距离通信连接,第一外接设备则向目标终端或第二外接设备发送目标短距离通信连接地址。
短距离通信也称近程通信,能够实现短距离内不同设备之间通信信息的传输,短距离通信例如可以是蓝牙(Bluetooth)通信、红外通信等。
本申请实施例中,第一外接设备检测第一外接设备与目标终端是否建立有短距离通信连接,可以是查找第一外接设备中的短距离通信连接列表中,是否包括目标终端的标识,若包括则确定第一外接设备与目标终端建立有短距离通信连接。
例如,第一外接设备在第一外接设备的蓝牙列表中查找是否记录有目标终端的蓝牙名称,若存在该蓝牙名称,则确定第一外接设备与目标终端建立有短距离通信连接。
在另一种可能的实施方式中,第一外接设备还可以从短距离通信连接状态接口读取第一外接设备的短距离通信连接的状态,若该状态为连接状态,则确定第一外接设备与目标终端建立有短距离通信连接。
这样,通过上述方式,第一外接设备则可以确定第一外接设备是否与目标终端建立有短距离通信连接。
第一外接设备确定第二外接设备与目标终端未建立短距离通信连接,可以是第一外接设备发送确认请求至第二外接设备或目标终端,该确认请求用于请求第二外接设备或目标终端检测第二外接设备与目标终端是否建立短距离通信连接,并返回确认结果。第一外接设备根据该确认结果,即可确定第二外接设备与目标终端是否建立短距离通信连接。
其中,第二外接设备或目标终端,检测第二外接设备与目标终端是否建立短距离通信连接的方式,与上述第一外接设备确定第一外接设备是否与目标终端建立有短距离通信连接的方式类似,在此不再赘述。
第一外接设备若确定第一外接设备与目标终端建立有短距离通信连接、第二外接设备与目标终端未建立短距离通信连接,且检测到第一撞击事件为相互撞击事件,为了建立第二外接设备和目标终端之间的短距离通信连接,以使目标终端与第一外接设备和第二外接设备均能够短距离通信,第一外接设备则向目标终端或向第二外接设备发送目标短距离通信连接地址,该目标短距离通信连接地址用于供第二外接设备和目标终端建立短距离通信连接。这样,基于该目标短距离通信连接地址,第二外接设备和目标终端则可以自动地快速建立短距离通信连接。
第二外接设备和目标终端建立短距离通信连接后,目标终端则与第一外接设备、第二外接设备均能够短距离通信,这样,目标终端中的通信信息则可以同时发送给第一外接设备和第二外接设备,实现通信信息在第一外接设备和第二外接设备中的共享,通信信息例如可以是音视频数据,文本数据,等等。
以第一外接设备为第一耳机、第二外接设备为第二耳机为例,目标终端在需要播放音频数据时,则可以将音频数据发送给第一耳机和第二耳机,第一耳机和第二耳机则均可以播放该音频数据,实现音频数据在第一耳机和第二耳机之间的共享。
上述实施例通过若检测到针对第一外接设备的第一撞击事件,则检测该第一撞击事件是否为第一外接设备与第二外接设备之间的相互撞击事件,若该第一撞击事件为相互撞击事件,且第一外接设备与目标终端建立有短距离通信连接、第二外接设备与目标终端未建立短距离通信连接,则向目标终端或第二外接设备发送目标短距离通信连接地址,这样,目标终端或第二外接设备则可以基于该目标短距离通信连接地址快速建立目标终端和第二外接设备之间的短距离通信连接,从而在第一外接设备与目标终端短距离通信连接的情况下,可以快速建立目标终端和第二外接设备之间的短距离通信连接,这样,用户则不必在目标终端中手动配置来建立目标终端与第二外接设备的短距离通信连接,故而可以提高目标终端与外接设备之间短距离通信连接的效率。
在一个实施例中,基于上述图2所示的实施例,参见图3,本实施例涉及的是在第一外接设备与目标终端建立有短距离通信连接的情况下,第一外接设备如何向目标终端或向第二外接设备发送目标短距离通信连接地址的过程。如图3所示,该过程可以包括步骤301和步骤302:
步骤301,第一外接设备获取目标终端的通信连接地址。
通信连接地址是指用于识别对应的短距离通信设备的地址。本申请实施例中,目标终端的通信连接地址例如可以是目标终端的蓝牙地址,其他短距离通信设备(如第二外接设备)基于该目标终端的通信连接地址,则可以识别出目标终端。
作为一种实施方式,目标终端的通信连接地址,可以是第一外接设备与目标终端建立短距离通信连接的过程中,目标终端发送至第一外接设备的。
步骤302,第一外接设备将目标终端的通信连接地址作为目标短距离通信连接地址发送至第二外接设备。
该目标终端的通信连接地址用于供第二外接设备基于该目标终端的通信连接地址,发起与目标终端的短距离通信连接流程,即第二外接设备收到该目标终端的通信连接地址后,则主动发起与目标终端的短距离通信连接流程。
在一种可能的实施方式中,第二外接设备可以基于该目标终端的通信连接地址,向目标终端发送短距离通信连接请求;目标终端收到该短距离通信连接请求后,可以向第二外接设备发送短距离通信连接确认指令,第二外接设备收到该短距离通信连接确认指令后,则与目标终端建立短距离通信连接。
在步骤302一种可能的实施方式中,第一外接设备将目标终端的通信连接地址确定为目标短距离通信连接地址,可以通过超声波将目标终端的通信连接地址发送至第二外接设备。
超声波是频率高于20KHz的声波,本申请实施例中,第一外接设备可以对目标终端的通信连接地址进行信号调制等操作,调制到超声波所在的频段后,通过第一外接设备中的扬声器以超声波的形式发送至第二外接设备,第二外接设备通过其拾音组件接收该目标终端的通信连接地址。
超声波传输不需要额外的硬件或配对设备,仅需扬声器和拾音组件即可实现,实施方式简单便捷;且超声波传输的距离小于蓝牙传输的距离,这就可以避免第一外接设备误将目标终端的通信连接地址发送至较远的其他设备,避免了目标终端的通信连接地址的误传输。
在另一个实施例中,基于上述图2所示的实施例,参见图4,本实施例涉及的是在第一外接设备与目标终端建立有短距离通信连接的情况下,第一外接设备如何向目标终端或向第二外接设备发送目标短距离通信连接地址的另一种实施方式。如图4所示,该方式可以包括步骤401和步骤402:
步骤401,第一外接设备接收第二外接设备在检测到第二撞击事件所广播的第二外接设备的通信连接地址。
本申请实施例中,第二外接设备的通信连接地址例如可以是第二外接设备的蓝牙地址,基于该第二外接设备的通信连接地址,则可以识别出第二外接设备。
作为一种实施方式,第二外接设备可以检测是否发生了针对第二外接设备的第二撞击事件,与上述第一外接设备检测第一撞击事件的过程类似,第二外接设备中可以设置抖动检测传感器来检测,或者第二外接设备也可以通过音频类型分类模型来检测,在此不再赘述。
第二外接设备若检测到第二撞击事件,第二外接设备则广播第二撞击事件的第二撞击时间、第二外接设备的通信连接地址等信息。这样,第一外接设备则接收到该第二外接设备的通信连接地址。
步骤402,第一外接设备将第二外接设备的通信连接地址作为目标短距离通信连接地址发送至目标终端。
第二外接设备的通信连接地址用于供目标终端基于第二外接设备的通信连接地址,发起与第二外接设备的短距离通信连接流程。即目标终端收到该第二外接设备的通信连接地址后,则主动发起与第二外接设备的短距离通信连接流程。
在一种可能的实施方式中,目标终端可以基于该第二外接设备的通信连接地址向第二外接设备发送短距离通信连接请求,第二外接设备收到该短距离通信连接请求后,可以向目标终端发送短距离通信连接确认指令,目标终端收到该短距离通信连接确认指令后,则 与第二外接设备建立短距离通信连接。
与上述步骤302类似,在步骤402一种可能的实施方式中,第一外接设备将第二外接设备的通信连接地址作为目标短距离通信连接地址,可以通过超声波将第二外接设备的通信连接地址发送至目标终端。这样可以避免第一外接设备误将第二外接设备的通信连接地址发送至较远的其他设备,避免了第二外接设备的通信连接地址的误传输。
在一个实施例中,基于上述图2所示的实施例,参见图5,其示出了本申请实施例提供的另一种通信连接控制方法的流程图。如图5所示,步骤201之后,本实施例通信连接控制方法还包括步骤203:
步骤203,若撞击事件为相互撞击事件,且第一外接设备与目标终端未建立短距离通信连接、第二外接设备与目标终端建立有短距离通信连接,第一外接设备则建立与目标终端的短距离通信连接。
本申请实施例中,若第一外接设备未与目标终端短距离通信连接,而第二外接设备与目标终端短距离通信连接,这样,则需要建立第一外接设备与目标终端之间的短距离通信连接。
第一外接设备和目标终端建立短距离通信连接后,目标终端则与第一外接设备、第二外接设备均能够短距离通信,这样,目标终端中的通信信息则可以同时发送给第一外接设备和第二外接设备,实现通信信息在第一外接设备和第二外接设备中的共享。
在一种可能的实施方式中,参见图6,第一外接设备可以通过执行图6所示的步骤601、步骤602和步骤603,实现建立与目标终端的短距离通信连接的过程:
步骤601,第一外接设备接收第二外接设备在检测到第二撞击事件所广播的目标终端的通信连接地址。
作为一种实施方式,目标终端的通信连接地址,可以是第二外接设备与目标终端建立短距离通信连接的过程中,目标终端发送至第二外接设备的。
第二外接设备与目标终端短距离通信连接的情况下,第二外接设备可以检测是否发生了针对第二外接设备的第二撞击事件,若检测到第二撞击事件,第二外接设备则广播目标终端的通信连接地址,这样,第一外接设备则收到该目标终端的通信连接地址。
在步骤601一种可能的实施方式中,第一外接设备可以通过超声波接收第二外接设备在检测到第二撞击事件所广播的目标终端的通信连接地址。第二外接设备可以对目标终端的通信连接地址进行信号调制等操作,调制到超声波所在的频段后,通过第二外接设备中的扬声器以超声波的形式发送至第一外接设备,第一外接设备通过其拾音组件接收该目标终端的通信连接地址,这样可以避免目标终端的通信连接地址的误传输。
步骤602,第一外接设备基于目标终端的通信连接地址向目标终端发送短距离通信连接请求。
第一外接设备收到目标终端的通信连接地址,则主动向目标终端发起短距离通信连接流程,第一外接设备基于目标终端的通信连接地址向目标终端发送短距离通信连接请求。
步骤603,第一外接设备响应于目标终端发送的短距离通信连接确认指令,与目标终端建立短距离通信连接。
其中,短距离通信连接确认指令是目标终端在接收到短距离通信连接请求后发送的。即,目标终端收到该短距离通信连接请求后,则向第一外接设备发送短距离通信连接确认指令,这样,第一外接设备收到该短距离通信连接确认指令后,则与目标终端建立短距离通信连接。
上述实施例在第一外接设备未与目标终端短距离通信连接,而第二外接设备与目标终端短距离通信连接的情况下,第一外接设备通过接收第二外接设备在检测到第二撞击事件所广播的目标终端的通信连接地址,并基于目标终端的通信连接地址向目标终端发送短距离通信连接请求,响应于目标终端发送的短距离通信连接确认指令,与目标终端建立短距 离通信连接,这样,则实现了第一外接设备与目标终端的快速短距离通信连接,用户则不必在目标终端中手动配置来建立目标终端与第一外接设备的短距离通信连接,故而可以提高目标终端与外接设备之间短距离通信连接的效率。
在一个实施例中,基于上述图2所示的实施例,参见图7,本实施例涉及的是第一外接设备如何检测第一撞击事件是否为第一外接设备与第二外接设备之间的相互撞击事件的过程。如图7所示,该过程包括步骤701、步骤702和步骤703:
步骤701,第一外接设备获取第一撞击事件对应的第一事件特征。
本申请实施例中,第一外接设备检测到针对第一外接设备的第一撞击事件后,获取第一撞击事件对应的第一事件特征。
可选地,第一事件特征可以包括第一撞击时间,第一外接设备获取第一事件特征,则可以是将检测到第一撞击事件的时间确定为该第一撞击时间。
可选地,第一事件特征可以包括第一撞击声音特征。第一外接设备可以通过第一外接设备中的拾音组件采集第一撞击事件对应的音频数据,接着,第一外接设备采用能量检测算法,对该音频数据进行频谱感知,得到各能量峰值对应的时刻,第一外接设备根据各能量峰值对应的时刻计算第一时间间隔,并将该第一时间间隔确定为第一撞击声音特征。
在一种可能的实施方式中,假设第一撞击事件的撞击操作的次数是两次,则第一外接设备采用能量检测算法可以得到两个能量峰值对应的时刻,第一外接设备对该两个能量峰值对应的时刻计算差值并取差值的绝对值,则得到第一时间间隔。
可选地,第一外接设备还可以对该第一时间间隔求倒数,得到第一频率特征,并将该第一频率特征确定为第一撞击声音特征,等等。
步骤702,第一外接设备接收第二外接设备在检测到第二撞击事件所广播的第二撞击事件对应的第二事件特征。
本申请实施例中,第二外接设备检测到针对第二外接设备的第二撞击事件后,第二外接设备获取第二撞击事件对应的第二事件特征,第二外接设备广播短距离连接请求,该短距离连接请求中可以携带第二撞击事件对应的第二事件特征,当然,该短距离连接请求中还可以携带其他信息,如通信连接地址,等等。
可选地,第二外接设备获取第二撞击事件对应的第二事件特征的方式,与步骤701中第一外接设备获取第一撞击事件对应的第一事件特征的方式类似,在此不再赘述。与步骤701类似,第二外接设备则可以将检测到第二撞击事件的时间确定为第二撞击时间、将第二时间间隔确定为第二撞击声音特征,或者,将第二频率特征确定为第二撞击声音特征,等等。
第一外接设备则接收第二外接设备所广播的第二撞击事件对应的第二事件特征,第一外接设备检测第一事件特征和第二事件特征之间的事件特征相似度是否大于预设的事件特征相似度阈值。
在一种可能的实施方式中,以第一事件特征包括第一撞击时间、第二事件特征包括第二撞击时间为例,参见图8,第一外接设备可以通过执行图8所示的步骤801和步骤802,实现检测第一事件特征和第二事件特征之间的事件特征相似度是否大于预设的事件特征相似度阈值的过程:
步骤801,第一外接设备检测第一撞击时间和第二撞击时间之间的时间差值是否小于预设的时间差阈值。
第一外接设备计算第一撞击时间和第二撞击时间之间的时间差值,该时间差值可以是第一外接设备计算第一撞击时间和第二撞击时间之间的差值,并对该差值求绝对值得到的。
第一外接设备检测该时间差值是否小于预设的时间差阈值,该时间差阈值子实施时可以自行设置。
步骤802,若时间差值小于时间差阈值,第一外接设备则确定事件特征相似度大于事件特征相似度阈值。
这样,则确定事件特征相似度大于事件特征相似度阈值。
在另一种可能的实施方式中,以第一事件特征包括第一撞击声音特征,第二事件特征包括第二撞击声音特征为例,参见图9,第一外接设备可以通过执行图9所示的步骤901和步骤902,实现检测第一事件特征和第二事件特征之间的事件特征相似度是否大于预设的事件特征相似度阈值的过程:
步骤901,第一外接设备检测第一撞击声音特征与第二撞击声音特征之间的声音特征相似度是否大于预设的声音特征相似度阈值。
假设第一撞击声音特征为第一时间间隔,第二撞击声音特征为第二时间间隔,第一外接设备可以计算第一时间间隔与第二时间间隔之间的差值的绝对值,若该差值的绝对值小于预设的阈值,则确定第一撞击声音特征与第二撞击声音特征之间的声音特征相似度大于预设的声音特征相似度阈值。
步骤902,若声音特征相似度大于声音特征相似度阈值,第一外接设备则确定事件特征相似度大于事件特征相似度阈值。
这样,则确定事件特征相似度大于事件特征相似度阈值。
步骤703,若第一事件特征和第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,第一外接设备则确定第一撞击事件为相互撞击事件。
第一外接设备若确定第一事件特征和第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,第一外接设备则确定第一撞击事件为相互撞击事件,相互撞击事件是指第一外接设备和第二外接设备之间相互撞击的操作,即表征第一撞击事件和第二撞击事件为同一个撞击事件。
上述实施例第一外接设备获取第一撞击事件对应的第一事件特征,第一外接设备接收第二外接设备在检测到第二撞击事件所广播的第二撞击事件对应的第二事件特征,若第一事件特征和第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,第一外接设备则确定第一撞击事件为相互撞击事件,即确定第一外接设备的共享设备为第二外接设备,在第一外接设备与目标终端建立有短距离通信连接的情况下,第一外接设备则向目标终端或第二外接设备发送目标短距离通信连接地址,供第二外接设备和目标终端基于目标短距离通信连接地址建立短距离通信连接,实现目标终端中的通信信息在第一外接设备、第二外接设备之间的共享。
在一个实施例中,请参考图10,其示出了本申请实施例提供的一种示例性的通信连接控制方法的流程图,该方法可以应用于图1所示实施环境中。如图10所示,该方法可以包括以下步骤:
步骤1001,第一外接设备若检测到针对第一外接设备的第一撞击事件,则获取第一撞击事件对应的第一事件特征。
步骤1002,第一外接设备接收第二外接设备在检测到第二撞击事件所广播的第二撞击事件对应的第二事件特征。
可选地,第一事件特征包括第一撞击时间,第二事件特征包括第二撞击时间,第一外接设备检测第一撞击时间和第二撞击时间之间的时间差值是否小于预设的时间差阈值,若时间差值小于时间差阈值,第一外接设备则确定事件特征相似度大于事件特征相似度阈值。
可选地,第一事件特征包括第一撞击声音特征,第二事件特征包括第二撞击声音特征,第一外接设备检测第一撞击声音特征与第二撞击声音特征之间的声音特征相似度是否大于预设的声音特征相似度阈值,若声音特征相似度大于声音特征相似度阈值,第一外接设备则确定事件特征相似度大于事件特征相似度阈值。
步骤1003,若第一事件特征和第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,第一外接设备则确定第一撞击事件为相互撞击事件。
步骤1004,若第一撞击事件为相互撞击事件,且第一外接设备与目标终端建立有短距离通信连接、第二外接设备与目标终端未建立短距离通信连接,第一外接设备则向目标终端或第二外接设备发送目标短距离通信连接地址。
可选地,向目标终端或第二外接设备发送目标短距离通信连接地址,包括:
步骤a,第一外接设备获取目标终端的通信连接地址;
步骤b,第一外接设备将目标终端的通信连接地址确定为目标短距离通信连接地址,并通过超声波将目标终端的通信连接地址发送至第二外接设备,目标终端的通信连接地址用于供第二外接设备基于目标终端的通信连接地址,发起与目标终端的短距离通信连接流程。
可选地,向目标终端或第二外接设备发送目标短距离通信连接地址,包括:
步骤c,第一外接设备接收第二外接设备在检测到第二撞击事件所广播的第二外接设备的通信连接地址;
步骤d,第一外接设备将第二外接设备的通信连接地址作为目标短距离通信连接地址发送至目标终端,第二外接设备的通信连接地址用于供目标终端基于第二外接设备的通信连接地址,发起与第二外接设备的短距离通信连接流程。
其中,目标短距离通信连接地址用于供第二外接设备和目标终端建立短距离通信连接
步骤1005,若撞击事件为相互撞击事件,且第一外接设备与目标终端未建立短距离通信连接、第二外接设备与目标终端建立有短距离通信连接,第一外接设备则建立与目标终端的短距离通信连接。
可选地,建立与目标终端的短距离通信连接,包括:
第一外接设备通过超声波接收第二外接设备在检测到第二撞击事件所广播的目标终端的通信连接地址;
第一外接设备基于目标终端的通信连接地址向目标终端发送短距离通信连接请求。
第一外接设备响应于目标终端发送的短距离通信连接确认指令,与目标终端建立短距离通信连接,其中,短距离通信连接确认指令是目标终端在接收到短距离通信连接请求后发送的。
以下,通过一个示例性地举例,对本实施例的实施过程进行介绍。
假设,TWS(True Wireless Stereo,真无线立体声)耳机A与目标终端建立有短距离通信连接、TWS耳机B与目标终端未建立短距离通信连接,短距离通信连接具体为蓝牙连接。
第一方面,以第一外接设备为TWS耳机A,第二外接设备为TWS耳机B为例,即第一外接设备已经与目标终端蓝牙连接,需要建立第二外接设备与目标终端的蓝牙连接:
1)TWS耳机A与TWS耳机B敲击,TWS耳机A通过TWS耳机A中设置的抖动检测传感器(加速度传感器、陀螺仪等)检测到在预设的时间段内抖动检测传感器输出一个或多个抖动信号(例如输出两个抖动信号,即表征TWS耳机A与TWS耳机B双击),则确定检测到第一撞击事件;或者,TWS耳机A通过TWS耳机A中设置的拾音组件采集音频数据,TWS耳机A将采集的音频数据输入至音频类型分类模型中得到音频数据的类型(音频数据的类型例如双击音频类型,即表征TWS耳机A与TWS耳机B双击),TWS耳机A则确定检测到针对TWS耳机A的第一撞击事件,TWS耳机A并获取第一撞击事件对应的第一事件特征。
其中,第一事件特征可以包括第一撞击时间(即TWS耳机A检测到的TWS耳机A与TWS耳机B敲击的时间),或者,第一事件特征可以包括第一撞击声音特征(即TWS耳机A检测到的TWS耳机A与TWS耳机B敲击的声音的特征)。
2)TWS耳机B与TWS耳机A类似,也会检测到针对TWS耳机B的第二撞击事件,并获取第二撞击事件对应的第二事件特征,TWS耳机B以蓝牙私有连接请求的方式广播第二事件特征。
其中,第二事件特征可以包括第二撞击时间(即TWS耳机B检测到的TWS耳机A与TWS耳机B敲击的时间),或者,第二事件特征可以包括第二撞击声音特征(即TWS耳机B检测到的TWS耳机A与TWS耳机B敲击的声音的特征)。
3)TWS耳机A接收TWS耳机B广播的第二事件特征。
4)TWS耳机A若检测到第一事件特征和第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,则确定第一撞击事件为相互撞击事件,即确定TWS耳机A的共享设备为TWS耳机B。
可选地,若第一事件特征包括第一撞击时间,第二事件特征包括第二撞击时间,TWS耳机A则检测第一撞击时间和第二撞击时间之间的时间差值是否小于预设的时间差阈值,若时间差值小于时间差阈值,TWS耳机A则确定事件特征相似度大于事件特征相似度阈值。
可选地,若第一事件特征包括第一撞击声音特征,第二事件特征包括第二撞击声音特征,TWS耳机A检测第一撞击声音特征与第二撞击声音特征之间的声音特征相似度是否大于预设的声音特征相似度阈值,若声音特征相似度大于声音特征相似度阈值,TWS耳机A则确定事件特征相似度大于事件特征相似度阈值。
5)TWS耳机A确定TWS耳机A的共享设备为TWS耳机B后,TWS耳机A将TWS耳机B的蓝牙地址发送至目标终端。其中,TWS耳机B的蓝牙地址可以是TWS耳机B在检测到第二撞击事件所广播的,TWS耳机A接收该TWS耳机B的蓝牙地址。
6)目标终端根据该TWS耳机B的蓝牙地址与TWS耳机B建立蓝牙连接,从而目标终端的音频流信息可以同时发送给TWS耳机A及TWS耳机B。
第二方面,以第一外接设备为TWS(True Wireless Stereo,真无线立体声)耳机B,第二外接设备为TWS耳机A为例,即第二外接设备已经与目标终端蓝牙连接,需要建立第一外接设备与目标终端的蓝牙连接:
1)TWS耳机A与TWS耳机B敲击,TWS耳机B若检测到针对TWS耳机B的第一撞击事件,TWS耳机B则获取第一撞击事件对应的第一事件特征。
2)TWS耳机A与TWS耳机B类似,也会检测到针对TWS耳机A的第二撞击事件,并获取第二撞击事件对应的第二事件特征,TWS耳机A以蓝牙私有连接请求的方式广播第二事件特征。
3)TWS耳机B接收TWS耳机A广播的第二事件特征。
4)TWS耳机B若检测到第一事件特征和第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,则确定第一撞击事件为相互撞击事件,即确定TWS耳机B的共享设备为TWS耳机A。
其中,TWS耳机B确定TWS耳机B的共享设备为TWS耳机A的方式,与上述举例的第一方面的相关实施方式类似,在此不再赘述。
5)TWS耳机B确定TWS耳机B的共享设备为TWS耳机A后,TWS耳机B基于接收到的TWS耳机A广播的目标终端的蓝牙地址,与目标终端建立蓝牙连接。其中,目标终端的蓝牙地址可以是TWS耳机A在检测到第二撞击事件时所广播的,TWS耳机B通过超声波接收该目标终端的蓝牙地址。
从而目标终端的音频流信息可以同时发送给TWS耳机A及TWS耳机B。
应该理解的是,虽然图2-10的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-10中的至少一 部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
请参考图11,其示出了本申请实施例提供的一种通信连接控制装置的框图,该通信连接控制装置可以配置于图1所示的第一外接设备102中。如图11所示,该通信连接控制装置可以包括检测模块110和发送模块120。
其中,检测模块110,用于若检测到针对第一外接设备的第一撞击事件,则检测所述第一撞击事件是否为所述第一外接设备与第二外接设备之间的相互撞击事件;
发送模块120,用于若所述第一撞击事件为所述相互撞击事件,且所述第一外接设备与目标终端建立有短距离通信连接、所述第二外接设备与所述目标终端未建立短距离通信连接,则向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,其中,所述目标短距离通信连接地址用于供所述第二外接设备和所述目标终端建立短距离通信连接。
在图11所示实施例的基础上,在一个实施例中,发送模块120包括:
第一获取单元,用于获取所述目标终端的通信连接地址;
第一发送单元,用于将所述目标终端的通信连接地址作为所述目标短距离通信连接地址发送至所述第二外接设备,所述目标终端的通信连接地址用于供所述第二外接设备基于所述目标终端的通信连接地址发起与所述目标终端的短距离通信连接流程。
可选地,第一发送单元具体用于将所述目标终端的通信连接地址确定为所述目标短距离通信连接地址,并通过超声波将所述目标终端的通信连接地址发送至所述第二外接设备。
在图11所示实施例的基础上,在一个实施例中,发送模块120包括:
第一接收单元,用于接收所述第二外接设备在检测到第二撞击事件所广播的所述第二外接设备的通信连接地址;
第二发送单元,用于将所述第二外接设备的通信连接地址作为所述目标短距离通信连接地址发送至所述目标终端,所述第二外接设备的通信连接地址用于供所述目标终端基于所述第二外接设备的通信连接地址发起与所述第二外接设备的短距离通信连接流程。
在图11所示实施例的基础上,在一个实施例中,所述装置还包括:
连接建立模块,用于若所述撞击事件为所述相互撞击事件,且所述第一外接设备与所述目标终端未建立短距离通信连接、所述第二外接设备与所述目标终端建立有短距离通信连接,则建立与所述目标终端的短距离通信连接。
可选地,所述连接建立模块包括:
第二接收单元,用于接收所述第二外接设备在检测到第二撞击事件所广播的所述目标终端的通信连接地址;
第三发送单元,用于基于所述目标终端的通信连接地址向所述目标终端发送短距离通信连接请求。
连接建立单元,用于响应于所述目标终端发送的短距离通信连接确认指令,与所述目标终端建立短距离通信连接,其中,所述短距离通信连接确认指令是所述目标终端在接收到所述短距离通信连接请求后发送的。
其中,第二接收单元具体用于通过超声波接收所述第二外接设备在检测到所述第二撞击事件所广播的所述目标终端的通信连接地址。
在图11所示实施例的基础上,在一个实施例中,检测模块110包括:
第二获取单元,用于获取所述第一撞击事件对应的第一事件特征;
第三接收单元,用于接收所述第二外接设备在检测到第二撞击事件所广播的所述第二撞击事件对应的第二事件特征;
确定单元,用于若所述第一事件特征和所述第二事件特征之间的事件特征相似度大于 预设的事件特征相似度阈值,则确定所述第一撞击事件为所述相互撞击事件。
可选地,所述第一事件特征包括第一撞击时间,所述第二事件特征包括第二撞击时间,所述确定单元还用于检测所述第一撞击时间和所述第二撞击时间之间的时间差值是否小于预设的时间差阈值;若所述时间差值小于所述时间差阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
可选地,所述第一事件特征包括第一撞击声音特征,所述第二事件特征包括第二撞击声音特征,所述确定单元还用于检测所述第一撞击声音特征与所述第二撞击声音特征之间的声音特征相似度是否大于预设的声音特征相似度阈值;若所述声音特征相似度大于所述声音特征相似度阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
本申请实施例提供的通信连接控制装置,可以实现上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
关于通信连接控制装置的具体限定可以参见上文中对于通信连接控制方法的限定,在此不再赘述。上述通信连接控制装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于终端中的处理器中,也可以以软件形式存储于终端中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在本申请的一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图12所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种通信连接控制方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图12中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在本申请的一个实施例中,提供了一种计算机设备,该计算机设备包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:
若检测到针对第一外接设备的第一撞击事件,则检测所述第一撞击事件是否为所述第一外接设备与第二外接设备之间的相互撞击事件;
若所述第一撞击事件为所述相互撞击事件,且所述第一外接设备与目标终端建立有短距离通信连接、所述第二外接设备与所述目标终端未建立短距离通信连接,则向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,其中,所述目标短距离通信连接地址用于供所述第二外接设备和所述目标终端建立短距离通信连接。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:获取所述目标终端的通信连接地址;将所述目标终端的通信连接地址作为所述目标短距离通信连接地址发送至所述第二外接设备,所述目标终端的通信连接地址用于供所述第二外接设备基于所述目标终端的通信连接地址发起与所述目标终端的短距离通信连接流程。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:将所述目标终端的通信连接地址确定为所述目标短距离通信连接地址,并通过超声波将所述目标终端的通信连接地址发送至所述第二外接设备。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:接收所述第二 外接设备在检测到第二撞击事件所广播的所述第二外接设备的通信连接地址;将所述第二外接设备的通信连接地址作为所述目标短距离通信连接地址发送至所述目标终端,所述第二外接设备的通信连接地址用于供所述目标终端基于所述第二外接设备的通信连接地址发起与所述第二外接设备的短距离通信连接流程。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:若所述撞击事件为所述相互撞击事件,且所述第一外接设备与所述目标终端未建立短距离通信连接、所述第二外接设备与所述目标终端建立有短距离通信连接,则建立与所述目标终端的短距离通信连接。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:接收所述第二外接设备在检测到第二撞击事件所广播的所述目标终端的通信连接地址;基于所述目标终端的通信连接地址向所述目标终端发送短距离通信连接请求。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:通过超声波接收所述第二外接设备在检测到所述第二撞击事件所广播的所述目标终端的通信连接地址。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:响应于所述目标终端发送的短距离通信连接确认指令,与所述目标终端建立短距离通信连接,其中,所述短距离通信连接确认指令是所述目标终端在接收到所述短距离通信连接请求后发送的。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:获取所述第一撞击事件对应的第一事件特征;接收所述第二外接设备在检测到第二撞击事件所广播的所述第二撞击事件对应的第二事件特征;若所述第一事件特征和所述第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,则确定所述第一撞击事件为所述相互撞击事件。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:检测所述第一撞击时间和所述第二撞击时间之间的时间差值是否小于预设的时间差阈值;若所述时间差值小于所述时间差阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:检测所述第一撞击声音特征与所述第二撞击声音特征之间的声音特征相似度是否大于预设的声音特征相似度阈值;若所述声音特征相似度大于所述声音特征相似度阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
本申请实施例提供的计算机设备,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
在本申请的一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
若检测到针对第一外接设备的第一撞击事件,则检测所述第一撞击事件是否为所述第一外接设备与第二外接设备之间的相互撞击事件;若所述第一撞击事件为所述相互撞击事件,且所述第一外接设备与目标终端建立有短距离通信连接、所述第二外接设备与所述目标终端未建立短距离通信连接,则向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,其中,所述目标短距离通信连接地址用于供所述第二外接设备和所述目标终端建立短距离通信连接。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:获取所述目标终端的通信连接地址;将所述目标终端的通信连接地址作为所述目标短距离通信连接地址发送至所述第二外接设备,所述目标终端的通信连接地址用于供所述第二外接设备基于所述目标终端的通信连接地址发起与所述目标终端的短距离通信连接流程。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:将所述目标终端的通信连接地址确定为所述目标短距离通信连接地址,并通过超声波将所述目标终端的通信连接地址发送至所述第二外接设备。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:接收所述第二外接设备在检测到第二撞击事件所广播的所述第二外接设备的通信连接地址;将所述第二外接设备的通信连接地址作为所述目标短距离通信连接地址发送至所述目标终端,所述第二外接设备的通信连接地址用于供所述目标终端基于所述第二外接设备的通信连接地址发起与所述第二外接设备的短距离通信连接流程。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:若所述撞击事件为所述相互撞击事件,且所述第一外接设备与所述目标终端未建立短距离通信连接、所述第二外接设备与所述目标终端建立有短距离通信连接,则建立与所述目标终端的短距离通信连接。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:接收所述第二外接设备在检测到第二撞击事件所广播的所述目标终端的通信连接地址;基于所述目标终端的通信连接地址向所述目标终端发送短距离通信连接请求。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:通过超声波接收所述第二外接设备在检测到所述第二撞击事件所广播的所述目标终端的通信连接地址。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:响应于所述目标终端发送的短距离通信连接确认指令,与所述目标终端建立短距离通信连接,其中,所述短距离通信连接确认指令是所述目标终端在接收到所述短距离通信连接请求后发送的。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:获取所述第一撞击事件对应的第一事件特征;接收所述第二外接设备在检测到第二撞击事件所广播的所述第二撞击事件对应的第二事件特征;若所述第一事件特征和所述第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,则确定所述第一撞击事件为所述相互撞击事件。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:检测所述第一撞击时间和所述第二撞击时间之间的时间差值是否小于预设的时间差阈值;若所述时间差值小于所述时间差阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
在本申请的一个实施例中,计算机程序被处理器执行时还实现以下步骤:检测所述第一撞击声音特征与所述第二撞击声音特征之间的声音特征相似度是否大于预设的声音特征相似度阈值;若所述声音特征相似度大于所述声音特征相似度阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
本实施例提供的计算机可读存储介质,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(SyMchliMk)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例 中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种通信连接控制方法,其中,所述方法包括:
    若检测到针对第一外接设备的第一撞击事件,则检测所述第一撞击事件是否为所述第一外接设备与第二外接设备之间的相互撞击事件;
    若所述第一撞击事件为所述相互撞击事件,且所述第一外接设备与目标终端建立有短距离通信连接、所述第二外接设备与所述目标终端未建立短距离通信连接,则向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,其中,所述目标短距离通信连接地址用于供所述第二外接设备和所述目标终端建立短距离通信连接。
  2. 根据权利要求1所述的方法,其中,所述向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,包括:
    获取所述目标终端的通信连接地址;
    将所述目标终端的通信连接地址作为所述目标短距离通信连接地址发送至所述第二外接设备,所述目标终端的通信连接地址用于供所述第二外接设备基于所述目标终端的通信连接地址发起与所述目标终端的短距离通信连接流程。
  3. 根据权利要求2所述的方法,其中,所述将所述目标终端的通信连接地址作为所述目标短距离通信连接地址发送至所述第二外接设备,包括:
    将所述目标终端的通信连接地址确定为所述目标短距离通信连接地址,并通过超声波将所述目标终端的通信连接地址发送至所述第二外接设备。
  4. 根据权利要求2所述的方法,其中,所述目标终端的通信连接地址为所述第一外接设备与所述目标终端建立短距离通信连接的过程中,所述目标终端发送至所述第一外接设备的。
  5. 根据权利要求1所述的方法,其中,所述向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,包括:
    接收所述第二外接设备在检测到第二撞击事件所广播的所述第二外接设备的通信连接地址;
    将所述第二外接设备的通信连接地址作为所述目标短距离通信连接地址发送至所述目标终端,所述第二外接设备的通信连接地址用于供所述目标终端基于所述第二外接设备的通信连接地址发起与所述第二外接设备的短距离通信连接流程。
  6. 根据权利要求1所述的方法,其中,所述方法还包括:
    若所述撞击事件为所述相互撞击事件,且所述第一外接设备与所述目标终端未建立短距离通信连接、所述第二外接设备与所述目标终端建立有短距离通信连接,则建立与所述目标终端的短距离通信连接。
  7. 根据权利要求6所述的方法,其中,所述建立与所述目标终端的短距离通信连接,包括:
    接收所述第二外接设备在检测到第二撞击事件所广播的所述目标终端的通信连接地址;
    基于所述目标终端的通信连接地址向所述目标终端发送短距离通信连接请求。
  8. 根据权利要求7所述的方法,其中,所述接收所述第二外接设备在检测到第二撞击事件所广播的所述目标终端的通信连接地址,包括:
    通过超声波接收所述第二外接设备在检测到所述第二撞击事件所广播的所述目标终端的通信连接地址。
  9. 根据权利要求7所述的方法,其中,所述目标终端的通信连接地址为所述第二外接设备与所述目标终端建立短距离通信连接的过程中,所述目标终端发送至所述第二外接设备的。
  10. 根据权利要求1所述的方法,其中,所述检测所述第一撞击事件是否为所述第一 外接设备与第二外接设备之间的相互撞击事件,包括:
    获取所述第一撞击事件对应的第一事件特征;
    接收所述第二外接设备在检测到第二撞击事件所广播的所述第二撞击事件对应的第二事件特征;
    若所述第一事件特征和所述第二事件特征之间的事件特征相似度大于预设的事件特征相似度阈值,则确定所述第一撞击事件为所述相互撞击事件。
  11. 根据权利要求10所述的方法,其中,所述第一事件特征包括第一撞击时间,所述第二事件特征包括第二撞击时间,所述方法还包括:
    检测所述第一撞击时间和所述第二撞击时间之间的时间差值是否小于预设的时间差阈值;
    若所述时间差值小于所述时间差阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
  12. 根据权利要求10所述的方法,其中,所述第一事件特征包括第一撞击声音特征,所述第二事件特征包括第二撞击声音特征,所述方法还包括:
    检测所述第一撞击声音特征与所述第二撞击声音特征之间的声音特征相似度是否大于预设的声音特征相似度阈值;
    若所述声音特征相似度大于所述声音特征相似度阈值,则确定所述事件特征相似度大于所述事件特征相似度阈值。
  13. 根据权利要求1所述的方法,其中,所述第一外接设备中设置有抖动检测传感器,所述第一外接设备若在预设的时间段内检测到所述抖动检测传感器输出的一个或多个抖动信号,则确定检测到所述第一撞击事件。
  14. 根据权利要求13所述的方法,其中,所述抖动检测传感器为加速度传感器或陀螺仪。
  15. 根据权利要求1所述的方法,其中,所述第一外接设备中设置有拾音组件,所述第一外接设备若通过所述拾音组件采集到音频数据,则将所述音频数据输入至音频类型分类模型中,得到所述音频类型分类模型输出的音频数据的类型,若所述音频数据的类型为预设类型,则确定检测到所述第一撞击事件。
  16. 根据权利要求15所述的方法,其中,所述预设类型为单击音频类型或双击音频类型。
  17. 根据权利要求1所述的方法,其中,所述第一外接设备为第一耳机,所述第二外接设备为第二耳机。
  18. 一种通信连接控制装置,其中,所述装置包括:
    检测模块,用于若检测到针对第一外接设备的第一撞击事件,则检测所述第一撞击事件是否为所述第一外接设备与第二外接设备之间的相互撞击事件;
    发送模块,用于若所述第一撞击事件为所述相互撞击事件,且所述第一外接设备与目标终端建立有短距离通信连接、所述第二外接设备与所述目标终端未建立短距离通信连接,则向所述目标终端或所述第二外接设备发送目标短距离通信连接地址,其中,所述目标短距离通信连接地址用于供所述第二外接设备和所述目标终端建立短距离通信连接。
  19. 一种计算机设备,其中,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至17任一所述的通信连接控制方法。
  20. 一种计算机可读存储介质,其中,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至17任一所述的通信连接控制方法。
PCT/CN2022/087324 2021-04-20 2022-04-18 通信连接控制方法、装置、计算机设备及可读存储介质 WO2022222877A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110424479.1A CN113163383B (zh) 2021-04-20 2021-04-20 通信连接控制方法、装置、计算机设备及可读存储介质
CN202110424479.1 2021-04-20

Publications (1)

Publication Number Publication Date
WO2022222877A1 true WO2022222877A1 (zh) 2022-10-27

Family

ID=76869331

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/087324 WO2022222877A1 (zh) 2021-04-20 2022-04-18 通信连接控制方法、装置、计算机设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN113163383B (zh)
WO (1) WO2022222877A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113163383B (zh) * 2021-04-20 2023-01-03 Oppo广东移动通信有限公司 通信连接控制方法、装置、计算机设备及可读存储介质
CN113194417B (zh) * 2021-04-30 2022-03-15 深圳市欢太科技有限公司 设备连接方法、装置、计算机设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110126014A1 (en) * 2009-11-24 2011-05-26 Sony Ericsson Mobile Communications Ab Event Triggered Pairing of Wireless Communication Devices Based on Time Measurements
US20140199967A1 (en) * 2012-08-31 2014-07-17 Apple Inc. Bump or Close Proximity Triggered Wireless Technology
CN111935682A (zh) * 2020-07-07 2020-11-13 歌尔科技有限公司 无线耳机配对方法、耳机充电盒及无线耳机产品组件
CN112312375A (zh) * 2020-11-17 2021-02-02 Oppo广东移动通信有限公司 一种设备连接方法、第一设备、第二设备及存储介质
CN113163383A (zh) * 2021-04-20 2021-07-23 Oppo广东移动通信有限公司 通信连接控制方法、装置、计算机设备及可读存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113225693B (zh) * 2019-04-18 2022-04-15 华为技术有限公司 一种蓝牙连接方法、设备及系统
CN112243220A (zh) * 2019-07-18 2021-01-19 华为技术有限公司 一种建立通信连接的方法及可穿戴设备
CN117544931A (zh) * 2019-08-09 2024-02-09 华为技术有限公司 信息共享方法、终端设备、存储介质及计算机程序产品
CN112020048B (zh) * 2020-09-04 2022-06-21 歌尔科技有限公司 蓝牙设备的配对方法、设备及存储介质
CN112233404A (zh) * 2020-10-14 2021-01-15 成都极米科技股份有限公司 一种蓝牙连接方法、蓝牙遥控器、终端设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110126014A1 (en) * 2009-11-24 2011-05-26 Sony Ericsson Mobile Communications Ab Event Triggered Pairing of Wireless Communication Devices Based on Time Measurements
US20140199967A1 (en) * 2012-08-31 2014-07-17 Apple Inc. Bump or Close Proximity Triggered Wireless Technology
CN111935682A (zh) * 2020-07-07 2020-11-13 歌尔科技有限公司 无线耳机配对方法、耳机充电盒及无线耳机产品组件
CN112312375A (zh) * 2020-11-17 2021-02-02 Oppo广东移动通信有限公司 一种设备连接方法、第一设备、第二设备及存储介质
CN113163383A (zh) * 2021-04-20 2021-07-23 Oppo广东移动通信有限公司 通信连接控制方法、装置、计算机设备及可读存储介质

Also Published As

Publication number Publication date
CN113163383B (zh) 2023-01-03
CN113163383A (zh) 2021-07-23

Similar Documents

Publication Publication Date Title
US20200312335A1 (en) Electronic device and method of operating the same
WO2022222877A1 (zh) 通信连接控制方法、装置、计算机设备及可读存储介质
JP6379103B2 (ja) ジェスチャを介したマルチデバイスのペアリングおよび共有
US20190166424A1 (en) Microphone mesh network
KR101971911B1 (ko) 이미지를 디스플레이하기 위한 방법 및 그 전자 장치
US9935949B2 (en) Systems and methods for mutual authentication of electronic devices
JP6626440B2 (ja) マルチメディアファイルを再生するための方法及び装置
WO2015191788A1 (en) Intelligent device connection for wireless media in an ad hoc acoustic network
CN109257336B (zh) 一种基于区块链的密码信息处理方法、终端设备
CN111083684A (zh) 控制电子设备的方法及电子设备
WO2019206077A1 (zh) 视频通话处理方法及移动终端
WO2015191787A2 (en) Intelligent device connection for wireless media in an ad hoc acoustic network
US9811311B2 (en) Using ultrasound to improve IMU-based gesture detection
CN105704110B (zh) 一种媒体传输方法、媒体控制方法及装置
WO2019011108A1 (zh) 虹膜识别方法及相关产品
WO2016037569A1 (zh) 无线通信连接的建立方法及终端设备
WO2022227905A1 (zh) 设备连接方法、装置、计算机设备及存储介质
CN112867175A (zh) 设备连接方法、装置、电子设备和存储介质
KR101640710B1 (ko) 카메라를 이용하여 주 디스플레이와 같은 방에 있는 후보 동반 디스플레이 디바이스의 근접 검출
WO2019242477A1 (zh) 随机接入资源的选择方法及终端设备
WO2021147583A1 (zh) 智能设备间的相对角度确定方法、装置、系统和智能设备
CN112954659A (zh) 蓝牙设备间的连接方法、装置、电子设备和存储介质
US10911887B2 (en) Sound system
US20220232647A1 (en) Electronic device for transmitting data in bluetooth network environment, and method therefor
US12034547B2 (en) Method for transceiving data in bluetooth network environment and electronic device thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22790985

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22790985

Country of ref document: EP

Kind code of ref document: A1