WO2021226881A1 - 一种数据传输方法、装置、芯片、电子设备及存储介质 - Google Patents

一种数据传输方法、装置、芯片、电子设备及存储介质 Download PDF

Info

Publication number
WO2021226881A1
WO2021226881A1 PCT/CN2020/090043 CN2020090043W WO2021226881A1 WO 2021226881 A1 WO2021226881 A1 WO 2021226881A1 CN 2020090043 W CN2020090043 W CN 2020090043W WO 2021226881 A1 WO2021226881 A1 WO 2021226881A1
Authority
WO
WIPO (PCT)
Prior art keywords
link
bluetooth
transmission mechanism
forwarding
data
Prior art date
Application number
PCT/CN2020/090043
Other languages
English (en)
French (fr)
Inventor
蒲川
Original Assignee
深圳市汇顶科技股份有限公司
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 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2020/090043 priority Critical patent/WO2021226881A1/zh
Publication of WO2021226881A1 publication Critical patent/WO2021226881A1/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

Definitions

  • This application relates to the field of communications, and in particular to a data transmission method, device, chip, electronic equipment, and storage medium.
  • a multi-device application scenario taking the communication between a mobile phone and multiple headsets as an example, assuming a dual-transmission mechanism, if both headsets are connected to the mobile phone, and the mobile phone transmits Bluetooth data to the two headsets through the connection, When the quality of the link between one of the earphones and the mobile phone is poor, the quality of the Bluetooth data will be affected. Assuming that the Bluetooth data is audio data, for example, the link between the left earphone and the mobile phone is of good quality, and the link between the right earphone and the mobile phone is of poor quality, and the right earphone does not receive enough audio data, which makes the right earphone play Stuttering occurs, which reduces the audio playback quality and affects the user experience.
  • the left earphone is connected to the mobile phone to transmit audio data, and then the left earphone is forwarded to the right earphone.
  • This forwarding transmission mechanism requires the link between the left and right ears to be relatively stable. If the link between the two is unstable, it is easy to cause unsuccessful forwarding and make the right earphone not receive audio data or receive failure.
  • this application provides a data transmission method, device, chip, electronic device, and storage medium.
  • the first aspect of the embodiments of the present application provides a data transmission method, including:
  • the dual transmission mechanism includes the first Bluetooth terminal transmitting Bluetooth data to the second Bluetooth terminal and the third Bluetooth terminal through the first main link and the second main link respectively;
  • the forwarding mechanism includes that the first Bluetooth terminal transmits Bluetooth data to the second Bluetooth terminal through the first main link, and part or all of the Bluetooth data received by the second Bluetooth terminal is used to be forwarded by the second Bluetooth terminal to the third through the first secondary link.
  • the monitoring mechanism includes that the first Bluetooth terminal transmits Bluetooth data to the second Bluetooth terminal through the first main link, and the Bluetooth data transmitted from the first Bluetooth terminal to the second Bluetooth terminal is monitored by the third Bluetooth terminal.
  • the first transmission mechanism before transmitting Bluetooth data according to the first transmission mechanism, it further includes: transmitting Bluetooth data according to a forwarding mechanism and a non-forwarding mechanism; the non-forwarding mechanism includes a dual transmission mechanism or Monitoring mechanism.
  • it further includes: transmitting Bluetooth data according to the second transmission mechanism in the first time period, and in the second time period, according to the first A transmission mechanism transmits Bluetooth data; in the third time period, Bluetooth data is transmitted according to a forwarding mechanism and a non-forwarding mechanism; the third time period is between the first time period and the second time period;
  • the second transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism; the first transmission mechanism is different from the second transmission mechanism.
  • the first transmission mechanism in another implementation manner of the first aspect, in the process of transmitting Bluetooth data according to the forwarding mechanism and the non-forwarding mechanism, the first transmission mechanism is updated.
  • the link quality parameter includes one or more of packet loss rate, signal strength, and retransmission rate
  • the signal strength of the first main link is greater than or equal to the signal strength of the second main link, or the packet loss rate of the first main link is less than or equal to the packet loss rate of the second main link, or the packet loss rate of the first main link
  • the retransmission rate is less than or equal to the retransmission rate of the second main link
  • Selecting the first transmission mechanism according to link quality parameters includes: according to one of the link quality parameters of the second primary link, the link quality parameters of the first secondary link, and the link quality parameters of the first primary link, or Multiple options for the first transmission mechanism.
  • selecting the first transmission mechanism according to the link quality parameter specifically includes:
  • the first transmission mechanism is selected according to the link quality parameter of the second primary link; or the first transmission mechanism is selected according to the link quality parameter of the first secondary link.
  • selecting the first transmission mechanism specifically includes:
  • the first transmission mechanism is selected according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link.
  • selecting the first transmission mechanism according to the link quality parameter of the second primary link includes:
  • the first transmission mechanism includes a non-forwarding mechanism; or, if the link quality parameter of the second main link does not meet the first preset condition, it is determined
  • the first transmission mechanism includes a forwarding mechanism; the non-forwarding mechanism includes a dual transmission mechanism or a monitoring mechanism;
  • the first preset condition includes: the signal strength of the second main link is greater than or equal to the first preset signal strength, or the retransmission rate of the second main link is less than or equal to the first preset retransmission rate, or the second The packet loss rate of the main link is less than or equal to the first preset packet loss rate.
  • the first preset signal strength is the signal strength of the first secondary link;
  • the first preset retransmission rate is the first The retransmission rate of the secondary link;
  • the first preset packet loss rate is the packet loss rate of the first secondary link;
  • Determining that the first transmission mechanism includes a non-forwarding mechanism includes: determining that the first transmission mechanism is a non-forwarding mechanism;
  • Determining that the first transmission mechanism includes a forwarding mechanism includes: determining that the first transmission mechanism is a forwarding mechanism.
  • the first transmission mechanism includes forwarding
  • the mechanism includes: determining that the first transmission mechanism is a forwarding mechanism, or determining that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism;
  • the transmission mechanism is a forwarding mechanism and a non-forwarding mechanism
  • the second preset condition includes: the signal strength of the second main link is less than the second preset signal strength, or the retransmission rate of the second main link is greater than the second preset retransmission rate, or the signal strength of the second main link
  • the packet loss rate is greater than the second preset packet loss rate
  • the first preset signal strength is greater than the second preset signal strength, the first preset retransmission rate is less than the second preset retransmission rate, and the first preset packet loss rate is less than the second preset packet loss rate;
  • Determining that the first transmission mechanism includes a non-forwarding mechanism includes: determining that the first transmission mechanism is a non-forwarding mechanism.
  • selecting the first transmission mechanism according to the link quality parameter of the first secondary link includes:
  • the first transmission mechanism includes a forwarding mechanism; or, if the link quality parameter of the first secondary link does not meet the third preset condition, it is determined that One transmission mechanism includes non-forwarding mechanism; non-forwarding mechanism includes double-transmitting mechanism or monitoring mechanism;
  • the third preset condition includes: the signal strength of the first secondary link is higher than the third preset signal strength, or the retransmission rate of the first secondary link is lower than the third preset retransmission rate, or the first secondary link
  • the packet loss rate of is lower than the third preset packet loss rate.
  • the third preset signal strength is the signal strength of the second main link;
  • the third preset packet loss rate is the second The packet loss rate of the primary link, and the third preset retransmission rate is the retransmission rate of the second primary link;
  • Determining that the first transmission mechanism includes a non-forwarding mechanism includes: determining that the first transmission mechanism is a non-forwarding mechanism;
  • Determining that the first transmission mechanism includes a forwarding mechanism includes: determining that the first transmission mechanism is a forwarding mechanism.
  • the forwarding mechanism includes: determining that the first transmission mechanism is a non-forwarding mechanism, or determining that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism;
  • the link quality parameter of the first secondary link meets the fourth preset condition, determine that the first transmission mechanism is a non-forwarding mechanism; or, if the link quality parameter of the first secondary link does not meet the third preset condition, determine The first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism; the non-forwarding mechanism includes a dual transmission mechanism or a monitoring mechanism;
  • the fourth preset condition includes: the signal strength of the first secondary link is less than the fourth preset signal strength, or the retransmission rate of the first secondary link is greater than the fourth preset retransmission rate, or the first secondary link
  • the packet loss rate of is greater than the fourth preset packet loss rate
  • the third preset signal strength is greater than the fourth preset signal strength
  • the third preset packet loss rate is less than the fourth preset packet loss rate
  • the third preset retransmission rate is less than the fourth preset retransmission rate
  • Determining that the first transmission mechanism includes a forwarding mechanism includes: determining that the first transmission mechanism is a forwarding mechanism.
  • the first transmission is selected according to the link quality parameter of the first main link and the link quality parameter of the second main link
  • the mechanism includes: if the link quality parameter of the first main link and the link quality parameter of the second main link meet the fifth preset condition, determining that the first transmission mechanism is a non-forwarding mechanism, or if the first main link The link quality parameter of the second main link and the link quality parameter of the second main link do not meet the fifth preset condition, and it is determined that the first transmission mechanism includes a forwarding mechanism;
  • Non-forwarding mechanisms include dual sending mechanism or monitoring mechanism
  • the first signal strength difference is the difference between the signal strength of the first main link and the signal strength of the second main link;
  • the first packet loss rate difference is the packet loss rate of the first main link and the second main link The difference between the packet loss rate of the link;
  • the first retransmission rate difference is the difference between the retransmission rate of the first main link and the retransmission rate of the second main link;
  • the fifth preset conditions include:
  • the first signal strength difference is less than the first preset signal strength difference, or
  • the first packet loss rate difference is less than the first preset packet loss rate difference, or
  • the first retransmission rate difference is less than the first preset retransmission rate difference.
  • the link quality parameter of the first main link and the link quality parameter of the second main link do not satisfy the fifth The preset condition determines that the first transmission mechanism includes a forwarding mechanism, including:
  • the first transmission mechanism is the forwarding mechanism, or if the link quality of the first main link
  • the parameters and the link quality parameters of the second main link do not meet the sixth preset condition, and it is determined that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism
  • the sixth preset condition includes:
  • the first signal strength difference is greater than the third preset signal strength difference, or
  • the first packet loss rate difference is greater than the third preset packet loss rate difference, or
  • the first retransmission rate difference is greater than the third preset retransmission rate difference
  • the first preset signal strength difference is less than the third preset signal strength difference; the first preset packet loss rate difference is less than the third preset packet loss rate difference; the first preset retransmission rate difference is less than the third The preset retransmission rate difference.
  • the selection of the forwarding mechanism according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link includes : If the link quality parameters of the first secondary link and the link quality parameters of the second primary link meet the seventh preset condition, determine that the first transmission mechanism is a forwarding mechanism or a non-forwarding mechanism; the non-forwarding mechanism includes a dual transmission mechanism Or monitoring mechanism;
  • the second signal strength difference is the difference between the signal strength of the first secondary link and the signal strength of the second primary link;
  • the second packet loss rate difference is the packet loss rate of the first secondary link and the second primary link The difference between the packet loss rate;
  • the second retransmission rate difference is the difference between the retransmission rate of the first secondary link and the retransmission rate of the second primary link;
  • the seventh preset conditions include:
  • the difference in the second signal strength is greater than the second preset signal strength difference, or
  • the difference in the second packet loss rate is greater than the difference in the second preset packet loss rate, or
  • the difference in the second retransmission rate is greater than the difference in the second preset retransmission rate.
  • the first transmission mechanism if the signal strength of the second primary link is greater than or equal to the signal strength of the first secondary link, the first transmission mechanism is determined It is a non-forwarding mechanism; or, if the signal strength of the second primary link is less than the signal strength of the first secondary link, it is determined that the first transmission mechanism is a forwarding mechanism.
  • the Bluetooth data is audio data
  • the first transmission mechanism is updated, or the rate of change of link quality parameters exceeds a predetermined rate, the first transmission mechanism is updated, or the first transmission mechanism is updated at a preset period. Transmission mechanism.
  • the reconnection signal is received or sent; the reception frequency of the reconnection signal is determined by the first main chain The link quality parameters of the first secondary link are determined; the reconnection signal is used to establish the second primary link.
  • the second aspect of the embodiments of the present application provides a data transmission method, including:
  • the dual transmission mechanism includes the second Bluetooth terminal receiving the Bluetooth data transmitted by the first Bluetooth terminal through the first main link;
  • the forwarding mechanism includes that the second Bluetooth terminal receives the Bluetooth data sent by the first Bluetooth terminal through the first main link, and the second Bluetooth terminal forwards part or all of the Bluetooth data to the third Bluetooth terminal through the first secondary link;
  • the monitoring mechanism includes that the second Bluetooth terminal receives the Bluetooth data transmitted by the first Bluetooth terminal through the first main link, and the Bluetooth data received by the second Bluetooth terminal through the first main link is monitored by the third Bluetooth terminal.
  • the first transmission mechanism before determining that the first transmission mechanism includes a forwarding mechanism, it includes:
  • the second bluetooth terminal receives the request forwarding command sent by the third bluetooth terminal, and the request forwarding command is used to request the second bluetooth terminal to transmit part or all of the bluetooth data to the third bluetooth terminal;
  • the second Bluetooth terminal judges whether to transmit part or all of the Bluetooth data to the third Bluetooth terminal according to one or both of the power or bandwidth occupancy rate of the second Bluetooth terminal.
  • the third aspect of the embodiments of the present application provides a data transmission method, including:
  • the dual transmission mechanism includes the third Bluetooth terminal receiving the Bluetooth data sent by the first Bluetooth terminal through the second main link;
  • the forwarding mechanism includes the third Bluetooth terminal receiving part or all of the Bluetooth data forwarded by the second Bluetooth terminal through the first secondary link;
  • the monitoring mechanism includes the third Bluetooth terminal monitoring the Bluetooth data sent by the first Bluetooth terminal to the second Bluetooth terminal through the first main link.
  • a fourth aspect of the embodiments of the present application provides a data transmission device, including:
  • the first determining module is configured to select the first transmission mechanism from at least two of the forwarding mechanism, the dual transmission mechanism and the monitoring mechanism according to the link quality parameter;
  • the first transmission module is configured to transmit Bluetooth data according to the first transmission mechanism
  • the first transmission module is configured to transmit Bluetooth data to the second Bluetooth terminal and the third Bluetooth terminal through the first main link and the second main link according to the dual transmission mechanism;
  • the first transmission module is also used to transmit Bluetooth data to the second Bluetooth terminal through the first main link according to the forwarding mechanism, and part or all of the Bluetooth data received by the second Bluetooth terminal is used to be forwarded by the second Bluetooth terminal through the first secondary link To the third Bluetooth terminal;
  • the first transmission module is also configured to transmit Bluetooth data to the second Bluetooth terminal through the first main link according to the monitoring mechanism, and the Bluetooth data transmitted by the first transmission module to the second Bluetooth terminal is monitored by the third Bluetooth terminal.
  • a fifth aspect of the embodiments of the present application provides a data transmission device, including:
  • the second determining module is configured to select the first transmission mechanism from at least two of the forwarding mechanism, the dual transmission mechanism and the monitoring mechanism according to the link quality parameter;
  • the second transmission module is configured to transmit Bluetooth data according to the first transmission mechanism
  • the second transmission module is configured to receive the Bluetooth data transmitted by the first Bluetooth terminal through the first main link according to the dual transmission mechanism;
  • the second transmission module is configured to receive the Bluetooth data sent by the first Bluetooth terminal through the first main link according to the forwarding mechanism, and the second transmission module is also configured to forward part or all of the Bluetooth data to the third Bluetooth terminal through the first secondary link;
  • the second transmission module is used to receive the Bluetooth data transmitted by the first Bluetooth terminal through the first main link according to the monitoring mechanism, and the Bluetooth data transmitted by the first Bluetooth terminal received by the second transmission module through the first main link is used by the third Bluetooth End monitoring.
  • a sixth aspect of the embodiments of the present application provides a data transmission device, including:
  • the third determining module is configured to select the first transmission mechanism from at least two of the forwarding mechanism, the dual transmission mechanism, and the monitoring mechanism according to the link quality parameter;
  • the third transmission module is used to transmit Bluetooth data according to the first transmission mechanism
  • the third transmission module is configured to receive the Bluetooth data sent by the first Bluetooth terminal through the second main link according to the dual transmission mechanism;
  • the third transmission module is configured to receive part or all of the Bluetooth data forwarded by the second Bluetooth terminal through the first secondary link according to the forwarding mechanism;
  • the third transmission module is used for monitoring the Bluetooth data sent by the first Bluetooth terminal to the second Bluetooth terminal through the first main link according to the monitoring mechanism.
  • the seventh aspect of the embodiments of the present application provides a chip for implementing a data transmission method, which is characterized in that it includes a memory and a processor;
  • the memory is coupled to the processor
  • Memory used to store program instructions
  • the processor is configured to call program instructions stored in the memory to make the chip execute the data transmission method of the first aspect, the second aspect, or the third aspect.
  • An eighth aspect of the embodiments of the present application provides an electronic device, including the chip provided in the seventh aspect.
  • a ninth aspect of the embodiments of the present application provides a computer-readable storage medium, including: a computer program is stored thereon, and when the computer program is executed by a processor, the data of the first aspect, second aspect, or third aspect described above is realized Transmission method.
  • the beneficial effect of the embodiments of the present application is that the embodiments of the present application provide a data transmission method, which determines the transmission mechanism according to the link quality, so as to avoid using a fixed transmission mechanism to change the link quality.
  • the problem of poor Bluetooth data quality occurs.
  • the transmission mechanism is determined according to the link quality. When the link quality changes, the determined transmission mechanism can be flexibly selected to transmit Bluetooth data to improve the quality of the transmitted Bluetooth data and enhance the user experience.
  • FIG. 1 is a flowchart of a data transmission method according to an embodiment of the application
  • FIG. 2 is a schematic diagram of a dual sending mechanism according to an embodiment of the application
  • FIG. 3 is a schematic diagram of a monitoring mechanism according to an embodiment of the application.
  • FIG. 4 is a schematic diagram of a forwarding mechanism according to an embodiment of the application.
  • FIG. 5 is a flowchart of a data transmission method according to an embodiment of the application.
  • FIG. 6 is a flowchart of determining the first transmission mechanism according to the link quality parameter of the second main link according to an embodiment of the application;
  • 6A is another flowchart of determining the first transmission mechanism according to the link quality parameter of the second main link according to an embodiment of the application;
  • FIG. 7 is another flowchart of determining the first transmission mechanism according to the link quality parameter of the second main link according to an embodiment of the application
  • FIG. 8 is still another flowchart of determining the first transmission mechanism according to the link quality parameter of the second main link according to an embodiment of the application;
  • FIG. 9 is a flowchart of determining the first transmission mechanism according to the link quality parameter of the first secondary link according to an embodiment of the application.
  • 9A is another flowchart of determining the first transmission mechanism according to the link quality parameter of the first secondary link according to an embodiment of the application;
  • FIG. 10 is another flowchart of determining the first transmission mechanism according to the link quality parameter of the first secondary link according to an embodiment of the application
  • FIG. 11 is a flowchart of determining the first transmission mechanism according to the link quality parameter of the first main link and the link quality parameter of the second main link according to an embodiment of the application;
  • FIG. 12 is another flowchart of determining the first transmission mechanism according to the link quality parameter of the first main link and the link quality parameter of the second main link according to an embodiment of the application;
  • FIG. 13 is a flowchart of determining the first transmission mechanism according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link according to an embodiment of the application;
  • FIG. 14 is another flowchart of determining the first transmission mechanism according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link according to an embodiment of the application;
  • 15 is a flowchart of switching from a non-forwarding mechanism to a forwarding mechanism according to an embodiment of the application;
  • FIG. 16 is a flowchart of switching a forwarding mechanism to a non-forwarding mechanism according to an embodiment of the application
  • FIG. 17 is a flowchart of determining whether to transmit Bluetooth data to a third Bluetooth terminal according to an embodiment of the application.
  • FIG. 18 is a schematic diagram of a data transmission device according to an embodiment of the application.
  • FIG. 19 is another schematic diagram of a data transmission device according to an embodiment of this application.
  • 20A is a schematic diagram of a switching module according to an embodiment of the application.
  • 20B is another schematic diagram of the switching module according to the embodiment of the application.
  • FIG. 21 is a schematic diagram of another data transmission device according to an embodiment of the application.
  • FIG. 22 is a schematic diagram of still another data transmission device according to an embodiment of the application.
  • FIG. 23 is a schematic diagram of still another data transmission device according to an embodiment of the application.
  • FIG. 24 is a schematic diagram of a chip according to an embodiment of the application.
  • the embodiment of the present application provides a data transmission method, which can be used to transmit various types of Bluetooth data, such as video data, instruction data, or audio data.
  • This embodiment uses audio data as an example for description.
  • the data transmission method provided in this embodiment can be used in a variety of smart devices with Bluetooth functions, such as earphones, speakers, mobile phones, smart watches, and so on.
  • the first bluetooth terminal can be used to transmit bluetooth data
  • the second bluetooth terminal and the third bluetooth terminal can be used to receive bluetooth data
  • the first bluetooth terminal, the second bluetooth terminal, and the third bluetooth terminal can be chips with bluetooth function
  • Components or electronic devices for example, the first Bluetooth terminal may be electronic devices that send Bluetooth data such as mobile phones, computers, and the second and third Bluetooth terminals may be electronic devices such as smart speakers and earphones that receive Bluetooth data.
  • the first Bluetooth terminal, the second Bluetooth terminal, and the third Bluetooth terminal can all use the BR (Basic Rate) Bluetooth protocol, that is, the first Bluetooth terminal, the second Bluetooth terminal, and the third Bluetooth terminal can all be Classic Bluetooth technology is used.
  • the first Bluetooth terminal, the second Bluetooth terminal, and the third Bluetooth terminal may also use EDR (Enhanced Data Rate) technology; in addition, in this embodiment, the first Bluetooth terminal, the second Bluetooth terminal, and the second Bluetooth terminal may also use EDR (Enhanced Data Rate) technology.
  • the Bluetooth terminal and the third Bluetooth terminal can also use the BLE (Bluetooth low energy, Bluetooth low energy) protocol.
  • the first Bluetooth terminal, the second Bluetooth terminal, and the third Bluetooth terminal can also be called the first BLE terminal and the third Bluetooth terminal, respectively.
  • the first Bluetooth terminal, the second Bluetooth terminal, and the third Bluetooth terminal can all support the classic Bluetooth protocol or the Bluetooth low energy protocol, or the first Bluetooth terminal, the second Bluetooth terminal, and the third Bluetooth terminal can simultaneously support the classic Bluetooth protocol and Bluetooth low energy protocol. Please refer to FIG. 1.
  • FIG. 1 is a flowchart of a data transmission method according to an embodiment of the present application. The method can be used for the first Bluetooth terminal, the second Bluetooth terminal, or the third Bluetooth terminal. The method includes the following steps:
  • Step S101 Select the first transmission mechanism according to the link quality parameter
  • Step S102 Transmit Bluetooth data according to the first transmission mechanism.
  • the link quality parameter can be understood as a parameter for evaluating the quality of the link.
  • the link in this embodiment can be understood as a synchronous link or an asynchronous link, and can also be understood as indicating that normal communication between Bluetooth devices is maintained.
  • the formed data interaction channel includes, but is not limited to, a link formed by establishing a connection in the Bluetooth protocol or a data channel formed by performing data interaction in other ways such as broadcasting. This embodiment does not limit the specific type of the link.
  • the link quality parameter may include one or more of the packet loss rate, signal strength, and retransmission rate, which is not limited in this embodiment.
  • the link quality parameter may also include parameters such as the received signal-to-noise ratio.
  • the signal strength of can be understood as a physical quantity that indicates the strength of the signal, for example, it can be the strength of the received signal, or the ratio of the received signal strength to the transmitted signal strength, or the ratio of the received power to the transmitted power.
  • the signal strength can usually be RSSI (Received Signal Strength Indication, received signal strength indication) indicates.
  • the first transmission mechanism needs to be determined according to the link quality, for example, according to the link quality parameter of the second primary link, the link quality parameter of the first secondary link, and the link quality of the first primary link At least two of the parameters determine the first transmission mechanism.
  • the first transmission mechanism can be determined based on the link quality parameter of the first main link and the link quality parameter of the second main link, or it can be based on the first secondary link.
  • the link quality parameters of the second main link and the link quality parameters of the second main link determine the first transmission mechanism, and the first transmission mechanism is selected according to at least two link quality parameters, which can facilitate comprehensive analysis of the link quality, so that the determined The first transmission mechanism is more accurate and can improve the success rate of Bluetooth data transmission.
  • the first transmission mechanism is determined according to the link quality parameters of the first primary link, the second primary link, and the first secondary link, more links are considered, which can significantly improve the success of Bluetooth data transmission. For example, when the link quality of the three links is good, the link quality can be compared with each other to determine the first transmission mechanism.
  • the first transmission mechanism in this embodiment includes one or both of a forwarding mechanism and a non-forwarding mechanism. That is, the transmission mechanism can be a forwarding mechanism or a non-forwarding mechanism, or it can maintain both the forwarding mechanism and the non-forwarding mechanism at the same time.
  • selecting the first transmission mechanism can also be understood as determining the first transmission mechanism. For example, in at least two transmission mechanisms from the forwarding mechanism, the dual transmission mechanism, and the monitoring mechanism, the forwarding mechanism is selected according to the link quality parameter, One or more of the dual transmission mechanism and the monitoring mechanism transmit Bluetooth data.
  • Non-forwarding mechanisms include dual-transmitting mechanisms or monitoring mechanisms.
  • the first transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism.
  • the first transmission mechanism may be one or two of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism; a dual transmission mechanism
  • the first Bluetooth terminal sends Bluetooth data to the second Bluetooth terminal and the third Bluetooth terminal, that is, there is a link between the first Bluetooth terminal and the second Bluetooth terminal, which can be called the first Bluetooth terminal.
  • the main link There is also a link between the first Bluetooth terminal and the third Bluetooth terminal, which can be called the second main link.
  • the first Bluetooth terminal sends Bluetooth data to the second Bluetooth terminal through the first main link.
  • Bluetooth terminal sends Bluetooth data to a third Bluetooth terminal through the second main link.
  • Bluetooth data can be understood as audio data.
  • Bluetooth data can be complete audio data, or left-channel or right-channel audio data.
  • the first Bluetooth terminal sends The Bluetooth data of the second Bluetooth terminal may be audio data of the right channel
  • the Bluetooth data sent by the first Bluetooth terminal to the third Bluetooth terminal may be audio data of the left channel.
  • the first main link and the second main link shown in FIG. 2 are shown with double arrows. It can be understood that the first main link and the second main link are used for sending Bluetooth from the first Bluetooth terminal, respectively.
  • the data can also be used for the second and third Bluetooth terminals to send data information to the first Bluetooth terminal.
  • the terminal sends a response message to the first bluetooth terminal to indicate whether the second bluetooth terminal and the third bluetooth terminal receive the bluetooth data.
  • the monitoring mechanism is shown in Figure 3. It can be understood that the first Bluetooth terminal sends Bluetooth data to the second Bluetooth terminal through the first main link, and the Bluetooth data is monitored by the third Bluetooth terminal.
  • a second secondary link can also be established to transmit command information, such as synchronization information or key information.
  • the second Bluetooth terminal can transmit the key information of Bluetooth data to the third Bluetooth through the second secondary link.
  • the third Bluetooth terminal can decrypt the specific information of the monitored Bluetooth data; the synchronization information is used to achieve synchronization between the second Bluetooth terminal and the third Bluetooth terminal, for example, to ensure that the left and right earphones are playing. In, the data played at the same time is consistent.
  • the first transmission mechanism can be a monitoring mechanism.
  • the first Bluetooth terminal, the second Bluetooth terminal or the third Bluetooth terminal is When either end does not support the monitoring mechanism, the first transmission mechanism can be a dual transmission mechanism, which can improve the compatibility and flexibility of the device.
  • the forwarding mechanism is shown in Figure 4, which can be understood as that the first Bluetooth terminal transmits Bluetooth data to the second Bluetooth terminal, and the Bluetooth data received by the second Bluetooth terminal is forwarded by the second Bluetooth terminal to the third Bluetooth terminal.
  • the first Bluetooth end and the second Bluetooth end which can be called the first main link.
  • the first main link is used by the first Bluetooth end to transmit Bluetooth data to the second Bluetooth end.
  • the second Bluetooth terminal forwards the Bluetooth data to the third Bluetooth terminal through the first secondary link, for example, audio Data or response message.
  • the Bluetooth data forwarded by the second Bluetooth terminal to the third Bluetooth terminal can be complete audio data, or left-channel or right-channel audio data, that is, it can also be part of Bluetooth. data.
  • the Bluetooth data sent by the first Bluetooth terminal to the second Bluetooth terminal can be complete audio data
  • the Bluetooth data forwarded by the second Bluetooth terminal to the third Bluetooth terminal can be left channel audio data.
  • the Bluetooth terminal can complete the separation of Bluetooth data.
  • the forwarding mechanism when the forwarding mechanism is adopted, when the quality of the link between the first Bluetooth terminal and the second Bluetooth terminal is better than the quality of the link between the first Bluetooth terminal and the third Bluetooth terminal, the second Bluetooth terminal is used.
  • the Bluetooth end is used as a forwarding end, which can make data transmission more stable.
  • the signal strength of the first main link is higher than the signal strength of the second main link, or the retransmission rate of the first main link is lower than that of the second main link.
  • the retransmission rate of the link, or when the packet loss rate of the first main link is lower than the packet loss rate of the second main link, the second Bluetooth end may be selected as the forwarding end.
  • the second main link between the first Bluetooth terminal and the third Bluetooth terminal may not exist, that is, the first Bluetooth terminal and the third Bluetooth terminal may not directly exchange information. In the forwarding mechanism, this embodiment only uses the second Bluetooth terminal as the forwarding terminal as an example.
  • the Bluetooth terminal receiving the Bluetooth data can be used as the forwarding terminal.
  • the first Bluetooth terminal, the second Bluetooth terminal, and the third Bluetooth terminal are used as examples for description, but it is understandable that this solution is applicable to scenarios with any number of Bluetooth terminals.
  • the first Bluetooth terminal may determine the first transmission mechanism according to the link quality parameter, or the second Bluetooth terminal or the third Bluetooth terminal may select the first transmission mechanism according to the link quality parameter.
  • the first Bluetooth terminal selects the first transmission mechanism according to the link quality parameters, power consumption can be saved, because generally speaking, the second Bluetooth terminal or the third Bluetooth terminal is a miniaturized device or a portable device, and the battery capacity is relatively small. Therefore, if the first Bluetooth terminal selects the first transmission mechanism, it will save the power consumption of the second and third Bluetooth terminals.
  • the first Bluetooth terminal can The first transmission mechanism is notified to the second Bluetooth terminal and the third Bluetooth terminal to realize the cooperation of the three to complete the transmission of Bluetooth data.
  • the Bluetooth data is transmitted according to the determined first transmission mechanism. It can be understood as using the determined first transmission mechanism to transmit Bluetooth data.
  • the first transmission mechanism that is determined can be a forwarding mechanism, a dual-transmit mechanism, or a monitoring mechanism, or the coexistence of the forwarding mechanism and the dual-transmission mechanism, or the coexistence of the forwarding mechanism and the monitoring mechanism.
  • the embodiment of the present application provides a data transmission method.
  • the first transmission mechanism is determined according to the link quality, so as to avoid using a fixed transmission mechanism to prevent the Bluetooth data quality from deteriorating when the link quality changes.
  • the first transmission mechanism is determined according to the link quality parameter.
  • a transmission mechanism, when the link quality changes, the corresponding mechanism can be flexibly selected to transmit Bluetooth data, so as to improve the quality of the Bluetooth data and enhance the user experience.
  • the Bluetooth data in the first time period, is transmitted according to the second transmission mechanism, and in the second time period, the Bluetooth data is transmitted according to the first transmission mechanism; as shown in FIG. 5, this
  • the data transmission method provided by the embodiment includes:
  • Step S501 In the first time period, transmit Bluetooth data according to the second transmission mechanism
  • Step S502 Select the first transmission mechanism according to the link quality parameter
  • Step S503 In the second time period, the Bluetooth data is transmitted according to the first transmission mechanism.
  • the second transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism.
  • the second transmission mechanism can be understood as the initial state of the transmission mechanism, that is, the default transmission mechanism, or the transmission mechanism at the previous moment.
  • the second transmission mechanism can be defaulted to be a forwarding mechanism, or a dual transmission mechanism, or a monitoring mechanism Wait.
  • the second transmission mechanism can be switched to the first transmission mechanism to adapt to the change in link quality.
  • the selection of the first transmission mechanism according to the link quality parameter may be periodic, that is, whether the second transmission mechanism needs to be switched is periodically inquired. When the link quality changes quickly, the query cycle becomes shorter.
  • step S501 in the first time period, Bluetooth data is transmitted according to the second transmission mechanism, and the first time period is The first half of the data packet of the Bluetooth data can be transmitted. After the second transmission mechanism is switched to the first transmission mechanism, the Bluetooth data can be continuously transmitted according to the first transmission mechanism, that is, the second half of the data packet of the Bluetooth data is transmitted.
  • the link quality parameter includes one or more of packet loss rate, signal strength, and retransmission rate.
  • the link quality parameter of the first main link can be understood as the first main link.
  • a link quality parameter between the bluetooth terminal and the second bluetooth terminal, the link quality parameter of the second main link can be understood as the link quality parameter between the first bluetooth terminal and the third bluetooth terminal, the first secondary link
  • the link quality parameter of the road can be understood as the link quality parameter between the second Bluetooth terminal and the third Bluetooth terminal.
  • the signal strength of the first main link is greater than or equal to the signal strength of the second main link, or the packet loss rate of the first main link is less than or equal to the packet loss rate of the second main link, or the packet loss rate of the first main link
  • the retransmission rate is less than or equal to the retransmission rate of the second main link; in this embodiment, the link quality of the first main link is higher than the link quality of the second main link.
  • the first Bluetooth terminal transmits the Bluetooth data to the second Bluetooth terminal through the first main link with higher link quality, which can improve the transmission success rate of the Bluetooth data.
  • determining the first transmission mechanism according to the link quality parameter includes: according to the link quality parameter of the second primary link, the link quality parameter of the first secondary link, and the link quality parameter of the first primary link One or more of determine the first transmission mechanism.
  • the link quality parameter can determine which transmission mechanism is suitable for the link quality at this time.
  • the non-forwarding mechanism can be selected as the first transmission mechanism, that is, the dual transmission mechanism Or a monitoring mechanism can be used.
  • the forwarding mechanism may be selected, that is, the first transmission mechanism may be a forwarding mechanism.
  • determining the first transmission mechanism according to the link quality parameter includes: determining the first transmission mechanism according to the link quality parameter of the second main link.
  • the second main link is used to transmit Bluetooth data between the first Bluetooth terminal and the third Bluetooth terminal. If the link quality of the second main link is good, a non-forwarding mechanism can be used, such as a dual transmission mechanism or a monitoring mechanism If the link quality of the second main link is poor, it indicates that the communication between the third Bluetooth terminal and the first Bluetooth terminal may be abnormal.
  • the forwarding mechanism can be selected, that is, the first transmission mechanism is the forwarding mechanism, so that
  • the second Bluetooth terminal can also receive part or all of the Bluetooth data, that is, the source of the Bluetooth data of the third Bluetooth terminal is the second Bluetooth terminal, which can ensure that the three can communicate normally. Since no matter what the mechanism is, there is a Bluetooth terminal connected to the first Bluetooth terminal.
  • the first main link between the first Bluetooth terminal and the second Bluetooth terminal is used as an example. When the link quality of the second main link is higher than that of the second main link, the link quality of the second main link can be judged to determine which one or two of the forwarding mechanism and the non-forwarding mechanism are selected as the first transmission mechanism .
  • determining the first transmission mechanism according to the link quality parameter includes: determining the first transmission mechanism according to the link quality parameter of the first secondary link.
  • the first secondary link is used for the second Bluetooth terminal to forward Bluetooth data to the third Bluetooth terminal. If the link quality of the first secondary link is good, the forwarding mechanism can be used. If the link quality of the link is poor , You can use a non-forwarding mechanism, for example, a dual send mechanism or a monitoring mechanism. Since no matter what the mechanism is, there is a Bluetooth terminal connected to the first Bluetooth terminal. In this embodiment, the first main link between the first Bluetooth terminal and the second Bluetooth terminal is used as an example. When the link quality of is higher than the second primary link, the link quality of the first secondary link can be judged to determine which one or two of the forwarding mechanism and the non-forwarding mechanism are selected as the first transmission mechanism .
  • selecting the first transmission mechanism according to the link quality parameter of the second primary link includes the following steps:
  • Step S601 Determine whether the link quality parameter of the second main link meets the first preset condition; if the link quality parameter of the second main link meets the first preset condition, perform step S601A;
  • Step S601A Determine that the first transmission mechanism includes a non-forwarding mechanism
  • the first transmission mechanism includes a non-forwarding mechanism.
  • the first preset condition includes: the signal strength of the second main link is greater than or equal to the first preset signal strength, or the retransmission rate of the second main link is less than or equal to the first preset retransmission rate, or the second The packet loss rate of the main link is less than or equal to the first preset packet loss rate.
  • the signal strength of the second main link is greater than the first preset signal strength, it indicates that the link quality of the second main link is better.
  • the first preset signal The strength may indicate the signal strength of the second main link when Bluetooth data can be received normally, for example, the signal strength of the second main link when the success rate of receiving Bluetooth data is greater than 99%. It is understandable that the signal strength of the second main link is related to the attenuation value of the signal strength when Bluetooth data is received. When Bluetooth data is received, the more the signal strength attenuates, the greater the signal strength of the second main link. Weak, so the success rate of successfully receiving Bluetooth data is smaller.
  • the first preset signal strength can also be expressed as the signal power of the Bluetooth data when the Bluetooth data can be received normally.
  • the first transmission mechanism may include a non-forwarding mechanism to smoothly transmit data.
  • the first transmission mechanism includes a non-forwarding mechanism to ensure the smooth reception of Bluetooth data.
  • the link quality of the second main link is good, the second main link tends to be used to transmit Bluetooth data. Therefore, the first transmission mechanism may include a non-forwarding mechanism to smoothly transmit data.
  • the specific data of the first preset retransmission rate and the first preset packet loss rate are not limited, and any value can be selected according to user needs or scenarios, for example, when the requirements for the reception quality of Bluetooth data are relatively high , You can select both the first preset retransmission rate and the first preset packet loss rate to be 3%.
  • the second transmission mechanism When the second transmission mechanism is the same as the current first transmission mechanism, the second transmission mechanism may not be converted to the first transmission mechanism, that is, the original second transmission mechanism may be maintained. When the second transmission mechanism is different from the current first transmission mechanism, the second transmission mechanism can be switched to the first transmission mechanism. Since no matter what the mechanism is, there is a Bluetooth terminal connected to the first Bluetooth terminal.
  • the first main link between the first Bluetooth terminal and the second Bluetooth terminal is used as an example.
  • the specific mechanism of the first transmission mechanism is determined by judging the link quality of the second main link.
  • the first transmission mechanism includes a non-forwarding mechanism.
  • the first transmission mechanism may be a forwarding mechanism and a non-forwarding mechanism in parallel, that is, the first transmission mechanism may be a forwarding mechanism and a monitoring mechanism, or the first transmission mechanism It can also be a forwarding mechanism and a dual sending mechanism.
  • the source of the Bluetooth data of the third Bluetooth terminal is not only the second Bluetooth terminal, but also the first Bluetooth terminal.
  • This parallel method of using the forwarding mechanism and the non-forwarding mechanism can make the 3. The success rate of Bluetooth data received by the Bluetooth terminal is higher.
  • the first transmission mechanism includes a non-forwarding mechanism.
  • the first transmission mechanism may be a non-forwarding mechanism, that is, the Bluetooth data is only transmitted according to the dual transmission mechanism or the listening mechanism.
  • the link quality of the second main link is good, avoid using the forwarding mechanism.
  • it can ensure the successful transmission of Bluetooth data.
  • it saves power consumption than the parallel scheme of forwarding mechanism and non-forwarding mechanism.
  • the first Bluetooth terminal transmits Bluetooth data to the third Bluetooth terminal through the second main link, and the second main link with better link quality is used to transmit Bluetooth data, which is beneficial Successfully receive data; when the monitoring mechanism is selected, there is no second main link, and the third Bluetooth end monitors the Bluetooth data sent by the first Bluetooth end to the second Bluetooth end. Although there is no second main link, the second main link When the signal strength of is higher than the second preset value, it is also conducive to the success of monitoring, the monitoring effect is better, and it can ensure that the Bluetooth data can be monitored normally.
  • step S602 is the same as or similar to step S601 in the foregoing embodiment, and will not be repeated here.
  • step S601B may be performed: determining that the first transmission mechanism includes Forwarding mechanism.
  • the first transmission mechanism may be a forwarding mechanism and a monitoring mechanism, or the first transmission mechanism may be a forwarding mechanism and a double-transmitting mechanism, so that the success rate of Bluetooth data transmission is higher.
  • the first transmission mechanism may be a forwarding mechanism, as shown in FIG. 6A
  • Middle step S602B Determine that the first transmission mechanism is the forwarding mechanism; in this way, when the link quality of the second main link is poor, the successful transmission of Bluetooth data can also be guaranteed.
  • the link quality parameter of the second main link When the first preset condition is not met, compared to the solution in which the forwarding mechanism and the non-forwarding mechanism are executed in parallel, the use of the forwarding mechanism only saves power consumption.
  • the first preset signal strength can be set to the signal strength of the first secondary link, that is, if the signal strength of the second primary link is greater than the signal strength of the first secondary link, it is determined that the first transmission mechanism is Non-forwarding mechanism, when the link quality of the second primary link is better than the link quality of the first secondary link, select the non-forwarding mechanism to make full use of the second primary link with better link quality .
  • the first preset retransmission rate may also be set to the retransmission rate of the first secondary link
  • the first preset packet loss rate may also be set to the packet loss rate of the first secondary link.
  • the signal strength, retransmission rate, or packet loss rate of the first secondary link can all be obtained through testing, that is, can be calculated from the current communication data.
  • the first transmission mechanism is selected by comparing the link quality of the first primary link and the first secondary link, which can adapt to the continuous changes of the link and improve the user experience.
  • selecting the first transmission mechanism according to the link quality parameter of the second primary link includes the following steps:
  • Step S701 Determine whether the link quality parameter of the second main link meets the first preset condition; if the link quality parameter of the second main link meets the first preset condition, perform step S701A; if the second main link If the link quality parameter of the road does not meet the first preset condition, step S702 is executed;
  • Step S701A Determine that the first transmission mechanism is a non-forwarding mechanism
  • Step S702 Determine whether the link quality parameter of the second main link meets the second preset condition; if the link quality parameter of the second main link meets the second preset condition, perform step S702A; if the second main link If the link quality parameter of the road does not meet the second preset condition, step S702B is executed;
  • S702A Determine that the first transmission mechanism is a forwarding mechanism
  • S702B Determine that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism.
  • steps S701 and S701A are the same as or similar to steps S601 and S601A in the foregoing embodiment, and will not be repeated here.
  • the second preset condition includes: the signal strength of the second main link is less than the second preset signal strength, or the retransmission rate of the second main link is greater than the second preset retransmission rate, or the signal strength of the second main link
  • the packet loss rate is greater than the second preset packet loss rate.
  • the first preset signal strength is greater than the second preset signal strength
  • the first preset retransmission rate is less than the second preset retransmission rate
  • the first preset packet loss rate is less than the second preset packet loss rate.
  • the first transmission mechanism can be a forwarding mechanism, avoiding the use of non-forwarding
  • the mechanism reduces the success rate of Bluetooth data transmission.
  • the link quality parameter of the second main link does not satisfy the first preset condition or the second preset condition, it means that the link quality of the second main link is average.
  • the first transmission mechanism is forwarding.
  • Mechanism and non-forwarding mechanism can improve the success rate of Bluetooth data transmission. In this embodiment, it is determined whether the second main link satisfies the first preset condition and the second preset condition is periodic, and the first transmission mechanism is updated in a timely manner.
  • selecting the first transmission mechanism according to the link quality parameter of the second main link may include the following steps:
  • Step S801 Determine whether the signal strength of the second main link is greater than or equal to the first preset signal strength; if it is greater than or equal to the first preset signal strength, perform step S801A; if it is less than the first preset signal strength, perform Step S802;
  • Step S801A Determine that the first transmission mechanism is a non-forwarding mechanism
  • Step S802 Determine whether the signal strength of the second main link is less than the second preset signal strength; if it is less than the second preset signal strength, execute step S802A; if it is not less than the second preset signal strength, execute step S802B;
  • Step S802A Determine that the first transmission mechanism is a forwarding mechanism
  • Step S802B Determine that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism.
  • the first transmission mechanism when the link quality of the second main link is good, for example, the signal strength of the second main link is higher than the first preset signal strength, the first transmission mechanism may be a non-forwarding mechanism.
  • the link quality of the second main link is poor, for example, if the signal strength of the second main link is lower than the second preset signal strength, the first transmission mechanism may be a forwarding mechanism.
  • the channel quality is normal, for example, when the signal strength of the second main link is lower than the first preset signal strength but higher than the second preset signal strength, the first transmission mechanism can be a forwarding mechanism and a non-forwarding mechanism in parallel.
  • the Bluetooth data of the third Bluetooth terminal has two sources to improve the success rate of the third Bluetooth terminal to receive Bluetooth data.
  • there can be a suitable first transmission mechanism which can adapt to the change of the link quality of the second main link.
  • the first preset retransmission rate is less than the second preset retransmission rate and the first preset packet loss rate is less than the second preset packet loss rate, which will not be repeated here.
  • the second preset signal strength can represent the lowest threshold of signal strength when Bluetooth data can be received normally, and can also be understood as the signal power of Bluetooth data when Bluetooth data can be received normally The lowest threshold.
  • the specific value of the second preset signal strength is not limited.
  • the second preset signal strength can be selected according to user needs or scenarios.
  • the second preset retransmission rate and the second preset packet loss rate are the same. , I won’t repeat it here.
  • the first preset signal strength and the second preset signal strength are set, which can clearly distinguish whether the first transmission mechanism is a forwarding mechanism or a non-forwarding mechanism.
  • the forwarding mechanism and the non-forwarding mechanism can be used at the same time, or only any one of the forwarding mechanism and the non-forwarding mechanism can also be used.
  • selecting the first transmission mechanism according to the link quality parameter of the first secondary link includes the following steps:
  • S901 Determine whether the link quality parameter of the first secondary link meets the third preset condition; if the link quality parameter of the first secondary link meets the third preset condition, perform step S901A;
  • S901A Determine that the first transmission mechanism includes a forwarding mechanism.
  • the link quality of the first secondary link is good, it means that the second Bluetooth terminal can transmit the Bluetooth data to the third Bluetooth terminal through the first secondary link.
  • the link quality of the first secondary link is poor
  • a non-forwarding mechanism can be selected to avoid transmitting Bluetooth data according to the first secondary link.
  • the third preset condition includes: the signal strength of the first secondary link is higher than the third preset signal strength, and when the signal strength of the first secondary link is higher than the third preset signal strength, it indicates the link of the first secondary link If the channel quality is better, the forwarding mechanism can be selected to use the first secondary link to transmit all or part of the Bluetooth data.
  • the third preset condition further includes that the retransmission rate of the first secondary link is lower than the third preset retransmission rate, or the packet loss rate of the first secondary link is lower than the third preset packet loss rate.
  • the retransmission rate of the first secondary link is lower than the third preset retransmission rate, or the packet loss rate of the first secondary link is lower than the third preset packet loss rate, it indicates the link of the first secondary link The quality is better.
  • the first transmission mechanism can include a forwarding mechanism.
  • the first transmission mechanism can be a forwarding mechanism and a non-forwarding mechanism in parallel, that is, the first transmission mechanism can be a forwarding mechanism and a monitoring mechanism, and the first transmission mechanism can also be a forwarding mechanism.
  • Mechanism and dual sending mechanism can be used to transmit the first secondary link.
  • the source of the Bluetooth data of the third Bluetooth terminal is not only the second Bluetooth terminal, but also the first Bluetooth terminal.
  • This parallel method of using forwarding mechanism and non-forwarding mechanism can make the third Bluetooth terminal receive
  • the success rate to Bluetooth data is higher.
  • the third preset signal strength indicates the signal strength that can normally receive Bluetooth data, and can also be understood as the signal power that can normally receive Bluetooth data.
  • the value of the specific third preset signal strength is not limited, and the third preset signal strength can be selected according to user needs or scenarios.
  • the third preset retransmission rate and the third preset packet loss rate are the same. , I won’t repeat it here.
  • the first transmission mechanism may include a forwarding mechanism.
  • the first transmission mechanism may be a forwarding mechanism, that is, transmission only depends on the first primary link and the first secondary link.
  • the forwarding mechanism For Bluetooth data, when the link quality of the first secondary link is good, only the forwarding mechanism is used. On the one hand, it can ensure the successful transmission of Bluetooth data. On the other hand, it saves power consumption than the parallel forwarding mechanism and non-forwarding mechanism.
  • Step S902 in FIG. 9A is the same as or similar to step S901 in the foregoing embodiment, and will not be repeated here.
  • step S901B may be performed: determining that the first transmission mechanism includes Non-forwarding mechanism.
  • the first transmission mechanism may be a forwarding mechanism and a monitoring mechanism in parallel, or the first transmission mechanism may be a forwarding mechanism and a dual-transmitting mechanism in parallel, so as to increase the success rate of the third Bluetooth terminal receiving Bluetooth data.
  • the first transmission mechanism may be a forwarding mechanism and a monitoring mechanism in parallel, or the first transmission mechanism may be a forwarding mechanism and a dual-transmitting mechanism in parallel, so as to increase the success rate of the third Bluetooth terminal receiving Bluetooth data.
  • the first transmission mechanism may be a non-forwarding mechanism, that is, the first transmission mechanism may be a monitoring mechanism or a dual-transmitting mechanism, instead of using a forwarding mechanism, in the chain of the first secondary link
  • the forwarding mechanism may be a monitoring mechanism or a dual-transmitting mechanism, instead of using a forwarding mechanism, in the chain of the first secondary link
  • the third preset signal strength can be set to the signal strength of the second main link, that is, when the signal strength of the first secondary link is higher than the signal strength of the second main link, the first The transmission mechanism is a forwarding mechanism, so that the first secondary link with good link quality can be fully utilized to transmit Bluetooth data to the third Bluetooth terminal, so as to improve the success rate of Bluetooth data transmission.
  • the third preset packet loss rate may be set as the packet loss rate of the second main link
  • the third preset retransmission rate may be set as the retransmission rate of the second main link.
  • the signal strength, retransmission rate, or packet loss rate of the second main link can be obtained through testing, that is, can be calculated from the current communication data.
  • the first transmission mechanism is selected by comparing the link quality of the first secondary link and the second primary link, which can adapt to the continuous changes of the link and improve the user experience.
  • the first Bluetooth terminal is the mobile phone
  • the second Bluetooth terminal is the right earphone
  • the third Bluetooth terminal is the left earphone
  • the Bluetooth data is audio data.
  • the mobile phone transmits audio data to the left and right earphones respectively.
  • the transmission mechanism used in the initial state is the dual-transmission mechanism.
  • the channel quality is better, that is, the signal strength of the first secondary link is higher than the third preset signal strength, or the retransmission rate of the first secondary link is lower than the third preset retransmission rate, or the first secondary link is If the packet loss rate of the channel is lower than the third preset packet loss rate, it indicates that the audio data can be transmitted normally between the left and right ears.
  • the first transmission mechanism can include a forwarding mechanism.
  • the dual transmission mechanism can be turned off and select Forwarding mechanism. Specifically, the left earphone can send a command request to the right earphone, and the command request is used to request the right earphone to forward audio data to itself.
  • the right earphone After the right earphone receives the command request from the left earphone, it can forward the audio data to the left earphone, so that the left earphone can also obtain the audio data and play it normally, or after obtaining the audio data, it can be further synchronized to obtain a change. Good playback quality.
  • the right earphone can judge whether it supports the forwarding mechanism, that is, the right earphone judges whether it can forward audio data to the left earphone.
  • the current power or transmission rate of the second Bluetooth terminal may not be suitable for using the forwarding mechanism, for example, the power of the second Bluetooth terminal is too low to support the forwarding mechanism or not enough to maintain the forwarding mechanism within a predetermined period of time.
  • the second Bluetooth terminal is already performing data interaction with the first Bluetooth terminal, and the transmission rate is relatively high, and it already occupies a part of the bandwidth resources, and the remaining bandwidth resources are not enough to support the forwarding mechanism. Therefore, the right earphone can choose to accept or reject the request of the left earphone according to its own bandwidth occupancy rate or power consumption.
  • the audio data is forwarded to the left earphone, and if the right earphone rejects the request of the left earphone, then a rejection message is sent to the left earphone.
  • the synchronization between the left and right earphones can be stopped, and the left and right ears can play audio data independently without affecting each other.
  • synchronization can also be rejected, that is, after the right earphone forwards audio data to the left earphone, the left earphone plays directly without performing synchronization operations.
  • synchronization can also be performed. For example, if the right earphone accepts the request of the left earphone, it can be ensured that the right earphone transmits audio data to the left earphone and the left earphone synchronizes the audio data when the original left and right earphones maintain synchronization. Play afterwards.
  • the right earphone forwards audio data to the left earphone, that is, when the forwarding mechanism is selected, during the audio forwarding process of the right earphone, you can also inquire whether the first transmission mechanism needs to be updated, that is, to re-determine the first transmission mechanism, specifically, the left earphone You can periodically query the link quality between yourself and the mobile phone.
  • the link quality parameter of the second main link meets the first preset condition
  • the first transmission mechanism is determined to be a non-forwarding mechanism, that is, when the left earphone and the mobile phone are connected
  • the first transmission mechanism is switched to a non-forwarding mechanism, the right earphone stops forwarding audio data to the left earphone, and the left earphone obtains audio data from the mobile phone.
  • the first transmission mechanism is switched to adopt a dual transmission mechanism. On the one hand, it avoids the use of the forwarding mode all the time, which makes the power of the second Bluetooth terminal quickly run out; in addition, the continuous update of the first transmission mechanism can also be more adapted to changes in the quality of the link.
  • selecting the first transmission mechanism according to the link quality parameter of the first secondary link includes the following steps:
  • Step S1001 Determine whether the link quality parameter of the first secondary link meets the third preset condition; if the link quality parameter of the first secondary link meets the third preset condition, perform step S1001A; if the first secondary link If the link quality parameter of the road does not meet the third preset condition, step S1002 is executed;
  • Step S1001A Determine that the first transmission mechanism is a forwarding mechanism
  • Step S1002 Determine whether the link quality parameter of the first secondary link meets the fourth preset condition; if the link quality parameter of the first secondary link meets the fourth preset condition, perform step S1002A; if the first secondary link If the link quality parameter of the road does not meet the fourth preset condition, step S1002B is executed;
  • S1002A Determine that the first transmission mechanism is a non-forwarding mechanism
  • S1002B Determine that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism
  • step S1001 and step S1001A are the same as or similar to steps S901 and S901A in the foregoing embodiment, and will not be repeated here.
  • the fourth preset condition includes: the signal strength of the first secondary link is less than the fourth preset signal strength, or the retransmission rate of the first secondary link is greater than the fourth preset retransmission rate, or the loss of the first secondary link
  • the packet rate is greater than the fourth preset packet loss rate.
  • the third preset signal strength is greater than the fourth preset signal strength; the third preset packet loss rate is less than the fourth preset packet loss rate; the third preset retransmission rate is less than the fourth preset retransmission rate.
  • the first transmission mechanism can be a non-forwarding mechanism, avoiding the use of forwarding
  • the mechanism reduces the success rate of Bluetooth data transmission.
  • the link quality parameter of the second main link does not meet the third preset condition or the fourth preset condition, it means that the link quality of the second main link is average.
  • the first transmission mechanism is forwarding.
  • Mechanism and non-forwarding mechanism can improve the success rate of Bluetooth data transmission. In this embodiment, it is determined whether the second main link satisfies the third preset condition or the fourth preset condition is periodic, and the first transmission mechanism is updated in time.
  • the fourth preset signal strength may represent the lowest threshold of signal strength that can normally receive Bluetooth data, and can also be understood as the lowest threshold of signal power that can normally receive Bluetooth data.
  • the value of the specific fourth preset signal strength is not limited.
  • the fourth preset signal strength can be selected according to user needs or scenarios.
  • the fourth preset retransmission rate and the fourth preset packet loss rate are the same. .
  • the third preset condition and the fourth preset condition are set to clearly distinguish the case where the first transmission mechanism is the forwarding mechanism or the non-forwarding mechanism.
  • the forwarding mechanism and the non-forwarding mechanism can be used at the same time, and in addition, any one of the forwarding mechanism or the non-forwarding mechanism can also be used.
  • selecting a transmission mechanism according to the link quality parameter further includes: determining the first transmission according to the link quality parameter of the first main link and the link quality parameter of the second main link mechanism.
  • determining the first transmission mechanism according to the link quality parameter further includes: selecting and determining the first transmission mechanism according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link.
  • selecting and determining the first transmission mechanism according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link With reference to the link quality of the first secondary link and the link quality of the second primary link at the same time, it is possible to more accurately evaluate which first transmission mechanism is used to ensure the quality of data transmission. For example, when the link quality of the first secondary link is better than the link quality of the second primary link, a forwarding mechanism can be selected to transmit Bluetooth data through the first secondary link.
  • the selection of the first transmission mechanism according to the link quality parameter of the first main link and the link quality parameter of the second main link includes the following step:
  • Step S1101 Determine whether the link quality parameters of the first main link and the second main link meet the fifth preset condition; if the link quality parameters of the first main link and the link quality parameters of the second main link If the fifth preset condition is met, step S1101A is performed; if the link quality parameter of the first main link and the link quality parameter of the second main link do not meet the fifth preset condition, step S1101B is performed;
  • Step S1101A Determine that the first transmission mechanism is a non-forwarding mechanism
  • Step S1101B Determine that the first transmission mechanism includes a forwarding mechanism.
  • the fifth preset condition includes: the first signal strength difference is less than the first preset signal strength difference, and the first signal strength difference is the difference between the signal strength of the first main link and the signal strength between the second main link Difference.
  • the first signal strength difference is less than the first preset signal strength difference
  • the signal strength of the first main link has a small difference from the signal strength of the second main link.
  • the link quality of the first main link is lower Hershey, if a non-forwarding mechanism is used, the second Bluetooth terminal or the third Bluetooth terminal can successfully obtain Bluetooth data. Therefore, the first transmission mechanism can be a dual transmission mechanism or a monitoring mechanism.
  • the first preset signal strength difference can be understood as the difference between the signal strength when the first main link and the second main link can just receive Bluetooth data, the first preset signal strength The difference can also be selected according to user needs and scenarios.
  • the difference between the first preset signal packet loss rate and the first preset retransmission rate are the same, and this embodiment does not limit this.
  • the link quality parameter of the first main link and the link quality parameter of the second main link do not meet the fifth preset condition, if the non-forwarding mechanism is used, due to the difference between the first main link and the second main link
  • the link quality varies greatly.
  • the link quality of the first main link is good, and the link quality of the second main link is poor, which may prevent the third Bluetooth terminal from successfully acquiring Bluetooth data. Therefore, the first transmission mechanism It may include a forwarding mechanism, and the first main link may be used to transmit Bluetooth data, and the second Bluetooth terminal will forward the Bluetooth data to the third Bluetooth terminal after receiving the Bluetooth data.
  • step S1101B it is determined that the first transmission mechanism includes a forwarding mechanism.
  • the first transmission mechanism is a forwarding mechanism.
  • the difference between the first main link and the second main link is small, and the link quality of the first main link is good, you can only select the forwarding mechanism to avoid the use of forwarding while ensuring the success rate of Bluetooth data transmission Mechanisms and non-forwarding mechanisms waste power consumption.
  • the selection of the first transmission mechanism according to the link quality parameter of the first main link and the link quality parameter of the second main link includes the following step:
  • Step S1201 Determine whether the link quality parameters of the first main link and the second main link meet the fifth preset condition; if the link quality parameters of the first main link and the link quality parameters of the second main link If the fifth preset condition is met, step S1201A is performed; if the link quality parameter of the first main link and the link quality parameter of the second main link do not meet the fifth preset condition, step S1202 is performed;
  • Step S1201A Determine that the first transmission mechanism is a non-forwarding mechanism
  • Step S1202 Determine whether the quality parameter of the first main link and the link quality parameter of the second main link meet the sixth preset condition; if the link quality parameter of the first main link and the second main link If the link quality parameter of the first main link meets the sixth preset condition, step S1202A is executed; if the link quality parameter of the first main link and the link quality parameter of the second main link do not meet the sixth preset condition, then step S1202A S1202B;
  • Step S1201A Determine that the first transmission mechanism is a forwarding mechanism
  • Step S1202B Determine that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism
  • the first transmission mechanism when the link quality parameter difference between the first main link and the second main link is large, the first transmission mechanism is the forwarding mechanism. If the difference in link quality parameters is small, the first transmission mechanism is a non-forwarding mechanism. When the link quality parameters between the first main link and the second main link neither satisfy the fifth preset condition nor the sixth preset When the conditions are set, the first transmission mechanism is the parallel of the forwarding mechanism and the non-forwarding mechanism.
  • the difference between the link quality of the first main link and the second main link is used to determine which transmission mechanism is selected, which can adapt to the scenario of link changes.
  • the first transmission mechanism is a forwarding mechanism
  • it can be further determined whether the link quality parameter of the first secondary link meets the third preset condition, when the link of the first secondary link
  • the quality parameter meets the third preset condition, it indicates that the link quality of the first secondary link is good, and then the forwarding mechanism is used to transmit Bluetooth data
  • the link of the second primary link can be further judged Whether the quality parameter meets the first preset condition, if it is satisfied, it indicates that the link quality of the second main link is good, and then the non-forwarding mechanism is used to transmit the Bluetooth data.
  • the determining the first transmission mechanism according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link includes: if the first secondary link The link quality parameter of the link and the link quality parameter of the second main link satisfy a seventh preset condition, and it is determined that the first transmission mechanism is the forwarding mechanism or the non-forwarding mechanism.
  • FIG. 13 is a flowchart of selecting the first transmission mechanism provided by this embodiment. As shown in FIG. 13, the method includes the following steps:
  • Step S1301 Determine whether the link quality parameter of the first secondary link and the link quality parameter of the second primary link meet the seventh preset condition; if they are satisfied, perform step S1301A;
  • Step S1301A Determine whether the first transmission mechanism is a forwarding mechanism or a non-forwarding mechanism.
  • the seventh preset condition includes: the difference between the second signal strength is greater than the second preset signal strength difference, and the second signal strength difference is the difference between the signal strength of the first secondary link and the signal strength of the second main link .
  • the forwarding mechanism and the non-forwarding mechanism are selected to avoid the simultaneous use of the forwarding mechanism and the non-forwarding mechanism.
  • the problem of high power consumption when the link quality parameter of the first secondary link and the link quality parameter of the second primary link do not meet the seventh preset condition, it means that the difference in link quality between the first secondary link and the second primary link is small At this time, please refer to step S1301B.
  • the first transmission mechanism can be a forwarding mechanism and a non-forwarding mechanism.
  • a forwarding mechanism or a non-forwarding mechanism can also be selected arbitrarily.
  • the method further includes the following steps:
  • Step S1401 Determine whether the link quality parameter of the first secondary link and the link quality parameter of the second primary link meet the seventh preset condition; if they are satisfied, perform step S1402;
  • Step S1402 Determine whether the signal strength of the second primary link is greater than or equal to the signal strength of the first secondary link; if yes, execute step S1402A; if not, execute step S1402B;
  • S1402A Determine that the first transmission mechanism is a non-forwarding mechanism
  • S1402B Determine that the first transmission mechanism is a forwarding mechanism
  • step S1401 is the same as or similar to step S1301 in the foregoing embodiment
  • step S1403 is the same as or similar to step S1301B in the foregoing embodiment, and will not be repeated here.
  • step S1402 the link quality parameter is taken as an example of signal strength.
  • step S1402 can also be implemented by judging the packet loss rate or retransmission rate. Specifically, for example, judging the loss of the second main link. Whether the packet rate is less than the packet loss rate of the first secondary link; if yes, go to step S1402A; if not, go to step S1402B; for another example, determine whether the retransmission rate of the second primary link is less than that of the first secondary link Retransmission rate; if yes, go to step S1402A; if not, go to step S1402B.
  • the forwarding mechanism can be selected.
  • the signal strength of the first secondary link is higher than the signal strength of the second main link and the difference in the second signal strength is greater than the second preset signal strength difference, it can indicate that the link quality of the first secondary link is excellent Because of the link quality of the second main link, the forwarding mechanism can be selected. It should be noted that in the forwarding mechanism, the link quality of the first main link is also good by default, and it can support the transmission of Bluetooth data to the second Bluetooth terminal.
  • the second preset signal strength difference can be selected according to user requirements and scenarios, which is not limited in this embodiment.
  • the seventh preset condition also includes: the difference between the second packet loss rate is greater than the second preset packet loss rate difference, and the second packet loss rate difference is the packet loss rate of the first secondary link and the second primary link The difference between the packet loss rate.
  • the packet loss rate of the first secondary link is lower than the packet loss rate of the second primary link and the difference of the second packet loss rate is greater than the difference of the second preset packet loss rate, it can indicate the packet loss rate of the first secondary link.
  • the link quality is better than the link quality of the second main link, so a forwarding mechanism can be selected.
  • the first preset packet loss rate difference can be selected according to user requirements and scenarios, which is not limited in this embodiment.
  • the seventh preset condition further includes: the difference between the second retransmission rate is greater than the second preset retransmission rate difference, and the second retransmission rate difference is the retransmission rate of the first secondary link and the second primary link The difference in the retransmission rate.
  • the retransmission rate of the first secondary link is lower than the retransmission rate of the second primary link and the difference in the second retransmission rate is greater than the difference in the second preset retransmission rate, it can indicate that the retransmission rate of the first secondary link is The link quality is better than the link quality of the second main link, so a forwarding mechanism can be selected.
  • the first preset retransmission rate difference can be selected according to user requirements and scenarios, which is not limited in this embodiment.
  • the first preset signal strength difference may be equal to the second preset signal strength difference.
  • the reference standard for evaluating the difference in link quality is the same, but this embodiment does not do this. Limited, the two may not be equal.
  • the first preset packet loss rate difference may be equal to the second preset packet loss rate difference
  • the first preset retransmission rate difference may also be equal to the second preset retransmission rate difference. Go into details.
  • the non-forwarding mechanism can be switched to the forwarding mechanism, or from the forwarding mechanism.
  • the non-forwarding mechanism is switched to the non-forwarding mechanism and the forwarding mechanism in parallel, and then switched to the forwarding mechanism.
  • the initial state is a non-forwarding mechanism, and if it is determined that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism, the non-forwarding mechanism can be switched to the non-forwarding mechanism and the forwarding mechanism.
  • the third Bluetooth terminal can receive the Bluetooth data forwarded by the second Bluetooth terminal.
  • the third Bluetooth terminal can also receive the data sent by the first Bluetooth terminal, or the third Bluetooth terminal can The Bluetooth data sent by the first Bluetooth terminal to the second Bluetooth terminal is monitored, so that it can be ensured to the greatest extent that the third Bluetooth terminal can obtain the Bluetooth data. If the initial state is a forwarding mechanism, if it is determined that the first transmission mechanism is a non-forwarding mechanism, you can switch from the forwarding mechanism to the non-forwarding mechanism, or switch from the forwarding mechanism to the non-forwarding mechanism in parallel with the forwarding mechanism, and then switch to the non-forwarding mechanism .
  • the forwarding mechanism can be switched to the non-forwarding mechanism and the forwarding mechanism in parallel.
  • the intermediate state can be a forwarding mechanism and a non-forwarding mechanism, so as to avoid missing some Bluetooth data during the switching process, so as to deteriorate the transmission quality.
  • the first Bluetooth terminal is a mobile phone
  • the second Bluetooth terminal is a right earphone
  • the third Bluetooth terminal is a left earphone
  • the Bluetooth data is audio data.
  • the mobile phone transmits audio data to the left and right earphones respectively, that is, the initial state is a dual transmission mechanism.
  • the left and right earphones receive The number of audio data packets is generally equal, and the left and right earphones can respectively record the number N of audio data packets received.
  • the link quality between the left earphone and the mobile phone becomes worse, and the retransmission rate and packet loss rate between the left earphone and the mobile phone become higher, that is, the retransmission rate and loss rate of the second main link. If the packet rate becomes higher and the link quality is poor, the left earphone may not be able to successfully receive the audio data sent by the mobile phone. At this time, if the link quality of the first main link between the right earphone and the mobile phone is good, the audio received by the left and right ears The number of data packets may be inconsistent. The right earphone receives more audio data packets than the left earphone.
  • a transmission mechanism may include a forwarding mechanism, for example, the first transmission mechanism is a forwarding mechanism.
  • the dual-transmission mechanism may not be directly switched to the forwarding mechanism, but the dual-transmission mechanism is first switched to the parallel forwarding mechanism and the non-forwarding mechanism, and then the forwarding mechanism is switched.
  • the first transmission mechanism may be a parallel forwarding mechanism and a non-forwarding mechanism within a period of time, that is, switching from the non-forwarding mechanism to a parallel forwarding mechanism and a non-forwarding mechanism.
  • the left earphone requests the mobile phone to retransmit data, it also requests the right earphone to forward the audio data received by the right earphone.
  • the audio data packet that the right earphone requests to forward can be the audio data packet that the left earphone did not receive or the reception failed.
  • the audio data packet that the left earphone requests to be forwarded to the right earphone may also be the next audio data packet of the audio data packet that was not received or failed to be received.
  • the right earphone After the right earphone receives the request sent by the left earphone, it can query whether it has received the requested data packet. If it has not received it, it will mark a failure in the response to the left earphone. If the right earphone has received the requested data packet, the requested audio data packet is forwarded to the left earphone. At this time, the first transmission mechanism may only be a forwarding mechanism.
  • the response of the right earphone received by the left earphone is marked as failed, continue to request the mobile phone to transmit audio data packets, and at the same time request the right earphone to forward the audio data packets.
  • the requested audio data packet can be the last time it was not received or the reception failed.
  • the Nth data packet can also be the N+1th data packet to be received next. This embodiment does not limit this. This embodiment takes the requested audio data packet as the Nth data packet as an example. illustrate.
  • the first transmission mechanism may include a non-forwarding mechanism, for example, at this time, the first transmission mechanism may be a non-forwarding mechanism, That is, the first transmission mechanism is re-determined as a non-forwarding mechanism.
  • the forwarding mechanism can be stopped, and the left earphone only receives audio data packets sent by the mobile phone or monitors the audio data packets sent by the mobile phone to the right earphone.
  • the first transmission mechanism is switched from the dual-transmission mechanism so that the forwarding mechanism and the non-forwarding mechanism are parallel, and the non-forwarding mechanism is re-determined later. It can be understood that the update of the first transmission mechanism is periodic. When the link quality changes rapidly, the first transmission mechanism will switch back and forth between various transmission mechanisms.
  • the left earphone can check the received audio data packet.
  • the processing method is similar to the case where the left earphone receives the response from the right earphone in the previous embodiment, and the mark failed. For example, you can continue to request the mobile phone to transmit the audio data packet. At the same time, the right earphone is requested to forward the audio data packet.
  • the requested audio data packet can be the Nth data packet that was not received or failed to be received last time, or the N+1th data packet to be received next. This implementation For example, there is no restriction on this.
  • the first transmission mechanism may include a non-forwarding mechanism.
  • the first transmission mechanism is a non-forwarding mechanism, that is, the first transmission mechanism is re-determined as a non-forwarding mechanism.
  • the forwarding mechanism can be stopped, and the left earphone only receives audio data packets sent by the mobile phone or the monitoring mobile phone sends it to the right earphone Audio packets.
  • the first transmission mechanism needs to be updated, so as to adapt to rapid changes in link quality.
  • the Nth audio data packet is found to be correct after verification, it is judged whether the Nth audio data packet sent by the mobile phone is received. If the Nth data packet sent by the mobile phone is not received, the second audio data packet can be judged. Whether the link quality parameter of the main link meets the first preset condition, if not, it is determined that the first transmission mechanism includes a forwarding mechanism, for example, the non-forwarding mechanism can be stopped and only the forwarding mechanism is used, and the left earphone uses the right earphone The forwarded audio data is played; if you receive the Nth data packet sent by the mobile phone, you can choose any one to play between the Nth audio data packet sent by the mobile phone and the Nth audio data packet sent by the right earphone , Another unselected Nth audio data packet is discarded.
  • the first transmission mechanism includes a forwarding mechanism, for example, the non-forwarding mechanism can be stopped and only the forwarding mechanism is used, and the left earphone uses the right earphone The forwarded audio data is played; if you
  • the non-forwarding mechanism when the quality of the link between the left earphone and the mobile phone deteriorates, the non-forwarding mechanism can be switched to the forwarding mechanism and the non-forwarding mechanism in parallel to ensure the quality of data transmission while achieving smooth and non-inductive switching. That is, the left earphone will simultaneously request data from the right earphone and the mobile phone for a period of time to ensure normal playback and avoid transmission interruption during the switching process.
  • the right earphone can determine whether it supports the forwarding mechanism, that is, the right earphone can determine whether the audio data can be forwarded to the left earphone.
  • the current power or transmission rate of the second Bluetooth terminal may not be suitable for the forwarding mechanism.
  • the power of the second Bluetooth terminal is too low to support the forwarding mechanism or not enough to maintain the forwarding mechanism within a predetermined time.
  • the second Bluetooth terminal It is already performing data interaction with the first Bluetooth terminal, the transmission rate is relatively large, and it has already occupied a part of the bandwidth resources, and the remaining bandwidth resources are not enough to support the forwarding mechanism.
  • the right earphone can choose to accept or reject the request of the left earphone according to its own bandwidth or power level. If the request of the left earphone is accepted, the audio data will be forwarded to the left earphone. If the request of the left earphone is rejected, the rejection message will be sent to After the left earphone and the right earphone reject the request of the left earphone, the synchronization between the left and right ears can be stopped, and the left and right ears play audio data independently, and the left and right earphones do not affect each other. In this embodiment, under the forwarding mechanism, synchronization may not be performed, that is, after the right earphone forwards the audio data to the left earphone, the left earphone directly plays it.
  • synchronization can also be performed. For example, if the right earphone accepts the request of the left earphone, it can be guaranteed that the right earphone transmits audio data to the left earphone, and the left earphone can continue to play and synchronize. After the audio data.
  • the left earphone forwards audio data to the left earphone, during the right earphone forwarding process, the left earphone periodically queries the link quality between itself and the mobile phone, when the link quality parameter of the second main link meets the first preset condition .
  • You can choose the non-forwarding mechanism that is, when the link quality between the left earphone and the mobile phone becomes better, you can choose the non-forwarding mechanism, the right earphone stops forwarding audio data to the left earphone, and the left earphone obtains audio data from the mobile phone.
  • the transmission mechanism after receiving one or more audio data packets, it can be judged whether the transmission mechanism needs to be switched, or after the link quality changes, it can be judged whether the transmission mechanism needs to be switched, so that the link quality can be quickly responded to.
  • the problem of incorrect reception of Bluetooth data caused by changes can also reduce the number of unnecessary retransmissions, thereby reducing power consumption.
  • switching the second transmission mechanism to the first transmission mechanism includes: switching from the forwarding mechanism to the non-forwarding mechanism, or switching from the forwarding mechanism to the non-forwarding mechanism and the forwarding mechanism in parallel.
  • switching the second transmission mechanism to the first transmission mechanism includes: switching from the non-forwarding mechanism to the forwarding mechanism, or switching from the non-forwarding mechanism to the forwarding mechanism and the non-forwarding mechanism in parallel.
  • the third Bluetooth terminal can receive the Bluetooth data forwarded by the second Bluetooth terminal, and the third Bluetooth terminal can also receive The data sent by the first Bluetooth terminal or the third Bluetooth terminal can monitor the Bluetooth data sent by the first Bluetooth terminal to the second Bluetooth terminal. In this way, it can be guaranteed to the greatest extent that the third Bluetooth terminal can obtain the Bluetooth data.
  • switching the non-forwarding mechanism to the forwarding mechanism may include the following steps:
  • Step S1501 Switch from the non-forwarding mechanism to the non-forwarding mechanism and the forwarding mechanism
  • Step S1502 Switch from the non-forwarding mechanism and the forwarding mechanism to the forwarding mechanism.
  • switching the forwarding mechanism to the non-forwarding mechanism includes:
  • Step S1601 Switch from the forwarding mechanism to the non-forwarding mechanism and the forwarding mechanism
  • Step S1602 Switch from the non-forwarding mechanism and the forwarding mechanism to the non-forwarding mechanism.
  • a transition phase before transmitting Bluetooth data according to the first transmission mechanism, a transition phase may be included.
  • Bluetooth data can be transmitted according to the forwarding mechanism and the non-forwarding mechanism, which can avoid Bluetooth data transmission fails during the process of mechanism switching, which can further improve the success rate of Bluetooth data transmission.
  • the Bluetooth data is transmitted according to the second transmission mechanism
  • the Bluetooth data is transmitted according to the selected first transmission mechanism
  • the Bluetooth data is transmitted according to the forwarding mechanism and the non-forwarding mechanism Data
  • the third time period is between the first time period and the second time period, that is, it is not directly switched from the second transmission mechanism to the first transmission mechanism, but inserts one between the first time period and the second time period
  • both the forwarding mechanism and the non-forwarding mechanism are used to transmit Bluetooth data, which can avoid Bluetooth data transmission failure during the mechanism switching process, and can further improve the success rate of Bluetooth data transmission.
  • the first transmission mechanism may not be selected, and the forwarding mechanism and the non-forwarding mechanism may be used to transmit the Bluetooth data.
  • the step of determining the first transmission mechanism can be omitted, and the transmission success rate of the Bluetooth data will be improved.
  • this embodiment can also reduce the power consumption.
  • This parallel scheme of forwarding mechanism and non-forwarding mechanism is set as a transition stage, which can save power consumption compared to directly adopting forwarding mechanism and non-forwarding mechanism.
  • the first transmission mechanism in the process of transmitting Bluetooth data according to the forwarding mechanism and the non-forwarding mechanism, can be updated.
  • the first transmission mechanism in the third time period, can be updated.
  • the update of the first transmission mechanism is also updated according to link quality, so as to ensure that changes in link quality can be tracked in time.
  • the non-forwarding mechanism when the link quality between the left earphone and the mobile phone deteriorates, the non-forwarding mechanism can be switched to the forwarding mechanism and the non-forwarding mechanism in parallel, so as to ensure the quality of data transmission while being smooth and insensitive.
  • the left earphone will request data from the right earphone and the mobile phone at the same time within a period of time to ensure normal playback. After switching from the non-forwarding mechanism to the forwarding mechanism and the non-forwarding mechanism in parallel, you can switch to the forwarding mechanism.
  • the first transmission mechanism may be determined to be a non-forwarding mechanism; that is, the signal strength of the second main link is greater than that of the first transmission mechanism.
  • a preset signal strength, or the retransmission rate of the second main link is less than the first preset retransmission rate, or the packet loss rate of the second main link is less than the first preset packet loss rate.
  • the left earphone The quality of the link with the mobile phone becomes better, and the non-forwarding mechanism can be selected to transmit Bluetooth data.
  • the first transmission mechanism is a non-forwarding mechanism and the forwarding mechanism includes:
  • the first bluetooth terminal transmits the bluetooth data to the second bluetooth terminal through the first main link; the second bluetooth terminal forwards part or all of the bluetooth data to the third bluetooth terminal through the first secondary link;
  • the first Bluetooth terminal transmits Bluetooth data to the third Bluetooth terminal through the second main link, or the Bluetooth data transmitted from the first Bluetooth terminal to the second Bluetooth terminal is monitored by the third Bluetooth terminal.
  • the forwarding mechanism and the dual-transmitting mechanism can be maintained at the same time, or the forwarding mechanism and the monitoring mechanism can be maintained at the same time.
  • the receiver can receive the Bluetooth data with the greatest probability.
  • the first transmission mechanism can be updated once, so that the first transmission mechanism can respond to link changes in a timely manner .
  • the link quality parameter can be calculated once to determine whether the first transmission mechanism needs to be updated.
  • the link quality parameter can also be calculated once. For example, the link quality parameter can be obtained through a response message.
  • the transmission mechanism is updated once, so that only when the link quality changes significantly, the first transmission mechanism needs to be updated. Save power consumption.
  • the first transmission mechanism can also be updated in a preset period, so that the first transmission mechanism will be adjusted periodically.
  • the first bluetooth terminal, the second bluetooth terminal or the third bluetooth terminal can update the first transmission mechanism.
  • the second bluetooth terminal and the second bluetooth terminal can be saved. 3. Power consumption of the Bluetooth terminal.
  • the second transmission mechanism includes a forwarding mechanism
  • the second Bluetooth terminal can update the first transmission mechanism. Because the second Bluetooth terminal directly communicates with the first Bluetooth terminal and the third Bluetooth terminal during the forwarding mechanism, it is easier Obtaining the link quality parameters of each link will make the update faster to reduce the delay.
  • the third Bluetooth terminal can transmit a reconnection signal to the first Bluetooth Terminal; the third Bluetooth terminal adjusts the frequency of transmitting the reconnection signal according to the signal strength of the second main link.
  • the third Bluetooth end will transmit a reconnection signal to the first Bluetooth end to establish the second main link, so that the link parameters of the second main link can be obtained to determine whether the first transmission needs to be updated mechanism.
  • the third Bluetooth terminal sends the reconnection signal, it can be understood that if the signal strength of the second main link is greater, the third Bluetooth terminal can send the reconnection signal at a higher frequency.
  • the third Bluetooth terminal can send the reconnection signal at a lower frequency. In this way, it can avoid the high-frequency transmission of the reconnection signal when the link quality of the second main link is poor. Waste power consumption.
  • the second main link has not been established, and the Bluetooth terminal cannot directly obtain the link quality of the second main link. Therefore, it can be based on the link quality parameters of the first main link and the first secondary link. Indirectly determine the link quality of the second main link.
  • the receiving frequency is also determined by the link quality parameters of the first primary link and the first secondary link.
  • the first Bluetooth terminal will also receive the reconnection signal at a higher frequency.
  • the first Bluetooth terminal is a mobile phone
  • the second Bluetooth terminal is a right earphone
  • the third Bluetooth terminal is a left earphone
  • the Bluetooth data is audio data.
  • the initial state is the forwarding mechanism
  • the left earphone has disconnected the second main link from the mobile phone, and the left earphone only obtains audio data through the forwarding of the right earphone. Since the forwarding process will speed up the power consumption of the right earphone, and the forwarding will also bring a certain delay. Therefore, the left earphone can continuously try to establish a connection with the mobile phone, or the mobile phone can continuously try to establish a connection with the left earphone, that is, try to establish a second master.
  • this embodiment takes the left earphone actively initiates the establishment of a connection as an example for description.
  • the quality of the second main link between the left earphone and the mobile phone is poor.
  • the action of establishing a connection between the left earphone and the mobile phone is likely to be unsuccessful and will cause power consumption. If the left earphone does not try to establish a connection with the earphone, the forwarding mechanism will still be used when the left earphone is close to the phone, which will affect the user experience.
  • the left earphone and the mobile phone may try to establish a connection.
  • the left earphone can try to establish a connection with the mobile phone at a lower frequency.
  • the first transmission mechanism can be Including a non-forwarding mechanism.
  • the first transmission mechanism may be a non-forwarding mechanism.
  • the link quality of the second main link can be indirectly judged to determine the frequency at which the third Bluetooth terminal and the first Bluetooth terminal establish a connection, that is, at which frequency the third Bluetooth terminal transmits Reconnect the signal.
  • the first transmission mechanism is the forwarding mechanism, before the left earphone is disconnected from the mobile phone .
  • the right earphone After receiving the notification message, the right earphone records the signal strength between the right earphone and the mobile phone at the current moment (RSSI between right earphone).
  • RM-RSSI the signal strength between the left earphone and the right earphone
  • the right earphone regularly queries the RM at subsequent moments -RSSI and RL-RSSI are compared with the previously recorded data. If the signal strength increases, or the weighted sum of the two increases, the left earphone is notified to try to establish a connection with the mobile phone, or the left earphone is notified to be shorter Try to connect with the mobile phone in the period of time, that is, send a reconnection signal at a higher frequency.
  • the left earphone will not try to reconnect or reduce the frequency of reconnecting attempts, that is, do not send the reconnect signal or send it at a lower frequency Reconnect the signal.
  • the signal strength of the first main link and the signal strength of the first secondary link both increase, it can be understood that the right earphone is close to the mobile phone, and the distance between the left earphone and the right earphone is reduced. In this case, the probability that the distance between the left earphone and the mobile phone will decrease will also decrease. Therefore, when the signal strength of the first main link increases and the signal strength of the first secondary link increases, the signal is retransmitted.
  • the increase of the sending frequency can make the left earphone and the mobile phone establish a connection when the left earphone is close to the earphone.
  • the left earphone may be Is also close to the mobile phone, so when the weighted sum of the two increases, the right earphone notifies the left earphone to make the left earphone try to establish a connection with the mobile phone, or the right earphone informs the left earphone to try to connect with the mobile phone at a higher frequency, so that when the When the left earphone may be close to the mobile phone, the left earphone can also be connected to the mobile phone in time.
  • the specific weight distribution of the weighted sum is not limited.
  • the signal strength of the first main link and the signal strength of the first secondary link are both 0.5, or 0.6 and 0.4, respectively.
  • trying to connect with the mobile phone can be understood as sending a reconnection signal.
  • the third Bluetooth terminal sends a reconnection signal
  • the first Bluetooth terminal receives the reconnection signal. Therefore, when the sending frequency increases When it is large, the receiving frequency also increases.
  • This method of using the signal strength between the right earphone and the mobile phone and the change in the signal strength between the left and right earphones to determine whether the left earphone is trying to establish a connection with the mobile phone or at what frequency is trying to establish a connection which can realize the use of the existing Data information, avoiding the left earphone to start scanning additionally, and further saving power consumption.
  • the left earphone When the left earphone is far away from the mobile phone, it will not try to reconnect with the mobile phone, or try to reconnect with the mobile phone in a larger period.
  • the right earphone will send a message to the left The headset tries to connect with the mobile phone or increases the frequency of attempts to connect with the mobile phone.
  • this method can be used to save power consumption, and after the left earphone is successfully connected to the mobile phone, it can be determined whether the link quality parameter of the second main link meets the first preset condition, It is determined that the first transmission mechanism includes a non-forwarding mechanism, for example, the first transmission mechanism is a non-forwarding mechanism to maintain smooth playback.
  • This embodiment uses signal strength as an example for description. It can be understood that the packet loss rate of the first primary link decreases and the packet loss rate of the first secondary link decreases, and the frequency of receiving or sending reconnection signals also increases.
  • the retransmission rate of the first primary link decreases and the retransmission rate of the first secondary link decreases, and the frequency of receiving or sending reconnection signals also increases; or, the packet loss of the first primary link
  • the weighted sum of the loss rate and the packet loss rate of the first secondary link decreases, and the frequency of receiving or sending reconnection signals also increases; or, the retransmission rate of the first primary link and the retransmission rate of the first secondary link
  • the frequency of receiving or sending reconnection signals is also increased, which is not repeated in this embodiment.
  • the embodiment of the present application may also provide a data transmission method for the second Bluetooth terminal or the third Bluetooth terminal, and the method includes the following steps:
  • the Bluetooth data is transmitted according to the first transmission mechanism.
  • the first transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism;
  • the dual transmission mechanism includes that the second Bluetooth terminal receives the Bluetooth data transmitted by the first Bluetooth terminal through the first main link;
  • the forwarding mechanism includes that the second Bluetooth terminal receives the Bluetooth data sent by the first Bluetooth terminal through the first main link, and the second Bluetooth terminal forwards part or all of the Bluetooth data to the third Bluetooth terminal through the first secondary link;
  • the monitoring mechanism includes that the second Bluetooth terminal receives the Bluetooth data transmitted by the first Bluetooth terminal through the first main link, and the Bluetooth data received by the second Bluetooth terminal through the first main link is monitored by the third Bluetooth terminal.
  • the second Bluetooth terminal may determine the first transmission mechanism. After the first transmission mechanism is determined, the second Bluetooth terminal may notify other Bluetooth terminals to realize the cooperation of the three to complete the transmission of Bluetooth data. For the specific implementation and beneficial effects of this embodiment, refer to the above, which will not be repeated here.
  • step S1703 the following steps are included before the Bluetooth data according to the forwarding mechanism:
  • Step S1701 The second Bluetooth terminal receives the request forwarding command sent by the third Bluetooth terminal, and the request forwarding command is used to request the second Bluetooth terminal to transmit part or all of the Bluetooth data to the third Bluetooth terminal;
  • Step S1702 After receiving the request forwarding command, the second Bluetooth terminal judges whether to transmit part or all of the Bluetooth data to the third Bluetooth terminal according to the power or bandwidth occupancy rate of the second Bluetooth terminal; if yes, perform step S1703, if not, perform Step S1704: Determine that the first transmission mechanism does not include a forwarding mechanism.
  • the power or transmission rate of the second Bluetooth terminal may not be suitable for the forwarding mechanism.
  • the power of the second Bluetooth terminal is too low to support the forwarding mechanism or to maintain the forwarding mechanism within a predetermined time.
  • the second Bluetooth terminal is already performing data interaction with the first Bluetooth terminal, and the transmission rate is relatively high, and it already occupies a part of the bandwidth resources, and the remaining bandwidth resources are not enough to support the forwarding mechanism. Therefore, before transmitting the Bluetooth data according to the forwarding mechanism, the third Bluetooth terminal can send a request forwarding command to the second Bluetooth terminal, so that after receiving the forwarding command, the second Bluetooth terminal judges whether it supports forwarding according to its power or transmission rate.
  • the mechanism can also consider the power and bandwidth occupancy at the same time, that is, determine whether to transmit Bluetooth data to the third Bluetooth terminal according to the power and transmission rate.
  • the Bluetooth data includes audio data as an example for description.
  • the non-forwarding mechanism if the first Bluetooth terminal is close to the second Bluetooth terminal, but the third Bluetooth terminal is away from the first Bluetooth terminal. If the second Bluetooth terminal is close to the first Bluetooth terminal, the link quality of the first main link is better, so the second Bluetooth terminal can receive enough audio data, but because the second main link The link quality is poor, the third Bluetooth terminal cannot receive enough audio data, or the third Bluetooth terminal cannot monitor the audio data sent by the first Bluetooth terminal to the second Bluetooth terminal.
  • the second Bluetooth terminal may give up some of the originally received audio data, which will affect the user experience.
  • the second Bluetooth terminal can play audio data normally. Effect.
  • a single earphone can play normally, so as to avoid another earphone that has not received enough audio data from affecting the earphone that has received enough audio data. Therefore, in the case where the synchronization effect of the second Bluetooth terminal and the third Bluetooth terminal is relatively poor, the synchronization can be stopped.
  • the second Bluetooth terminal is the right earphone
  • the third Bluetooth terminal is the left earphone.
  • a second secondary link is established between the left and right earphones to transmit data synchronization information to achieve data synchronization.
  • the left and right earphones respectively establish links with the sound source to transmit audio data.
  • the sound source can be understood as a mobile phone.
  • the left and right earphones monitor the signal strength and retransmission rate between the left and right earphones respectively. Information such as transmission rate and the packet loss rate, retransmission rate and signal strength of each and the audio source are notified to the opposite end.
  • the signal strength, packet loss rate or retransmission rate between one of the earphones and the audio source reaches the correspondingly set threshold, it means that the earphone has not received enough audio data, and it cannot be well synchronized with the opposite earphone. Therefore, you can stop the synchronization between the two earphones, and the two earphones will play the audio data they receive separately.
  • the left earphone When the signal strength, packet loss rate or retransmission rate between the left earphone and the audio source reaches the corresponding threshold, the left earphone sends these information to the right earphone to indicate that the left earphone receives data abnormally. After the right earphone receives the information, Determine whether the link quality between yourself and the audio source is better than the link quality between the left earphone and the audio source. If the signal strength between the right earphone and the mobile phone is high, the right earphone will notify the left earphone to stop syncing, and then the right earphone will continue. For data interaction with the audio source, the left earphone is not synchronized with the right earphone, and the two earphones play independently or the left earphone stops playing. In this way, the right earphone can be guaranteed to work normally.
  • the embodiment of the present application may also provide a data transmission method, which includes:
  • the first transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism;
  • the dual transmission mechanism includes the third Bluetooth terminal receiving the Bluetooth data sent by the first Bluetooth terminal through the second main link;
  • the forwarding mechanism includes the third Bluetooth terminal receiving part or all of the Bluetooth data forwarded by the second Bluetooth terminal through the first secondary link;
  • the monitoring mechanism includes the third Bluetooth terminal monitoring the Bluetooth data sent by the first Bluetooth terminal to the second Bluetooth terminal through the first main link.
  • the embodiment of the application provides a data transmission method, which can be used for the third Bluetooth terminal to determine the transmission mechanism according to the link quality, so as to avoid the problem of poor Bluetooth data quality when the link quality changes due to the use of a fixed transmission mechanism.
  • the transmission mechanism is determined according to the link quality, and when the link quality changes, a certain transmission mechanism can be flexibly selected to transmit Bluetooth data, so as to improve the quality of the transmitted Bluetooth data and enhance the user experience.
  • An embodiment of the present application may also provide a data transmission device. As shown in FIG. 18, the device 1800 includes:
  • the first determining module 1801 is configured to select the first transmission mechanism from at least two of the forwarding mechanism, the dual transmission mechanism and the monitoring mechanism according to the link quality parameter;
  • the first transmission module 1802 is configured to transmit Bluetooth data according to the first transmission mechanism
  • the first transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism;
  • the first transmission module is configured to transmit Bluetooth data to the second Bluetooth terminal and the third Bluetooth terminal through the first main link and the second main link according to the dual transmission mechanism;
  • the first transmission module is also used to transmit Bluetooth data to the second Bluetooth terminal through the first main link according to the forwarding mechanism, and part or all of the Bluetooth data received by the second Bluetooth terminal is used to be forwarded by the second Bluetooth terminal through the first secondary link To the third Bluetooth terminal;
  • the first transmission module is also configured to transmit Bluetooth data to the second Bluetooth terminal through the first main link according to the monitoring mechanism, and the Bluetooth data transmitted by the first transmission module to the second Bluetooth terminal is monitored by the third Bluetooth terminal.
  • the first transmission module is also used to transmit Bluetooth data according to a forwarding mechanism and a non-forwarding mechanism;
  • the non-forwarding mechanism includes a dual transmission mechanism or a monitoring mechanism.
  • the first transmission module is also configured to transmit Bluetooth data according to the second transmission mechanism in the first time period, and transmit Bluetooth data according to the first transmission mechanism in the second time period;
  • the Bluetooth data is transmitted according to the forwarding mechanism and the non-forwarding mechanism;
  • the third time period is between the first time period and the second time period, and the first transmission mechanism is different from the second transmission mechanism;
  • the second transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism.
  • the first determining module is further configured to update the first transmission mechanism in the process of transmitting Bluetooth data according to the forwarding mechanism and the non-forwarding mechanism.
  • the link quality parameter includes one or more of packet loss rate, signal strength, and retransmission rate
  • the signal strength of the first main link is greater than or equal to the signal strength of the second main link, or the packet loss rate of the first main link is less than or equal to the packet loss rate of the second main link, or the packet loss rate of the first main link
  • the retransmission rate is less than or equal to the retransmission rate of the second main link
  • the first determining module is specifically configured to select the first link quality parameter according to one or more of the link quality parameter of the second primary link, the link quality parameter of the first secondary link, and the link quality parameter of the first primary link. Transmission mechanism.
  • the first determining module is specifically configured to select the first transmission mechanism according to the link quality parameter of the second primary link; or select according to the link quality parameter of the first secondary link The first transmission mechanism.
  • the first determining module is specifically configured to:
  • the first transmission mechanism is selected according to the link quality parameter of the first secondary link and the link quality parameter of the second primary link.
  • the first determining module is specifically configured to determine that the first transmission mechanism includes a non-forwarding mechanism; or, If the link quality parameter of the second main link does not meet the first preset condition, the transmission mechanism is specifically used to determine that the first transmission mechanism includes a forwarding mechanism;
  • the first preset condition includes: the signal strength of the second main link is greater than or equal to the first preset signal strength, or the retransmission rate of the second main link is less than or equal to the first preset retransmission rate, or the second The packet loss rate of the main link is less than or equal to the first preset packet loss rate.
  • the first preset signal strength is the signal strength of the first secondary link
  • the first preset retransmission rate is the retransmission rate of the first secondary link
  • Let the packet loss rate be the packet loss rate of the first secondary link.
  • the first determining module is specifically configured to determine that the first transmission mechanism is a forwarding mechanism; or, if The link quality parameter of the second main link does not meet the second preset condition, and the first determining module is specifically configured to determine whether the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism;
  • the second preset condition includes: the signal strength of the second main link is less than the second preset signal strength, or the retransmission rate of the second main link is greater than the second preset retransmission rate, or the signal strength of the second main link
  • the packet loss rate is greater than the second preset packet loss rate
  • the first preset signal strength is greater than the second preset signal strength, the first preset retransmission rate is less than the second preset retransmission rate, and the first preset packet loss rate is less than the second preset packet loss rate;
  • Determining that the first transmission mechanism includes a non-forwarding mechanism includes: determining that the first transmission mechanism is a non-forwarding mechanism.
  • the first determining module is specifically configured to determine that the first transmission mechanism includes a forwarding mechanism; or, if The link quality parameter of the first secondary link does not meet the third preset condition, and the first determining module is specifically configured to determine that the first transmission mechanism includes a non-forwarding mechanism; the non-forwarding mechanism includes a dual transmission mechanism or a monitoring mechanism;
  • the third preset condition includes: the signal strength of the first secondary link is higher than the third preset signal strength, or the retransmission rate of the first secondary link is lower than the third preset retransmission rate, or the first secondary link
  • the packet loss rate of is lower than the third preset packet loss rate.
  • the third preset signal strength is the signal strength of the second main link;
  • the third preset packet loss rate is the packet loss rate of the second main link, and the third preset signal strength is Let the retransmission rate be the retransmission rate of the second main link.
  • the first determining module if the link quality parameter of the first secondary link meets the fourth preset condition, the first determining module is specifically configured to determine that the first transmission mechanism is a non-forwarding mechanism; or, If the link quality parameter of the first secondary link does not meet the third preset condition, the first determining module is specifically configured to determine that the first transmission mechanism is a forwarding mechanism and a non-forwarding mechanism; the non-forwarding mechanism includes a dual transmission mechanism or a monitoring mechanism;
  • the fourth preset condition includes: the signal strength of the first secondary link is less than the fourth preset signal strength, or the retransmission rate of the first secondary link is greater than the fourth preset retransmission rate, or the first secondary link
  • the packet loss rate of is greater than the fourth preset packet loss rate
  • the third preset signal strength is greater than the fourth preset signal strength
  • the third preset packet loss rate is less than the fourth preset packet loss rate
  • the third preset retransmission rate is less than the fourth preset retransmission rate
  • Determining that the first transmission mechanism includes a forwarding mechanism includes: determining that the first transmission mechanism is a forwarding mechanism.
  • the first determining module is specifically configured to determine The first transmission mechanism is a non-forwarding mechanism, or, if the link quality parameter of the first main link and the link quality parameter of the second main link do not meet the fifth preset condition, the first determining module is specifically configured to determine the first One transmission mechanism includes a forwarding mechanism;
  • Non-forwarding mechanisms include dual sending mechanism or monitoring mechanism
  • the first signal strength difference is the difference between the signal strength of the first main link and the signal strength of the second main link;
  • the first packet loss rate difference is the packet loss rate of the first main link and the second main link The difference between the packet loss rate of the link;
  • the first retransmission rate difference is the difference between the retransmission rate of the first main link and the retransmission rate of the second main link;
  • the fifth preset conditions include:
  • the first signal strength difference is less than the first preset signal strength difference, or
  • the first packet loss rate difference is less than the first preset packet loss rate difference, or
  • the first retransmission rate difference is less than the first preset retransmission rate difference.
  • the first determining module is specifically configured to determine The first transmission mechanism is a forwarding mechanism, or, if the link quality parameter of the first main link and the link quality parameter of the second main link do not meet the sixth preset condition, the first determining module is specifically configured to determine the first The transmission mechanism is forwarding mechanism and non-forwarding mechanism;
  • the sixth preset condition includes:
  • the first signal strength difference is greater than the third preset signal strength difference, or
  • the first packet loss rate difference is greater than the third preset packet loss rate difference, or
  • the first retransmission rate difference is greater than the third preset retransmission rate difference
  • the first preset signal strength difference is less than the third preset signal strength difference; the first preset packet loss rate difference is less than the third preset packet loss rate difference; the first preset retransmission rate difference is less than the third The preset retransmission rate difference.
  • the first determining module is specifically configured to determine
  • the first transmission mechanism is a forwarding mechanism or a non-forwarding mechanism
  • the second signal strength difference is the difference between the signal strength of the first secondary link and the signal strength of the second primary link;
  • the second packet loss rate difference is the packet loss rate of the first secondary link and the second primary link The difference between the packet loss rate;
  • the second retransmission rate difference is the difference between the retransmission rate of the first secondary link and the retransmission rate of the second primary link;
  • the seventh preset conditions include:
  • the difference in the second signal strength is greater than the second preset signal strength difference, or
  • the difference in the second packet loss rate is greater than the difference in the second preset packet loss rate, or
  • the difference in the second retransmission rate is greater than the difference in the second preset retransmission rate.
  • the first determining module is specifically configured to determine that the first transmission mechanism is a non-forwarding mechanism Or, if the signal strength of the second primary link is less than the signal strength of the first secondary link, the first determining module is specifically configured to determine that the first transmission mechanism is a forwarding mechanism.
  • a switching module 1901 is further included, and the switching module is connected to the first determining module;
  • the switching module is used to switch the non-forwarding mechanism to the forwarding mechanism
  • the switching module 1901 includes a first switching module 2001 and a second switching module 2002; or, the switching module 1901 includes a third switching module 2003 and a second switching module 2003.
  • the first switching module is used to switch the non-forwarding mechanism to the non-forwarding mechanism and the forwarding mechanism
  • the second switching module is used to switch the non-forwarding mechanism and the forwarding mechanism to the forwarding mechanism
  • the third switching module is used to switch the forwarding mechanism to a non-forwarding mechanism and a forwarding mechanism
  • the fourth switching module is used to switch the non-forwarding mechanism and the forwarding mechanism to the non-forwarding mechanism.
  • an update module 2101 is further included, and the Bluetooth data is audio data;
  • the update module is used to update the first transmission mechanism every time one or more audio data packets of audio data are received or sent, or the change rate of the link quality parameter exceeds a predetermined rate, and the first transmission mechanism is updated once, or in accordance with a preset Periodically update the first transmission mechanism.
  • a reconnection module 2101 is further included. If the first transmission module is used to transmit Bluetooth data according to the forwarding mechanism, the reconnection module is used to receive or send reconnection. Signal; the receiving frequency of the reconnection signal is determined by the link quality parameters of the first main link and the first secondary link; the reconnection signal is used to establish the second main link.
  • the frequency of the reconnection module receiving or sending reconnection signals increases.
  • the embodiment of the present application provides a data transmission device, for example, for the first Bluetooth terminal, the transmission mechanism is determined according to the link quality, so as to avoid the problem of poor Bluetooth data quality when the link quality changes due to the use of a fixed transmission mechanism , Determine the transmission mechanism according to the link quality.
  • the link quality changes you can flexibly choose to use the determined transmission mechanism to transmit Bluetooth data to improve the quality of the transmitted Bluetooth data and enhance the user experience.
  • the device 2200 includes:
  • the second determining module 2201 is configured to select the first transmission mechanism from at least two of the forwarding mechanism, the dual transmission mechanism, and the monitoring mechanism according to the link quality parameter;
  • the second transmission module 2202 is configured to transmit Bluetooth data according to the first transmission mechanism
  • the first transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism;
  • the second transmission module is configured to receive the Bluetooth data transmitted by the first Bluetooth terminal through the first main link according to the dual transmission mechanism;
  • the second transmission module is configured to receive the Bluetooth data sent by the first Bluetooth terminal through the first main link according to the forwarding mechanism, and the second transmission module is also configured to forward part or all of the Bluetooth data to the third Bluetooth terminal through the first secondary link;
  • the second transmission module receives the Bluetooth data transmitted by the first Bluetooth terminal through the first main link according to the monitoring mechanism, and the Bluetooth data transmitted by the first Bluetooth terminal received by the second transmission module through the first main link is used by the third Bluetooth End monitoring.
  • this embodiment further includes a judgment module, and the second determination module is connected to the judgment module;
  • the second transmission module is further configured to receive a request forwarding command sent by the third Bluetooth terminal, and the request forwarding command is used to request the second transmission module to forward part or all of the Bluetooth data;
  • the judging module is used for judging whether to forward part or all of the Bluetooth data according to one or both of the power or the bandwidth occupancy rate.
  • the embodiment of the present application provides a data transmission device, for example, for the second Bluetooth end, which determines the transmission mechanism according to the link quality, so as to avoid the problem of poor Bluetooth data quality when the link quality changes due to the use of a fixed transmission mechanism , Determine the transmission mechanism according to the link quality.
  • a data transmission device for example, for the second Bluetooth end, which determines the transmission mechanism according to the link quality, so as to avoid the problem of poor Bluetooth data quality when the link quality changes due to the use of a fixed transmission mechanism , Determine the transmission mechanism according to the link quality.
  • the device 2300 includes:
  • the third determining module 2301 is configured to select the first transmission mechanism from at least two of the forwarding mechanism, the dual transmission mechanism, and the monitoring mechanism according to the link quality parameter;
  • the third transmission module 2302 is configured to transmit Bluetooth data according to the first transmission mechanism
  • the first transmission mechanism includes one or more of a forwarding mechanism, a dual transmission mechanism, and a monitoring mechanism;
  • the third transmission module receives the Bluetooth data sent by the first Bluetooth terminal through the second main link according to the dual transmission mechanism
  • the third transmission module receives part or all of the Bluetooth data forwarded by the second Bluetooth terminal through the first secondary link according to the forwarding mechanism;
  • the third transmission module monitors the Bluetooth data sent by the first Bluetooth terminal to the second Bluetooth terminal through the first main link according to the monitoring mechanism.
  • the embodiment of the present application provides a data transmission device, for example, used for the third Bluetooth terminal to determine the transmission mechanism according to the link quality, so as to avoid the problem of poor Bluetooth data quality when the link quality changes due to the use of a fixed transmission mechanism , Determine the transmission mechanism according to the link quality.
  • a data transmission device for example, used for the third Bluetooth terminal to determine the transmission mechanism according to the link quality, so as to avoid the problem of poor Bluetooth data quality when the link quality changes due to the use of a fixed transmission mechanism , Determine the transmission mechanism according to the link quality.
  • An embodiment of the present application may also provide a chip for executing a data transmission method proposed in the foregoing embodiment; as shown in FIG. 24, the chip 2400 includes a memory 2401 and a processor 2402;
  • the memory is coupled to the processor
  • Memory used to store program instructions
  • the processor is configured to call the program instructions stored in the memory, so that the chip executes a data transmission method proposed in any of the foregoing embodiments. It is understandable that the chip can be a chip in a headset or a chip in a mobile phone.
  • the embodiment of the application also provides an electronic device, which includes the chip proposed in the above embodiment; the electronic device may be a headset or a mobile phone.
  • the electronic device may be a headset or a mobile phone.
  • the embodiments of the present application may also provide a computer-readable storage medium, including: a computer program is stored thereon, and when the computer program is executed by a processor, the data transmission method of any one of the above-mentioned embodiments is implemented, and the specific implementation process thereof See the above and the beneficial effects, which will not be repeated here.
  • the foregoing method embodiments of the present application may be applied to a processor or implemented by a processor.
  • the processor may be an integrated circuit chip with signal processing capabilities.
  • the steps of the foregoing method embodiments may be completed by hardware integrated logic circuits in the processor or instructions in the form of software.
  • the above-mentioned processor may be a general-purpose processor, a digital signal processor (digital signal processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (field programmable gate array, FPGA) or other Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • Programming logic devices discrete gates or transistor logic devices, discrete hardware components.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (programmable rom, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electrically available Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • static random access memory static random access memory
  • dynamic RAM dynamic RAM
  • DRAM dynamic random access memory
  • synchronous dynamic random access memory synchronous DRAM, SDRAM
  • double data rate synchronous dynamic random access memory double data rate SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • synchronous connection dynamic random access memory serial DRAM, SLDRAM
  • direct rambus RAM direct rambus RAM
  • B corresponding to A means that B is associated with A, and B can be determined according to A.
  • determining B based on A does not mean that B is determined only based on A, and B can also be determined based on A and/or other information.
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disks or optical disks and other media that can store program codes. .

Landscapes

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

Abstract

一种数据传输方法、装置、芯片、电子设备及存储介质,涉及信号处理领域。该方法包括:根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制,根据第一传输机制传输蓝牙数据,第一传输机制包括转发机制、双发机制和监听机制中的一种或多种;双发机制包括第一蓝牙端通过第一主链路和第二主链路分别传输蓝牙数据给第二蓝牙端和第三蓝牙端;转发机制包括第一蓝牙端通过第一主链路传输蓝牙数据给第二蓝牙端,第二蓝牙端接收的部分或者全部蓝牙数据用于由第二蓝牙端通过第一副链路转发给第三蓝牙端;本方法提升了音频质量。

Description

一种数据传输方法、装置、芯片、电子设备及存储介质 技术领域
本申请涉及通信领域,尤其涉及一种数据传输方法、装置、芯片、电子设备及存储介质。
背景技术
在多设备的应用场景下,以手机和多耳机之间的通信为例,假设采用双发机制,如果两个耳机都与手机建立连接,并且手机通过该连接分别传输蓝牙数据给两个耳机,则当其中一个耳机与手机之间的链路质量较差时,会影响到蓝牙数据的质量。假设蓝牙数据为音频数据,例如,左耳机与手机之间的链路质量好,右耳机与手机之间的链路质量差时,右耳机未收到足够的音频数据,而使得右耳机的播放出现卡顿现象,因而音频播放质量降低,影响用户体验。
而如果采用转发机制,例如,左耳机与手机建立连接传输音频数据,然后左耳机转发给右耳机,这种转发的传输机制要求左右耳之间的链路比较稳定,如果左耳机与右耳机之间的链路不稳定,则容易导致转发不成功而使得右耳机收不到音频数据或者接收失败。
因此,现有技术中无论采用何种机制都不能保证在链路质量改变时保持较好的蓝牙数据质量,都会影响用户体验。
发明内容
针对现有技术中的传输机制中存在的在链路质量改变时蓝牙数据质量较差的问题,本申请提供了一种数据传输方法、装置、芯片、电子设备及存储介质。
本申请的实施例的第一方面提供了一种数据传输方法,包括:
根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制,根据第一传输机制传输蓝牙数据;
双发机制包括第一蓝牙端通过第一主链路和第二主链路分别传输蓝牙数据给第二蓝牙端和第三蓝牙端;
转发机制包括第一蓝牙端通过第一主链路传输蓝牙数据给第二蓝牙端,第二蓝牙端接收的部分或者全部蓝牙数据用于由第二蓝牙端通过第一副链路转 发给第三蓝牙端;
监听机制包括第一蓝牙端通过第一主链路传输蓝牙数据给第二蓝牙端,第一蓝牙端传输给第二蓝牙端的蓝牙数据被第三蓝牙端监听。
另外,结合第一方面,在第一方面的一种实现方式中,在根据第一传输机制传输蓝牙数据之前还包括:根据转发机制和非转发机制传输蓝牙数据;非转发机制包括双发机制或者监听机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,还包括:在第一时间段,根据第二传输机制传输蓝牙数据,在第二时间段,根据第一传输机制传输蓝牙数据;在第三时间段,根据转发机制和非转发机制传输蓝牙数据;第三时间段在第一时间段与第二时间段之间;
第二传输机制包括转发机制、双发机制和监听机制中的一种或多种;第一传输机制与第二传输机制不同。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,根据转发机制和非转发机制传输蓝牙数据的过程中,更新第一传输机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,链路质量参数包括丢包率、信号强度和重传率中的一种或者多种;
第一主链路的信号强度大于或者等于第二主链路的信号强度,或者第一主链路的丢包率小于或者等于第二主链路的丢包率,或者第一主链路的重传率小于或者等于第二主链路的重传率;
根据链路质量参数选择第一传输机制包括:根据第二主链路的链路质量参数、第一副链路的链路质量参数和第一主链路的链路质量参数中的一种或多种选择第一传输机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,根据链路质量参数选择第一传输机制具体包括:
根据第二主链路的链路质量参数选择第一传输机制;或者根据第一副链路的链路质量参数选择第一传输机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,选择第一传输机制具体包括:
根据第一主链路的链路质量参数和第二主链路的链路质量参数选择第一传输机制;或者
根据第一副链路的链路质量参数和第二主链路的链路质量参数确选择第 一传输机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,根据第二主链路的链路质量参数选择第一传输机制包括:
若第二主链路的链路质量参数满足第一预设条件,确定第一传输机制包括非转发机制;或者,若第二主链路的链路质量参数不满足第一预设条件,确定第一传输机制包括转发机制;非转发机制包括双发机制或监听机制;
第一预设条件包括:第二主链路的信号强度大于或者等于第一预设信号强度,或者第二主链路的重传率小于或者等于第一预设重传率,或者,第二主链路的丢包率小于或者等于第一预设丢包率。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,第一预设信号强度为第一副链路的信号强度;第一预设重传率为第一副链路的重传率;第一预设丢包率为第一副链路的丢包率;
确定第一传输机制包括非转发机制包括:确定第一传输机制为非转发机制;
确定第一传输机制包括转发机制包括:确定第一传输机制为转发机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,若第二主链路的链路质量参数不满足第一预设条件,确定第一传输机制包括转发机制,包括:确定第一传输机制为转发机制,或者,确定第一传输机制为转发机制和非转发机制;
若第二主链路的链路质量参数满足第二预设条件,确定第一传输机制为转发机制;或者,若第二主链路的链路质量参数不满足第二预设条件,确定第一传输机制为转发机制和非转发机制;
第二预设条件包括:第二主链路的信号强度小于第二预设信号强度,或者第二主链路的重传率大于第二预设重传率,或者,第二主链路的丢包率大于第二预设丢包率;
第一预设信号强度大于第二预设信号强度,第一预设重传率小于第二预设重传率,第一预设丢包率小于第二预设丢包率;
确定第一传输机制包括非转发机制包括:确定第一传输机制为非转发机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,根据第一副链路的链路质量参数选择第一传输机制包括:
若第一副链路的链路质量参数满足第三预设条件,确定第一传输机制包括转发机制;或者,若第一副链路的链路质量参数不满足第三预设条件,确定第一传输机制包括非转发机制;非转发机制包括双发机制或监听机制;
第三预设条件包括:第一副链路的信号强度高于第三预设信号强度,或者第一副链路的重传率低于第三预设重传率,或者第一副链路的丢包率低于第三预设丢包率。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,第三预设信号强度为第二主链路的信号强度;第三预设丢包率为第二主链路的丢包率,第三预设重传率为第二主链路的重传率;
确定第一传输机制包括非转发机制包括:确定第一传输机制为非转发机制;
确定第一传输机制包括转发机制包括:确定第一传输机制为转发机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,若第一副链路的链路质量参数不满足第三预设条件,确定第一传输机制包括非转发机制,包括:确定第一传输机制为非转发机制,或者,确定第一传输机制为转发机制和非转发机制;
若第一副链路的链路质量参数满足第四预设条件,确定第一传输机制为非转发机制;或者,若第一副链路的链路质量参数不满足第三预设条件,确定第一传输机制为转发机制和非转发机制;非转发机制包括双发机制或监听机制;
第四预设条件包括:第一副链路的信号强度小于第四预设信号强度,或者,第一副链路的重传率大于第四预设重传率,或者,第一副链路的丢包率大于第四预设丢包率;
第三预设信号强度大于第四预设信号强度;
第三预设丢包率小于第四预设丢包率;
第三预设重传率小于第四预设重传率;
确定第一传输机制包括转发机制包括:确定第一传输机制为转发机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,根据第一主链路的链路质量参数和第二主链路的链路质量参数选择第一传输机制包括:若第一主链路的链路质量参数和第二主链路的链路质量参数满足第五预设条件,确定第一传输机制为非转发机制,或者,若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第五预设条件,确定第一传输机 制包括转发机制;
非转发机制包括双发机制或者监听机制;
第一信号强度差值为第一主链路的信号强度和第二主链路之间的信号强度之差;第一丢包率差值为第一主链路的丢包率和第二主链路的丢包率之差;第一重传率差值为第一主链路的重传率和第二主链路的重传率之差;
第五预设条件包括:
第一信号强度差值小于第一预设信号强度差值,或者
第一丢包率差值小于第一预设丢包率差值,或者
第一重传率差值小于第一预设重传率差值。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第五预设条件,确定第一传输机制包括转发机制,包括:
若第一主链路的链路质量参数和第二主链路的链路质量参数满足第六预设条件,确定第一传输机制为转发机制,或者,若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第六预设条件,确定第一传输机制为转发机制和非转发机制;
第六预设条件包括:
第一信号强度差值大于第三预设信号强度差值,或者
第一丢包率差值大于第三预设丢包率差值,或者
第一重传率差值大于第三预设重传率差值;
第一预设信号强度差值小于第三预设信号强度差值;第一预设丢包率差值小于第三预设丢包率差值;第一预设重传率差值小于第三预设重传率差值。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,根据第一副链路的链路质量参数和第二主链路的链路质量参数选择转发机制包括:若第一副链路的链路质量参数和第二主链路的链路质量参数满足第七预设条件,确定第一传输机制为转发机制或非转发机制;非转发机制包括双发机制或者监听机制;
第二信号强度差值为第一副链路的信号强度和第二主链路的信号强度之差;第二丢包率差值为第一副链路的丢包率和第二主链路之间的丢包率之差;第二重传率差值为第一副链路的重传率和第二主链路的重传率之差;
第七预设条件包括:
第二信号强度的差值大于第二预设信号强度差值,或者
第二丢包率的差值大于第二预设丢包率差值,或者
第二重传率的差值大于第二预设重传率差值。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,若第二主链路的信号强度大于或者等于第一副链路的信号强度,确定第一传输机制为非转发机制;或者,若第二主链路的信号强度小于第一副链路的信号强度,确定第一传输机制为转发机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,其特征在于,蓝牙数据为音频数据;
每接收或者发送音频数据的一个或多个音频数据包,更新一次第一传输机制,或者,链路质量参数的变化速率超过预定速率,更新一次第一传输机制,或者以预设周期更新第一传输机制。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,若根据转发机制传输蓝牙数据,接收或者发送重连信号;重连信号的接收频率由第一主链路和第一副链路的链路质量参数确定;重连信号用于建立第二主链路。
另外,结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,若第一主链路的信号强度增大并且第一副链路的信号强度增大,接收或者发送重连信号的频率增大。
本申请的实施例的第二方面提供了一种数据传输方法,包括:
根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制,根据第一传输机制传输蓝牙数据;
双发机制包括第二蓝牙端通过第一主链路接收第一蓝牙端传输的蓝牙数据;
转发机制包括第二蓝牙端通过第一主链路接收第一蓝牙端发送的蓝牙数据,第二蓝牙端通过第一副链路转发部分或者全部蓝牙数据给第三蓝牙端;
监听机制包括第二蓝牙端通过第一主链路接收第一蓝牙端传输的蓝牙数据,第二蓝牙端通过第一主链路接收的蓝牙数据被第三蓝牙端监听。
另外,结合第二方面,在第二方面的一种实现方式中,确定第一传输机制包括转发机制之前包括:
第二蓝牙端接收第三蓝牙端发送的请求转发命令,请求转发命令用于请 求第二蓝牙端传输部分或者全部蓝牙数据给第三蓝牙端;
第二蓝牙端接收到请求转发命令后,根据第二蓝牙端的电量或者带宽占用率中的一种或两种判断是否传输部分或者全部蓝牙数据给第三蓝牙端。
本申请的实施例的第三方面提供了一种数据传输方法,包括:
根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制,根据第一传输机制传输蓝牙数据;
双发机制包括第三蓝牙端通过第二主链路接收第一蓝牙端发送的蓝牙数据;
转发机制包括第三蓝牙端接收第二蓝牙端通过第一副链路转发的部分或者全部蓝牙数据;
监听机制包括第三蓝牙端监听第一蓝牙端通过第一主链路发送给第二蓝牙端的蓝牙数据。
本申请的实施例的第四方面提供了一种数据传输装置,包括:
第一确定模块,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;和
第一传输模块,用于根据第一传输机制传输蓝牙数据;
第一传输模块用于根据双发机制通过第一主链路和第二主链路分别传输蓝牙数据给第二蓝牙端和第三蓝牙端;
第一传输模块还用于根据转发机制通过第一主链路传输蓝牙数据给第二蓝牙端,第二蓝牙端接收的部分或者全部蓝牙数据用于由第二蓝牙端通过第一副链路转发给第三蓝牙端;
第一传输模块还用于根据监听机制通过第一主链路传输蓝牙数据给第二蓝牙端,第一传输模块传输给第二蓝牙端的蓝牙数据被第三蓝牙端监听。
本申请的实施例的第五方面提供了一种数据传输装置,包括:
第二确定模块,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;
第二传输模块,用于根据第一传输机制传输蓝牙数据;
第二传输模块用于根据双发机制通过第一主链路接收第一蓝牙端传输的蓝牙数据;
第二传输模块用于根据转发机制通过第一主链路接收第一蓝牙端发送的蓝牙数据,第二传输模块还用于通过第一副链路转发部分或者全部蓝牙数据给 第三蓝牙端;
第二传输模块用于根据监听机制通过第一主链路接收第一蓝牙端传输的蓝牙数据,第二传输模块通过第一主链路接收到的第一蓝牙端传输的蓝牙数据被第三蓝牙端监听。
本申请的实施例的第六方面提供了一种数据传输装置,包括:
第三确定模块,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;
第三传输模块,用于根据第一传输机制传输蓝牙数据;
第三传输模块用于根据双发机制通过第二主链路接收第一蓝牙端发送的蓝牙数据;
第三传输模块用于根据转发机制接收第二蓝牙端通过第一副链路转发的部分或者全部蓝牙数据;
第三传输模块用于根据监听机制监听第一蓝牙端通过第一主链路发送给第二蓝牙端的蓝牙数据。
本申请的实施例的第七方面提供了一种芯片,用于实现数据传输方法,其特征在于,包括存储器和处理器;
存储器与处理器耦合;
存储器,用于存储程序指令;
处理器,用于调用存储器存储的程序指令,使得芯片执行上述第一方面、第二方面或者第三方面的数据传输方法。
本申请的实施例的第八方面提供了一种电子设备,包括如第七方面提供的芯片。
本申请的实施例的第九方面提供了一种计算机可读存储介质,包括:其上存储有计算机程序,计算机程序被处理器执行时实现上述第一方面、第二方面或第三方面的数据传输方法。
与现有技术相比,本申请实施例的有益效果在于,本申请实施例提供了一种数据传输方法,根据链路质量确定传输机制,以避免采用固定的传输机制而使得链路质量变化时出现蓝牙数据质量差的问题,根据链路质量确定传输机制,在链路质量变化时,可以灵活选择采用确定的传输机制传输蓝牙数据,以提高传输的蓝牙数据的质量,提升了用户体验。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例的一种数据传输方法的流程图;
图2为本申请实施例的双发机制的示意图;
图3为本申请实施例的监听机制的示意图;
图4为本申请实施例的转发机制的示意图;
图5为本申请实施例的一种数据传输方法的流程图;
图6为本申请实施例的根据第二主链路的链路质量参数确定第一传输机制的流程图;
图6A为本申请实施例的根据第二主链路的链路质量参数确定第一传输机制的又一流程图;
图7为本申请实施例的根据第二主链路的链路质量参数确定第一传输机制的再一流程图;
图8为本申请实施例的根据第二主链路的链路质量参数确定第一传输机制的再一流程图;
图9为本申请实施例的根据第一副链路的链路质量参数确定第一传输机制的流程图;
图9A为本申请实施例的根据第一副链路的链路质量参数确定第一传输机制的又一流程图;
图10为本申请实施例的根据第一副链路的链路质量参数确定第一传输机制的再一流程图;
图11为本申请实施例的根据第一主链路的链路质量参数和第二主链路的链路质量参数确定第一传输机制的流程图;
图12为本申请实施例的根据第一主链路的链路质量参数和第二主链路的链路质量参数确定第一传输机制的又一流程图;
图13为本申请实施例的根据第一副链路的链路质量参数和第二主链路的链路质量参数确定第一传输机制的流程图;
图14为本申请实施例的根据第一副链路的链路质量参数和第二主链路 的链路质量参数确定第一传输机制的又一流程图;
图15为本申请实施例的将非转发机制切换为转发机制的流程图;
图16为本申请实施例的将转发机制切换为非转发机制的流程图;
图17为本申请实施例的确定是否传输蓝牙数据给第三蓝牙端的流程图;
图18为本申请实施例的一种数据传输装置的示意图;
图19为本申请实施例的一种数据传输装置的又一示意图;
图20A为本申请实施例的切换模块的示意图;
图20B为本申请实施例的切换模块的又一示意图;
图21为本申请实施例的又一数据传输装置的示意图;
图22为本申请实施例的再一数据传输装置的示意图;
图23为本申请实施例的再一数据传输装置的示意图;
图24为本申请实施例的芯片的示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的部分实施例采用举例的方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在各例子中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。
本申请实施例提供了一种数据传输方法,该数据传输方法可以用于传输各种类型的蓝牙数据,例如视频数据、指令数据或音频数据等,本实施例以音频数据为例进行说明。本实施例提供的数据传输方法可以用于具备蓝牙功能的多种智能设备中,例如,耳机、音箱、手机、智能手表等。其中,第一蓝牙端可以用于传输蓝牙数据,第二蓝牙端和第三蓝牙端可以用于接收蓝牙数据,第一蓝牙端、第二蓝牙端、第三蓝牙端可以是具有蓝牙功能的芯片、组件或者电子设备等,例如,第一蓝牙端可以是手机、电脑等发送蓝牙数据的电子设备,第二蓝牙端、第三蓝牙端可以是智能音箱、耳机等接收蓝牙数据的电子设备。本实施例中,第一蓝牙端、第二蓝牙端和第三蓝牙端都可以采用BR(Basic Rate,基本速率)蓝牙协议,即第一蓝牙端、第二蓝牙端和第三蓝牙端都可以采用经典蓝牙技术,例如,第一蓝牙端、第二蓝牙端和第三蓝牙端也可以采用EDR(Enhanced Data Rate,增强数据率)技术;另外,本实施例中,第一蓝牙端、 第二蓝牙端和第三蓝牙端也都可以采用BLE(Bluetooth low energy,低功耗蓝牙)协议,第一蓝牙端、第二蓝牙端和第三蓝牙端也可以分别称之为第一BLE端、第二BLE端、第三BLE端。第一蓝牙端、第二蓝牙端和第三蓝牙端可以全部支持经典蓝牙协议或者低功耗蓝牙协议,或者,第一蓝牙端、第二蓝牙端和第三蓝牙端可以同时支持经典蓝牙协议和低功耗蓝牙协议。请参考图1,图1是本申请实施例的一种数据传输方法的流程图,该方法可以用于第一蓝牙端、第二蓝牙端或者第三蓝牙端,该方法包括以下步骤:
步骤S101:根据链路质量参数选择第一传输机制;
步骤S102:根据第一传输机制传输蓝牙数据。
在步骤S101中,链路质量参数可以理解为评估链路质量的参数,本实施例中的链路可以理解为同步链路或者异步链路,也可以理解为表示蓝牙设备之间维持正常通信所形成的数据交互通道,包括但不限于使用蓝牙协议中通过建立连接形成的链路或是通过广播等其他方式进行数据交互而形成的数据通道,本实施例对链路的具体类型不作限制。链路质量参数可以包括丢包率、信号强度和重传率中的一种或者多种,本实施例对此不作限制,链路质量参数还可以包括接收信噪比等参数,本实施例中的信号强度可以理解为表示信号强度的物理量,例如可以是接收信号的强度,也可以是接收信号强度与发射信号强度的比值,或者是接收功率与发射功率的比值,该信号强度通常可以用RSSI(Received Signal Strength Indication,接收的信号强度指示)表示。本实施例中,需要根据链路质量确定第一传输机制,例如,根据第二主链路的链路质量参数、第一副链路的链路质量参数和第一主链路的链路质量参数中的至少两种确定第一传输机制,可以为根据第一主链路的链路质量参数和第二主链路的链路质量参数确定第一传输机制,也可以为根据第一副链路的链路质量参数和第二主链路的链路质量参数确定第一传输机制,根据至少两种链路质量参数选择第一传输机制,可以便于综合分析链路的质量,以使得确定的第一传输机制更准确,可以提高蓝牙数据传输的成功率。另外,当根据第一主链路、第二主链路、第一副链路的链路质量参数来确定第一传输机制时,考虑到的链路更多,可以显著提高蓝牙数据传输的成功率,例如,在三条链路的链路质量都较好时,可以互相比较链路质量,以确定第一传输机制。
本实施例中第一传输机制包括转发机制或非转发机制中的一种或两种,即传输机制可以是转发机制,也可以是非转发机制,也可以是同时维持转发机 制和非转发机制。对于步骤S101,选择第一传输机制也可以理解为确定第一传输机制,例如,在从转发机制、双发机制和监听机制中的至少两种传输机制中,根据链路质量参数选择转发机制、双发机制和监听机制中的一种或者多种传输蓝牙数据。
非转发机制包括双发机制或监听机制。第一传输机制包括转发机制、双发机制和监听机制中的一种或多种,例如,第一传输机制可以为转发机制、双发机制和监听机制中的一种或者两种;双发机制如图2所示,可以理解为第一蓝牙端分别发送蓝牙数据给第二蓝牙端和第三蓝牙端,即第一蓝牙端和第二蓝牙端之间存在链路,可以称之为第一主链路,第一蓝牙端和第三蓝牙端之间也存在链路,可以称之为第二主链路,第一蓝牙端通过第一主链路给第二蓝牙端发送蓝牙数据,第一蓝牙端通过第二主链路给第三蓝牙端发送蓝牙数据。本实施例中,蓝牙数据可以理解为音频数据,蓝牙数据可以是完整的音频数据,也可以是左声道或者右声道的音频数据,例如,在双发机制中,第一蓝牙端发送给第二蓝牙端的蓝牙数据可以为右声道的音频数据,第一蓝牙端发送给第三蓝牙端的蓝牙数据可以为左声道的音频数据。图2中所示的第一主链路和第二主链路用双箭头示出,可以理解的是,该第一主链路和第二主链路除了分别用于第一蓝牙端发送蓝牙数据给第二蓝牙端和第三蓝牙端之外,还可以用于第二蓝牙端和第三蓝牙端给第一蓝牙端发送数据信息,例如,还可以用于第二蓝牙端和第三蓝牙端给第一蓝牙端发送应答消息,以表明第二蓝牙端和第三蓝牙端是否收到该蓝牙数据。监听机制如图3所示,可以理解为第一蓝牙端通过第一主链路发送蓝牙数据给第二蓝牙端,该蓝牙数据被第三蓝牙端监听,在第二蓝牙端和第三蓝牙端之间还可以建立第二副链路用来传输指令信息,例如同步信息或者密钥等信息,例如,第二蓝牙端可以将蓝牙数据的密钥信息通过第二副链路传输给第三蓝牙端,以使得第三蓝牙端可以解密获取到监听的该蓝牙数据的具体信息;同步信息用于实现第二蓝牙端和第三蓝牙端之间的同步,例如,可以保证左右耳机在播放的过程中,同时播放的数据是一致的。当第一蓝牙端、第二蓝牙端或者第三蓝牙端中任意一端不支持双发机制时,第一传输机制可以为监听机制,当第一蓝牙端、第二蓝牙端或者第三蓝牙端中任意一端不支持监听机制时,第一传输机制可以为双发机制,这样可以提高设备的兼容性以及灵活性。
转发机制如图4所示,可以理解为第一蓝牙端传输蓝牙数据给第二蓝牙 端,第二蓝牙端接收的蓝牙数据由第二蓝牙端转发给所述第三蓝牙端。对于转发机制,第一蓝牙端和第二蓝牙端之间存在链路,可以称之为第一主链路,第一主链路用于第一蓝牙端传输蓝牙数据给第二蓝牙端,第二蓝牙端和第三蓝牙端之间也存在链路,可以称之为第一副链路,第二蓝牙端通过该第一副链路将该蓝牙数据转发给第三蓝牙端,例如,音频数据或者应答消息,本实施例中,第二蓝牙端转发给第三蓝牙端的蓝牙数据可以是完整的音频数据,也可以是左声道或者右声道的音频数据,即,也可以是部分蓝牙数据。例如,第一蓝牙端发送给第二蓝牙端的蓝牙数据可以为完整的音频数据,第二蓝牙端转发给第三蓝牙端的蓝牙数据可以为左声道的音频数据,可以理解的是,在第二蓝牙端,可以完成蓝牙数据的分离。本实施例中,在采用转发机制时,当第一蓝牙端与第二蓝牙端之间的链路的质量优于第一蓝牙端与第三蓝牙端之间的链路质量时,使用第二蓝牙端作为转发端,这样可以使得数据传输更稳定,例如,第一主链路的信号强度高于第二主链路的信号强度,或者第一主链路的重传率低于第二主链路的重传率,或者,所述第一主链路的丢包率低于第二主链路的丢包率时,可以选择第二蓝牙端作为转发端。对于转发机制,第一蓝牙端与第三蓝牙端之间的第二主链路可以不存在,即第一蓝牙端与第三蓝牙端可以不直接交互信息。在转发机制中,本实施例只是以第二蓝牙端作为转发端为例进行说明,可以理解的是,只要第二蓝牙端或者第三蓝牙端中有任意一端可以收到第一蓝牙端的蓝牙数据,则收到该蓝牙数据的蓝牙端可以作为转发端。本实施例中,仅以第一蓝牙端、第二蓝牙端、第三蓝牙端为例进行说明,但是可以理解的是本方案适用于任意多个蓝牙端的场景。
本实施例中,可以由第一蓝牙端根据链路质量参数确定第一传输机制,也可以由第二蓝牙端或者第三蓝牙端根据链路质量参数选择第一传输机制。当由第一蓝牙端根据链路质量参数选择第一传输机制时,可以节省功耗,因为一般来说,第二蓝牙端或者第三蓝牙端是小型化设备或者是便携式设备,电池的容量较小,因此由第一蓝牙端来选择第一传输机制会更节省第二蓝牙端和第三蓝牙端的功耗,另外,由第一蓝牙端确定第一传输机制之后,可以由第一蓝牙端将该第一传输机制通知给第二蓝牙端和第三蓝牙端,以实现三者配合完成蓝牙数据的传输。
在步骤S102中,根据被确定的第一传输机制传输蓝牙数据。可以理解为使用被确定的第一传输机制传输蓝牙数据。被确定的第一传输机制可以是转发 机制,也可以是双发机制,也可以是监听机制,也可以转发机制和双发机制并存,也可以是转发机制和监听机制并存。
本申请实施例提供了一种数据传输方法,根据链路质量确定第一传输机制,以避免采用固定的传输机制而使得链路质量变化时蓝牙数据质量也变差,根据链路质量参数确定第一传输机制,在链路质量变化时,可以灵活选择使用对应的机制传输蓝牙数据,以起到提高蓝牙数据质量的目的,提升了用户体验。
基于上述实施例公开的内容,本实施例中,在第一时间段,根据第二传输机制传输蓝牙数据,在第二时间段,根据第一传输机制传输蓝牙数据;如图5所示,本实施例提供的数据传输方法包括:
步骤S501:在第一时间段,根据第二传输机制传输蓝牙数据;
步骤S502:根据链路质量参数选择第一传输机制;
步骤S503:在第二时间段,根据第一传输机制传输蓝牙数据。
本实施例中,第二传输机制包括转发机制、双发机制和监听机制中的一种或多种。第二传输机制可以理解为传输机制的初始状态,即默认的传输机制,或者是上一时刻的传输机制,例如,可以默认第二传输机制为转发机制,或者是双发机制,或者是监听机制等。当根据链路质量参数确定了第一传输机制后,该第二传输机制可以切换为第一传输机制以适应链路质量的变化。本实施例中,根据链路质量参数选择第一传输机制可以是周期性的,即周期性的查询是否需要切换该第二传输机制。当链路质量变化较快时,其查询周期变短,当链路质量变化较慢时,其查询周期变长,例如,第一主链路、第二主链路以及第一副链路的信号强度、丢包率或者重传率变化越快,则可以以越快的频率周期性的根据链路质量参数确定第一传输机制。步骤S502、步骤S503与前述实施例中的步骤S101和步骤S102相同或者近似,此处不再赘述,在步骤S501中,在第一时间段,根据第二传输机制传输蓝牙数据,第一时间段传输的可以是蓝牙数据的前半部分数据包,当第二传输机制切换为第一传输机制后,可以根据第一传输机制继续传输该蓝牙数据,即传输该蓝牙数据后半部分数据包。
基于上述实施例公开的内容,本实施例中,链路质量参数包括丢包率、信号强度和重传率中的一种或者多种,第一主链路的链路质量参数可以理解为第一蓝牙端和第二蓝牙端之间的链路质量参数,第二主链路的链路质量参数可以理解为第一蓝牙端和第三蓝牙端之间的链路质量参数,第一副链路的链路质量参数可以理解为第二蓝牙端和第三蓝牙端之间的链路质量参数。第一主链路 的信号强度大于或者等于第二主链路的信号强度,或者第一主链路的丢包率小于或者等于第二主链路的丢包率,或者第一主链路的重传率小于或者等于所述第二主链路的重传率;本实施例中,第一主链路的链路质量高于第二主链路的链路质量,在转发机制或者监听机制中,第一蓝牙端通过链路质量较高的第一主链路将蓝牙数据传输给第二蓝牙端,可以提高该蓝牙数据的传输成功率。
本实施例中,根据链路质量参数确定第一传输机制包括:根据第二主链路的链路质量参数、第一副链路的链路质量参数和第一主链路的链路质量参数中的一种或多种确定第一传输机制。在确定选择何种第一传输机制时,可以考虑第一主链路、第二主链路以及第一副链路的链路质量参数中的一种或多种,根据这三条链路的链路质量参数,可以确定此时的链路质量适合何种传输机制。例如,当第一主链路的信号强度和第二主链路的信号强度都较高时,例如,高于一设定阈值时,可以选择非转发机制作为第一传输机制,即双发机制或者监听机制都可以。当第一主链路的信号强度和第一副链路的信号强度都较高时,例如,高于该一设定阈值时,可以选择转发机制,即第一传输机制可以为转发机制。
基于上述实施例公开的内容,本实施例中,根据链路质量参数确定第一传输机制包括:根据所述第二主链路的所述链路质量参数确定第一传输机制。第二主链路用于第一蓝牙端与第三蓝牙端之间传输蓝牙数据,若该第二主链路的链路质量好,则可以使用非转发机制,例如,双发机制或者监听机制,若该第二主链路的链路质量较差,则表明第三蓝牙端与第一蓝牙端的通信可能出现异常,这样,可以选择转发机制,即该第一传输机制为转发机制,以使得第二蓝牙端也可以收到部分或者全部蓝牙数据,即第三蓝牙端的蓝牙数据的来源为第二蓝牙端,这样可以保证三者可以正常通信。由于不管是何种机制,都存在与第一蓝牙端连接的蓝牙端,本实施例以第一蓝牙端与第二蓝牙端之间存在第一主链路来举例说明,在第一主链路的链路质量高于第二主链路的情况下,可以通过判断第二主链路的链路质量来确定选择转发机制和非转发机制中的哪一种或者哪两种作为第一传输机制。
基于上述实施例公开的内容,本实施例中,根据链路质量参数确定第一传输机制包括:根据所述第一副链路的链路质量参数确定第一传输机制。第一副链路用于第二蓝牙端转发蓝牙数据给第三蓝牙端,若该第一副链路的链路质量较好,则可以使用转发机制,若该链路的链路质量较差,则可以使用非转发 机制,例如,双发机制或者监听机制。由于不管是何种机制,都存在与第一蓝牙端连接的蓝牙端,本实施例以第一蓝牙端与第二蓝牙端之间存在第一主链路来举例说明,在第一主链路的链路质量高于第二主链路的情况下,可以通过判断第一副链路的链路质量来确定选择转发机制和非转发机制中的哪一种或者哪两种作为第一传输机制。
基于上述实施例公开的内容,本实施例中,如图6所示,根据第二主链路的链路质量参数选择第一传输机制包括以下步骤:
步骤S601:判断第二主链路的链路质量参数是否满足第一预设条件;若第二主链路的链路质量参数满足第一预设条件,则执行步骤S601A;
步骤S601A:确定第一传输机制包括非转发机制;
在第二主链路的链路质量较好时,可以确定第一传输机制包括非转发机制。第一预设条件包括:第二主链路的信号强度大于或者等于第一预设信号强度,或者第二主链路的重传率小于或者等于第一预设重传率,或者,第二主链路的丢包率小于或者等于第一预设丢包率。当第二主链路的信号强度大于第一预设信号强度时,表示第二主链路的链路质量较好,本实施例中,对第二主链路来说,第一预设信号强度可以表示可以正常接收蓝牙数据时第二主链路的信号强度,例如,接收蓝牙数据的成功率大于99%时的第二主链路的信号强度。可以理解的是,第二主链路的信号强度与接收到蓝牙数据时的信号强度的衰减值有关,当接收到蓝牙数据时信号强度衰减越多,则表明第二主链路的信号强度越弱,从而成功接收蓝牙数据的成功率越小。另外,第一预设信号强度也可以表示为可以正常接收到蓝牙数据时蓝牙数据的信号功率,可以理解的是信号功率的衰减越多,则接收数据的成功率越低,则第一预设信号强度可以理解为接收蓝牙数据的成功率大于99%时的蓝牙数据的信号接收功率。本实施例中,对具体的第一预设信号强度的值不作限定,可以根据用户需求或者场景选择第一预设信号强度,第一预设重传率、第一预设丢包率同理,此处不再赘述。当第二主链路的信号强度大于第一预设信号强度时,表明第二主链路的链路质量较好,因此,第一传输机制可以包括非转发机制以顺利传输数据。当第二主链路的重传率小于第一预设重传率时或者当第二主链路的丢包率小于第一预设丢包率时,也表明第二主链路的链路质量较好,可以确定第一传输机制包括非转发机制以保证蓝牙数据顺利接收。在第二主链路的链路质量较好的情况下,倾向于使用该第二主链路传输蓝牙数据,因此,第一传输机制可以包括非转发机 制以顺利传输数据。本实施例中对第一预设重传率和第一预设丢包率的具体数据不作限制,可以根据用户需求或者场景选择任意的值,例如,在对蓝牙数据的接收质量要求比较高时,可以选择第一预设重传率和第一预设丢包率都为3%。当第二传输机制跟目前的第一传输机制相同时,第二传输机制可以不转换为第一传输机制,即,维持原来的第二传输机制即可。当第二传输机制与当前的第一传输机制不同时,可以将第二传输机制切换为第一传输机制。由于不管是何种机制,都存在与第一蓝牙端连接的蓝牙端,本实施例以第一蓝牙端与第二蓝牙端之间存在第一主链路来举例说明,在第一主链路的链路质量优于第二主链路的链路质量的条件下,通过判断第二主链路的链路质量来确定第一传输机制具体为何种机制。
本实施例中,第一传输机制包括非转发机制,具体地,第一传输机制可以为转发机制和非转发机制并行,即第一传输机制可以为转发机制和监听机制,或者,第一传输机制也可以为转发机制和双发机制,这样,第三蓝牙端的蓝牙数据的来源不仅仅有第二蓝牙端,还有第一蓝牙端,这种采用转发机制和非转发机制并行的方式可以使得第三蓝牙端接收到蓝牙数据的成功率更高。
本实施例中,第一传输机制包括非转发机制,具体地,如图6A所示,步骤S602A:第一传输机制可以为非转发机制,即仅仅根据双发机制或者监听机制传输蓝牙数据,在第二主链路的链路质量较好时,避免使用转发机制,一方面可以保证蓝牙数据的成功传输,另外一方面,比转发机制和非转发机制并行的方案更节省功耗。选择双发机制为第一传输机制时,第一蓝牙端通过该第二主链路传输蓝牙数据给第三蓝牙端,使用链路质量较好的第二主链路来传输蓝牙数据,有利于成功接收数据;选择监听机制时,不存在第二主链路,第三蓝牙端监听第一蓝牙端发送给第二蓝牙端的蓝牙数据,虽然不存在第二主链路,但是第二主链路的信号强度高于第二预设值时,也有利于监听的成功,监听效果较好,可以保证正常地监听到蓝牙数据。可以理解的是,若第一蓝牙端和第三蓝牙端之间的信号强度较小,则可能影响到第三蓝牙设备监听蓝牙数据而导致监听失败,从而使得第三蓝牙端无法获取到蓝牙数据。如图6A中,步骤S602与前述实施例中的步骤S601相同或者近似,此处不再赘述。
本实施例中,若第二主链路的链路质量参数不满足第一预设条件,即第二主链路的链路质量较差时,则可以执行步骤S601B:确定第一传输机制包括转发机制。例如,第一传输机制可以为转发机制和监听机制,或者第一传输机 制可以为转发机制和双发机制,这样,蓝牙数据传输的成功率更高。
可以理解的是,如果不考虑功耗,无论第一主链路、第二主链路或者第一副链路的链路质量如何,如果都使用转发机制和转发机制并行的方案,这样,蓝牙数据的传输成功率会得到较大提升。
本实施例中,若第二主链路的链路质量参数不满足第一预设条件,即第二主链路的链路质量较差时,第一传输机制可以为转发机制,如图6A中步骤S602B:确定第一传输机制为转发机制;这样,在第二主链路的链路质量较差时,也能够保证蓝牙数据的成功传输,另外,第二主链路的链路质量参数不满足第一预设条件时,相比于执行转发机制和非转发机制并行的方案,仅仅使用转发机制也更节省功耗。
本实施例中,第一预设信号强度可以设置为第一副链路的信号强度,即,若第二主链路的信号强度大于第一副链路的信号强度,确定第一传输机制为非转发机制,在第二主链路的链路质量比第一副链路的链路质量更好的情况下,选择非转发机制,可以充分利用到链路质量较好的第二主链路。同理,第一预设重传率也可以设置为第一副链路的重传率,第一预设丢包率也可以设置为第一副链路的丢包率。其中,第一副链路的信号强度、重传率或者丢包率都可以通过测试得到,即可以通过当前的通信数据计算出来。本实施例通过比较第一主链路和第一副链路的链路质量来选择第一传输机制,可以适应链路的不断变化,提高了用户体验。
基于上述实施例公开的内容,本实施例中,如图7所示,根据第二主链路的链路质量参数选择第一传输机制包括以下步骤:
步骤S701:判断第二主链路的链路质量参数是否满足第一预设条件;若第二主链路的链路质量参数满足第一预设条件,则执行步骤S701A;若第二主链路的链路质量参数不满足第一预设条件,则执行步骤S702;
步骤S701A:确定第一传输机制为非转发机制;
步骤S702:判断第二主链路的链路质量参数是否满足第二预设条件;若第二主链路的链路质量参数满足第二预设条件,则执行步骤S702A;若第二主链路的链路质量参数不满足第二预设条件,则执行步骤S702B;
S702A:确定第一传输机制为转发机制;
S702B:确定第一传输机制为转发机制和非转发机制。
本实施例中,步骤S701、S701A与前述实施例中的步骤S601、S601A 相同或者近似,此处不再赘述。第二预设条件包括:第二主链路的信号强度小于第二预设信号强度,或者第二主链路的重传率大于第二预设重传率,或者,第二主链路的丢包率大于第二预设丢包率。其中,第一预设信号强度大于第二预设信号强度;第一预设重传率小于第二预设重传率;第一预设丢包率小于第二预设丢包率。当第二主链路的链路质量参数满足第二预设条件时,表明此时第二主链路的链路质量较差,此时,第一传输机制可以为转发机制,避免使用非转发机制而使得蓝牙数据传输成功率降低。当第二主链路的链路质量参数不满足第一预设条件也不满足第二预设条件时,说明第二主链路的链路质量一般,此时,确定第一传输机制为转发机制和非转发机制,可以提高蓝牙数据传输的成功率。在本实施例中,判断第二主链路是否满足第一预设条件以及第二预设条件是周期性的,以及时更新第一传输机制。
请参考图8,以第一预设信号强度大于第二预设信号强度为例进行说明,根据第二主链路的所述链路质量参数选择第一传输机制可以包括以下步骤:
步骤S801:判断第二主链路的信号强度是否大于或者等于第一预设信号强度;若大于或者等于第一预设信号强度,则执行步骤S801A;若小于第一预设信号强度,则执行步骤S802;
步骤S801A:确定第一传输机制为非转发机制;
步骤S802:判断第二主链路的信号强度是否小于第二预设信号强度;若小于第二预设强度,则执行步骤S802A;若不小于第二预设信号强度,则执行步骤S802B;
步骤S802A:确定第一传输机制为转发机制;
步骤S802B:确定第一传输机制为转发机制和非转发机制。
本实施例中,当第二主链路的链路质量较好时,例如,第二主链路的信号强度高于第一预设信号强度,则第一传输机制可以为非转发机制,当第二主链路的链路质量较差时,例如,第二主链路的信号强度低于第二预设信号强度,则第一传输机制可以为转发机制,当第二主链路的链路质量一般时,例如,第二主链路的信号强度低于第一预设信号强度,但是高于第二预设信号强度时,第一传输机制可以为转发机制和非转发机制并行,这样,在第二链路质量一般时,第三蓝牙端的蓝牙数据有两个来源,以提高第三蓝牙端接收蓝牙数据的成功率。以使得无论第二主链路在何种链路质量的情况下,都可以有合适的第一传输机制,可以适应第二主链路的链路质量变化的情况。第一预设重传率小于 第二预设重传率以及第一预设丢包率小于第二预设丢包率的情况同理,此处不再赘述。
本实施例中,对第二主链路来说,第二预设信号强度可以表示可以正常接收蓝牙数据时信号强度的最低阈值,也可以理解为可以正常接收蓝牙数据时的蓝牙数据的信号功率最低阈值。本实施例中,对具体的第二预设信号强度的值不作限定,可以根据用户需求或者场景选择第二预设信号强度,第二预设重传率、第二预设丢包率同理,此处不再赘述。
本实施例中,设置了第一预设信号强度和第二预设信号强度,可以明显的区分开第一传输机制为转发机制还是非转发机制的情况,另外,对于第二主链路的信号强度,当处于第一预设信号强度和第二预设信号强度之间时,可以同时使用转发机制和非转发机制,或者也可以仅采用转发机制和非转发机制其中的任意一种。
基于上述实施例公开的内容,本实施例中,如图9所示,根据第一副链路的链路质量参数选择第一传输机制包括以下步骤:
S901:判断第一副链路的链路质量参数是否满足第三预设条件;若第一副链路的链路质量参数满足第三预设条件,则执行步骤S901A;
S901A:确定第一传输机制包括转发机制。
当第一副链路的链路质量较好时,则表示第二蓝牙端可以将该蓝牙数据通过第一副链路传输给第三蓝牙端,当第一副链路的链路质量较差时,可以选择非转发机制,避免根据该第一副链路传输蓝牙数据。第三预设条件包括:第一副链路的信号强度高于第三预设信号强度,第一副链路的信号强度高于第三预设信号强度时,表明第一副链路的链路质量较好,则可以选择转发机制使用该第一副链路传输全部或者部分蓝牙数据。该第三预设条件还包括第一副链路的重传率低于第三预设重传率,或者第一副链路的丢包率低于第三预设丢包率。当第一副链路的重传率低于第三预设重传率,或者第一副链路的丢包率低于第三预设丢包率时,表明第一副链路的链路质量较好,第一传输机制可以包括转发机制,例如,第一传输机制可以为转发机制和非转发机制并行,即第一传输机制可以为转发机制和监听机制,第一传输机制也可以为转发机制和双发机制,这样,第三蓝牙端的蓝牙数据的来源不仅仅有第二蓝牙端,还有第一蓝牙端,这种采用转发机制和非转发机制并行的方式可以使得第三蓝牙端接收到蓝牙数据的成功率更高。对于第一副链路来说,第三预设信号强度表示可以正常接收 蓝牙数据的信号强度,也可以理解为可以正常接收蓝牙数据的信号功率。本实施例中,对具体的第三预设信号强度的值不作限定,可以根据用户需求或者场景选择第三预设信号强度,第三预设重传率、第三预设丢包率同理,此处不再赘述。
本实施例中,第一传输机制可以包括转发机制,具体地,如图9A所示,步骤S902A:第一传输机制可以为转发机制,即仅仅依靠第一主链路和第一副链路传输蓝牙数据,在第一副链路的链路质量较好时,仅仅使用转发机制,一方面可以保证蓝牙数据的成功传输,另外一方面,比转发机制和非转发机制并行的方案更节省功耗。图9A中的步骤S902与前述实施例中的步骤S901相同或者近似,此处不再赘述。
本实施例中,若第一副链路的链路质量参数不满足第三预设条件,即第一副链路的链路质量较差时,则可以执行步骤S901B:确定第一传输机制包括非转发机制。例如,第一传输机制可以为转发机制和监听机制并行,或者第一传输机制可以为转发机制和双发机制并行,这样可以增加第三蓝牙端接收蓝牙数据的成功率。再例如,如图9A所示,步骤S902B:第一传输机制可以为非转发机制,即第一传输机制可以为监听机制或者双发机制,而不采用转发机制,在第一副链路的链路质量较差时,避免使用转发机制,一方面可以保证蓝牙数据的成功传输,另外一方面,比转发机制和非转发机制并行的方案更节省功耗。
本实施例中,第三预设信号强度可以设置为第二主链路的信号强度,即,当第一副链路的信号强度高于第二主链路的信号强度时,可以确定第一传输机制为转发机制,这样,可以充分利用链路质量好的第一副链路来给第三蓝牙端传输蓝牙数据,以提高蓝牙数据的传输成功率。同理,第三预设丢包率可以设置为第二主链路的丢包率,第三预设重传率可以设置为第二主链路的重传率。其中,第二主链路的信号强度、重传率或者丢包率都可以通过测试得到,即可以通过当前的通信数据计算出来。本实施例通过比较第一副链路和第二主链路的链路质量来选择第一传输机制,可以适应链路的不断变化,提高了用户体验。
为了便于理解,以第一蓝牙端为手机、第二蓝牙端为右耳机、第三蓝牙端为左耳机,蓝牙数据为音频数据进行举例说明,本实施例中,手机分别向左右耳机传输音频数据,即以第二传输机制为双发机制为例进行说明,初始状态使用的传输机制为双发机制。当左耳机与手机远离时,则左耳机与手机之间的链路质量变差,可能导致左耳机不能成功接收手机发送的音频数据,若此时左 右耳机之间的第一副链路的链路质量较好,即第一副链路的信号强度高于第三预设信号强度,或者是第一副链路的重传率低于第三预设重传率,或者是第一副链路的丢包率低于第三预设丢包率,则表明左右耳之间可以正常进行音频数据的传输,此时,第一传输机制可以包括转发机制,例如,可以关闭双发机制,选择转发机制。具体地,左耳机可以发命令请求给右耳机,该命令请求用于请求右耳机转发音频数据给自己。右耳机收到左耳机的命令请求后,可以转发该音频数据给左耳机,以使得左耳机也可以获取到该音频数据而正常播放,或者是获取到该音频数据后还可以进一步同步以取得更好的播放质量。
本实施例中,右耳机收到左耳机的命令请求之后,右耳机可以判断是否支持转发机制,即右耳机判断是否可以转发音频数据给左耳机。考虑到第二蓝牙端当前的电量或者传输速率可能会不适合使用转发机制,例如,第二蓝牙端的电量过低,不足以支撑转发机制或者不足以在预定时间段内维持转发机制,再例如,第二蓝牙端已经在跟第一蓝牙端进行数据交互,传输速率比较大,已经占有了一部分带宽资源,剩下的带宽资源不足以支撑转发机制。因此,右耳机可以根据自身的带宽占用率或者电量等情况,选择接受或者拒绝左耳机的请求。
如果右耳机接受左耳机的请求,则转发音频数据给左耳机,如果右耳机拒绝左耳机的请求,则发拒绝信息给左耳机。右耳机拒绝左耳机的请求后,左右耳机之间还可以停止同步,左右耳独立播放音频数据,互不影响。本实施例中,如果右耳机接受左耳机的请求,在转发机制下,也可以拒绝同步,即右耳机转发音频数据给左耳机后,左耳机直接播放,不需要执行同步操作。本实施例中,也可以进行同步,例如,右耳机如果接受左耳机的请求,可以保证在原来左右耳机维持同步的情况下,右耳机将音频数据传输给左耳机,左耳机将该音频数据同步后进行播放。
如果右耳机转发音频数据给左耳机,即选择了转发机制时,在右耳机转发音频的过程中,也可以查询是否需要更新第一传输机制,即重新确定第一传输机制,具体的,左耳机可以定期查询自己与手机之间的链路质量,当第二主链路的链路质量参数满足第一预设条件时,确定第一传输机制为非转发机制,即当左耳机与手机之间的链路质量变好之后,第一传输机制切换为非转发机制,右耳机停止转发音频数据给左耳机,左耳机从手机端获取音频数据,例如,第一传输机制切换为采取双发机制,一方面,避免了一直使用转发模式,而使得 第二蓝牙端的电量很快耗尽;另外,第一传输机制的不断更新也可以更加适应链路的质量变化。
基于上述实施例公开的内容,本实施例中,如图10所示,根据第一副链路的链路质量参数选择第一传输机制包括以下步骤:
步骤S1001:判断第一副链路的链路质量参数是否满足第三预设条件;若第一副链路的链路质量参数满足第三预设条件,则执行步骤S1001A;若第一副链路的链路质量参数不满足第三预设条件,则执行步骤S1002;
步骤S1001A:确定第一传输机制为转发机制;
步骤S1002:判断第一副链路的链路质量参数是否满足第四预设条件;若第一副链路的链路质量参数满足第四预设条件,则执行步骤S1002A;若第一副链路的链路质量参数不满足第四预设条件,则执行步骤S1002B;
S1002A:确定第一传输机制为非转发机制;
S1002B:确定第一传输机制为转发机制和非转发机制;
本实施例中,步骤S1001、步骤S1001A与前述实施例中的步骤S901、S901A相同或者近似,此处不再赘述。第四预设条件包括:第一副链路的信号强度小于第四预设信号强度,或者第一副链路的重传率大于第四预设重传率,或者第一副链路的丢包率大于第四预设丢包率。其中,第三预设信号强度大于第四预设信号强度;第三预设丢包率小于第四预设丢包率;第三预设重传率小于第四预设重传率。当第一副链路的链路质量参数满足第四预设条件时,表明此时第一副链路的链路质量较差,此时,第一传输机制可以为非转发机制,避免使用转发机制而使得蓝牙数据传输成功率降低。当第二主链路的链路质量参数不满足第三预设条件也不满足第四预设条件时,说明第二主链路的链路质量一般,此时,确定第一传输机制为转发机制和非转发机制,可以提高蓝牙数据传输的成功率。在本实施例中,判断第二主链路是否满足第三预设条件或者第四预设条件是周期性的,以及时更新第一传输机制。
对于第一副链路来说,第四预设信号强度可以表示可以正常接收蓝牙数据的信号强度的最低阈值,也可以理解为可以正常接收蓝牙数据的信号功率的最低阈值。本实施例中,对具体的第四预设信号强度的值不作限定,可以根据用户需求或者场景选择第四预设信号强度,第四预设重传率、第四预设丢包率同理。
本实施例中,设置了第三预设条件和第四预设条件,以明显的区分开第 一传输机制为转发机制或者非转发机制的情况,对于第一副链路的信号强度,当其处于第三预设信号强度和第四预设信号强度之间时,可以同时使用转发机制和非转发机制,另外,也可以使用转发机制或者非转发机制中的任意一种。
基于上述实施例公开的内容,本实施例中,根据链路质量参数选择传输机制还包括:根据第一主链路的链路质量参数和第二主链路的链路质量参数确定第一传输机制。同时参考第一主链路的链路质量和第二主链路的链路质量,可以更准确的评估适合采用何种第一传输机制能够保证数据传输质量,例如,第一主链路和第二主链路的链路质量较好的时候,可以选择非转发机制,例如监听机制或者双发机制。
本实施例中,根据链路质量参数确定第一传输机制还包括:根据第一副链路的链路质量参数和第二主链路的链路质量参数选择确定第一传输机制。同时参考第一副链路的链路质量和第二主链路的链路质量,可以更准确地评估采用何种第一传输机制能够保证数据传输质量。例如,第一副链路的链路质量比第二主链路的链路质量更好时,可以选择采用转发机制,通过第一副链路传输蓝牙数据。
基于上述实施例公开的内容,本实施例中,如图11所示,所述根据第一主链路的链路质量参数和第二主链路的链路质量参数选择第一传输机制包括以下步骤:
步骤S1101:判断第一主链路和第二主链路的链路质量参数是否满足第五预设条件;若第一主链路的链路质量参数和第二主链路的链路质量参数满足第五预设条件,则执行步骤S1101A;若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第五预设条件,则执行步骤S1101B;
步骤S1101A:确定第一传输机制为非转发机制;
步骤S1101B:确定第一传输机制包括转发机制。
第五预设条件包括:第一信号强度差值小于第一预设信号强度差值,第一信号强度差值为第一主链路的信号强度和第二主链路之间的信号强度之差。当第一信号强度差值小于第一预设信号强度差值时,第一主链路的信号强度与第二主链路的信号强度差别很小,当第一主链路的链路质量较好时,如果使用非转发机制,可以使得第二蓝牙端或者第三蓝牙端成功获取到蓝牙数据,因此,第一传输机制可以为双发机制或者监听机制。本实施例中,第一预设信号强度差值可以理解为第一主链路和第二主链路都刚好可以接收到蓝牙数据时的信号 强度之间的差值,第一预设信号强度差值也可以根据用户需求和场景进行选择,第一预设信号丢包率差值和第一预设重传率差值同理,本实施例对此不作限定。
当第一主链路的链路质量参数和第二主链路的链路质量参数不满足第五预设条件时,如果使用非转发机制,由于第一主链路和第二主链路的链路质量差别大,第一主链路的链路质量较好,第二主链路的链路质量较差,则可能使得第三蓝牙端不能成功获取到蓝牙数据,因此,第一传输机制可以包括转发机制,可以使用第一主链路传输蓝牙数据,第二蓝牙端收到该蓝牙数据后转发给第三蓝牙端。
步骤S1101B中,确定第一传输机制包括转发机制,具体的,第一传输机制为转发机制。当第一主链路和第二主链路差别较小时,并且第一主链路的链路质量较好时,可以只选择转发机制,以在保证蓝牙数据传输成功率的同时,避免使用转发机制和非转发机制而浪费功耗。
基于上述实施例公开的内容,本实施例中,如图12所示,所述根据第一主链路的链路质量参数和第二主链路的链路质量参数选择第一传输机制包括以下步骤:
步骤S1201:判断第一主链路和第二主链路的链路质量参数是否满足第五预设条件;若第一主链路的链路质量参数和第二主链路的链路质量参数满足第五预设条件,则执行步骤S1201A;若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第五预设条件,则执行步骤S1202;
步骤S1201A:确定第一传输机制为非转发机制;
步骤S1202:判断第一主链路的所述质量参数和第二主链路的链路质量参数是否满足第六预设条件;若第一主链路的链路质量参数和第二主链路的链路质量参数满足第六预设条件,则执行步骤S1202A;若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第六预设条件,则执行步骤S1202B;
步骤S1201A:确定第一传输机制为转发机制;
步骤S1202B:确定第一传输机制为转发机制和非转发机制;
本实施例中,当第一主链路和第二主链路之间的链路质量参数差别大时,第一传输机制为转发机制,当第一主链路和第二主链路之间的链路质量参数差别小时,第一传输机制为非转发机制,当第一主链路和第二主链路之间的链路质量参数既不满足第五预设条件也不满足第六预设条件时,第一传输机制为转发机制和非转发机制并行。
本实施例中,以第一主链路和第二主链路的链路质量的差别大小来确定选择何种传输机制,能够适应链路变化的场景。结合前述实施例公开的内容,在确定第一传输机制为转发机制后,还可以进一步判断第一副链路的链路质量参数是否满足第三预设条件,当第一副链路的链路质量参数满足第三预设条件时,表明第一副链路的链路质量较好,再采用转发机制传输蓝牙数据;在选择非转发机制时,还可以进一步判断第二主链路的链路质量参数是否满足第一预设条件,若满足,表明第二主链路的链路质量较好,再采用非转发机制传输蓝牙数据。
基于上述实施例公开的内容,本实施例中,所述根据第一副链路的链路质量参数和第二主链路的链路质量参数确定第一传输机制包括:若所述第一副链路的所述链路质量参数和所述第二主链路的所述链路质量参数满足第七预设条件,确定第一传输机制为所述转发机制或所述非转发机制。
图13为本实施例提供的选择第一传输机制的一流程图,如图13所示,该方法包括以下步骤:
步骤S1301:判断第一副链路的链路质量参数和第二主链路的链路质量参数是否满足第七预设条件;若满足,则执行步骤S1301A;
步骤S1301A:确定所述第一传输机制为转发机制或者非转发机制。
第七预设条件包括:第二信号强度的差值大于第二预设信号强度差值,第二信号强度差值为第一副链路的信号强度和第二主链路的信号强度之差。本实施例中,当第一副链路和第二主链路的链路质量相差较大时,选择转发机制和非转发机制其中的任意一种,以避免转发机制和非转发机制同时使用时带来的功耗高的问题。当第一副链路的链路质量参数和第二主链路的链路质量参数不满足第七预设条件时,说明第一副链路和第二主链路的链路质量差别较小,此时,请参考步骤S1301B,第一传输机制可以为转发机制和非转发机制,另外,也可以任意选择一种转发机制或者非转发机制。
进一步的,如图14所示,该方法还包括以下步骤:
步骤S1401:判断第一副链路的链路质量参数和第二主链路的链路质量参数是否满足第七预设条件;若满足,则执行步骤S1402;
步骤S1402:判断第二主链路的信号强度是否大于或者等于第一副链路的信号强度;若是,则执行步骤S1402A;若否,则执行步骤S1402B;
S1402A:确定第一传输机制为非转发机制;
S1402B:确定第一传输机制为转发机制;
本实施例中,步骤S1401与前述实施例中的步骤S1301相同或者近似,步骤S1403与前述实施例中的步骤S1301B相同或者近似,此处不再赘述。
在步骤S1402中,以链路质量参数为信号强度进行举例说明,需要说明的是,步骤S1402也可以通过判断丢包率或者重传率实现,具体的,例如,判断第二主链路的丢包率是否小于第一副链路的丢包率;若是,则执行步骤S1402A;若否,则执行步骤S1402B;再例如,判断第二主链路的重传率是否小于第一副链路的重传率;若是,则执行步骤S1402A;若否,则执行步骤S1402B。
当第一副链路的信号强度高于第二主链路的信号强度时,可以选择转发机制。当第一副链路的信号强度高于第二主链路的信号强度并且第二信号强度的差值大于第二预设信号强度差值时,可以表明第一副链路的链路质量优于第二主链路的链路质量,因此,可以选择转发机制,需要说明的是,在转发机制中,默认第一主链路的链路质量也较好,可以支持传输蓝牙数据给第二蓝牙端。本实施例中,第二预设信号强度差值可以根据用户需求和场景进行选择,本实施例对此不作限定。
第七预设条件还包括:第二丢包率的差值大于第二预设丢包率差值,第二丢包率差值为第一副链路的丢包率和第二主链路之间的丢包率之差。当第一副链路的丢包率低于第二主链路的丢包率并且第二丢包率的差值大于第二预设丢包率差值时,可以表明第一副链路的链路质量优于第二主链路的链路质量,因此,可以选择转发机制。本实施例中,第一预设丢包率差值可以根据用户需求和场景进行选择,本实施例对此不作限定。
第七预设条件还包括:第二重传率的差值大于第二预设重传率差值,第二重传率差值为第一副链路的重传率和第二主链路的重传率之差。当第一副链路的重传率低于第二主链路的重传率并且第二重传率的差值大于第二预设重传率差值时,可以表明第一副链路的链路质量优于第二主链路的链路质量,因此,可以选择转发机制。本实施例中,第一预设重传率差值可以根据用户需求和场景进行选择,本实施例对此不作限定。
本实施例中,第一预设信号强度差值可以等于第二预设信号强度差值,当二者相等时,对于链路质量区别大小的评估的参考标准相同,但是本实施例对此不作限定,二者也可以不相等。同理,第一预设丢包率差值可以等于第二预设丢包率差值,第一预设重传率差值也可以等于第二预设重传率差值,此处 不再赘述。
基于上述实施例公开的内容,本实施例中,若初始状态为非转发机制,如果确定第一传输机制为转发机制,则可以从所述非转发机制切换为所述转发机制,或者,从所述非转发机制切换为非转发机制和转发机制并行,再切换为转发机制。若初始状态为非转发机制,如果确定第一传输机制为转发机制和非转发机制,则可以从非转发机制切换为非转发机制和转发机制。当非转发机制和转发机制并行时,第三蓝牙端可以收到第二蓝牙端转发的蓝牙数据,另外,第三蓝牙端还可以收到第一蓝牙端发送的数据,或者第三蓝牙端可以监听到第一蓝牙端发送给第二蓝牙端的蓝牙数据,这样,可以最大程度的保证第三蓝牙端可以获取到该蓝牙数据。若初始状态为转发机制,如果确定第一传输机制为非转发机制,则可以从转发机制切换为非转发机制,或者,从转发机制切换为非转发机制和转发机制并行,再切换为非转发机制。若初始状态为转发机制,如果确定第一传输机制为转发机制和非转发机制,则可以从转发机制切换为非转发机制和转发机制并行。在两个不同状态切换时,可以有一个中间状态,其中间状态可以为转发机制和非转发机制,以避免在切换的过程中漏掉部分蓝牙数据,以使得传输质量变差。
为了便于理解,以第一蓝牙端为手机、第二蓝牙端为右耳机、第三蓝牙端为左耳机,蓝牙数据为音频数据进行举例说明。本实施例中,手机分别向左右耳机传输音频数据,即,初始状态为双发机制,在第一主链路和第二主链路的链路质量都较好的情况下,左右耳机收到的音频数据包的个数一般是相等的,左右耳机可以分别记录下各自收到的音频数据包的个数N。当左耳机与手机远离时,左耳机与手机之间的链路质量变差,左耳机与手机之间的重传率和丢包率变高,即第二主链路的重传率和丢包率变高,链路质量差可能导致左耳机不能成功接收手机发送的音频数据,此时若右耳机与手机之间的第一主链路的链路质量好,则左右耳收到的音频数据包的个数可能不一致,右耳机收到的音频数据包比左耳机收到的音频数据包要多。若此时左右耳机之间的第一副链路的链路质量较好,即所述第一副链路的信号强度高于第三预设信号强度,或者是第一副链路的重传率低于第三预设重传率,或者是第一副链路丢包率低于第三预设丢包率,则表明左右耳之间可以正常进行音频数据的传输,此时,确定第一传输机制可以包括转发机制,例如,第一传输机制为转发机制。但是本实施例可以不直接由双发机制切换为转发机制,而是先由双发机制切换为转发机制 和非转发机制并行,再切换为转发机制。例如,第一传输机制在一段时间内可以为转发机制和非转发机制并行,即从所述非转发机制切换为转发机制和非转发机制并行。左耳机向手机请求重传数据的同时,也向右耳机请求转发右耳机收到的音频数据,向右耳机请求转发的音频数据包可以是左耳机没有收到的或者接收失败的音频数据包,另外,左耳机向右耳机请求转发的音频数据包也可以是没有收到的或者接收失败的音频数据包的下一个音频数据包。右耳机收到该左耳机发出的请求后,可以查询自己是否已经收到了该被请求的数据包,若也没有收到,则在回复给左耳机的应答中标记失败。若右耳机已经收到了该被请求的数据包,则转发该被请求的音频数据包给左耳机,此时,第一传输机制可以仅仅为转发机制。
如果左耳机收到的右耳机的应答中标记失败,则继续向手机请求传输音频数据包,也同时请求右耳机转发音频数据包,被请求的音频数据包可以是上一次未收到或者接收失败的第N个数据包,也可以是接下来要接收的第N+1个数据包,本实施例对此不作限制,本实施例以被请求的音频数据包为第N个数据包为例进行说明。如果左耳机收到手机端发送的该第N个音频数据包,而没有收到右耳机发送的第N个音频数据包,则可以判断第二主链路的所述链路质量参数是否满足第一预设条件,例如,若第二主链路的信号强度大于第一预设信号强度,则第一传输机制可以包括非转发机制,例如,此时,第一传输机制可以为非转发机制,即,第一传输机制重新确定为非转发机制,在这种情况下,可以停止转发机制,左耳机仅接收手机发送的音频数据包或者是监听手机发给右耳机的音频数据包。本实施例中,第一传输机制由双发机制切换为了转发机制和非转发机制并行,后面又重新确定为非转发机制。可以理解的是,第一传输机制的更新是周期性的,当链路质量改变迅速时,第一传输机制会在各种传输机制之间来回转换。
如果左耳机收到了右耳机转发的该第N个音频数据包,则左耳机可以对收到的音频数据包进行校验。
如果校验后发现该第N个音频数据包不正确,处理方法与前述实施例中左耳机收到右耳机的应答中标记失败的情况类似,例如,可以继续向手机请求传输音频数据包,也同时请求右耳机转发音频数据包,被请求的音频数据包可以是上一次未收到或者接收失败的第N个数据包,也可以是接下来要接收的第N+1个数据包,本实施例对此不作限制,另外,如果校验后发现该第N个音频 数据包不正确,而左耳机收到手机端发送的该第N个音频数据包,则也可以判断第二主链路的所述链路质量参数是否满足第一预设条件,例如,若第二主链路的信号强度大于第一预设信号强度,则第一传输机制可以包括非转发机制,例如,此时,第一传输机制为非转发机制,即,第一传输机制重新确定为非转发机制,在这种情况下,可以停止转发机制,左耳机仅接收手机发送的音频数据包或者是监听手机发给右耳机的音频数据包。本实施例中,每收到一个音频数据包后就检查一次第一传输机制是否需要更新,以此可以适应链路质量的快速变化。
如果校验后发现该第N个音频数据包正确,则判断是否收到手机端发送的该第N个音频数据包,若未收到手机端发送的第N个数据包,则可以判断第二主链路的链路质量参数是否满足所述第一预设条件,若不满足,则确定第一传输机制包括转发机制,例如,可以停止非转发机制,仅仅使用转发机制,左耳机使用右耳机转发的音频数据进行播放;若收到手机端发送的第N个数据包,则可以在手机发送的第N个音频数据包和右耳机发送的第N个音频数据包之间任意选择一个进行播放,另外一个未被选择的第N个音频数据包被丢弃。
本实施例中,当左耳机与手机之间的链路质量变差时,可以从非转发机制切换到转发机制和非转发机制并行,以保证数据传输质量的同时做到平滑无感的切换,即左耳机会在一段时间内,同时向右耳机和手机请求数据,以保证正常的播放,避免在切换的过程中产生传输中断的情况。
本实施例中,右耳机收到左耳机的命令请求之后,右耳机可以判断是否支持转发机制,即右耳机可以判断是否可以转发音频数据给左耳机。第二蓝牙端当前的电量或者传输速率可能会不适合转发机制,例如,第二蓝牙端的电量过低,不足以支撑转发机制或者不足以在预定时间内维持转发机制,再例如,第二蓝牙端已经在跟第一蓝牙端进行数据交互,传输速率比较大,已经占有了一部分带宽资源,剩下的带宽资源不足以支撑转发机制。因此,右耳机可以根据自身的带宽或者电量等情况,选择接受或者拒绝左耳机的请求,如果接受左耳机的请求,则转发音频数据给左耳机,如果拒绝左耳机的请求,则发拒绝信息给左耳机,右耳机拒绝左耳机的请求后,左右耳之间可以停止同步,左右耳独立播放音频数据,左右耳机互不影响。本实施例中,在转发机制下,也可以不进行同步,即右耳机转发音频数据给左耳机后,左耳机直接播放。本实施例中,也可以进行同步,例如,右耳机如果接受左耳机的请求,可以保证在原来 左右耳机同步不变的情况下,右耳机将音频数据传输给左耳机,左耳机可以继续播放同步后的音频数据。如果右耳机转发音频数据给左耳机,在右耳机转发的过程中,左耳机定期查询自己与手机之间的链路质量,当第二主链路的链路质量参数满足第一预设条件时,可以选择非转发机制,即当左耳机与手机之间的链路质量变好之后,可以选择非转发机制,右耳机停止转发音频数据给左耳机,左耳机从手机端获取音频数据。
本实施例中,在每收到一个或多个音频数据包后,可以判断是否需要切换传输机制,或者是链路质量出现变化后,判断是否需要切换传输机制,以使得可以快速响应链路质量变化带来的蓝牙数据不能正确接收的问题,也可以降低不必要的重传次数,进而降低功耗。
本实施例中,确定了第一传输机制后还包括将第二传输机制切换为第一传输机制,其中,第二传输机制可以理解为初始状态,例如,前一时刻采用的传输机制。若初始状态为转发机制,则将第二传输机制且切换为第一传输机制包括:从所述转发机制切换为非转发机制,或者,从所述转发机制切换为非转发机制和转发机制并行。另外,当初始状态为非转发机制时,将第二传输机制且切换为第一传输机制包括:从非转发机制切换为转发机制,或者从非转发机制切换为转发机制和非转发机制并行。当第一传输机制为非转发机制和转发机制时,即非转发机制和转发机制并行时,第三蓝牙端可以收到第二蓝牙端转发的蓝牙数据,另外,第三蓝牙端还可以收到第一蓝牙端发送的数据,或者第三蓝牙端可以监听到第一蓝牙端发送给第二蓝牙端的蓝牙数据,这样,可以最大程度的保证第三蓝牙端可以获取到该蓝牙数据。
基于上述实施例公开的内容,本实施例中,如图15所示,将非转发机制切换为转发机制可以包括以下步骤:
步骤S1501:从非转发机制切换为非转发机制和转发机制;
步骤S1502:从非转发机制和转发机制切换为转发机制。
如果直接由非转发机制切换为转发机制,则可能会导致数据传输中断,可能会出现部分数据包丢失或者延迟而带来播放卡顿的现象,因此,中间增加一个非转发机制和转发机制并行的状态,可以避免数据传输受到切换动作的影响,能最大程度地保证都能收到蓝牙数据。同理,如图16所示,将转发机制切换为非转发机制包括:
步骤S1601:从转发机制切换为非转发机制和转发机制;
步骤S1602:从非转发机制和转发机制切换为非转发机制。
结合上述实施例公开的内容,本实施例中,在根据第一传输机制传输蓝牙数据之前还可以包括一个过渡阶段,在该过渡阶段,可以根据转发机制和非转发机制传输蓝牙数据,这样可以避免蓝牙数据在机制切换的过程中出现蓝牙数据传输失败,可以进一步提高蓝牙数据的传输成功率。具体的,在第一时间段,根据第二传输机制传输蓝牙数据,在第二时间段,根据选择的第一传输机制传输蓝牙数据,在第三时间段,根据转发机制和非转发机制传输蓝牙数据,第三时间段在第一时间段和第二时间段之间,即不直接由第二传输机制切换为第一传输机制,而是在第一时间段和第二时间段之间插入一个过渡阶段,在这个过渡阶段,同时采用转发机制和非转发机制传输蓝牙数据,可以避免蓝牙数据在机制切换的过程中出现蓝牙数据传输失败,可以进一步提高蓝牙数据的传输成功率。
另外,也可以不选择第一传输机制,而采用转发机制和非转发机制来传输蓝牙数据,这样,可以省略确定第一传输机制这个步骤,并且蓝牙数据的传输成功率也会提高。但是考虑到同时采用转发机制和非转发机制带来的功耗较高,这对于蓝牙设备,特别是低功耗蓝牙设备来说,会使得电量消耗速度变快,因此,本实施例也可以将这种转发机制和非转发机制并行的方案设置为一个过渡阶段,相比于直接采用转发机制和非转发机制,可以节省功耗。
结合上述实施例公开的内容,本实施例中,在根据转发机制和非转发机制传输蓝牙数据的过程中,可以更新第一传输机制,例如,在第三时间段,可以更新第一传输机制,以使得可以及时响应链路质量的变化,本实施例中,更新第一传输机制也是根据链路质量来更新的,以便于确保可以及时跟踪链路质量的变化。
结合上述实施例公开的内容,当左耳机与手机之间的链路质量变差时,可以从非转发机制切换到转发机制和非转发机制并行,以保证数据传输质量的同时做到平滑无感的切换,即左耳机会在一段时间内,同时向右耳机和手机请求数据,以保证正常的播放。在从非转发机制切换到转发机制和非转发机制并行之后,可以再切换为转发机制。在后续的时间中,若第二主链路的所述链路质量参数满足第一预设条件,还可以再确定第一传输机制为非转发机制;即第二主链路的信号强度大于第一预设信号强度,或者第二主链路的重传率小于第一预设重传率,或者,第二主链路的丢包率小于第一预设丢包率,此时,左耳 机与手机之间的链路质量变好,可以选择非转发机制传输蓝牙数据。
基于上述实施例公开的内容,本实施例中,第一传输机制为非转发机制和转发机制包括:
第一蓝牙端通过第一主链路传输所述蓝牙数据给第二蓝牙端;第二蓝牙端通过第一副链路转发部分或者全部蓝牙数据给第三蓝牙端;
第一蓝牙端通过第二主链路传输蓝牙数据给第三蓝牙端,或者,第一蓝牙端传输给第二蓝牙端的蓝牙数据被第三蓝牙端监听。在非转发机制和转发机制并行时,可以是同时维持转发机制和双发机制,也可以是同时维持转发机制和监听机制。在这种非转发机制和转发机制并行的情况下,接收端能最大概率的接收到的蓝牙数据,在维持一段时间转发机制和非转发机制并行后,根据链路质量的变化快慢,或者每接收一个音频数据包,可以再判断选择转发机制或者非转发机制中的任意一种来传输蓝牙数据,以进一步节省功耗。
基于上述实施例公开的内容,本实施例中,每接收或者发送音频数据的一个或者多个音频数据包,则可以更新一次第一传输机制,以使得第一传输机制可以及时响应链路的变化。本实施例中,收到一个音频数据包之后,可以计算一次链路质量参数,以判断是否需要更新第一传输机制。在发送一个音频数据包后,也可以计算一次链路质量参数,例如,可以通过应答消息来获取到链路质量参数。另外,当链路质量参数的变化速率很高时,例如,超过预定速率时,则更新一次传输机制,以仅仅在链路质量发生较大变化时,才查询是否需要更新第一传输机制,可以节省功耗。另外,还可以以预设周期更新该第一传输机制,这样,第一传输机制会定期的调整。本实施例中,第一蓝牙端、第二蓝牙端或者第三蓝牙端都可以更新该第一传输机制,当为第一蓝牙端更新该第一传输机制时,更节省第二蓝牙端和第三蓝牙端的功耗。当第二传输机制包括转发机制时,可以由第二蓝牙端更新该第一传输机制,由于在转发机制时,第二蓝牙端直接与第一蓝牙端和第三蓝牙端通信,因此,更容易获取到各个链路的链路质量参数,则会使得更新的速度更快,以减少延时。
基于上述实施例公开的内容,本实施例中,若当前的第一传输机制为转发机制,即此时不存在第二主链路,第三蓝牙端可以传输重连信号给所述第一蓝牙端;第三蓝牙端根据第二主链路的信号强度来调节传输重连信号的频率。在转发机制下,第三蓝牙端会传输重连信号给第一蓝牙端,以建立第二主链路,从而可以获取到第二主链路的链路参数,以确定是否需要更新第一传输机制。 在第三蓝牙端发送重连信号时,可以理解的是,若第二主链路的信号强度较大,则第三蓝牙端可以以较高的频率发送该重连信号,当第二主链路的信号强度较小时,第三蓝牙端可以以较低的频率发送该重连信号,这样,可以避免在第二主链路的链路质量较差时,由于高频率地发送重连信号而浪费功耗。而此时,第二主链路还没有建立,蓝牙端均不能直接获取第二主链路的链路质量,因此,可以根据第一主链路和第一副链路的链路质量参数来间接确定第二主链路的链路质量。对于第一蓝牙端来说,第一蓝牙端接收该重连信号,则接收频率也由第一主链路和第一副链路的链路质量参数确定,当第三蓝牙端以较高的频率发送重连信号时,第一蓝牙端也会以较高的频率接收到该重连信号。
为了便于理解,以第一蓝牙端为手机、第二蓝牙端为右耳机、第三蓝牙端为左耳机,蓝牙数据为音频数据进行举例说明。假设初始状态为转发机制,例如左耳机已经与手机断开了第二主链路,左耳机仅仅通过右耳机的转发来获取音频数据。由于转发过程会使得右耳机耗电加快,并且转发也带来一定延时,因此,左耳机可以不断地尝试与手机建立连接,或者手机不断地尝试与左耳机建立连接,即尝试建立第二主链路,本实施例以左耳机主动发起建立连接为例进行说明。在左耳机距离手机较远的情况下,左耳机与手机之间的第二主链路质量较差,此时左耳机与手机之间建立连接的动作大概率不会成功,并且会使得功耗加大,而如果左耳机不尝试与耳机建立连接,则会导致当左耳机靠近手机时,依然采用转发机制,会影响用户体验。因此,可以在左耳机接近耳机时,即左耳机与手机之间的第二主链路的链路质量较好时,左耳机与手机尝试建立连接。例如左耳机可以以较低的频率尝试与手机建立连接,建立连接后,可以判断第二主链路的所述链路质量参数是否满足第一预设条件,若满足,则第一传输机制可以包括非转发机制,具体的,第一传输机制可以为非转发机制。本实施例中,可以间接判断第二主链路的链路质量好坏,以确定第三蓝牙端和第一蓝牙端之间以何种频率建立连接,即第三蓝牙端以何种频率发送重连信号。
当左耳机与耳机之间的通信质量较差,以至于第二主链路的链路质量参数满足第二预设条件时,第一传输机制为转发机制,在左耳机与手机断开连接之前,可以向右耳机发送一条通知消息,通知右耳机当前左耳机与手机之间停止数据传输,右耳机收到该通知消息后记录下当前时刻右耳机与手机之间的信号强度(RSSI between right earphone and mobile phone,RM-RSSI),以及左耳机与右耳机之间的信号强度(RSSI between right earphone and left phone, RL-RSSI),左耳机与手机断开后,右耳机定期查询后续时刻的RM-RSSI与RL-RSSI并与之前记录的数据相比较,如果信号强度均增大,或者二者加权后的和增大,则通知左耳机尝试与手机建立连接,或者是通知左耳机以更短的周期尝试与手机连接,即以更高的频率发送重连信号。相反的,如果信号强度均减小,或者二者的加权和减小,则左耳机不尝试重连或者是减小尝试重连的频率,即不发送重连信号或者是以更低的频率发送重连信号。本实施例中,在第一主链路的信号强度和第一副链路的信号强度均增大时,可以理解为右耳机靠近手机,并且左耳机和右耳机之间的距离减小,在这种情况下,左耳机与手机之间的距离大概率也会减小,因此,当第一主链路的信号强度增大并且第一副链路的信号强度增大时,重传信号的发送频率增大,可以使得在左耳机靠近耳机时,使得左耳机与手机建立连接。本实施例中,当第一主链路的信号强度和第一副链路的信号强度的加权和增大时,由于手机与右耳机之间的相对位置进行了调整,此时,左耳机可能也在靠近手机,因此,当二者的加权和增大时,右耳机通知左耳机使得左耳机尝试与手机建立连接,或者右耳机通知左耳机以更高的频率尝试与手机连接,以使得当左耳机可能靠近手机时,左耳机也可以及时与手机连接。本实施例中,对于加权和的具体权值分配不作限定,例如,当第一主链路的信号强度和第一副链路的信号强度的权值可以均为0.5,或者分别为0.6和0.4,本实施例中,尝试与手机连接可以理解为发送重连信号,可以理解的是,当第三蓝牙端发送重连信号时,第一蓝牙端接收该重连信号,因此,当发送频率增大时,接收频率也增大。
这种利用右耳机与手机之间的信号强度和左右耳机之间的信号强度的变化以判断左耳机是否尝试与手机建立连接或者是以多大的频率尝试建立连接的方法,可以实现利用原本就存在的数据信息,避免左耳机额外开启扫描,进一步节省了功耗。在左耳机远离手机时,不会尝试与手机重连,或者是以较大的周期尝试与手机重连,在左耳机靠近手机时,右耳机检测到信号强度的变化后,会发消息让左耳机尝试与手机连接或者是增大与手机尝试连接的频率。从尝试连接到连接成功的过程中,可以采用此方法来节省功耗,并且左耳机与手机连接成功后,可以判断第二主链路的所述链路质量参数是否满足第一预设条件,以确定第一传输机制包括非转发机制,例如,第一传输机制为非转发机制,以维持平稳播放。本实施例以信号强度为例进行说明,可以理解的是,第一主链路的丢包率减小并且第一副链路的丢包率减小,接收或者发送重连信号的频率 也增大;或者,第一主链路的重传率减小并且第一副链路的重传率减小,接收或者发送重连信号的频率也增大;或者,第一主链路的丢包率和第一副链路的丢包率的加权和减小,接收或者发送重连信号的频率也增大;或者,第一主链路的重传率和第一副链路的重传率的加权和减小,接收或者发送重连信号的频率也增大,本实施例不再赘述。
本申请实施例还可提供一种数据传输方法,用于第二蓝牙端或者第三蓝牙端,该方法包括以下步骤:
根据链路质量参数确定第一传输机制;
根据第一传输机制传输蓝牙数据。
第一传输机制包括转发机制、双发机制和监听机制中的一种或多种;
双发机制包括第二蓝牙端通过第一主链路接收所述第一蓝牙端传输的所述蓝牙数据;
转发机制包括第二蓝牙端通过第一主链路接收第一蓝牙端发送的蓝牙数据,第二蓝牙端通过第一副链路转发部分或者全部蓝牙数据给所述第三蓝牙端;
监听机制包括第二蓝牙端通过第一主链路接收第一蓝牙端传输的蓝牙数据,第二蓝牙端通过第一主链路接收的蓝牙数据被第三蓝牙端监听。
本实施例中,可以由第二蓝牙端确定第一传输机制,该第一传输机制确定后,可以由第二蓝牙端通知其他蓝牙端,以实现三者配合完成蓝牙数据的传输。本实施例的具体实现方式及有益效果参见上述,此处不再赘述。
基于上述实施例公开的内容,本实施例中,请参考图17,步骤S1703:根据转发机制蓝牙数据之前包括以下步骤:
步骤S1701:第二蓝牙端接收第三蓝牙端发送的请求转发命令,请求转发命令用于请求第二蓝牙端传输部分或者全部蓝牙数据给第三蓝牙端;
步骤S1702:第二蓝牙端接收到请求转发命令后,根据第二蓝牙端的电量或者带宽占用率判断是否传输部分或者全部蓝牙数据给第三蓝牙端;若是,则执行步骤S1703,若否,则执行步骤S1704:确定第一传输机制不包括转发机制。
本实施例中,由于第二蓝牙端的电量或者传输速率可能会不适合转发机制,例如,第二蓝牙端的电量过低,不足以支撑转发机制或者不足以在预定时间内维持转发机制,再例如,第二蓝牙端已经在跟第一蓝牙端进行数据交互,传输速率比较大,已经占有了一部分带宽资源,剩下的带宽资源不足以支撑转 发机制。因此,在根据转发机制传输蓝牙数据之前,第三蓝牙端可以发送请求转发命令给第二蓝牙端,以使得第二蓝牙端在接收到该转发命令后,根据其电量或者传输速率判断是否支持转发机制,也可以同时考虑电量和带宽占有率,即根据其电量和传输速率判断是否传输蓝牙数据给第三蓝牙端。
基于上述实施例公开的内容,本实施例中,以蓝牙数据包括音频数据为例进行说明,在非转发机制下,若第一蓝牙端靠近第二蓝牙端,但是第三蓝牙端距离第一蓝牙端较远,则由于第二蓝牙端距离第一蓝牙端近,因此,第一主链路的链路质量较好,因而第二蓝牙端可以收到足够的音频数据,但是由于第二主链路链路质量差,第三蓝牙端不能收到足够的音频数据,或者第三蓝牙端监听不到第一蓝牙端发给第二蓝牙端的音频数据。而为了实现同步,第二蓝牙端可能会放弃一些本来收到的音频数据,这样会影响用户体验,为了解决该问题,可以采用关闭同步的方法,以达到至少第二蓝牙端可以正常播放音频数据的效果。这样,在单个耳机有足够的音频数据时,单个耳机可以正常播放,以避免另一个没有收到足够音频数据的耳机影响收到了足够音频数据的耳机。因此,在第二蓝牙端和第三蓝牙端同步效果比较差的情况下,可以停止同步。具体地,以第二蓝牙端为右耳机,第三蓝牙端为左耳机举例说明。左右耳机之间建立一条第二副链路,用于传输数据同步信息以实现数据同步。左右耳机分别与音源建立链路传输音频数据,音源可以理解为手机,左右耳机分别监控与音源之间的信号强度以及重传率等,左右耳机之间定期交互左右耳机之间的信号强度以及重传率等信息并将各自与音源的丢包率、重传率以及信号强度通知到对端。当其中一只耳机与音源之间的信号强度、丢包率或者重传率到达对应设置的阈值后,代表该耳机已经收不到足够的音频数据,并且也不能很好的与对端耳机同步,因此,可以停止两个耳机之间的同步,两个耳机各自单独播放自己收到的音频数据。
当左耳机与音源之间的信号强度、丢包率或者重传率到达对应设置的阈值后,左耳机将这些信息发送给右耳机以表示左耳机接收数据异常,右耳机收到该信息后,判断自己与音源之间的链路质量是否优于左耳机与音源之间的链路质量,若右耳机与手机之间的信号强度较高,则右耳机通知左耳机停止同步,然后右耳机继续与音源进行数据交互,左耳机不与右耳机同步,两个耳机各自独立播放或者左耳机停止播放。这样就可以保证右耳机正常工作。
本申请实施例还可提供一种数据传输方法,该方法包括:
根据链路质量参数确定第一传输机制,根据第一传输机制传输蓝牙数据,第一传输机制包括转发机制、双发机制和监听机制中的一种或多种;
双发机制包括第三蓝牙端通过第二主链路接收第一蓝牙端发送的蓝牙数据;
转发机制包括第三蓝牙端接收第二蓝牙端通过第一副链路转发的部分或者全部蓝牙数据;
监听机制包括第三蓝牙端监听第一蓝牙端通过第一主链路发送给第二蓝牙端的蓝牙数据。
本申请实施例提供了一种数据传输方法,可以用于第三蓝牙端,根据链路质量确定传输机制,以避免采用固定的传输机制而使得链路质量变化时出现蓝牙数据质量差的问题,根据链路质量确定传输机制,在链路质量变化时,可以灵活选择采用确定的传输机制传输蓝牙数据,以提高传输的蓝牙数据的质量,提升了用户体验。
本申请实施例还可提供一种数据传输装置,如图18所示,该装置1800包括:
第一确定模块1801,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;和
第一传输模块1802,用于根据第一传输机制传输蓝牙数据;
第一传输机制包括转发机制、双发机制和监听机制中的一种或多种;
第一传输模块用于根据双发机制通过第一主链路和第二主链路分别传输蓝牙数据给第二蓝牙端和第三蓝牙端;
第一传输模块还用于根据转发机制通过第一主链路传输蓝牙数据给第二蓝牙端,第二蓝牙端接收的部分或者全部蓝牙数据用于由第二蓝牙端通过第一副链路转发给第三蓝牙端;
第一传输模块还用于根据监听机制通过第一主链路传输蓝牙数据给第二蓝牙端,第一传输模块传输给第二蓝牙端的蓝牙数据被第三蓝牙端监听。
基于上述实施例公开的内容,本实施例中,第一传输模块还用于根据转发机制和非转发机制传输蓝牙数据;非转发机制包括双发机制或者监听机制。
基于上述实施例公开的内容,本实施例中,第一传输模块还用于在第一时间段,根据第二传输机制传输蓝牙数据,在第二时间段,根据第一传输机制传输蓝牙数据;在第三时间段,根据转发机制和非转发机制传输所述蓝牙数据; 第三时间段在第一时间段与第二时间段之间,第一传输机制与第二传输机制不同;
第二传输机制包括转发机制、双发机制和监听机制中的一种或多种。
基于上述实施例公开的内容,本实施例中,第一确定模块还用于在根据转发机制和非转发机制传输蓝牙数据的过程中,更新第一传输机制。
基于上述实施例公开的内容,本实施例中,链路质量参数包括丢包率、信号强度和重传率中的一种或者多种;
第一主链路的信号强度大于或者等于第二主链路的信号强度,或者第一主链路的丢包率小于或者等于第二主链路的丢包率,或者第一主链路的重传率小于或者等于第二主链路的重传率;
第一确定模块具体用于根据第二主链路的链路质量参数、第一副链路的链路质量参数和第一主链路的链路质量参数中的一种或多种选择第一传输机制。
基于上述实施例公开的内容,本实施例中,第一确定模块具体用于根据第二主链路的链路质量参数选择第一传输机制;或者根据第一副链路的链路质量参数选择第一传输机制。
基于上述实施例公开的内容,本实施例中,第一确定模块具体用于:
根据第一主链路的链路质量参数和第二主链路的链路质量参数选择第一传输机制;或者
根据第一副链路的链路质量参数和第二主链路的链路质量参数选择第一传输机制。
基于上述实施例公开的内容,本实施例中,若第二主链路的链路质量参数满足第一预设条件,第一确定模块具体用于确定第一传输机制包括非转发机制;或者,若第二主链路的链路质量参数不满足第一预设条件,传输机制具体用于确定第一传输机制包括转发机制;
第一预设条件包括:第二主链路的信号强度大于或者等于第一预设信号强度,或者第二主链路的重传率小于或者等于第一预设重传率,或者,第二主链路的丢包率小于或者等于第一预设丢包率。
基于上述实施例公开的内容,本实施例中,第一预设信号强度为第一副链路的信号强度;第一预设重传率为第一副链路的重传率;第一预设丢包率为第一副链路的丢包率。
基于上述实施例公开的内容,本实施例中,若第二主链路的链路质量参 数满足第二预设条件,第一确定模块具体用于确定第一传输机制为转发机制;或者,若第二主链路的链路质量参数不满足第二预设条件,第一确定模块具体用于确定第一传输机制为转发机制和非转发机制;
第二预设条件包括:第二主链路的信号强度小于第二预设信号强度,或者第二主链路的重传率大于第二预设重传率,或者,第二主链路的丢包率大于第二预设丢包率;
第一预设信号强度大于第二预设信号强度,第一预设重传率小于第二预设重传率,第一预设丢包率小于第二预设丢包率;
确定第一传输机制包括非转发机制包括:确定第一传输机制为非转发机制。
基于上述实施例公开的内容,本实施例中,若第一副链路的链路质量参数满足第三预设条件,第一确定模块具体用于确定第一传输机制包括转发机制;或者,若第一副链路的链路质量参数不满足第三预设条件,第一确定模块具体用于确定第一传输机制包括非转发机制;非转发机制包括双发机制或监听机制;
第三预设条件包括:第一副链路的信号强度高于第三预设信号强度,或者第一副链路的重传率低于第三预设重传率,或者第一副链路的丢包率低于第三预设丢包率。
基于上述实施例公开的内容,本实施例中,第三预设信号强度为第二主链路的信号强度;第三预设丢包率为第二主链路的丢包率,第三预设重传率为第二主链路的重传率。
基于上述实施例公开的内容,本实施例中,若第一副链路的链路质量参数满足第四预设条件,第一确定模块具体用于确定第一传输机制为非转发机制;或者,若第一副链路的链路质量参数不满足第三预设条件,第一确定模块具体用于确定第一传输机制为转发机制和非转发机制;非转发机制包括双发机制或监听机制;
第四预设条件包括:第一副链路的信号强度小于第四预设信号强度,或者,第一副链路的重传率大于第四预设重传率,或者,第一副链路的丢包率大于第四预设丢包率;
第三预设信号强度大于第四预设信号强度;
第三预设丢包率小于第四预设丢包率;
第三预设重传率小于第四预设重传率;
确定第一传输机制包括转发机制包括:确定第一传输机制为转发机制。
基于上述实施例公开的内容,本实施例中,若第一主链路的链路质量参数和第二主链路的链路质量参数满足第五预设条件,第一确定模块具体用于确定第一传输机制为非转发机制,或者,若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第五预设条件,第一确定模块具体用于确定第一传输机制包括转发机制;
非转发机制包括双发机制或者监听机制;
第一信号强度差值为第一主链路的信号强度和第二主链路之间的信号强度之差;第一丢包率差值为第一主链路的丢包率和第二主链路的丢包率之差;第一重传率差值为第一主链路的重传率和第二主链路的重传率之差;
第五预设条件包括:
第一信号强度差值小于第一预设信号强度差值,或者
第一丢包率差值小于第一预设丢包率差值,或者
第一重传率差值小于第一预设重传率差值。
基于上述实施例公开的内容,本实施例中,若第一主链路的链路质量参数和第二主链路的链路质量参数满足第六预设条件,第一确定模块具体用于确定第一传输机制为转发机制,或者,若第一主链路的链路质量参数和第二主链路的链路质量参数不满足第六预设条件,第一确定模块具体用于确定第一传输机制为转发机制和非转发机制;
第六预设条件包括:
第一信号强度差值大于第三预设信号强度差值,或者
第一丢包率差值大于第三预设丢包率差值,或者
第一重传率差值大于第三预设重传率差值;
第一预设信号强度差值小于第三预设信号强度差值;第一预设丢包率差值小于第三预设丢包率差值;第一预设重传率差值小于第三预设重传率差值。
基于上述实施例公开的内容,本实施例中,若第一副链路的链路质量参数和第二主链路的链路质量参数满足第七预设条件,第一确定模块具体用于确定第一传输机制为转发机制或非转发机制;
第二信号强度差值为第一副链路的信号强度和第二主链路的信号强度之差;第二丢包率差值为第一副链路的丢包率和第二主链路之间的丢包率之差;第二重传率差值为第一副链路的重传率和第二主链路的重传率之差;
第七预设条件包括:
第二信号强度的差值大于第二预设信号强度差值,或者
第二丢包率的差值大于第二预设丢包率差值,或者
第二重传率的差值大于第二预设重传率差值。
基于上述实施例公开的内容,本实施例中,若第二主链路的信号强度大于或者等于第一副链路的信号强度,第一确定模块具体用于确定第一传输机制为非转发机制;或者,若第二主链路的信号强度小于第一副链路的信号强度,第一确定模块具体用于确定第一传输机制为转发机制。
基于上述实施例公开的内容,本实施例中,如图19所示,还包括切换模块1901,切换模块与第一确定模块连接;
切换模块用于将非转发机制切换为转发机制;或者
将非转发机制切换为非转发机制和转发机制;或者
将转发机制切换为非转发机制;或者
将转发机制切换为非转发机制和转发机制。
基于上述实施例公开的内容,本实施例中,如图20A、20B所示,切换模块1901包括第一切换模块2001和第二切换模块2002;或者,切换模块1901包括第三切换模块2003和第四切换模块2004;
第一切换模块用于将非转发机制切换为非转发机制和转发机制,
第二切换模块用于将非转发机制和转发机制切换为转发机制;
第三切换模块用于将转发机制切换为非转发机制和转发机制;
第四切换模块用于将非转发机制和转发机制切换为非转发机制。
基于上述实施例公开的内容,本实施例中,如图21所示,还包括更新模块2101,蓝牙数据为音频数据;
更新模块用于每接收或者发送音频数据的一个或多个音频数据包,更新一次第一传输机制,或者,链路质量参数的变化速率超过预定速率,更新一次第一传输机制,或者以预设周期更新第一传输机制。
基于上述实施例公开的内容,本实施例中,如图21所示,还包括重连模块2101,若第一传输模块用于根据转发机制传输蓝牙数据,重连模块用于接收或者发送重连信号;重连信号的接收频率由第一主链路和第一副链路的链路质量参数确定;重连信号用于建立第二主链路。
基于上述实施例公开的内容,本实施例中,若第一主链路的信号强度增 大并且第一副链路的信号强度增大,重连模块接收或者发送重连信号的频率增大。
本申请实施例提供了一种数据传输装置,例如,用于第一蓝牙端,据链路质量确定传输机制,以避免采用固定的传输机制而使得链路质量变化时出现蓝牙数据质量差的问题,根据链路质量确定传输机制,在链路质量变化时,可以灵活选择采用确定的传输机制传输蓝牙数据,以提高传输的蓝牙数据的质量,提升了用户体验。
本申请实施例还提供了一种数据传输装置,如图22所示,该装置2200包括:
第二确定模块2201,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;
第二传输模块2202,用于根据第一传输机制传输蓝牙数据;
第一传输机制包括转发机制、双发机制和监听机制中的一种或多种;
第二传输模块用于根据双发机制通过第一主链路接收第一蓝牙端传输的蓝牙数据;
第二传输模块用于根据转发机制通过第一主链路接收第一蓝牙端发送的蓝牙数据,第二传输模块还用于通过第一副链路转发部分或者全部蓝牙数据给第三蓝牙端;
第二传输模块根据监听机制通过第一主链路接收第一蓝牙端传输的蓝牙数据,第二传输模块通过第一主链路接收到的第一蓝牙端传输的蓝牙数据被所述第三蓝牙端监听。
基于上述实施例公开的内容,本实施例中,还包括判断模块,第二确定模块与判断模块连接;
第二传输模块还用于接收第三蓝牙端发送的请求转发命令,请求转发命令用于请求第二传输模块转发部分或者全部蓝牙数据;
判断模块用于根据电量或者带宽占用率中的一种或两种判断是否转发部分或者全部蓝牙数据。
本申请实施例提供了一种数据传输装置,例如,用于第二蓝牙端,根据链路质量确定传输机制,以避免采用固定的传输机制而使得链路质量变化时出现蓝牙数据质量差的问题,根据链路质量确定传输机制,在链路质量变化时,可以灵活选择采用确定的传输机制传输蓝牙数据,以提高传输的蓝牙数据的质 量,提升了用户体验。
本申请实施例还提供了一种数据传输装置,如图23所示,该装置2300包括:
第三确定模块2301,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;
第三传输模块2302,用于根据第一传输机制传输蓝牙数据;
第一传输机制包括转发机制、双发机制和监听机制中的一种或多种;
第三传输模块根据双发机制通过第二主链路接收第一蓝牙端发送的蓝牙数据;
第三传输模块根据转发机制接收第二蓝牙端通过第一副链路转发的部分或者全部所述蓝牙数据;
第三传输模块根据监听机制监听第一蓝牙端通过第一主链路发送给第二蓝牙端的蓝牙数据。
本申请实施例提供了一种数据传输装置,例如,用于第三蓝牙端,根据链路质量确定传输机制,以避免采用固定的传输机制而使得链路质量变化时出现蓝牙数据质量差的问题,根据链路质量确定传输机制,在链路质量变化时,可以灵活选择采用确定的传输机制传输蓝牙数据,以提高传输的蓝牙数据的质量,提升了用户体验。
本申请实施例还可提供一种芯片,用于执行上述实施例提出的一种数据传输方法;如图24所示,芯片2400包括存储器2401和处理器2402;
存储器与处理器耦合;
存储器,用于存储程序指令;
处理器,用于调用存储器存储的程序指令,使得芯片执行上述任一实施例提出的一种数据传输方法。可以理解的是,该芯片可以为耳机中的芯片,也可以为手机端的芯片。
本申请实施例提供的芯片其具体的实现过程及有益效果参见上述,在此不再赘述。
本申请实施例还提供一种电子设备,该电子设备包括上述实施例提出的芯片;该电子设备可以为耳机或者手机,本申请实施例提供的电子设备其具体的实现过程及有益效果参见上述,在此不再赘述。
本申请实施例还可提供一种计算机可读存储介质,包括:其上存储有计 算机程序,该计算机程序被处理器执行时实现上述实施例中任一项的数据传输方法,其具体的实现过程及有益效果参见上述,在此不再赘述。
应注意,本申请上述方法实施例可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable rom,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
应理解,在本申请实施例中,“与A相应的B”表示B与A相关联, 根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。
另外,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以 软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。

Claims (29)

  1. 一种数据传输方法,其特征在于,包括:
    根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制,根据所述第一传输机制传输蓝牙数据;
    所述双发机制包括第一蓝牙端通过第一主链路和第二主链路分别传输所述蓝牙数据给第二蓝牙端和第三蓝牙端;
    所述转发机制包括所述第一蓝牙端通过所述第一主链路传输所述蓝牙数据给所述第二蓝牙端,所述第二蓝牙端接收的部分或者全部所述蓝牙数据用于由所述第二蓝牙端通过第一副链路转发给所述第三蓝牙端;
    所述监听机制包括所述第一蓝牙端通过所述第一主链路传输所述蓝牙数据给所述第二蓝牙端,所述第一蓝牙端传输给所述第二蓝牙端的所述蓝牙数据被所述第三蓝牙端监听。
  2. 根据权利要求1所述的数据传输方法,其特征在于,所述在根据所述第一传输机制传输蓝牙数据之前还包括:根据所述转发机制和非转发机制传输所述蓝牙数据;所述非转发机制包括所述双发机制或者所述监听机制。
  3. 根据权利要求2所述的数据传输方法,其特征在于,还包括:在第一时间段,根据第二传输机制传输所述蓝牙数据,在第二时间段,根据所述第一传输机制传输所述蓝牙数据;在第三时间段,根据所述转发机制和所述非转发机制传输所述蓝牙数据;所述第三时间段在所述第一时间段与所述第二时间段之间;
    所述第二传输机制包括所述转发机制、所述双发机制和所述监听机制中的一种或多种;所述第一传输机制与所述第二传输机制不同。
  4. 根据权利要求2或3所述的数据传输方法,其特征在于,根据所述转发机制和所述非转发机制传输所述蓝牙数据的过程中,更新所述第一传输机制。
  5. 根据权利要求1至4中任一项所述的数据传输方法,其特征在于,所述链路质量参数包括丢包率、信号强度和重传率中的一种或者多种;
    所述第一主链路的信号强度大于或者等于所述第二主链路的信号强度,或者所述第一主链路的丢包率小于或者等于所述第二主链路的丢包率,或者所述第一主链路的重传率小于或者等于所述第二主链路的重传率;
    所述根据链路质量参数选择第一传输机制包括:根据所述第二主链路的所述链路质量参数、所述第一副链路的所述链路质量参数和所述第一主链路的所述链路质量参数中的一种或多种选择所述第一传输机制。
  6. 根据权利要求5所述的数据传输方法,其特征在于,所述根据链路质量参数选择所述第一传输机制具体包括:
    根据所述第二主链路的所述链路质量参数选择所述第一传输机制;或者根据所述第一副链路的所述链路质量参数选择所述第一传输机制。
  7. 根据权利要求5所述的数据传输方法,其特征在于,所述选择第一传输机制具体包括:
    根据所述第一主链路的所述链路质量参数和所述第二主链路的所述链路质量参数选择所述第一传输机制;或者
    根据所述第一副链路的所述链路质量参数和所述第二主链路的所述链路质量参数确选择所述第一传输机制。
  8. 根据权利要求6所述的数据传输方法,其特征在于,根据所述第二主链路的所述链路质量参数选择所述第一传输机制包括:
    若所述第二主链路的所述链路质量参数满足第一预设条件,确定所述第一传输机制包括非转发机制;或者,若所述第二主链路的所述链路质量参数不满足所述第一预设条件,确定所述第一传输机制包括所述转发机制;所述非转发机制包括所述双发机制或所述监听机制;
    所述第一预设条件包括:所述第二主链路的信号强度大于或者等于第一预设信号强度,或者所述第二主链路的重传率小于或者等于第一预设重传率,或者,所述第二主链路的丢包率小于或者等于第一预设丢包率。
  9. 根据权利要求8所述的数据传输方法,其特征在于,所述第一预设信号强度为所述第一副链路的信号强度;所述第一预设重传率为所述第一副链路的重传率;所述第一预设丢包率为所述第一副链路的丢包率;
    所述确定所述第一传输机制包括所述非转发机制包括:确定所述第一传输机制为所述非转发机制;
    所述确定所述第一传输机制包括所述转发机制包括:确定所述第一传输机制为所述转发机制。
  10. 根据权利要求8所述的数据传输方法,其特征在于,若所述第二主链路的所述链路质量参数不满足所述第一预设条件,确定所述第一传输机制包括所述转发机制,包括:确定所述第一传输机制为所述转发机制,或者,确定所述第一传输机制为所述转发机制和所述非转发机制;
    若所述第二主链路的所述链路质量参数满足第二预设条件,确定所述第一 传输机制为所述转发机制;或者,若所述第二主链路的所述链路质量参数不满足所述第二预设条件,确定所述第一传输机制为所述转发机制和所述非转发机制;
    所述第二预设条件包括:所述第二主链路的信号强度小于第二预设信号强度,或者所述第二主链路的重传率大于第二预设重传率,或者,所述第二主链路的丢包率大于第二预设丢包率;
    所述第一预设信号强度大于所述第二预设信号强度,所述第一预设重传率小于所述第二预设重传率,所述第一预设丢包率小于所述第二预设丢包率;
    所述确定所述第一传输机制包括所述非转发机制包括:确定所述第一传输机制为所述非转发机制。
  11. 根据权利要求6所述的数据传输方法,其特征在于,根据所述第一副链路的所述链路质量参数选择所述第一传输机制包括:
    若所述第一副链路的所述链路质量参数满足第三预设条件,确定所述第一传输机制包括所述转发机制;或者,若所述第一副链路的所述链路质量参数不满足所述第三预设条件,确定所述第一传输机制包括非转发机制;所述非转发机制包括所述双发机制或所述监听机制;
    所述第三预设条件包括:所述第一副链路的信号强度高于第三预设信号强度,或者所述第一副链路的重传率低于第三预设重传率,或者所述第一副链路的丢包率低于第三预设丢包率。
  12. 根据权利要求11所述的数据传输方法,其特征在于,所述第三预设信号强度为所述第二主链路的信号强度;所述第三预设丢包率为所述第二主链路的丢包率,所述第三预设重传率为所述第二主链路的重传率;
    所述确定所述第一传输机制包括所述非转发机制包括:确定所述第一传输机制为所述非转发机制;
    所述确定所述第一传输机制包括所述转发机制包括:确定所述第一传输机制为所述转发机制。
  13. 根据权利要求11所述的数据传输方法,其特征在于,若所述第一副链路的所述链路质量参数不满足所述第三预设条件,确定所述第一传输机制包括非转发机制,包括:确定所述第一传输机制为所述非转发机制,或者,确定所述第一传输机制为所述转发机制和所述非转发机制;
    若所述第一副链路的所述链路质量参数满足第四预设条件,确定所述第一 传输机制为所述非转发机制;或者,若所述第一副链路的所述链路质量参数不满足所述第三预设条件,确定所述第一传输机制为所述转发机制和所述非转发机制;所述非转发机制包括所述双发机制或所述监听机制;
    所述第四预设条件包括:所述第一副链路的信号强度小于第四预设信号强度,或者,所述第一副链路的重传率大于第四预设重传率,或者,第一副链路的丢包率大于第四预设丢包率;
    所述第三预设信号强度大于所述第四预设信号强度;
    所述第三预设丢包率小于所述第四预设丢包率;
    所述第三预设重传率小于所述第四预设重传率;
    所述确定所述第一传输机制包括所述转发机制包括:确定所述第一传输机制为所述转发机制。
  14. 根据权利要求7所述的数据传输方法,其特征在于,根据所述第一主链路的所述链路质量参数和所述第二主链路的所述链路质量参数选择所述第一传输机制包括:若所述第一主链路的所述链路质量参数和所述第二主链路的所述链路质量参数满足第五预设条件,确定所述第一传输机制为非转发机制,或者,若所述第一主链路的所述链路质量参数和所述第二主链路的所述链路质量参数不满足所述第五预设条件,确定所述第一传输机制包括所述转发机制;
    所述非转发机制包括所述双发机制或者所述监听机制;
    第一信号强度差值为所述第一主链路的信号强度和所述第二主链路之间的信号强度之差;第一丢包率差值为所述第一主链路的丢包率和所述第二主链路的丢包率之差;第一重传率差值为所述第一主链路的重传率和所述第二主链路的重传率之差;
    所述第五预设条件包括:
    所述第一信号强度差值小于第一预设信号强度差值,或者
    所述第一丢包率差值小于第一预设丢包率差值,或者
    所述第一重传率差值小于第一预设重传率差值。
  15. 根据权利要求14所述的数据传输方法,其特征在于,若所述第一主链路的所述链路质量参数和所述第二主链路的所述链路质量参数不满足所述第五预设条件,确定所述第一传输机制包括所述转发机制,包括:
    若所述第一主链路的所述链路质量参数和所述第二主链路的所述链路质量参数满足第六预设条件,确定所述第一传输机制为所述转发机制,或者,若所 述第一主链路的所述链路质量参数和所述第二主链路的所述链路质量参数不满足所述第六预设条件,确定所述第一传输机制为所述转发机制和所述非转发机制;
    所述第六预设条件包括:
    所述第一信号强度差值大于第三预设信号强度差值,或者
    所述第一丢包率差值大于第三预设丢包率差值,或者
    所述第一重传率差值大于第三预设重传率差值;
    所述第一预设信号强度差值小于所述第三预设信号强度差值;所述第一预设丢包率差值小于所述第三预设丢包率差值;所述第一预设重传率差值小于所述第三预设重传率差值。
  16. 根据权利要求7所述的数据传输方法,其特征在于,所述根据所述第一副链路的所述链路质量参数和所述第二主链路的所述链路质量参数选择所述转发机制包括:若所述第一副链路的所述链路质量参数和所述第二主链路的所述链路质量参数满足第七预设条件,确定所述第一传输机制为所述转发机制或非转发机制;所述非转发机制包括所述双发机制或者所述监听机制;
    第二信号强度差值为所述第一副链路的信号强度和所述第二主链路的信号强度之差;第二丢包率差值为所述第一副链路的丢包率和所述第二主链路之间的丢包率之差;第二重传率差值为所述第一副链路的重传率和所述第二主链路的重传率之差;
    所述第七预设条件包括:
    所述第二信号强度的差值大于第二预设信号强度差值,或者
    所述第二丢包率的差值大于第二预设丢包率差值,或者
    所述第二重传率的差值大于第二预设重传率差值。
  17. 根据权利要求16所述的数据传输方法,其特征在于,若所述第二主链路的信号强度大于或者等于所述第一副链路的信号强度,确定所述第一传输机制为所述非转发机制;或者,若所述第二主链路的信号强度小于所述第一副链路的信号强度,确定所述第一传输机制为所述转发机制。
  18. 根据权利要求1至17中任一项所述的数据传输方法,其特征在于,所述蓝牙数据为音频数据;
    每接收或者发送所述音频数据的一个或多个音频数据包,更新一次所述第一传输机制,或者,所述链路质量参数的变化速率超过预定速率,更新一次所 述第一传输机制,或者以预设周期更新所述第一传输机制。
  19. 根据权利要求1至18中任一项所述的数据传输方法,其特征在于,若根据所述转发机制传输所述蓝牙数据,接收或者发送重连信号;所述重连信号的接收频率由所述第一主链路和所述第一副链路的链路质量参数确定;所述重连信号用于建立所述第二主链路。
  20. 根据权利要求19所述的数据传输方法,其特征在于,若所述第一主链路的信号强度增大并且所述第一副链路的信号强度增大,接收或者发送所述重连信号的频率增大。
  21. 一种数据传输方法,其特征在于,包括:
    根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制,根据所述第一传输机制传输蓝牙数据;
    所述双发机制包括第二蓝牙端通过第一主链路接收第一蓝牙端传输的所述蓝牙数据;
    所述转发机制包括所述第二蓝牙端通过所述第一主链路接收所述第一蓝牙端发送的所述蓝牙数据,所述第二蓝牙端通过第一副链路转发部分或者全部所述蓝牙数据给第三蓝牙端;
    所述监听机制包括所述第二蓝牙端通过所述第一主链路接收所述第一蓝牙端传输的所述蓝牙数据,所述第二蓝牙端通过所述第一主链路接收的所述蓝牙数据被所述第三蓝牙端监听。
  22. 根据权利要求21所述的数据传输方法,其特征在于,确定所述第一传输机制包括所述转发机制之前包括:
    所述第二蓝牙端接收所述第三蓝牙端发送的请求转发命令,所述请求转发命令用于请求第二蓝牙端传输部分或者全部所述蓝牙数据给所述第三蓝牙端;
    所述第二蓝牙端接收到所述请求转发命令后,根据所述第二蓝牙端的电量或者带宽占用率中的一种或两种判断是否传输所述部分或者全部所述蓝牙数据给所述第三蓝牙端。
  23. 一种数据传输方法,其特征在于,包括:
    根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制,根据所述第一传输机制传输蓝牙数据;
    所述双发机制包括第三蓝牙端通过第二主链路接收第一蓝牙端发送的所述蓝牙数据;
    所述转发机制包括所述第三蓝牙端接收第二蓝牙端通过第一副链路转发的部分或者全部所述蓝牙数据;
    所述监听机制包括所述第三蓝牙端监听所述第一蓝牙端通过所述第一主链路发送给第二蓝牙端的所述蓝牙数据。
  24. 一种数据传输装置,其特征在于,包括:
    第一确定模块,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;和
    第一传输模块,用于根据所述第一传输机制传输蓝牙数据;
    所述第一传输模块用于根据所述双发机制通过第一主链路和第二主链路分别传输蓝牙数据给第二蓝牙端和第三蓝牙端;
    所述第一传输模块还用于根据所述转发机制通过所述第一主链路传输所述蓝牙数据给所述第二蓝牙端,所述第二蓝牙端接收的部分或者全部所述蓝牙数据用于由所述第二蓝牙端通过第一副链路转发给所述第三蓝牙端;
    所述第一传输模块还用于根据所述监听机制通过所述第一主链路传输所述蓝牙数据给所述第二蓝牙端,所述第一传输模块传输给所述第二蓝牙端的所述蓝牙数据被所述第三蓝牙端监听。
  25. 一种数据传输装置,其特征在于,包括:
    第二确定模块,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;
    第二传输模块,用于根据所述第一传输机制传输蓝牙数据;
    所述第二传输模块用于根据所述双发机制通过第一主链路接收第一蓝牙端传输的所述蓝牙数据;
    所述第二传输模块用于根据所述转发机制通过所述第一主链路接收所述第一蓝牙端发送的所述蓝牙数据,所述第二传输模块还用于通过第一副链路转发部分或者全部所述蓝牙数据给第三蓝牙端;
    所述第二传输模块用于根据所述监听机制通过所述第一主链路接收所述第一蓝牙端传输的所述蓝牙数据,所述第二传输模块通过所述第一主链路接收到的所述第一蓝牙端传输的所述蓝牙数据被所述第三蓝牙端监听。
  26. 一种数据传输装置,其特征在于,包括:
    第三确定模块,用于根据链路质量参数从转发机制、双发机制和监听机制中的至少两种中选择第一传输机制;
    第三传输模块,用于根据所述第一传输机制传输蓝牙数据;
    所述第三传输模块用于根据所述双发机制通过所述第二主链路接收第一蓝牙端发送的所述蓝牙数据;
    所述第三传输模块用于根据所述转发机制接收第二蓝牙端通过所述第一副链路转发的部分或者全部所述蓝牙数据;
    所述第三传输模块用于根据所述监听机制监听所述第一蓝牙端通过所述第一主链路发送给所述第二蓝牙端的所述蓝牙数据。
  27. 一种芯片,用于实现数据传输方法,其特征在于,包括存储器和处理器;
    所述存储器与所述处理器耦合;
    所述存储器,用于存储程序指令;
    所述处理器,用于调用所述存储器存储的程序指令,使得所述芯片执行上述权利要求1至23中任一项所述的数据传输方法。
  28. 一种电子设备,其特征在于,包括如权利要求27所述的芯片。
  29. 一种计算机可读存储介质,其特征在于,包括:其上存储有计算机程序,所述计算机程序被处理器执行时实现上述权利要求1至23中任一项所述的数据传输方法。
PCT/CN2020/090043 2020-05-13 2020-05-13 一种数据传输方法、装置、芯片、电子设备及存储介质 WO2021226881A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/090043 WO2021226881A1 (zh) 2020-05-13 2020-05-13 一种数据传输方法、装置、芯片、电子设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/090043 WO2021226881A1 (zh) 2020-05-13 2020-05-13 一种数据传输方法、装置、芯片、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021226881A1 true WO2021226881A1 (zh) 2021-11-18

Family

ID=78526118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/090043 WO2021226881A1 (zh) 2020-05-13 2020-05-13 一种数据传输方法、装置、芯片、电子设备及存储介质

Country Status (1)

Country Link
WO (1) WO2021226881A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745705A (zh) * 2022-03-24 2022-07-12 Oppo广东移动通信有限公司 通信芯片、蓝牙通信设备及数据传输方法
CN116744267A (zh) * 2022-11-16 2023-09-12 荣耀终端有限公司 数据处理方法、系统、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106535081A (zh) * 2016-12-20 2017-03-22 建荣半导体(深圳)有限公司 蓝牙模式切换方法、装置、通信系统及立体声音频传输方法
CN109347581A (zh) * 2018-09-30 2019-02-15 Oppo广东移动通信有限公司 蓝牙耳机连接方法、装置、电子设备及存储介质
CN111107460A (zh) * 2019-12-09 2020-05-05 珠海慧联科技有限公司 无线耳机通信方法及无线耳机
CN111132110A (zh) * 2019-12-26 2020-05-08 重庆物奇科技有限公司 用于无线通信的设备主从角色切换系统及方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106535081A (zh) * 2016-12-20 2017-03-22 建荣半导体(深圳)有限公司 蓝牙模式切换方法、装置、通信系统及立体声音频传输方法
CN109347581A (zh) * 2018-09-30 2019-02-15 Oppo广东移动通信有限公司 蓝牙耳机连接方法、装置、电子设备及存储介质
CN111107460A (zh) * 2019-12-09 2020-05-05 珠海慧联科技有限公司 无线耳机通信方法及无线耳机
CN111132110A (zh) * 2019-12-26 2020-05-08 重庆物奇科技有限公司 用于无线通信的设备主从角色切换系统及方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745705A (zh) * 2022-03-24 2022-07-12 Oppo广东移动通信有限公司 通信芯片、蓝牙通信设备及数据传输方法
CN116744267A (zh) * 2022-11-16 2023-09-12 荣耀终端有限公司 数据处理方法、系统、电子设备和存储介质
CN116744267B (zh) * 2022-11-16 2024-05-21 荣耀终端有限公司 数据处理方法、系统、电子设备和存储介质

Similar Documents

Publication Publication Date Title
CN111294784B (zh) 一种数据传输方法、装置、芯片、电子设备及存储介质
EP3849223B1 (en) Bluetooth headset device and communication method for the same
CN108600892B (zh) 一种升级方法、装置、无线耳机、tws耳机及充电盒
US20210219041A1 (en) Voice data transmission method, wireless earphone and tws earphone
WO2021082875A1 (zh) 主从蓝牙耳机切换的方法及装置、蓝牙耳机、系统
CN109391876A (zh) 音频设备及其数据接收方法
WO2020107691A1 (zh) 蓝牙连接方法及装置
US20220418021A1 (en) Audio data transmission method and apparatus for wireless earphone, and storage medium and terminal
US11895456B2 (en) Sharing audio from a source device
WO2021226881A1 (zh) 一种数据传输方法、装置、芯片、电子设备及存储介质
US20220264672A1 (en) Method of data transmission between bluetooth tws devices, and bluetooth tws device
CN111447603A (zh) 数据传输方法及装置
TW200423768A (en) Method, communications network arrangement, communications network server, terminal, and software means for selecting and changing operating modes for packet-switched voice connection
CN111885554B (zh) 基于双无线蓝牙通信的链路切换方法及相关设备
US20230179902A1 (en) Communication method applied to binaural wireless headset, and apparatus
CN110166988B (zh) 一种无线通信系统及其方法
US10588167B1 (en) Method and system for wireless communication
US20210368566A1 (en) Data communication method and system, electronic device, chip and storage medium
US20220174392A1 (en) Sharing audio from a source device
US20220256314A1 (en) Method, apparatus and computer program for broadcast discovery service in wireless communication system, and recording medium therefor
US20220353616A1 (en) Method, device, and computer program for controlling and managing state of peripheral device in wireless communication system, and recording medium therefor
WO2022228569A1 (zh) 蓝牙设备控制传输的方法和装置、电子设备
WO2020172830A1 (zh) 无线连接方法、设备组、系统及存储介质
CN114079894B (zh) 双无线音频通信控制方法、装置、设备和系统
CN115967927A (zh) 蓝牙连接方法及装置、耳机、存储介质

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: 20935674

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: 20935674

Country of ref document: EP

Kind code of ref document: A1