CN112437370B - Link switching method, system, TWS earphone pair, chip and medium - Google Patents

Link switching method, system, TWS earphone pair, chip and medium Download PDF

Info

Publication number
CN112437370B
CN112437370B CN202010799424.4A CN202010799424A CN112437370B CN 112437370 B CN112437370 B CN 112437370B CN 202010799424 A CN202010799424 A CN 202010799424A CN 112437370 B CN112437370 B CN 112437370B
Authority
CN
China
Prior art keywords
tws
link
slave
master
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010799424.4A
Other languages
Chinese (zh)
Other versions
CN112437370A (en
Inventor
薛文良
黄紫明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Jieli Technology Co Ltd
Original Assignee
Zhuhai Jieli Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Jieli Technology Co Ltd filed Critical Zhuhai Jieli Technology Co Ltd
Priority to CN202010799424.4A priority Critical patent/CN112437370B/en
Publication of CN112437370A publication Critical patent/CN112437370A/en
Application granted granted Critical
Publication of CN112437370B publication Critical patent/CN112437370B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/0005Control or signalling for completing the hand-off
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/0005Control or signalling for completing the hand-off
    • H04W36/0011Control or signalling for completing the hand-off for data sessions of end-to-end connection
    • 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
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2201/00Details of transducers, loudspeakers or microphones covered by H04R1/00 but not provided for in any of its subgroups
    • H04R2201/10Details of earpieces, attachments therefor, earphones or monophonic headphones covered by H04R1/10 but not provided for in any of its subgroups

Landscapes

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

Abstract

The invention provides a link switching method and a system based on TWS equipment, a TWS earphone pair, a chip and a medium, wherein the method comprises the following steps: if the TWS slave equipment judges that a preset link switching condition is met according to communication data received within a first preset time length, switching from a second link to a master-slave link, and sending a first switching request to the TWS master equipment through a preset additional packet sending window, wherein the additional packet sending window and a data receiving window of the TWS slave equipment for receiving the communication data belong to the same time slot; the TWS main equipment receives the first switching request through an additional packet receiving window aligned with an additional packet sending window, and the additional packet receiving window and a data receiving window of the TWS main equipment for receiving communication data belong to the same time slot; the TWS master device switches from the first link to the master-slave link according to the first switch request. The invention improves the flexibility of the link switching mode and improves the communication efficiency between the terminal equipment and the TWS equipment.

Description

Link switching method, system, TWS earphone pair, chip and medium
Technical Field
The invention relates to the technical field of TWS (time and frequency switching), in particular to a link switching method and system based on TWS (time and frequency switching) equipment, a TWS earphone pair, a chip and a medium.
Background
With the popularization of communication technology and Bluetooth technology, many types of real Wireless Stereo (TWS) Bluetooth headsets appear on the market, and the traditional constraint of wired headsets is removed. The TWS working principle of the Bluetooth headset means that the mobile phone is connected with the main headset, and then the main headset is rapidly connected with the auxiliary headset in a wireless mode, so that the real Bluetooth left and right sound channels are wirelessly separated and used, and when the main headset is not connected with the auxiliary headset, the main headset returns to the monophonic tone quality. How to efficiently realize the link switching between the master earphone and the mobile phone, between the master earphone and the slave earphone, and between the slave earphone and the mobile phone becomes an important research direction in the technical field of the bluetooth earphone TWS.
There are generally two implementations of existing TWS bluetooth headset link switching: 1. the master earphone and the slave earphone are switched at a switching timing time set by software on a mobile phone link, and when the clock of the master earphone and the clock of the slave earphone run to the timing time, the link is switched, namely the slave mobile phone link is switched to a master-slave link, wherein the mobile phone link is a communication link between the master earphone and the mobile phone, and the master-slave link is a communication link between the master earphone and the slave earphone. 2. The master earphone controls the link switching time, and the master earphone can switch the links of the master earphone and the slave earphone at any time. The timing link switching mode is not flexible, and the playing code rate of audio can be influenced, so that the phenomenon of earphone jamming is caused; although the link switching mode controlled by the master earphone is flexible, the data receiving situation of the slave earphone is not considered, and the link switching is not needed under the condition that the master earphone and the slave earphone receive good mobile phone packets at some time, and at this time, if the link switching is carried out, the communication efficiency between the mobile phone and the master earphone is reduced.
Therefore, the switching method of the current link switching is poor in flexibility, and the communication efficiency between the terminal device and the TWS device is low.
Disclosure of Invention
Based on the above situation, a primary objective of the present invention is to provide a link switching method and system based on a TWS device, a TWS headset pair, a chip and a medium, so as to solve the technical problems of poor flexibility of a switching manner of link switching and low communication efficiency between a terminal device and the TWS device.
In order to realize the purpose, the technical scheme adopted by the invention is as follows:
a link switching method based on TWS equipment is applied to TWS master equipment and TWS slave equipment, wherein the TWS master equipment communicates with terminal equipment through a first link, the TWS slave equipment receives communication data through a second link, the communication data are communication data sent to the TWS master equipment by the terminal equipment through the first link, and the TWS master equipment and the TWS slave equipment perform data interaction through a master-slave link, and the link switching method based on the TWS equipment comprises the following steps:
s100, the TWS slave equipment judges whether a preset link switching condition is met or not according to communication data received within a first preset time length; if the link switching condition is satisfied, executing step S200;
s200, the TWS slave device is switched from the second link to the master-slave link, and sends a first switching request to the TWS master device through a preset additional packet sending window, wherein the additional packet sending window and a data receiving window of the TWS slave device for receiving the communication data belong to the same time slot;
s300, the TWS master device receives the first switching request through an additional packet receiving window aligned with the additional packet sending window, wherein the additional packet receiving window and a data receiving window of the TWS master device for receiving the communication data belong to the same time slot;
s400, the TWS master device switches from the first link to the master-slave link according to the first switching request so as to perform data interaction with the TWS slave device through the master-slave link.
Preferably, the step S100 further includes that the TWS master device determines whether a preset link switching condition is met according to communication data received within a first preset time, and if so, executes step S500;
s500, the TWS master device is switched to the master-slave link from the first link, and sends a second switching request to the TWS slave device in a time slot corresponding to a data sending window for sending communication data to the terminal device;
and S600, the TWS slave device receives the second switching request, and switches from a second link to the master-slave link according to the second switching request so as to perform data communication with the TWS master device through the master-slave link.
Preferably, the step S500 includes:
and the TWS master device is switched to the master-slave link from the first link, starts an additional packet sending window to send a second switching request to the TWS slave device after sending communication data to the terminal device through a data sending window, wherein the additional packet sending window sending the second switching request and the data sending window belong to the same time slot.
Preferably, in the step S100, the step of determining whether a preset link switching condition is met according to the communication data received within the first preset time period includes:
s110, calculating the data volume of the communication data received in a first preset time, and executing the step S120 if the data volume is smaller than a preset threshold value; if the data amount is greater than or equal to the preset threshold, executing step S130;
s120, judging that the link switching condition is met;
s130, judging that the link switching condition is not met.
Preferably, in the step S110, when the communication data is audio data, the preset threshold is a data amount corresponding to a lowest playing code rate when the audio data is played within the first preset time period.
Preferably, after the step S200, the method further includes:
and the TWS slave equipment performs data interaction with the TWS master equipment through the master-slave link after a second preset time.
The invention also provides a link switching system based on the TWS equipment, which comprises the TWS main equipment and the TWS slave equipment, wherein the TWS main equipment is communicated with the terminal equipment through a first link, the TWS slave equipment is communicated with the terminal equipment through a second link, and the TWS main equipment and the TWS slave equipment are subjected to data interaction through a main link and a slave link;
the TWS slave device is used for judging whether a preset link switching condition is met or not according to the communication data received within a first preset time length; if the link switching condition is met, switching from the second link to the master-slave link, and sending a first switching request to the TWS master device through a preset additional packet sending window, wherein the additional packet sending window and a data receiving window of the TWS slave device for receiving the communication data belong to the same time slot;
the TWS master device is further configured to receive the first handover request through an additional packet reception window aligned with the additional packet transmission window, wherein the additional packet reception window and a data reception window in which the TWS master device receives the communication data belong to a same timeslot; and switching from the first link to the master-slave link according to the first switching request so as to perform data interaction with the TWS slave equipment through the master-slave link.
The invention also provides a TWS earphone pair, which comprises a left earphone and a right earphone, wherein any one of the left earphone and the right earphone is used as a TWS master device, and the other one is used as a TWS slave device, and the link switching method based on the TWS device is realized together.
The invention also provides a chip for mounting in a TWS headset to form a TWS master device or a TWS slave device, the TWS master device and the TWS slave device being for constituting a TWS device based link switching system as described above.
The present invention also provides a computer readable storage medium, which includes a first medium and a second medium, where the first medium and the second medium respectively store a computer program, and the computer program, when executed by a processor, implements the TWS device-based link switching method as described above.
[ PROBLEMS ] the present invention
The TWS slave device judges whether a link switching condition is met or not according to the data volume of received communication data, when the link switching condition is met, the TWS slave device actively initiates a switching request, so that the TWS slave device and the TWS master device are switched to a master-slave link, the situation that only the TWS master device actively initiates the link switching request is avoided, the situation that the TWS slave device can only initiate the link switching request at regular time is avoided, the TWS slave device can determine whether to initiate the link switching request or not according to the data volume received by the TWS slave device, the flexibility of a link switching mode is improved, when the TWS slave device sends the switching request to the TWS master device, the switching request is sent to the TWS master device in the time slot of a data receiving window, when the TWS master device receives the communication data sent by the terminal device in the time slot corresponding to the data receiving window, the TWS slave device can also receive the switching request sent by the TWS slave device, the TWS master device can successfully receive the switching request without waiting for the arrival of the time slot of the next data receiving, and accordingly, the TWS master device can quickly receive the switching request, the link switching request from the first link to the master-slave device can timely respond to the related link switching link; and because the TWS main device and the TWS slave device can be quickly switched to the master-slave link, the time for the TWS main device and the TWS slave device to carry out data interaction through the master-slave link is shortened, and the TWS main device and the TWS slave device can quickly receive communication data sent by the terminal device, so that the time for the TWS main device to send the communication data to the terminal device is shortened, for example, the time for the TWS main device to send an ACK signal to the terminal device is shortened, the terminal device is prevented from waiting for the TWS main device to return the communication data for a long time, and the communication efficiency between the terminal device and the TWS device is improved.
Other advantages of the present invention will be described in the detailed description, and those skilled in the art will understand the technical features and technical solutions presented in the description.
Drawings
Preferred embodiments of link handover based on a TWS device according to the present invention will be described below with reference to the accompanying drawings. In the figure:
fig. 1 is a flowchart of an embodiment of a link switching method based on a TWS device according to the present invention;
fig. 2 is a schematic diagram of data communication among a TWS master device, a TWS slave device and a terminal device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a time window handover when a TWS slave device actively initiates a handover request in an embodiment of the present invention;
fig. 4 is a schematic diagram of a time window switching when the TWS master device actively initiates a handover request according to an embodiment of the present invention.
Detailed Description
Fig. 1 is a flowchart of an embodiment of a link switching method based on a TWS device according to the present invention, and the method includes the following steps.
It should be noted that step numbers (letter or number numbers) are used to refer to some specific method steps in the present invention only for the purpose of convenience and brevity of description, and the order of the method steps is not limited by letters or numbers in any way. It will be clear to a person skilled in the art that the order of the steps of the method in question, as determined by the technology itself, should not be unduly limited by the presence of step numbers.
Step S100, the TWS slave equipment judges whether a preset link switching condition is met or not according to communication data received within a first preset time length; if the link switching condition is satisfied, step S200 is executed.
In this embodiment, the TWS device includes a TWS master device and a TWS slave device, and the TWS device may be a TWS headset, a TWS speaker, or the like. In the present embodiment, a communication link between the TWS master device and the terminal device is denoted as a first link, a communication link between the TWS slave device and the terminal device is denoted as a second link, and a communication link between the TWS master device and the TWS slave device is denoted as a master-slave link. The terminal equipment can be mobile phones, personal computers and other equipment. Specifically, referring to fig. 2, as can be seen from fig. 2, the TWS master device and the terminal device perform communication through the first link, and receive communication data sent by the terminal device, where the communication data may be voice data or other control data, and the TWS slave device can only listen to the communication data sent by the terminal device to the TWS master device through the second link to receive the communication data, where the communication data is communication data sent by the terminal device to the TWS master device through the first link, and the TWS master device and the TWS slave device perform data interaction through the master-slave link. The first link, the second link and the master-slave link are all bluetooth links. After the TWS slave device is powered on and started, the TWS slave device periodically or in real time determines whether a preset link switching condition is currently met, specifically, determines whether the preset link switching condition is met according to communication data received within a first preset time period, where the size of the first preset time period may be set according to specific needs. It should be noted that the link switching condition of the TWS master device may be the same as or different from the link switching condition of the TWS slave device. If the TWS master device judges that the link switching condition is not met, the TWS master device continuously judges whether the preset link switching condition is met; and if the TWS slave equipment judges that the link switching condition is not met, the TWS slave equipment continuously judges whether the preset link switching condition is met.
Further, in step S100, the step of determining whether the preset link switching condition is met according to the communication data received within the first preset time period includes:
s110, calculating the data volume of the communication data received in a first preset time, and executing the step S120 if the data volume is smaller than a preset threshold value; if the data amount is greater than or equal to the preset threshold, executing step S130;
s120, judging that the link switching condition is met;
s130, judging that the link switching condition is not met.
Specifically, the process of the TWS slave device or the TWS master device determining whether the preset link switching condition is satisfied is as follows: calculating the data volume of the received communication data in the first preset time period, and determining whether the data volume is smaller than a preset threshold in a buffer, where the first preset time period may be set according to specific needs, for example, the first preset time period may be set as the time period of a communication cycle corresponding to the current communication link, one communication cycle may be 4 slots (slots), 6 slots, or 9 slots, and the like, and specifically, the number of the slots corresponding to the communication cycle may be set according to needs, and one slot is 625us (microseconds). The size of the first preset duration is not limited in the embodiment, and the size of the preset threshold is also not limited, so that the user can set the size of the preset threshold as required. If the data volume is smaller than a preset threshold value, determining that the link switching condition is met currently; if the data volume is judged to be larger than or equal to the preset threshold value, determining that the link switching condition is not met currently, and not needing to switch the link.
It can be understood that, when the data volume of the communication data received by the TWS master device or the TWS slave device in the first preset time period is smaller than the preset threshold, the correspondence indicates that the communication environment where the TWS master device or the TWS slave device is located is poor, and the packet loss of the communication data corresponding to the data packet is serious. By setting the link switching condition, the link switching can be realized as long as the TWS master device or the TWS slave device meets the link switching condition, the link switching request can be initiated by the TWS master device or the TWS slave device, and the conditions for initiating the switching request by the TWS master device and the TWS slave device are not interfered with each other, and both the TWS master device and the TWS slave device can select the time point for generating the switching request by monitoring the receiving condition of data on respective links.
Further, when the communication data is audio data, the preset threshold is a data amount corresponding to the lowest play code rate when the audio data is played within the first preset time period, that is, a data amount required by the lowest play code rate. By setting the preset threshold value as the data volume corresponding to the lowest playing code rate, link switching is realized when the data volume of the currently received audio data of the TWS master device or the TWS slave device may affect the playing code rate of the audio, so that the phenomenon of pause is caused, the TWS master device and the TWS slave device perform data interaction through a master-slave link, and the phenomenon of pause in audio playing is avoided.
Further, the data volume of the communication data received in the first preset time period can be calculated, then the data volume is compared with the data volume which can be received in the normal communication state in the first preset time period, the packet loss rate corresponding to the communication data in the first preset time period is calculated, and when the calculated packet loss rate is greater than the preset packet loss rate, the link switching condition is determined to be met; and when the calculated packet loss rate is less than or equal to the preset packet loss rate, judging that the link switching condition is not met. The present embodiment does not limit the size of the preset packet loss rate.
Further, in step S100, the step of determining, by the TWS master device, whether the preset link switching condition is met according to the communication data received within the first preset time period includes:
step a, when the TWS master device monitors that the current time is a preset switching time point, judging that the TWS master device meets a link switching condition.
And b, when the TWS master device monitors that the current time is not the switching time point, judging that the TWS master device does not meet the link switching condition.
Further, the process of the TWS master device determining whether the preset link switching condition is satisfied is as follows: when the TWS master device monitors whether the current time is a preset handover time point, where the preset handover time point is preset and a time point for actively initiating a handover request for switching a link needs to be initiated by the TWS master device, the handover time point may be set by a user according to specific needs. When the TWS master device monitors that the current time is a preset switching time point, the TWS master device judges that the link switching condition is currently met; when the TWS master device monitors that the current time is not the preset switching time point, the TWS master device judges that the link switching condition is not met currently. Further, the TWS slave device may also periodically generate the first handover request.
Step S200, the TWS slave device switches from the second link to the master-slave link, and sends a first switching request to the TWS master device through a preset additional packet sending window, where the additional packet sending window and a data receiving window of the TWS slave device for receiving the communication data belong to the same timeslot.
When the TWS slave device satisfies the link switching condition, the TWS slave device switches from the second link to the master-slave link and generates a link switching request, and in order to avoid mixing the link switching request generated by the TWS slave device with the link switching request generated by the TWS master device, the present embodiment takes the link switching request generated by the TWS slave device as the first switching request. After the TWS slave device generates the first handover request, the TWS slave device sends the first handover request to the TWS master device through the additional packet sending window, that is, the first handover request is sent to the TWS master device within a time duration corresponding to the additional packet sending window, and the additional packet sending window and a data receiving window of the TWS slave device for receiving communication data through the second link belong to the same time slot. It should be noted that the window mentioned in this embodiment is a time window, and the setting of the additional packet sending window and the additional packet receiving window can be realized by software. In this embodiment, if R represents a data reception window for receiving communication data of the terminal device, and R represents a data reception window for receiving data via the master-slave link, the time window corresponding to the communication link of the TWS slave device is R → R, that is, the TWS slave device switches back and forth between the data reception window R and the data reception window R. Further, in this embodiment, the TWS slave device may set an additional packet transmission window after each data reception window R, or may set an additional packet transmission window after a specific data reception window R as needed. The duration of the interval between the data receiving window R and the additional packet sending window may be set according to specific needs, for example, the duration of the interval between the data receiving window R and the additional packet sending window may be set to 1us (microseconds), 0.5us, and so on, as long as it is ensured that the additional packet sending window and the data receiving window R belong to the same timeslot. It should be noted that, in order to quickly send the first handover request to the TWS master device, the additional packet sending window may be always in an open state, and when necessary, the first handover request may be sent directly through the additional packet window.
Step S300, the TWS master device receives the first handover request through an additional packet receiving window aligned with the additional packet sending window, where the additional packet receiving window and a data receiving window of the TWS master device receiving the communication data belong to the same timeslot.
The TWS master device receives the first switching request through an additional packet receiving window aligned with the additional packet sending window, wherein in order to successfully receive the first switching request, the additional packet receiving window in the TWS master device is always in an open state, so that the TWS master device can receive the first switching request in time when the TWS slave device sends the first switching request. The additional packet reception window and a data reception window in which the TWS master receives communication data through the first link belong to the same slot. It should be noted that, the TWS master knows that the TWS slave has additional packet transmission windows set in those timeslots, and the TWS master will set corresponding additional packet reception windows in corresponding timeslots, so that the additional packet transmission windows in the TWS slave and the additional packet reception windows in the TWS master are aligned.
Step S400, the TWS master device switches from the first link to the master-slave link according to the first switching request, so as to perform data interaction with the TWS slave device through the master-slave link.
When the TWS master device receives the first handover request, the TWS master device switches from the first link to the master-slave link according to the first handover request, and at this time, the TWS master device and the TWS slave device are both switched to the master-slave link, and the TWS master device and the TWS slave device may perform data interaction via the master-slave link.
Specifically, referring to fig. 3, as can be seen from fig. 3, the terminal device first transmits communication data to the TWS master device through the data transmission window T based on the first link, the TWS master device receives the communication data through the data reception window R, meanwhile, the TWS slave device can listen to the communication data through the data reception window R based on the second link, and at the next time slot, the TWS master device returns data to the terminal device through the data transmission window T based on the first link, and the terminal device receives the data returned by the TWS master device through the data reception window R, and at this time, the TWS slave device does not need to communicate with the terminal device. If the TWS slave device is to actively initiate a handover request for switching a link, the TWS slave device sends a first handover request to the TWS master device in a time slot corresponding to a data receiving window, that is, the first handover request is sent to the TWS master device in a time duration corresponding to an additional packet sending window t in the time slot. When the TWS slave device works in the data receiving window R, the TWS master device also works in the data receiving window R, so that the TWS master device receives communication data sent by the terminal device in a time slot corresponding to the data receiving window R, receives a first switching request sent by the TWS slave device through an additional packet adding window R in the time slot, and enables the TWS master device to complete communication data receiving and switching request receiving in one time slot without waiting for the arrival of the next time slot and then receives the first switching request, and therefore the TWS master device can quickly respond to the switching request and switch from a first link to a master-slave link.
Further, the link switching method based on the TWS device further includes:
in the step S100, the TWS master device determines whether a preset link switching condition is satisfied according to the communication data received within a first preset duration, and if so, executes step S500;
step S500, the TWS master device switches from the first link to the master-slave link, and sends a second switching request to the TWS slave device in a time slot corresponding to a data sending window for sending communication data to the terminal device.
Step S600, the TWS slave device receives the second handover request, and switches from a second link to the master-slave link according to the second handover request, so as to perform data communication with the TWS master device through the master-slave link.
Further, after the TWS master device is powered on and started, the TWS master device periodically or in real time determines whether a preset link switching condition is currently met. It should be noted that, the process of determining whether the link handover condition is satisfied is the same for the TWS master device and the TWS slave device, and details are not repeated in this embodiment. If the TWS master device meets the preset link switching condition, the TWS master device switches from the first link to the master-slave link and generates a second switching request for switching the link, and the second switching request is sent to the TWS slave device in a time slot corresponding to a data sending window for sending communication data to the terminal device, namely the TWS master device sends the second switching request to the TWS slave device in a time slot corresponding to the terminal device for receiving the communication data. And when the TWS slave equipment receives the second switching request, the TWS slave equipment is switched to the master-slave link from the second link according to the second switching request so as to carry out data communication with the TWS master equipment through the master-slave link.
Specifically, referring to fig. 4, in fig. 4, a timeslot window of the bluetooth network clock on the first link of the terminal device is T → R → T → R. In fig. 4, there are only 4 timeslots, in the 4 th timeslot (counted from left to right) of the TWS master device, the TWS master device determines that the link handover condition is satisfied, and needs to send the second handover request to the TWS slave device, and at this time, the TWS master device operates in the data sending window, so the TWS master device may directly send the second handover request to the TWS slave device, the corresponding TWS slave device also operates in the data receiving window, and the TWS slave device may also directly receive the second handover request sent by the TWS master device, and does not need to wait for the timeslot corresponding to the next data receiving window to arrive. It is understood that, if it is determined that the link switching condition is satisfied when the TWS master device operates in the data receiving window, the TWS master device sends the second handover request to the TWS slave device in the next time slot of the data receiving window, i.e. the time slot corresponding to the data sending window, so as to quickly send the second handover request to the TWS slave device.
Further, step S500 includes:
and c, the TWS master device is switched from the first link to the master-slave link, after the TWS master device sends communication data to the terminal device through the data sending window, an additional packet sending window is started to send a second switching request to the TWS slave device, and the additional packet sending window for sending the second switching request and the data sending window belong to the same time slot.
Further, when the TWS master device is switched from the first link to the master-slave link and after sending the communication data to the terminal device through the data sending window, the TWS master device starts an additional packet sending window to send a second switching request to the TWS slave device, wherein the additional packet sending window and the data sending window belong to the same time slot. It is understood that, for the TWS master, the last time window of the data transmission window is a data receiving window, that is, the TWS master has just received the communication data sent by the terminal device, at this time, the TWS master should return an ACK (acknowledgement character) signal to the terminal device through the data transmission window, so that, for the TWS master to successfully send the ACK signal to the terminal device and send the second handover request to the TWS slave, two transmission windows may be set in the time slot, one data transmission window T is used for sending the ACK signal to the terminal device, and one additional packet transmission window T is used for sending the second handover request to the TWS slave. It should be noted that the setting manner of the additional packet transmission window in the TWS master device is the same as the setting manner of the additional packet transmission window in the TWS slave device, and details are not repeated here. At this time, in the TWS slave device, only one data receiving window R may be set to correspond to the data sending window T of the TWS master device and the additional packet sending window T, where the duration corresponding to the data receiving window in the TWS slave device is one time slot, or two data receiving windows may be set, one of which is aligned with the data sending window T of the TWS master device and the other of which is aligned with the additional packet sending window T, where the durations corresponding to the two data receiving windows are one time slot.
In the embodiment, the TWS slave device judges whether a link switching condition is met according to the data volume of received communication data, when the link switching condition is met, the TWS slave device actively initiates a switching request, so that both the TWS slave device and the TWS master device are switched to a master-slave link, the problem that only the TWS master device can actively initiate the link switching request is avoided, the flexibility of a link switching mode is improved, and when the TWS slave device sends the switching request to the TWS master device, the switching request is sent to the TWS master device in a time slot of a data receiving window, so that the TWS master device can successfully receive the switching request when receiving the communication data sent by the terminal device in the time slot corresponding to the data receiving window, and can quickly respond to the switching request, switch from a first link to the master-slave link, and realize the timely response of relevant hardware of the switching link; and because the TWS main device and the TWS slave device can be quickly switched to the master-slave link, the time for the TWS main device and the TWS slave device to carry out data interaction through the master-slave link is shortened, and the TWS main device and the TWS slave device can quickly receive communication data sent by the terminal device, so that the time for the TWS main device to send the communication data to the terminal device is shortened, for example, the time for the TWS main device to send an ACK signal to the terminal device is shortened, the terminal device is prevented from waiting for the TWS main device to return the communication data for a long time, and the communication efficiency between the terminal device and the TWS device is improved.
Further, a second embodiment of the link switching method based on the TWS device of the present invention is proposed.
The second embodiment of the link switching method based on TWS device is different from the above-mentioned embodiments of the link switching method based on TWS device in that the step S200 includes:
and d, the TWS slave device is switched to the master-slave link from the second link, a preset additional packet sending window is started, and a first switching request is sent to the TWS master device through the additional packet sending window.
When the TWS slave device is switched from the second link to the master-slave link, the TWS slave device indicates that the TWS slave device needs to perform data interaction with the TWS master device through the master-slave link, at the moment, the TWS slave device starts a preset additional packet sending window, and sends a first switching request to the TWS master device through the additional packet sending window. In this embodiment, the additional packet sending window corresponding to the TWS slave device is not always in the on state, and the additional packet sending window is only opened when the first handover request needs to be sent to the TWS master device, so that the additional packet sending window in the TWS slave device is prevented from being always in the on state, and the energy consumption of the TWS slave device is reduced.
The link switching method based on the TWS equipment further comprises the following steps:
and e, after the TWS slave device sends the first switching request to the TWS master device, carrying out data interaction with the TWS master device through the master-slave link after a second preset time.
When the TWS slave device sends a first handover request to the TWS master device, that is, after both the TWS slave device and the TWS master device are handed over to the master-slave link, the TWS slave device performs data interaction with the TWS master device through the master-slave link after the second preset duration, that is, receives communication data forwarded by the TWS master device through the master-slave link. The second preset time period may be set according to specific needs, for example, the second preset time period may be set to be one time slot. Specifically, referring to fig. 3, "N" in fig. 3 indicates a null packet, that is, the TWS slave device does not transmit data in the current time slot, and the time slot corresponding to "N" is a second preset time duration.
In this embodiment, after the TWS slave device sends the first handover request to the TWS master device, that is, after both the TWS slave device and the TWS master device are handed over to the master-slave link, the TWS slave device performs data interaction with the TWS master device through the master-slave link after the second preset duration, and gives enough duration to allow both the TWS slave device and the TWS master device to prepare respective hardware and software resources, so that data interaction can be successfully performed through the master-slave link, and a packet loss situation occurring when the TWS slave device and the TWS master device transmit the first data through the master-slave link is avoided, thereby improving a success rate of data interaction between the TWS slave device and the TWS master device through the master-slave link.
The invention also provides a link switching system based on the TWS equipment, which comprises the TWS main equipment and the TWS slave equipment, wherein the TWS main equipment is communicated with the terminal equipment through a first link, the TWS slave equipment is communicated with the terminal equipment through a second link, communication data are received through the second link, the communication data are communication data sent to the TWS main equipment by the terminal equipment through the first link, and the TWS main equipment and the TWS slave equipment are subjected to data interaction through the main link and the slave link;
the TWS slave device is used for judging whether a preset link switching condition is met or not according to the communication data received within a first preset time length; if the link switching condition is met, switching from the second link to the master-slave link, and sending a first switching request to the TWS master device through a preset additional packet sending window, wherein the additional packet sending window and a data receiving window of the TWS slave device for receiving the communication data belong to the same time slot;
the TWS master device is further configured to receive the first handover request through an additional packet reception window aligned with the additional packet transmission window, wherein the additional packet reception window and a data reception window in which the TWS master device receives the communication data belong to a same timeslot; and switching from the first link to the master-slave link according to the first switching request so as to perform data interaction with the TWS slave equipment through the master-slave link.
Further, the TWS master device is further configured to determine whether a preset link switching condition is satisfied according to communication data received within a first preset duration; when the link switching condition is met, switching from a first link to the master-slave link, and sending a second switching request to the TWS slave device in a time slot corresponding to a data sending window for sending communication data to the terminal device;
the TWS slave device is further configured to receive the second handover request, and switch from a second link to the master-slave link according to the second handover request, so as to perform data communication with the TWS master device through the master-slave link.
Further, the TWS master device is further configured to switch from the first link to the master-slave link, and after sending communication data to the terminal device through the data sending window, start an additional packet sending window to send a second handover request to the TWS slave device, where the additional packet sending window that sends the second handover request and the data sending window belong to the same timeslot.
Further, the TWS slave device is further configured to switch from the second link to the master-slave link, start a preset additional packet sending window, and send a first switching request to the TWS master device through the additional packet sending window.
Further, the TWS master device and the TWS slave device are further configured to calculate a data volume of the received communication data within a first preset time period, and if the data volume is smaller than a preset threshold, it is determined that the link handover condition is satisfied; and if the data volume is greater than or equal to the preset threshold, judging that the link switching condition is not met.
Further, when the communication data is audio data, the preset threshold is a data amount corresponding to the lowest playing code rate when the audio data is played within the first preset time period.
Further, the TWS slave device is further configured to perform data interaction with the TWS master device through the master-slave link after a second preset duration elapses after sending the first handover request to the TWS master device.
The specific implementation of the link switching system based on the TWS device of the present invention is basically the same as the first and second embodiments of the link switching method based on the TWS device, and will not be described repeatedly herein.
The invention also provides a TWS earphone pair, which comprises a left earphone and a right earphone, wherein any one of the left earphone and the right earphone is used as a TWS master device, and the other one is used as a TWS slave device, and the link switching method based on the TWS device is realized together.
The specific implementation of the TWS headset pair of the present invention is substantially the same as the first and second embodiments of the above-mentioned link switching method based on TWS devices, and details are not repeated here.
The invention also provides a chip for mounting in a TWS headset to form a TWS master device or a TWS slave device, the TWS master device and the TWS slave device being for constituting a TWS device based link switching system as described above.
The specific implementation of the chip of the present invention is substantially the same as the above link switching system based on TWS device, and will not be described repeatedly herein.
The present invention also proposes a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, implements the steps of the TWS device based link switching method as described above.
The specific implementation manner of the computer-readable storage medium of the present invention is substantially the same as that of each embodiment of the above-mentioned link switching method based on the TWS device, and will not be described repeatedly herein.
It will be appreciated by those skilled in the art that the various preferences described above can be freely combined, superimposed without conflict.
It will be understood that the embodiments described above are illustrative only and not restrictive, and that various obvious and equivalent modifications and substitutions for details described herein may be made by those skilled in the art without departing from the basic principles of the invention.

Claims (10)

1. A link switching method based on TWS equipment is applied to TWS main equipment and TWS slave equipment, wherein the TWS main equipment communicates with terminal equipment through a first link, the TWS slave equipment monitors and receives communication data sent by the terminal equipment to the TWS main equipment through a second link, the communication data are communication data sent by the terminal equipment to the TWS main equipment through the first link, and the TWS main equipment and the TWS slave equipment carry out data interaction through a main link and a slave link, and the link switching method based on the TWS equipment comprises the following steps:
s100, the TWS slave device calculates the data volume of the received communication data in a first preset time, if the data volume is smaller than a preset threshold value, the condition of link switching is judged to be met, and the step S200 is executed; when the communication data is audio data, the preset threshold is a data volume corresponding to the lowest playing code rate when the audio data is played within the first preset time length;
s200, the TWS slave device is switched to the master-slave link from the second link, and sends a first switching request to the TWS master device through a preset additional packet sending window, wherein the additional packet sending window and a data receiving window for the TWS slave device to receive the communication data belong to the same time slot;
s300, the TWS master device receives the first switching request through an additional packet receiving window aligned with the additional packet sending window, wherein the additional packet receiving window and a data receiving window of the TWS master device for receiving the communication data belong to the same time slot;
and S400, the TWS master device switches from the first link to the master-slave link according to the first switching request so as to perform audio data interaction with the TWS slave device through the master-slave link, and the TWS slave device receives the audio data forwarded by the TWS master device through the master-slave link and does not receive the audio data from the terminal device.
2. The method according to claim 1, wherein the step S100 further includes the TWS master device determining whether a predetermined link handover condition is satisfied according to the communication data received within a first predetermined duration, and if so, executing step S500;
s500, the TWS master device is switched from a first link to the master-slave link, and a second switching request is sent to the TWS slave device in a time slot corresponding to a data sending window for sending communication data to the terminal device;
and S600, the TWS slave device receives the second switching request, and switches from a second link to the master-slave link according to the second switching request so as to perform data communication with the TWS master device through the master-slave link.
3. The TWS device based link switching method of claim 2, wherein the step S500 comprises:
and the TWS master device is switched from the first link to the master-slave link, starts an additional packet sending window to send a second switching request to the TWS slave device after sending communication data to the terminal device through a data sending window, wherein the additional packet sending window for sending the second switching request and the data sending window belong to the same time slot.
4. The TWS device-based link switching method according to any one of claims 1 to 3, further comprising, after the step S200:
and the TWS slave equipment performs data interaction with the TWS master equipment through the master-slave link after a second preset time period.
5. A link switching system based on TWS equipment is characterized by comprising TWS main equipment and TWS slave equipment, wherein the TWS main equipment is communicated with terminal equipment through a first link, the TWS slave equipment monitors and receives communication data sent by the terminal equipment to the TWS main equipment through a second link, and the TWS main equipment and the TWS slave equipment are subjected to data interaction through a main link and a slave link;
the TWS slave device is used for calculating the data volume of the audio data received within a first preset time, if the data volume is smaller than a preset threshold value, the TWS slave device judges that a link switching condition is met, switches from the second link to the master-slave link, and sends a first switching request to the TWS master device through a preset additional packet sending window, wherein the additional packet sending window and a data receiving window of the TWS slave device for receiving the communication data belong to the same time slot; when the communication data is audio data, the preset threshold is a data volume corresponding to the lowest playing code rate when the audio data is played within the first preset time length;
the TWS master device is further configured to receive the first handover request through an additional packet reception window aligned with the additional packet transmission window, wherein the additional packet reception window and a data reception window in which the TWS master device receives the communication data belong to a same timeslot; and switching from the first link to the master-slave link according to the first switching request so as to perform audio data interaction with the TWS slave device through the master-slave link, wherein the TWS slave device receives the audio data forwarded by the TWS master device through the master-slave link and does not receive the audio data from the terminal device.
6. The TWS device based link switching system of claim 5, wherein the TWS master device is further configured to determine whether a predetermined link switching condition is met based on the communication data received within a first predetermined duration; when the link switching condition is met, switching from the first link to the master-slave link, and sending a second switching request to the TWS slave device in a time slot corresponding to a data sending window for sending communication data to the terminal device;
the TWS slave device is further configured to receive the second handover request, and switch from a second link to the master-slave link according to the second handover request, so as to perform data communication with the TWS master device through the master-slave link.
7. The TWS device-based link switching system of claim 6, wherein the TWS master device is further configured to switch from the first link to the master-slave link, and after sending the communication data to the terminal device through the data sending window, initiate an additional packet sending window to send a second handover request to the TWS slave device, wherein the additional packet sending window sending the second handover request and the data sending window belong to a same timeslot.
8. A TWS headset pair comprising a left headset and a right headset, wherein either one of the left headset and the right headset acts as a TWS master device and the other acts as a TWS slave device, together implementing a TWS device based link switching method as claimed in any one of claims 1-4.
9. A chip adapted to be mounted in a TWS headset to form a TWS master device or a TWS slave device, the TWS master device and the TWS slave device being adapted to constitute a TWS device based link switching system according to any one of claims 5 to 7.
10. A computer-readable storage medium comprising a first medium and a second medium, on which a computer program is stored, respectively, which, when executed by a processor, implements the TWS device-based link switching method according to any one of claims 1 to 4.
CN202010799424.4A 2020-08-11 2020-08-11 Link switching method, system, TWS earphone pair, chip and medium Active CN112437370B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010799424.4A CN112437370B (en) 2020-08-11 2020-08-11 Link switching method, system, TWS earphone pair, chip and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010799424.4A CN112437370B (en) 2020-08-11 2020-08-11 Link switching method, system, TWS earphone pair, chip and medium

Publications (2)

Publication Number Publication Date
CN112437370A CN112437370A (en) 2021-03-02
CN112437370B true CN112437370B (en) 2023-02-24

Family

ID=74689903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010799424.4A Active CN112437370B (en) 2020-08-11 2020-08-11 Link switching method, system, TWS earphone pair, chip and medium

Country Status (1)

Country Link
CN (1) CN112437370B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107950014A (en) * 2016-04-22 2018-04-20 苹果公司 Role swap is carried out between the wireless connectivity devices do not fastened
US10412481B1 (en) * 2019-01-30 2019-09-10 Bestechnic (Shanghai) Co., Ltd. Operation mode switch of wireless headphones
CN110913375A (en) * 2019-11-27 2020-03-24 南京中感微电子有限公司 Wireless communication system and equipment
CN111106853A (en) * 2019-10-08 2020-05-05 珠海市杰理科技股份有限公司 Master-slave switching method, device and equipment for double wireless Bluetooth equipment and audio system
CN111107526A (en) * 2019-10-08 2020-05-05 珠海市杰理科技股份有限公司 Master-slave switching method, device and system for double wireless Bluetooth devices in standard time slot
CN111132110A (en) * 2019-12-26 2020-05-08 重庆物奇科技有限公司 Device master-slave role switching system and method for wireless communication
CN111436042A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Bluetooth headset and dynamic master-slave switching method, device and system thereof
CN111436041A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Method and device for switching master and slave Bluetooth earphones, Bluetooth earphones and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391876A (en) * 2018-01-10 2019-02-26 展讯通信(上海)有限公司 Audio frequency apparatus and its data receiver method
CN110519742B (en) * 2019-09-16 2022-02-18 安徽华米信息科技有限公司 Audio synchronous playing method and device and TWS Bluetooth headset
CN111294784B (en) * 2020-05-13 2020-10-20 深圳市汇顶科技股份有限公司 Data transmission method, device, chip, electronic equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107950014A (en) * 2016-04-22 2018-04-20 苹果公司 Role swap is carried out between the wireless connectivity devices do not fastened
US10412481B1 (en) * 2019-01-30 2019-09-10 Bestechnic (Shanghai) Co., Ltd. Operation mode switch of wireless headphones
CN111106853A (en) * 2019-10-08 2020-05-05 珠海市杰理科技股份有限公司 Master-slave switching method, device and equipment for double wireless Bluetooth equipment and audio system
CN111107526A (en) * 2019-10-08 2020-05-05 珠海市杰理科技股份有限公司 Master-slave switching method, device and system for double wireless Bluetooth devices in standard time slot
CN111436042A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Bluetooth headset and dynamic master-slave switching method, device and system thereof
CN111436041A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Method and device for switching master and slave Bluetooth earphones, Bluetooth earphones and system
CN110913375A (en) * 2019-11-27 2020-03-24 南京中感微电子有限公司 Wireless communication system and equipment
CN111132110A (en) * 2019-12-26 2020-05-08 重庆物奇科技有限公司 Device master-slave role switching system and method for wireless communication

Also Published As

Publication number Publication date
CN112437370A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN111654845B (en) Bluetooth multi-terminal link switching method, bluetooth audio equipment and system
WO2021129892A1 (en) System and method for switching device primary/secondary roles for use in wireless communications
WO2021082875A1 (en) Method and apparatus for switching master and slave bluetooth headsets, bluetooth headset, and system
CN111436044B (en) Method, device and system for processing packet loss data of dual-wireless Bluetooth communication network
CN111106853B (en) Master-slave switching method, device and equipment for double wireless Bluetooth equipment and audio system
CN111435844B (en) Method, device, equipment and system for correcting audio data in dual-wireless Bluetooth communication
CN111885553B (en) Bluetooth device communication method and related device
CN112437369A (en) Audio data transmission method and system, TWS earphone pair, chip and medium
CN111885554B (en) Link switching method based on dual-wireless Bluetooth communication and related equipment
CN111107526B (en) Master-slave switching method, device and system for standard time slot dual-wireless Bluetooth device
CN112055349B (en) Wireless communication method and Bluetooth device
CN111436042B (en) Bluetooth headset and dynamic master-slave switching method, device and system thereof
CN112437371B (en) BLE link switching method, equipment, earphone pair, chip and medium
WO2022188360A1 (en) Bluetooth fast networking method and system, and bluetooth earphones
CN112291683B (en) TWS earphone control method and device
CN112437370B (en) Link switching method, system, TWS earphone pair, chip and medium
CN114079894B (en) Dual-wireless audio communication control method, device, equipment and system
CN113115281B (en) Bluetooth audio device, bluetooth audio system and operation method thereof
EP1334574A1 (en) Method and apparatus to synchronize mobile radios
CN114079898B (en) Audio data communication method, device, equipment and system in double-transmission mode
CN113207114B (en) Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system
CN114079896B (en) Method, device, equipment and system for error correction of packet loss data in double-transmission mode
CN114079898A (en) Audio data communication method, device, equipment and system in dual-transmission mode
CN118119005A (en) Data synchronization method and related product
JP2006157543A (en) Radio communication terminal and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 519075 No. 333, Kexing Road, Xiangzhou District, Zhuhai City, Guangdong Province

Applicant after: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

Address before: Floor 1-107, building 904, ShiJiHua Road, Zhuhai City, Guangdong Province

Applicant before: ZHUHAI JIELI TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant