Audio data transmission method, terminal, device, storage medium and program product
Patent Information
- Application Number
- CN202311120892.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-08-31
AI Technical Summary
主耳与从耳进行数据传输的过程中,在其中任意一支耳机接收失败后就要求手机重传数据包,可能存在手机频繁重传,但仍然传输失败的情况
[0023]上述音频数据传输方法、终端、设备、存储介质及程序产品,主终端接收到发送端发送的音频数据之后,在未接收到从终端的监听确认信息的情况下,确定发送端对音频数据的重传次数;该监听确认信息用于表示从终端监听到音频数据。并且,在重传次数达到预设次数阈值的情况下,主终端将音频数据转发至从终端。这样,主终端接收到音频数据之后,如果没有接收到从终端的监听确认信息,即开始统计发送端对音频数据的重传次数,以判断该重传次数是否达到预设次数阈值;如果重传次数较高,那么主终端将音频数据转发至从终端;如此,既能够减少发送端重传音频数据的次数,还能够提高音频数据传输的成功率。
Smart Images

Figure CN119544156B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and in particular to an audio data transmission method, terminal, device, storage medium, and program product. Background Technology
[0002] With the maturity of True Wireless Stereo (TWS) technology, TWS has become extremely popular due to its lightweight and cordless portability, and users are using TWS earphones in more and more scenarios and environments.
[0003] In related technologies, the master earbud in TWS earbuds maintains a connection and communicates with the mobile phone, while the slave earbud maintains a connection and communicates with the master earbud while simultaneously monitoring the data packets exchanged between the master earbud and the mobile phone. During data transmission between the master and slave earbuds, if either earbud fails to receive the data, the mobile phone is required to retransmit the data packet. It is possible that the mobile phone may frequently retransmit, but transmission may still fail. Summary of the Invention
[0004] Therefore, it is necessary to provide an audio data transmission method, terminal, device, storage medium, and program product that can reduce the number of times audio data is retransmitted at the sending end and improve the success rate of audio data transmission, in order to address the above-mentioned technical problems.
[0005] In a first aspect, this application provides an audio data transmission method applied to a main terminal, the method comprising:
[0006] Receive audio data sent by the sending end;
[0007] If no listening confirmation information is received from the slave terminal, the number of times the sending end retransmits the audio data to the master terminal is determined; wherein, the listening confirmation information is used to indicate that the slave terminal has listened to the audio data;
[0008] If the number of retransmissions reaches a preset threshold, the audio data is forwarded to the slave terminal.
[0009] In one embodiment, the method further includes: determining a first received signal strength of the master terminal receiving the signal from the transmitter and a second received signal strength of the slave terminal receiving the signal from the transmitter; and determining whether to perform a master-slave relationship switch based on the first received signal strength and the second received signal strength.
[0010] In one embodiment, determining whether to perform a master-slave relationship switch based on the first received signal strength and the second received signal strength includes: switching the master-slave relationship between the master terminal and the slave terminal when the second received signal strength is greater than the first received signal strength.
[0011] In one embodiment, determining the number of retransmissions of the audio data from the sending end to the master terminal when no listening confirmation information is received from the slave terminal includes: returning a non-acknowledgment message to the sending end when no listening confirmation information is received from the slave terminal, the non-acknowledgment message being used to instruct the sending end to retransmit the audio data to the master terminal; and updating the retransmission count when no listening confirmation information is received from the slave terminal for the retransmitted audio data.
[0012] In one embodiment, forwarding the audio data to the slave terminal when the number of retransmissions reaches a preset threshold includes: returning a confirmation message to the sending end when the number of retransmissions reaches the preset threshold; and forwarding the audio data to the slave terminal through a preset channel negotiated with the slave terminal.
[0013] In one embodiment, before forwarding the audio data to the slave terminal via a preset channel negotiated with the slave terminal, the method further includes: determining a difference between a third received signal strength and a second received signal strength when the slave terminal receives a signal from the master terminal; the second received signal strength is the received signal strength when the slave terminal receives the signal from the transmitter; correspondingly, forwarding the audio data to the slave terminal via the preset channel negotiated with the slave terminal includes: forwarding the audio data to the slave terminal via the preset channel when the difference is greater than a preset difference threshold.
[0014] In one embodiment, after forwarding the audio data to the slave terminal through a preset channel negotiated with the slave terminal, the method further includes: in response to not receiving confirmation information from the slave terminal, continuing to forward the audio data to the slave terminal until confirmation information from the slave terminal is received.
[0015] In one embodiment, after forwarding the audio data to the slave terminal via a preset channel negotiated with the slave terminal, the method further includes: in response to receiving confirmation information from the slave terminal, switching from the preset channel to a communication channel with the sending end; and receiving the audio data sent by the sending end on the communication channel.
[0016] Secondly, this application also provides an audio data transmission terminal, the terminal comprising:
[0017] The receiving module is used to receive audio data sent by the sending end;
[0018] The first determining module is used to determine the number of times the sending end will retransmit the audio data to the master terminal if no listening confirmation information is received from the slave terminal; wherein the listening confirmation information is used to indicate that the slave terminal has listened to the audio data;
[0019] The forwarding module is used to forward the audio data to the slave terminal when the number of retransmissions reaches a preset threshold.
[0020] Thirdly, this application also provides an electronic device. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the first aspect described above.
[0021] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the first aspect described above.
[0022] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the first aspect described above.
[0023] In the aforementioned audio data transmission method, terminal, device, storage medium, and program product, after the main terminal receives audio data sent by the sending end, it determines the number of retransmissions of the audio data by the sending end if it does not receive a listening confirmation message from the slave terminal; this listening confirmation message indicates that the slave terminal has detected the audio data. Furthermore, if the number of retransmissions reaches a preset threshold, the main terminal forwards the audio data to the slave terminal. Thus, after receiving audio data, if the main terminal does not receive a listening confirmation message from the slave terminal, it begins to count the number of retransmissions of the audio data by the sending end to determine whether the number of retransmissions has reached the preset threshold; if the number of retransmissions is high, the main terminal forwards the audio data to the slave terminal. This reduces the number of times the sending end retransmits audio data and improves the success rate of audio data transmission. Attached Figure Description
[0024] Figure 1 This is a schematic diagram illustrating the implementation framework of master-slave earphone data transmission in related technologies;
[0025] Figure 2 This is an application environment diagram of an audio data transmission method in one embodiment;
[0026] Figure 3 This is a flowchart illustrating an audio data transmission method in one embodiment;
[0027] Figure 4This is a flowchart illustrating the steps for switching master-slave relationships in one embodiment;
[0028] Figure 5 This is a schematic diagram of the implementation process of step 302 in one embodiment;
[0029] Figure 6 This is a schematic diagram of the implementation process of step 303 in one embodiment;
[0030] Figure 7 This is a schematic diagram illustrating the implementation framework of an audio data transmission method in one embodiment;
[0031] Figure 8 This is a schematic diagram of another implementation framework for the audio data transmission method in one embodiment;
[0032] Figure 9 This is a schematic diagram of another implementation framework for the audio data transmission method in one embodiment;
[0033] Figure 10 This is a structural block diagram of an audio data transmission terminal in one embodiment;
[0034] Figure 11 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0036] In some embodiments, users use TWS earphones in various scenarios, such as making calls, watching videos, and holding video conferences. The environments in which TWS earphones are used include outdoor locations, offices, airports, and train stations. Because TWS earphones use Bluetooth wireless communication technology, they have inherent disadvantages compared to corded earphones, such as signal quality being significantly affected by transmission distance and susceptibility to interference from surrounding electromagnetic signals. In particular, Bluetooth signals use the unlicensed Industrial Scientific Medical (ISM) 2.4 GHz band, which is also the operating frequency of many devices, such as microwave ovens, cordless phones, infrared devices, and wireless cameras. Therefore, Bluetooth signals are easily interfered with by surrounding signals.
[0037] Traditional Bluetooth headsets only have one earbud because a mobile phone can only communicate with one peer device at a time. To enable both earbuds of a TWS (True Wireless Stereo) headset to receive data packets from the phone and play simultaneously, the technology uses a master earbud to maintain a connection and communication with the phone, while the slave earbud maintains a connection and communication with the master earbud while simultaneously monitoring the data packets exchanged between the master and the phone. When the slave earbud successfully detects a data packet, it sends a page confirmation packet to the master earbud before the master earbud finishes receiving the data packet and before replying to the phone. The master earbud replies to the phone based on whether both earbuds have successfully received the data packet. When both earbuds successfully receive the audio data packet from the phone, the master earbud replies with an acknowledgment character (ACK) packet. The phone does not need to retransmit but prepares to send the next data packet. If either earbud fails to receive the data packet, the master earbud replies with a negative acknowledgment character (NAK) packet. Upon receiving the NAK, the phone retransmits the data packet to the earbud until it receives an ACK packet from the earbud. Figure 1 As shown, for packet 0, both the master earphone 12 and the slave earphone 13 successfully received it, so no retransmission was needed. When receiving packet 1, the slave earphone failed to receive it, causing the master earphone 12 to reply with a NAK to the phone 11, and the phone 11 retransmitted packet 1 once. Then, the master earphone 12 failed to receive it, causing it to reply with a NAK to the phone 11, and the phone 11 retransmitted packet 1 a second time. Finally, both the master earphone 12 and the slave earphone 13 successfully received it, and the master earphone replied with an ACK to the phone, preventing further retransmission. When receiving packet 2, both the master earphone 12 and the slave earphone 13 successfully received it, so no retransmission was needed.
[0038] In practical applications, users often find that one earphone is more likely to receive a signal successfully, while the other is less likely to do so, leading to frequent retransmissions by the phone, yet transmission still fails. For example, when holding the phone with the right hand, the right ear has a closer visual distance and is therefore more likely to transmit successfully, while the left ear experiences significant signal attenuation because it has to pass through the head, making transmission more prone to failure. Therefore, simply requiring the phone to retransmit will not solve the problem of data transmission failure.
[0039] Based on this, this application provides an audio data transmission method. When the master terminal does not receive a listening confirmation message from the slave terminal, the number of retransmissions of audio data by the sending end is counted to determine whether the number of retransmissions reaches a preset threshold. If the number of retransmissions is high, the master terminal forwards the audio data to the slave terminal, thereby reducing the number of times the sending end retransmits audio data and improving the success rate of audio data transmission.
[0040] The audio data transmission method provided in this application embodiment can be applied to, for example... Figure 2In the application environment shown, the master terminal 101 is connected to the transmitter 102 and the slave terminal 103. The transmitter 102 sends audio data to the master terminal 101, and the slave terminal 103 monitors the communication link between the transmitter and the master terminal. If the master terminal 101 does not receive a monitoring confirmation from the slave terminal 103, it counts the number of times the transmitter 102 retransmits the audio data. If the number of retransmissions reaches a preset threshold, the master terminal 101 forwards the audio data to the slave terminal 103 to reduce the number of times the transmitter retransmits the audio data. The transmitter 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. The master terminal 101 and the slave terminal 103 can be the master ear and slave ear in a pair of Bluetooth headsets, or the master speaker and slave speaker in a pair of Bluetooth speakers, etc.
[0041] In one embodiment, such as Figure 3 As shown, an audio data transmission method is provided, which is applied to... Figure 2 Taking the main terminal in the example, the explanation includes the following steps:
[0042] Step 301: Receive audio data sent by the sending end.
[0043] The audio data can be of any type, such as audio in Compact Disc (CD) format, Waveform Audio File Format (WAV) format, MP3 format, Windows Media Audio (WMA) format, or even noisy audio. In some possible implementations, the master terminal receives the audio data initially sent by the sender. Alternatively, if the master terminal does not receive the initial audio data sent by the sender, it returns a NAK to the sender, causing the sender to retransmit the audio data until the master terminal receives it.
[0044] Step 302: If no listening confirmation information is received from the slave terminal, determine the number of times the sending end will retransmit the audio data to the master terminal.
[0045] The monitoring confirmation information indicates that the slave terminal has detected that the master terminal has received the audio data sent by the sending end. The retransmission count indicates the number of times the sending end repeatedly sends the audio data to the master terminal. The sending end is only connected to the master terminal, the slave terminal is connected to the master terminal, and the slave terminal is not connected to the sending end. The slave terminal can monitor the communication link between the master terminal and the sending end to monitor the data interaction between them.
[0046] For example, the sending end sends audio data to the master terminal, and the slave terminal listens for the audio data sent from the sending end to the master terminal. If the slave terminal detects the audio data sent from the sending end to the master terminal, it sends a listening acknowledgment message (e.g., a page packet) to the master terminal. This acknowledgment message indicates that the audio data was successfully received. In some possible implementations, if the master terminal does not receive the listening acknowledgment message from the slave terminal, it means the slave terminal has not successfully detected the audio data sent from the sending end to the master terminal. In this case, the master terminal returns a non-acknowledgment message to the sending end, prompting the sending end to retransmit the audio data; and it begins to count the number of retransmissions. If, after retransmitting the audio data, the sending end still does not receive a listening acknowledgment message from the slave terminal for the retransmitted audio data, the retransmission count is incremented by 1, thus obtaining the final retransmission count.
[0047] Step 303: If the number of retransmissions reaches a preset threshold, the audio data is forwarded to the slave terminal.
[0048] The preset threshold number of attempts can be user-defined or determined based on the data processing capabilities of the sending end. For example, if the sending end has strong data processing capabilities, the preset threshold number of attempts can be set to be slightly higher; if the sending end has strong data processing capabilities, the preset threshold number of attempts can be set to be slightly lower.
[0049] For example, if the number of retransmissions reaches a preset threshold, it indicates that the sending end has repeatedly sent the audio data too many times, and that even with numerous retransmissions, the slave terminal still cannot detect the audio data. The master terminal returns a confirmation message to the sending end to prevent the sending end from continuing to retransmit the audio data. Furthermore, the master terminal forwards the received audio data to the slave terminal so that the slave terminal can receive and demodulate the audio data. Thus, after continuous retransmissions by the sending end, which are ineffective and waste significant air interface resources, directly forwarding the audio data to the slave terminal by the master terminal improves the data success rate and reduces the frequency of audio data transmission by the sending end.
[0050] In this embodiment, if the master terminal does not receive the listening confirmation information from the slave terminal, it starts to count the number of times the sending end retransmits the audio data to determine whether the number of retransmissions has reached a preset threshold. If the number of retransmissions is high, it means that the slave terminal still has not listened to the audio data after multiple retransmissions. At this time, the master terminal forwards the audio data to the slave terminal. In this way, the number of times the sending end retransmits the audio data can be reduced, and the success rate of audio data transmission can be improved.
[0051] In one embodiment, to enable the main terminal connected to the transmitter to receive audio data with a stronger signal strength, it can be done by... Figure 4 The steps shown are to be implemented as follows:
[0052] Step 401 determines the first received signal strength of the main terminal receiving the signal from the transmitting end and the second received signal strength of the slave terminal receiving the signal from the transmitting end.
[0053] Wherein, the first received signal strength is the signal strength of the transmitter signal that the main terminal can receive, and the second received signal strength is the signal strength of the transmitter signal that the slave terminal can receive. In some possible implementations, the main terminal receives the second received signal strength fed back by the slave terminal and obtains its own first received signal strength of the transmitter signal.
[0054] Step 402: Based on the first received signal strength and the second received signal strength, determine whether to perform a master-slave relationship switch.
[0055] In some possible implementations, the master-slave relationship between the master terminal and the slave terminal is switched according to the comparison result by comparing the magnitudes of the first received signal strength and the second received signal strength, so that the master-slave relationship of the master terminal and the slave terminal can match their respective received signal strengths. Thus, by analyzing the received signal strengths of the master terminal and the slave terminal respectively receiving signals from the transmitter, the master-slave relationship of the master terminal and the slave terminal is switched in real time, ensuring that the master terminal connected to the transmitter can always receive audio data with a stronger signal strength, thereby improving the accuracy of the master terminal's audio data reception.
[0056] In some possible implementations, step 402 above can be achieved through the following step 421 (not shown in the figure):
[0057] Step 421: When the strength of the second received signal is greater than the strength of the first received signal, switch the master-slave relationship between the master terminal and the slave terminal.
[0058] In this process, after the master terminal receives the second received signal strength from the slave terminal, it compares the values of the first and second received signal strengths to determine the numerical relationship. This relationship includes either the first received signal strength being greater than the second received signal strength, or the first received signal strength being less than the second received signal strength. If the second received signal strength is greater than the first received signal strength, the master terminal switches to slave terminal status and disconnects from the transmitter, monitoring audio data sent from the transmitter to the new master terminal. Simultaneously, the slave terminal receives the first received signal strength from the master terminal and, by comparing the values of the first and second received signal strengths, if the second received signal strength is greater than the first received signal strength, the slave terminal switches to master terminal status and reconnects to the transmitter.
[0059] Specifically, if the numerical relationship indicates that the second received signal strength is greater than the first received signal strength, it means that the signal strength received from the slave terminal is stronger than that from the master terminal at the current moment. Therefore, the master-slave relationship between the master and slave terminals should be switched promptly. That is, the master terminal with the weaker received signal strength is switched to slave, and the slave terminal with the stronger received signal strength is switched to master. In this way, when the received signal strength of the slave terminal is detected to be greater than that of the master terminal, the master-slave relationship between the master and slave terminals is switched in a timely manner, ensuring that the master terminal always receives the stronger signal, thereby improving the success rate of the master terminal in receiving audio data.
[0060] In one embodiment, to accurately count the number of times the main terminal retransmits audio data, step 302 above can be achieved by... Figure 5 The steps shown are to be implemented as follows:
[0061] Step 501: If no listening confirmation information is received from the slave terminal, return a non-acknowledgment information to the sending end. The non-acknowledgment information is used to instruct the sending end to retransmit the audio data to the master terminal.
[0062] The "Not Acknowledged" message indicates that at least one of the master terminal and the slave terminal has not received the audio data, requiring the sending end to retransmit the audio data. For example, this "Not Acknowledged" message could be a Negative Acknowledgment (NAK) message. If the master terminal does not receive a listening acknowledgment message from the slave terminal, it means that the slave terminal has not listened to the audio data and has not sent a page packet to the master terminal. While not receiving the listening acknowledgment message from the slave terminal, the master terminal may or may not have received the audio data. To ensure that both the master and slave terminals can obtain the audio data, the master terminal sends a "Not Acknowledged" message to the sending end. In response to this message, the sending end retransmits the audio data to the master terminal. Simultaneously, the slave terminal listens to the retransmitted audio data, and may or may not hear the audio data. If the audio data is detected by the terminal, the terminal sends a confirmation message to the master terminal. The master terminal receives the confirmation message and sends a receipt message back to the sender. After receiving the receipt message, the sender will not retransmit the audio data, but will continue to send other audio data in the next clock cycle.
[0063] In some possible implementations, if no listening confirmation message is received from the slave terminal and the master terminal has already received the audio data, a non-acknowledgment message is returned to the sender, and a counter is started, with the counter counted to 1.
[0064] Step 502: If no confirmation message is received from the terminal regarding the retransmitted audio data, update the number of retransmissions.
[0065] If no confirmation message is received from the slave terminal for the retransmitted audio data, it means that the slave terminal has still not detected the retransmitted audio data from the sender. In this case, the count is incremented by 1, i.e., the retransmission count is incremented by 1. This process continues, gradually increasing the retransmission count until a preset threshold is reached. Thus, after the master terminal returns a no-acknowledgment message to the sender, the sender responds by retransmitting the audio data. If no confirmation message is received from the slave terminal again, the retransmission count is increased. This method accurately counts the number of times the sender retransmits the audio data.
[0066] If no listening confirmation message is received from the terminal, the number of retransmissions of audio data from the sending end to the main terminal is counted. To reduce the frequency of audio data retransmissions by the sending end, step 303 above can be... Figure 6 Steps 601 and 602 shown are implemented as follows:
[0067] Step 601: If the number of retransmissions reaches the preset threshold, return a confirmation message to the sending end.
[0068] The confirmation message indicates that both the master and slave terminals have received the audio data, and the sending end does not need to retransmit it. If the number of retransmissions reaches a preset threshold, it means that although the sending end has retransmitted the audio data multiple times, the slave terminal still has not heard it, indicating that retransmitting the audio data by the sending end is not effectively solving the problem of the slave terminal not hearing the audio data. Therefore, to reduce frequent retransmissions by the sending end, the master terminal returns a confirmation message to the sending end, causing the sending end to stop retransmitting the audio data in response to this confirmation message.
[0069] Step 602: The audio data is forwarded to the slave terminal through a preset channel negotiated with the slave terminal.
[0070] The preset channel is negotiated between the master terminal and the slave terminal, and it differs from the data transmission channel between the master terminal and the sending end. Thus, although the sending end will continue transmitting other audio data in the next clock cycle after stopping retransmission, the preset channel and the corresponding communication channel of the sending end are different. Therefore, the master terminal is not affected by other audio data being sent to the master terminal by the sending end during the forwarding of audio data to the slave terminal, improving the accuracy of audio data forwarding by the master terminal. If the number of retransmissions reaches the preset threshold, indicating that the slave terminal still cannot listen to the audio data after multiple retransmissions by the sending end, the master terminal forwards the audio data to the slave terminal through the preset channel to improve the success rate of the slave terminal listening to the audio data and to control the sending end from continuously and frequently retransmitting.
[0071] After step 602 above, if no confirmation of receipt is received, the master terminal continues to forward audio data to the slave terminal so that the slave terminal can accurately receive the audio data. This can be achieved through step 603:
[0072] Step 603: In response to not receiving confirmation information from the slave terminal, continue to forward the audio data to the slave terminal until confirmation information from the slave terminal is received.
[0073] If the master terminal forwards audio data to the slave terminal but still does not receive a confirmation message from the slave terminal, it means that the slave terminal has not yet received the forwarded audio data. In this case, the master terminal continues to send audio data to the slave terminal until the slave terminal receives the audio data and sends a confirmation message back to the master terminal. This ensures that the slave terminal successfully receives the audio data, thereby improving the accuracy of audio data reception by the slave terminal.
[0074] After step 602 above, if the main terminal receives a confirmation message, then the main terminal switches from the preset channel to the communication channel for receiving audio data, so as to effectively receive the audio data sent by the sender in each clock cycle. This can be achieved through the following steps 604 and 605:
[0075] Step 604: In response to receiving the confirmation information from the terminal, switch from the preset channel to the communication channel with the sending end.
[0076] If the master terminal receives a confirmation message from the slave terminal, it indicates that the slave terminal has successfully received the audio data forwarded by the master terminal, and after successful demodulation, sends an ACK message back to the master terminal to indicate normal reception. In response to this confirmation message, the master terminal exits the current preset channel and enters the communication channel with the sending end; similarly, after sending the confirmation message back to the master terminal, the slave terminal also exits the preset channel to ensure accurate monitoring of the audio data sent from the sending end to the master terminal.
[0077] Step 605: Receive audio data sent by the sending end on the communication channel.
[0078] After the master terminal enters the communication channel, it continues to receive audio data sent by the sender in the next clock cycle. Thus, after receiving confirmation, the master terminal returns to the corresponding communication channel of the sender, enabling it to receive audio data more effectively on that channel.
[0079] In some possible implementations, to reduce the impact of the data packets sent by the sending end on the forwarding of audio data by the main terminal, step 602 above can be achieved through the following steps 621 and 622 (not shown in the figure):
[0080] Step 621: Determine the difference between the third received signal strength and the second received signal strength when the main terminal signal is received from the terminal.
[0081] Wherein, the second received signal strength is the received signal strength of the signal received by the slave terminal from the transmitter. Thus, this difference reflects the magnitude between the signal strength of the data forwarded by the slave terminal from the master terminal and the signal strength of the signal received by the slave terminal from the transmitter.
[0082] Step 622: If the difference is greater than a preset difference threshold, the audio data is forwarded to the slave terminal through the preset channel.
[0083] The preset difference threshold can be set based on the communication rate's resistance to intra-channel interference and adjacent-channel interference. For example, the signal-to-noise ratio (SNR) can be calculated based on the intra-channel interference and adjacent-channel interference resistance, and the preset difference threshold can be set using this SNR. If the difference is greater than the preset difference threshold, it indicates that the difference reflects the signal strength of the data received from the master terminal by the slave terminal, which is higher than the signal strength received from the transmitter by the slave terminal. In this case, the master terminal forwards the audio data to the slave terminal through a preset channel. Thus, although the transmitter will continuously send the next data packet after the master terminal replies with a confirmation message, the master terminal is also forwarding audio data, and the transmitter's packet sending may interfere with the master terminal's forwarding of data packets. If the slave terminal receives a strong signal from the master terminal, even if the data packets sent by the transmitter cause interference, the slave terminal can still resist the interference and demodulate normally without being affected. Therefore, when the signal strength received by the slave terminal from the master terminal is greater than a certain range of the second received signal strength, forwarding the audio data to the slave terminal can reduce the interference of the transmitter's data sending on the slave terminal's reception of the data forwarded by the master terminal, thereby improving the success rate of the slave terminal receiving audio data.
[0084] This application provides an audio data transmission method, which is described below using the adaptive selection of the best communication path based on the signal source quality as an example.
[0085] First, the connection between the phone and the TWS dual earbuds is as follows: the phone maintains a connection only with the master earbud, the slave earbud maintains a connection with the master earbud, and the slave earbud is not connected to the phone. The master and slave earbuds periodically exchange the Received Signal Strength Indication (RSSI) received by each earbud every n seconds or milliseconds. The slave earbud receives RSSI_s from the phone, and the master earbud receives RSSI_m from the phone. RSSI_s and RSSI_m are compared. If RSSI_m is greater than or equal to RSSI_s, the master earbud remains unchanged; if RSSI_m is less than RSSI_s, a master-slave switch occurs, with the slave earbud becoming the master earbud and the master earbud becoming the slave earbud.
[0086] like Figure 7 As shown in Figure (a), mobile phone 71 is connected to earphone 72 (the master ear) to establish a communication path; earphone 72 is connected to earphone 73 (the slave ear), while earphone 73 is not connected to mobile phone 71, thus establishing a monitoring path between earphone 73 and mobile phone 71. If RSSI_m is less than RSSI_s, then a master-slave earphone switch is performed, as shown in Figure (b). Earphone 71 is used as the slave ear, and earphone 73 is used as the master ear. The communication path between earphone 73 and mobile phone 71 is established, and the connection between earphone 72 and mobile phone 71 is broken, forming a monitoring path.
[0087] Secondly, the master ear and slave ear establish a communication link. The signal strength of the packet received by the master ear from the slave ear is RSSI_f_s, and the signal strength of the packet received by the slave ear from the master ear is RSSI_f_m.
[0088] Next, the mobile phone sends packets to the master ear, while the slave ear is still listening. If the slave ear successfully listens and sends a page packet to the master ear, the master ear, after receiving the page packet and also successfully receiving the mobile phone packet, replies with an ACK to the mobile phone, indicating successful reception. For example... Figure 8 As shown, mobile phone 81 sends packet 0 to master earphone 82, which successfully receives it (i.e., Rx is successful). Slave earphone 83 detects "Rx successful" and sends a page to master earphone 82. After master earphone 82 receives the page and successfully receives it, it returns an ACK to mobile phone 81. Then, mobile phone continues to send packet 1 to master earphone. Slave earphone detects "Rx successful" and sends a page to master earphone 82. After master earphone 82 receives the page and successfully receives it, it returns an ACK to mobile phone.
[0089] Since the primary earphone signal is always the best, when the primary earphone cannot correctly receive data packets sent by the mobile phone, the secondary earphone 83 also basically cannot correctly listen to the data packets sent by the mobile phone. Figure 9 The process shown enables both the master ear and slave ear to receive data packets:
[0090] A: The master earphone 91 is unable to correctly receive packet 0 sent by the mobile phone 90. In the subsequent reply slot, the master earphone directly replies with NAK or does not respond, causing the mobile phone to retransmit.
[0091] B: Initially, slave earphone 92 fails to correctly receive packet 0 from the mobile phone, but master earphone 91 has successfully received this packet 0. Slave earphone 92 does not send a page to master earphone 91, meaning the slave earphone considers "Rx unsuccessful". Since the master earphone does not receive the page packet, it starts a counter, setting it to 1 (counter increment). Master earphone 91 sends a NAK (Nearest Acceptance) message back to mobile phone 90. The mobile phone receives the NAK and retransmits packet 0 in the next clock cycle.
[0092] C: If the mobile phone initiates a retransmission of packet0 and the slave earpiece 92 still fails to receive it, the counter is incremented by 1. When the counter value reaches the preset condition M, the master earpiece 91 no longer returns NAK to the mobile phone 90, but instead returns ACK to the mobile phone 90 to indicate that it has been successfully received.
[0093] D: After the master ear 91 transmits the ACK, it enters the channel negotiated with the slave ear 92 in the next clock cycle and sends the mobile phone packet0 received by the master ear 91 to the slave ear 92.
[0094] Here, after receiving the ACK, the mobile phone 90 sends packet1 to the master ear 91 in the next clock cycle. Since the master ear 91 will not send the ACK back to the mobile phone 90 in the next clock cycle, the mobile phone 90 will continue to send packet1 repeatedly until it receives the ACK back from the master ear, and then send other data packets in the next clock cycle.
[0095] E: Since the slave ear 92 knows the counter M, after M meets the counting threshold, the slave ear 92 will enter the channel negotiated with the master ear 91 in the next clock cycle (this channel can avoid the next time slot transmission channel of the mobile phone) to receive the master ear's transmitted packet 0.
[0096] F: After receiving packet0 forwarded by master ear 91, slave ear 92 replies with ACK to master ear 91 to indicate normal reception.
[0097] G: If the master ear 91 forwards to the slave ear 92 for the first time, and the slave ear fails to receive the message and returns NAK or does not reply, the master ear will continue to forward the message until the slave ear successfully receives it.
[0098] H: After the master ear successfully forwards the message, both the master ear and the slave ear return to the same clock cycle as the phone and continue to receive packet1 from the phone.
[0099] I: The forwarding mechanism can also be configured to trigger only when RSSI_f_m is greater than RSSI_s within a certain range. For example, a threshold can be set based on the anti-interference capability of the communication rate within the channel or the anti-interference capability of the adjacent channel. It can effectively solve the problem of interference between mobile phone data packets and forwarded data packets when mobile phone packet sending and forwarding are carried out simultaneously.
[0100] In this embodiment, master-slave switching is achieved through RSSI determination, ensuring that the earphone with the best signal remains the master earphone, maintaining the highest reception success rate. The slave earphone then adaptively forwards to the master earphone based on conditions, resolving the issue of continuous retransmissions due to poor reception from one earphone. This allows for real-time selection of the optimal transmission path when playing music from a mobile phone in TWS earphones, resolving transmission failures and audio stuttering caused by poor signal from one earphone in actual use. In particular, it addresses the issue of audio stuttering caused by severe signal attenuation in the left (or right) earphone when the phone is placed in the right (or left) pocket, as the signal has to pass through the body.
[0101] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0102] Based on the same inventive concept, this application also provides an audio data transmission terminal for implementing the audio data transmission method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more audio data transmission terminal embodiments provided below can be found in the limitations of the audio data transmission method described above, and will not be repeated here.
[0103] In one embodiment, such as Figure 10 As shown, an audio data transmission terminal 1000 is provided, including: a receiving module 1001, a first determining module 1002, and a forwarding module 1003, wherein:
[0104] The receiving module 1001 is used to receive audio data sent by the sending end;
[0105] The first determining module 1002 is used to determine the number of times the sending end will retransmit the audio data to the master terminal if no listening confirmation information is received from the slave terminal; wherein the listening confirmation information is used to indicate that the slave terminal has listened to the audio data;
[0106] The forwarding module 1003 is used to forward the audio data to the slave terminal when the number of retransmissions reaches a preset threshold.
[0107] In one embodiment, the terminal further includes: a second determining module, configured to determine a first received signal strength of the master terminal receiving the signal from the transmitter and a second received signal strength of the slave terminal receiving the signal from the transmitter; and a third determining module, configured to determine whether to perform a master-slave relationship switch based on the first received signal strength and the second received signal strength.
[0108] In one embodiment, the third determining module is further configured to switch the master-slave relationship between the master terminal and the slave terminal when the second received signal strength is greater than the first received signal strength.
[0109] In one embodiment, the first determining module 1002 is further configured to return unacknowledged information to the sending end if no listening confirmation information is received from the slave terminal, the unacknowledged information being used to instruct the sending end to retransmit the audio data to the master terminal; and to update the retransmission count if no listening confirmation information is received from the slave terminal for the retransmitted audio data.
[0110] In one embodiment, the forwarding module 1003 is further configured to return a receipt confirmation to the sending end when the number of retransmissions reaches the preset number threshold; and forward the audio data to the slave terminal through a preset channel negotiated with the slave terminal.
[0111] In one embodiment, the forwarding module 1003 is further configured to determine the difference between the third received signal strength and the second received signal strength of the signal received by the slave terminal from the master terminal; the second received signal strength is the received signal strength of the signal received by the slave terminal from the transmitter; if the difference is greater than a preset difference threshold, the audio data is forwarded to the slave terminal through the preset channel.
[0112] In one embodiment, the forwarding module 1003 is further configured to continue forwarding the audio data to the slave terminal in response to not receiving confirmation information from the slave terminal, until confirmation information from the slave terminal is received.
[0113] In one embodiment, the forwarding module 1003 is further configured to, in response to receiving the confirmation information fed back from the terminal, switch from the preset channel to a communication channel with the sending end; and receive audio data sent by the sending end on the communication channel.
[0114] The modules in the aforementioned audio data transmission terminal can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0115] In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 11As shown, this electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an audio data transmission method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the electronic device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the electronic device, or external keyboards, touchpads, or mice, etc.
[0116] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0117] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program as the steps described in the above method embodiments.
[0118] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0119] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this patent application. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the scope of protection of this application shall be determined by the appended claims.
Claims
1. An audio data transmission method, applied to a main terminal, characterized in that, The method includes: Receive audio data sent by the sending end; If no listening confirmation information is received from the slave terminal, the number of times the sending end retransmits the audio data to the master terminal is determined; wherein, the listening confirmation information is used to indicate that the slave terminal has obtained the audio data by listening to the communication link between the master terminal and the sending end; If the number of retransmissions reaches a preset threshold, a confirmation message is returned to the sending end to instruct the sending end to stop retransmitting the audio data; The difference between the third received signal strength and the second received signal strength of the signal received from the master terminal by the slave terminal is determined, and if the difference is greater than a preset difference threshold, the audio data is forwarded to the slave terminal through a preset channel negotiated with the slave terminal; the second received signal strength is the received signal strength of the signal received by the slave terminal from the transmitter; the preset channel is different from the channel between the master terminal and the transmitter, and the preset channel is time-slot-spaced with the next transmission channel of the transmitter.
2. The method according to claim 1, characterized in that, The method further includes: Determine the first received signal strength of the main terminal receiving the signal from the transmitting end and the second received signal strength of the slave terminal receiving the signal from the transmitting end; Based on the first received signal strength and the second received signal strength, determine whether to perform a master-slave relationship switch.
3. The method according to claim 2, characterized in that, The step of determining whether to perform a master-slave relationship switch based on the first received signal strength and the second received signal strength includes: When the strength of the second received signal is greater than the strength of the first received signal, the master-slave relationship between the master terminal and the slave terminal is switched.
4. The method according to claim 1, characterized in that, Determining the number of retransmissions of the audio data from the sending end to the main terminal when no listening confirmation information is received from the slave terminal includes: If no confirmation message is received from the slave terminal, a non-acknowledgment message is returned to the sending end, which instructs the sending end to retransmit the audio data to the master terminal. If no confirmation of listening to the retransmitted audio data is received from the slave terminal, the number of retransmissions is updated.
5. The method according to claim 1, characterized in that, After forwarding the audio data to the slave terminal via a preset channel negotiated with the slave terminal, the method further includes: In response to not receiving confirmation of receipt from the slave terminal, the audio data continues to be forwarded to the slave terminal until confirmation of receipt is received from the slave terminal.
6. The method according to claim 1, characterized in that, After forwarding the audio data to the slave terminal via a preset channel negotiated with the slave terminal, the method further includes: In response to receiving the confirmation information from the terminal, the system switches from the preset channel to the communication channel with the sending end. The system receives audio data transmitted by the transmitting end on the communication channel.
7. An audio data transmission terminal, applied to a main terminal, characterized in that, The terminal includes: The receiving module is used to receive audio data sent by the sending end; The first determining module is used to determine the number of times the sending end will retransmit the audio data to the master terminal if no listening confirmation information is received from the slave terminal; wherein the listening confirmation information is used to indicate that the slave terminal has obtained the audio data by listening to the communication link between the master terminal and the sending end; The forwarding module is used to return a confirmation message to the sending end when the number of retransmissions reaches a preset threshold, so as to instruct the sending end to stop retransmitting the audio data; It is also used to determine the difference between the third received signal strength and the second received signal strength of the signal received by the slave terminal from the master terminal, and if the difference is greater than a preset difference threshold, to forward the audio data to the slave terminal through a preset channel negotiated with the slave terminal; the second received signal strength is the received signal strength of the signal received by the slave terminal from the transmitter; the preset channel is different from the channel between the master terminal and the transmitter, and the preset channel is time-slot-spaced with the next transmission channel of the transmitter.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
High-reliability Bluetooth data transmission system and method
CN113068167A