CN114499776A - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN114499776A
CN114499776A CN202210029608.1A CN202210029608A CN114499776A CN 114499776 A CN114499776 A CN 114499776A CN 202210029608 A CN202210029608 A CN 202210029608A CN 114499776 A CN114499776 A CN 114499776A
Authority
CN
China
Prior art keywords
data
data packet
data segment
transmitted
segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210029608.1A
Other languages
Chinese (zh)
Inventor
尚岸奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202210029608.1A priority Critical patent/CN114499776A/en
Publication of CN114499776A publication Critical patent/CN114499776A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/033Headphones for stereophonic communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The application discloses a data transmission method and a device thereof, belonging to the technical field of communication. The method is applied to a main earphone and comprises the following steps: receiving a first data packet sent by electronic equipment; checking the first data packet to obtain a first checking result; sending the first check result to the slave earphone, so that the slave earphone determines the data segment which fails to be transmitted in the first data packet according to the first check result and the second check result of the second data packet, and receiving the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet; or receiving the second check result sent by the earphone, determining the data segment which fails to be transmitted in the second data packet according to the first check result and the second check result, and sending the first data segment which corresponds to the data segment which fails to be transmitted in the second data packet to the earphone; the first data packet is divided into a plurality of first data segments, and the second data packet is divided into a plurality of second data segments.

Description

Data transmission method and device
Technical Field
The present application belongs to the field of communication technology, and in particular, relates to a data transmission method and apparatus.
Background
With the continuous development of wireless technology, the application of wireless earphones is quite common. Currently, True Wireless bluetooth headsets (TWS) can bring good Wireless Stereo experience to users, and are increasingly popular with users.
TWS headsets typically include two audio output devices, a master headset and a slave headset. The main earphone is used for being in communication connection with the terminal equipment, and receiving audio data transmitted by the terminal equipment in a Bluetooth mode, and the modes of acquiring data from the earphone mainly include two modes: one is a relay mode, namely, the master earphone obtains data and forwards the data to the slave earphone; the other is a monitoring mode, namely the slave earphone acquires data by monitoring a communication channel between the master earphone and the terminal equipment.
However, if packet loss occurs during communication, the above data transmission methods all need to retransmit a complete data packet, which results in large data volume and long required transmission time, resulting in path delay and easily causing a blocking tone.
Disclosure of Invention
The embodiment of the application aims to provide a data transmission method and a device thereof, and can solve the problems that when packet loss occurs in the existing transmission mode, a complete data packet needs to be retransmitted, the data volume is large, the required transmission time is long, and blocking sound is easily caused.
In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a master earphone, and the method includes:
receiving a first data packet sent by electronic equipment;
checking the first data packet to obtain a first checking result;
sending the first check result to a slave earphone, so that the slave earphone determines a data segment which fails to be transmitted in the first data packet according to the first check result and a second check result of a second data packet, and receives the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet; or, receiving the second check result sent by the slave earphone, determining a data segment failed to be transmitted in the second data packet according to the first check result and the second check result, and sending a first data segment corresponding to the data segment failed to be transmitted in the second data packet to the slave earphone;
the first data packet is divided into a plurality of first data segments, the second data packet corresponds to the first data packet, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
In a second aspect, an embodiment of the present application provides a data transmission method, which is applied to a slave earphone, and the method includes:
under the condition that a second data packet corresponding to the first data packet is received, verifying the second data packet to obtain a second verification result;
receiving a first check result sent by a master earphone, determining a data segment which fails to be transmitted in the first data packet according to the first check result and the second check result, and sending a second data segment which corresponds to the data segment which fails to be transmitted in the first data packet to the master earphone; or sending the second check result to the master earphone, so that the master earphone determines the data segment which fails to be transmitted in the second data packet according to the second check result and the first check result, and receives the first data segment which is sent by the master earphone and corresponds to the data segment which fails to be transmitted in the second data packet;
the first data packet is divided into a plurality of first data segments, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments are in one-to-one correspondence with the plurality of first data segments of the first data packet.
In a third aspect, an embodiment of the present application provides a data transmission device, which is applied to a master earphone, and the device includes:
the receiving module is used for receiving a first data packet sent by the electronic equipment;
the checking module is used for checking the first data packet to obtain a first checking result;
the processing module is used for sending the first check result to a slave earphone, so that the slave earphone determines a data segment which fails to be transmitted in the first data packet according to the first check result and a second check result of a second data packet, and receives the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet; or, receiving the second check result sent by the slave earphone, determining a data segment failed to be transmitted in the second data packet according to the first check result and the second check result, and sending a first data segment corresponding to the data segment failed to be transmitted in the second data packet to the slave earphone;
the first data packet is divided into a plurality of first data segments, the second data packet corresponds to the first data packet, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
In a fourth aspect, an embodiment of the present application provides a data transmission device, which is applied to a slave earphone, and includes:
the verification module is used for verifying the second data packet under the condition of receiving the second data packet corresponding to the first data packet to obtain a second verification result;
the processing module is used for receiving a first check result sent by a main earphone, determining a data segment which fails to be transmitted in the first data packet according to the first check result and the second check result, and sending a second data segment which corresponds to the data segment which fails to be transmitted in the first data packet to the main earphone; or sending the second check result to the master earphone, so that the master earphone determines the data segment which fails to be transmitted in the second data packet according to the second check result and the first check result, and receives the first data segment which is sent by the master earphone and corresponds to the data segment which fails to be transmitted in the second data packet;
the first data packet is divided into a plurality of first data segments, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments are in one-to-one correspondence with the plurality of first data segments of the first data packet.
In a fifth aspect, the present embodiments provide an electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method according to the first aspect or implementing the steps of the method according to the second aspect.
In a sixth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect, or implement the steps of the method according to the second aspect.
In a seventh aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect, or to implement the method according to the second aspect.
In an eighth aspect, embodiments of the present application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method according to the first aspect or the method according to the second aspect.
In this embodiment of the application, the master earphone checks the first data packet to obtain a first check result when receiving the first data packet sent by the electronic device, and sends the first check result to the slave earphone, so that the slave earphone can determine a data segment failed to be transmitted in the first data packet according to the first check result and the second check result, and receive a second data segment sent by the slave earphone and corresponding to the data segment failed to be transmitted in the first data packet. And after the first data packet is verified to obtain the first verification result, the master earphone may further receive a second verification result of the second data packet sent from the earphone, so as to determine the data segment failed in transmission in the second data packet according to the first verification result and the second verification result, and send the first data segment corresponding to the data segment failed in transmission in the second data packet to the slave earphone. Therefore, the master earphone and the slave earphone can perform mutual compensation based on the stored effective data, the data compensation effect of the master earphone and the slave earphone can be improved, a complete data packet does not need to be retransmitted, the transmission quantity of data can be reduced, the transmission time is saved, and the sound blocking is prevented. In addition, data compensation is performed by using the transmission time slot, so that the utilization rate of the time slot can be improved, and the improvement of the communication bandwidth and the reduction of the communication delay are facilitated.
Drawings
Fig. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a slave earphone compensating master earphone data according to an embodiment of the present application;
fig. 3 is a schematic diagram of a master earphone compensating slave earphone data according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another data transmission method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another data transmission device provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 8 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application;
fig. 9 is a schematic hardware structure diagram of another electronic device for implementing the embodiments of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The data transmission method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
As shown in fig. 1, the present embodiment provides a data transmission method applied to a master earphone, which may include the following steps, which are described in detail below.
In step 1100, a first data packet sent by an electronic device is received.
In this embodiment, the first data packet may be transmitted by the electronic device through the first signal link. The first packet may be Audio data (Advanced Audio Distribution Profile, A2 DP). The first signal link is a communication link established between the primary earpiece and the electronic device.
The first data packet may be divided into a plurality of first data segments. The finer the granularity of the first packet division, i.e., the more the first data segment is divided, the smaller the amount of data to be retransmitted when a packet loss occurs. Similarly, the finer the granularity of the first packet partition is, the greater the amount of processing required during verification.
In one embodiment, the first data packet is divided into a plurality of first data segments according to the setting parameters. Wherein the setting parameter is determined according to the time slot of the transmission data. That is, the division may be made by time slots of data transmission. Illustratively, the division is by 1 slot, i.e. each slot corresponds to one first data segment. For example, as shown in fig. 2, a first data packet is received through 5 time slots, and the first data packet is divided into 5 first data segments, that is, a time slot N +1, a time slot N +2, a time slot N +3, and a time slot N +4 correspond to one first data segment respectively. Illustratively, the division may also be made in 1/2 time slots. Also for example, the division may be made in 1/4 time slots. Illustratively, the division may also be made in 2 slots. In this embodiment, the first data packet may be divided according to actual needs, so as to reduce the data processing amount during checking while improving the retransmission efficiency.
After step 1100, step 1200 is executed to check the first data packet, so as to obtain a first check result.
In this embodiment, the checking the first data packet may include checking the integrity of the received first data packet to obtain first checking information. The checking of the first data packet may further include splitting the first data packet, and checking each first data segment of the first data packet to obtain a first check code corresponding to each first data segment. The first check result includes first check information indicating whether the first data packet is complete and a first check code of each of the plurality of first data segments. Continuing with fig. 2 as an example, the first data packet is divided into 5 first data segments according to the time slot, and each first data segment corresponds to obtain a first check code. Based on the first check information, it may be determined whether the first data packet is complete, i.e. whether the first data packet fails to be transmitted. It may further be determined which of the first data segments in the first data packet failed to be transmitted based on the first check code.
It will be appreciated that the first packet may be checked in a Cyclic Redundancy Check (CRC) Check, such as CRC-32. The first data packet may be checked in a parity check. The embodiment of the present application does not limit the checking method of the first data packet.
After step 1200, step 1300a is executed to send the first verification result to the slave earphone, so that the slave earphone determines the data segment which is failed to be transmitted in the first data packet according to the first verification result and the second verification result of the second data packet, and receives the second data segment which is sent by the slave earphone and corresponds to the data segment which is failed to be transmitted in the first data packet.
In this embodiment, the second data packet may be obtained by the slave earphone by monitoring a signal link between the master earphone and the electronic device when the master earphone receives the first data packet sent by the electronic device. The second packet is a packet corresponding to the first packet. The second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
The finer the granularity of the division of the second data packet, i.e., the more the divided second data segment, the smaller the amount of data to be retransmitted when a packet loss occurs. Similarly, the finer the granularity of the second packet partition, the greater the amount of processing required for verification.
In one embodiment, the second data packet is divided into a plurality of second data segments according to the setting parameters. Wherein the setting parameter is determined according to the time slot of the transmission data. That is, it may be divided by the time slot of the data transmission. Illustratively, the division is by 1 slot, i.e. each slot corresponds to one second data segment. For example, as shown in fig. 2, the second data packet is received through 5 time slots, and the second data packet is divided into 5 second data segments, that is, time slot N +1, time slot N +2, time slot N +3, and time slot N +4 correspond to one second data segment respectively. Illustratively, the division may also be made in 1/2 time slots. Also for example, the division may be made in 1/4 time slots. Illustratively, the division may also be made in 2 slots. In this embodiment, the second data packet may be divided according to actual needs, so as to reduce the data processing amount during checking while improving the retransmission efficiency.
In this embodiment, before the slave earphone determines the data segment that fails to be transmitted in the first data packet according to the first verification result and the second verification result of the second data packet, the slave earphone verifies the second data packet. The checking the second data packet may include checking the integrity of the received second data packet to obtain second check information. And checking the second data packet, which may further include splitting the second data packet, and checking each second data segment of the second data packet to obtain a second check code corresponding to each second data segment. The second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments. Continuing with the example of fig. 2, the second data packet is divided into 5 second data segments according to the time slot, and each second data segment correspondingly obtains a second parity code. Based on the second check information, it may be determined whether the second data packet is complete, i.e. whether the second data packet failed to be transmitted. It may further be determined from the second check code which of the second data segments in the second data packet failed to be transmitted.
It will be appreciated that the second data packet may be checked in a cyclic redundancy check, CRC, check, e.g., CRC-32. The second data packet may also be checked in a parity check. The embodiment of the present application does not limit the checking method of the second data packet.
In specific implementation, as shown in fig. 2, after the electronic device sends the first data packet to the master earphone and before the time slot is not completed, that is, in the time slot T3 of the (N + 5) th time slot, the master earphone verifies the first data packet to obtain a first verification result, and synchronizes the first verification result to the slave earphone. And in the time period T5, the slave earphone checks the second data packet to obtain a second check result, and synchronizes the second check result to the master earphone. After the synchronization check result, the master earpiece transmits an acknowledgement packet (ACK) to the electronic device. And then the slave earphone determines whether the first data packet is complete or not according to the first check information and determines whether the second data packet is complete or not according to the second check information, the slave earphone compares the first check code of each first data segment of the first data packet with the second check code of the corresponding second data segment respectively under the condition that the first check information indicates that the first data packet is incomplete and the second check information indicates that the second data packet is complete, determines the first data segment corresponding to the first check code as the data segment failed to be transmitted in the first data packet under the condition that the first check code and the second check code are inconsistent, and sends the second data segment corresponding to the data segment failed to the master earphone.
After step 1200, step 1300b is executed to receive the second check result sent by the slave earphone, determine the data segment failed to be transmitted in the second data packet according to the first check result and the second check result, and send the first data segment corresponding to the data segment failed to be transmitted in the second data packet to the slave earphone.
In some embodiments, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the determining, according to the first check result and the second check result, a data segment in the second data packet that fails to be transmitted may further include: and under the condition that the first check information indicates that the first data packet is complete and the second check information indicates that the second data packet is not complete, determining the data segments which fail to be transmitted in the second data packet according to the first check code of each first data segment and the second check code of each second data segment.
In this embodiment, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments. Taking fig. 3 as an example, the first data packet is divided into 5 first data segments according to the time slot, and each first data segment corresponds to obtain a first check code. Based on the first check information, it may be determined whether the first data packet is complete, i.e. whether the first data packet fails to be transmitted. It may further be determined from the first check code which data segment of the first data packet failed to be transmitted.
The second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments. Continuing with the example of fig. 3, the second data packet is divided into 5 second data segments according to the time slot, and each second data segment corresponds to a second parity code. Based on the second check information, it may be determined whether the second data packet is complete, i.e. whether the second data packet failed to be transmitted. It may further be determined from the second check code which data segment of the second data packet failed to be transmitted.
In specific implementation, as shown in fig. 3, after the electronic device sends the first data packet to the master earphone and before the time slot is not completed, that is, in the time slot T3 of the (N + 5) th time slot, the master earphone verifies the first data packet to obtain a first verification result, and synchronizes the first verification result to the slave earphone. And in the time period T5, the slave earphone checks the second data packet to obtain a second check result, and synchronizes the second check result to the master earphone. After the synchronization check result, the master earphone transmits an acknowledgement packet (ACK) to the electronic device. And then the master earphone determines whether the first data packet is complete or not according to the first check information and determines whether the second data packet is complete or not according to the second check information, the master earphone compares the first check code of each first data segment of the first data packet with the second check code of the corresponding second data segment respectively under the condition that the first check information indicates that the first data packet is complete and the second check information indicates that the second data packet is incomplete, the master earphone determines the second data segment corresponding to the second check code as the data segment failed to be transmitted in the second data packet under the condition that the first check code and the second check code are inconsistent, and sends the first data segment corresponding to the data segment failed to the slave earphone.
In this embodiment of the application, the master earphone checks the first data packet to obtain a first check result when receiving the first data packet sent by the electronic device, and sends the first check result to the slave earphone, so that the slave earphone can determine a data segment failed to be transmitted in the first data packet according to the first check result and the second check result, and receive a second data segment sent by the slave earphone and corresponding to the data segment failed to be transmitted in the first data packet. And after the first data packet is verified to obtain the first verification result, the master earphone may further receive a second verification result of the second data packet sent from the earphone, so as to determine the data segment failed in transmission in the second data packet according to the first verification result and the second verification result, and send the first data segment corresponding to the data segment failed in transmission in the second data packet to the slave earphone. Therefore, the master earphone and the slave earphone can perform mutual compensation based on the stored effective data, the data compensation effect of the master earphone and the slave earphone can be improved, a complete data packet does not need to be retransmitted, the transmission quantity of data can be reduced, the transmission time is saved, and the sound blocking is prevented. In addition, data compensation is performed by using the transmission time slot, so that the utilization rate of the time slot can be improved, and the improvement of the communication bandwidth and the reduction of the communication delay are facilitated.
In some embodiments, after the first verification result is sent to the slave earphone so that the slave earphone determines the data segment which fails to be transmitted in the first data packet according to the first verification result and the second verification result of the second data packet, and receives the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet, the master earphone verifies the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet.
In specific implementation, before receiving a second data segment corresponding to the data segment which fails to be transmitted in the first data packet and sent from the earphone, the master earphone receives a second check result sent from the earphone, and determines the data segment which fails to be transmitted in the first data packet according to the first check result and the second check result. In this way, after receiving the second data segment corresponding to the data segment failed in transmission in the first data packet sent by the slave earphone, the master earphone may check the received second data segment corresponding to the data segment failed in transmission in the first data packet, so as to ensure the correctness of the retransmitted data segment.
In some embodiments, after the receiving the first data packet sent by the electronic device, the method may further include: step 2100-step 2300.
In step 2100, a first parameter corresponding to each of the plurality of first data segments is obtained, where the first parameter is used to measure a link quality of a first signal link, and the first signal link is a signal link between the main headset and the electronic device.
In this embodiment, the first signal link is a signal link between the primary earpiece and the electronic device. The success rate of receiving data from the primary earpiece may be affected by the link quality of the first signal link. And the quality of the link quality of the first signal link is related to the distance between the master earphone and the electronic device, e.g., the farther the master earphone is from the electronic device, the worse the link quality of the first signal link. The closer the primary earpiece is to the electronic device, the higher the link quality of the first signal link. For example, if the user wearing the main headset faces the electronic device, the link quality of the first signal link is better, and if the user wearing the main headset faces away from the electronic device, the link quality of the first signal link is worse. Based on this, in the process of receiving the first data packet, the link quality of the first signal link can be detected, so as to judge the data segment which is possibly failed to be transmitted in the first data packet according to the link quality of the first signal link.
The first parameter may be used to measure a link quality of the first signal link. Each of the plurality of first data segments corresponds to a first parameter, and the first parameter may reflect link quality of the first signal link in the process of acquiring the first data segment. Taking the example of dividing the data segment by the time slot, the first parameter may be a first parameter corresponding to the time slot in which the first data segment is transmitted.
It will be appreciated herein that the first parameter may be a signal-to-noise ratio of a signal received by the first signal link. The first parameter may also be a Received Signal Strength (RSSI) of a Signal Received by the first Signal link.
Step 2200, determining the first data segment corresponding to the first parameter as the data segment failed in transmission in the first data packet, if the parameter value of the first parameter is smaller than the first threshold value.
In this embodiment, the first threshold may measure whether the link quality of the first signal link is poor. When the parameter value of the first parameter is smaller than the first threshold, it is determined that the first data segment corresponding to the first parameter is the data segment of the first data packet, which has failed to be transmitted.
Step 2300, sending a first identifier corresponding to the data segment failed in transmission in the first data packet to the slave earphone, so that the slave earphone sends a second data segment corresponding to the data segment failed in transmission in the first data packet according to the first identifier.
In this embodiment, the first identifier is used to identify a data segment in the first data packet that failed in transmission. Illustratively, the first identifier may be a time slot corresponding to a data segment of the first data packet that failed to be transmitted.
In this embodiment, when the primary earpiece receives the first data packet through the first signal link, the link quality of the first signal link is combined, so that a data segment in the first data packet, in which transmission failure may occur, can be predicted, and the first data packet does not need to be checked, which can reduce the processing computation amount and further reduce the delay.
It should be noted that, in this embodiment, before the first data packet is verified to obtain the first verification result, the data segment that fails to be transmitted in the first data packet may be determined and retransmitted in combination with the link quality of the first signal link, and then, the integrity and the correctness of the first data packet are verified again in a verification manner, so as to ensure the correctness of data transmission.
As shown in fig. 4, the present embodiment also provides a data transmission method applied to a slave headset, which may include the following steps, which are described in detail below.
Step 3100, in case of receiving a second data packet corresponding to the first data packet, verifying the second data packet to obtain a second verification result.
In this embodiment, the second data packet may be obtained by the slave earphone by monitoring a signal link between the master earphone and the electronic device when the master earphone receives the first data packet sent by the electronic device. The second packet is a packet corresponding to the first packet. The second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
The finer the granularity of the division of the second data packet, i.e., the more the divided second data segment, the smaller the amount of data to be retransmitted when a packet loss occurs. Similarly, the finer the granularity of the second packet partition, the greater the amount of processing required for verification.
In one embodiment, the second data packet is divided into a plurality of second data segments according to the setting parameters. Wherein the setting parameter is determined according to the time slot of the transmission data. That is, the division may be made by time slots of data transmission. Illustratively, the division is by 1 slot, i.e. each slot corresponds to one second data segment. For example, as shown in fig. 2, the second data packet is received through 5 time slots, and the second data packet is divided into 5 second data segments, that is, time slot N +1, time slot N +2, time slot N +3, and time slot N +4 correspond to one second data segment respectively. Illustratively, the division may also be made in 1/2 time slots. Also for example, the division may be made in 1/4 time slots. Illustratively, the division may also be made in 2 slots. In this embodiment, the second data packet may be divided according to actual needs, so as to improve retransmission efficiency and reduce data processing amount during checking.
In this embodiment, the verifying the second data packet may include verifying the integrity of the received second data packet to obtain the second verification information. And checking the second data packet, which may further include splitting the second data packet, and checking each second data segment of the second data packet to obtain a second check code corresponding to each second data segment. The second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments. Continuing with the example of fig. 2, the second data packet is divided into 5 second data segments according to the time slot, and each second data segment corresponds to a second parity code. Based on the second check information, it may be determined whether the second data packet is complete, i.e. whether the second data packet failed to be transmitted. It may further be determined from the second check code which data segment of the second data packet failed to be transmitted.
It will be appreciated that the second packet may be checked in a CRC check, for example CRC-32. The second data packet may also be checked in parity. The embodiment of the present application does not limit the checking method of the second data packet.
After step 3100, execute step 3200a, receive a first check result sent by a master earphone, determine a data segment that fails to be transmitted in the first data packet according to the first check result and the second check result, and send a second data segment corresponding to the data segment that fails to be transmitted in the first data packet to the master earphone.
In this embodiment, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments. Continuing with fig. 2 as an example, the first data packet is divided into 5 first data segments according to the time slot, and each first data segment corresponds to obtain a first check code. Based on the first check information, it may be determined whether the first data packet is complete, i.e. whether the first data packet fails to be transmitted. It may further be determined from the first check code which of the first data segments in the first data packet failed to be transmitted.
In some embodiments, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the determining, according to the first check result and the second check result, a data segment in the first data packet that fails to be transmitted may further include: and under the condition that the first check information indicates that the first data packet is incomplete and the second check information indicates that the second data packet is complete, determining the data segment which fails to be transmitted in the first data packet according to the first check code of each first data segment and the second check code of each second data segment.
In specific implementation, with reference to fig. 2, after the electronic device sends the first data packet to the master earphone and before the time slot is not completed, that is, in the time slot T3 of the (N + 5) th time slot, the master earphone verifies the first data packet to obtain a first verification result, and synchronizes the first verification result to the slave earphone. And in the time period T5, the slave earphone checks the second data packet to obtain a second check result, and synchronizes the second check result to the master earphone. After the synchronization check result, the master earpiece transmits an acknowledgement packet (ACK) to the electronic device. And then the slave earphone determines whether the first data packet is complete or not according to the first check information and determines whether the second data packet is complete or not according to the second check information, the slave earphone compares the first check code of each first data segment of the first data packet with the second check code of the corresponding second data segment respectively under the condition that the first check information indicates that the first data packet is incomplete and the second check information indicates that the second data packet is complete, determines the first data segment corresponding to the first check code as the data segment failed to be transmitted in the first data packet under the condition that the first check code and the second check code are inconsistent, and sends the second data segment corresponding to the first data segment failed to the master earphone.
After step 3100, step 3200b is executed to send the second check result to the master earphone, so that the master earphone determines the data segment in the second data packet that fails to be transmitted according to the second check result and the first check result, and receives the first data segment sent by the master earphone and corresponding to the data segment in the second data packet that fails to be transmitted.
In specific implementation, as shown in fig. 3, after the electronic device sends the first data packet to the master earphone and before the time slot is not completed, that is, in the time slot T3 of the (N + 5) th time slot, the master earphone verifies the first data packet to obtain a first verification result, and synchronizes the first verification result to the slave earphone. And in the time period T5, the slave earphone checks the second data packet to obtain a second check result, and synchronizes the second check result to the master earphone. After the synchronization check result, the master earpiece transmits an acknowledgement packet (ACK) to the electronic device. And then the master earphone determines whether the first data packet is complete or not according to the first check information and determines whether the second data packet is complete or not according to the second check information, the master earphone compares the first check code of each first data segment of the first data packet with the second check code of the corresponding second data segment respectively under the condition that the first check information indicates that the first data packet is complete and the second check information indicates that the second data packet is incomplete, the master earphone determines the second data segment corresponding to the second check code as the data segment failed to be transmitted in the second data packet under the condition that the first check code and the second check code are inconsistent, and sends the first data segment corresponding to the data segment failed to the slave earphone.
In this embodiment of the application, when a second data packet corresponding to a first data packet is received from a headset, the second data packet is verified to obtain a second verification result, and when a first verification result of the first data packet sent by a master headset is received, a data segment failed in transmission in the first data packet is determined according to the first verification result and the second verification result, and a second data segment corresponding to the data segment failed in transmission is sent to the master headset. And after the slave earphone checks the second data packet to obtain a second check result, the slave earphone may also send the second check result to the master earphone, so that the master earphone determines the data segment failed in transmission in the second data packet according to the second check result and the first check result, and receives the first data segment sent by the master earphone and corresponding to the data segment failed in transmission in the second data packet. Therefore, the master earphone and the slave earphone can perform mutual compensation based on the stored effective data, the data compensation effect of the master earphone and the slave earphone can be improved, a complete data packet does not need to be retransmitted, the transmission quantity of data can be reduced, the transmission time is saved, and the sound blocking is prevented. In addition, data compensation is performed by using the transmission time slot, so that the utilization rate of the time slot can be improved, and the improvement of the communication bandwidth and the reduction of the communication delay are facilitated.
In some embodiments, after receiving the first data segment corresponding to the data segment failed to be transmitted in the second data packet sent by the master earphone, the slave earphone checks the first data segment corresponding to the data segment failed to be transmitted in the second data packet sent by the master earphone.
In specific implementation, before receiving a first data segment corresponding to a data segment which fails to be transmitted in a second data packet and sent by a master earphone, a first check result sent by the master earphone is received by the slave earphone, and the data segment which fails to be transmitted in the second data packet is determined according to the first check result and a second check result. In this way, after receiving the first data segment corresponding to the data segment failed in transmission in the second data packet sent by the master earphone, the slave earphone can verify the received first data segment corresponding to the second data segment failed in transmission in the second data packet, so as to ensure the correctness of the retransmitted data segment.
In some embodiments, before the performing the verification on the second data packet to obtain the second verification result, the method may further include: step 4100-step 4300.
Step 4100, acquiring a second parameter corresponding to each of the second data segments, where the second parameter is used to measure link quality of a second signal link, and the second signal link is a listening link of the slave earphone.
In this embodiment, the second signal link is a listening link from the headset. The success rate of receiving data from the headset is affected by the quality of the link of the second signal link. And the quality of the link quality of the second signal link is related to the distance from the headset to the electronic device, e.g. the further from the headset to the electronic device, the worse the link quality of the second signal link. The closer the headset is to the electronic device, the higher the link quality of the second signal link. Also for example, the link quality of the second signal link is better when the user wearing the slave ear piece faces the electronic device, and the link quality of the second signal link is worse when the user wearing the slave ear piece faces away from the electronic device. Based on this, in the process of receiving the second data packet, the link quality of the second signal link may be detected, so as to judge that the second data segment with transmission failure may occur in the second data packet according to the link quality of the second signal link.
The second parameter may be used to measure a link quality of the second signal link. The second parameter corresponding to the second data segment may reflect the link quality of the second signal link in the process of acquiring the second data segment. Taking the division of the data segment according to the time slot as an example, the second parameter corresponding to the second data segment may be a second parameter corresponding to the time slot for transmitting the second data segment.
It will be appreciated herein that the second parameter may be a signal-to-noise ratio of the signal received by the second signal link. The first parameter may also be an RSSI value of a signal received by the second signal link.
Step 4200, if the parameter value of the second parameter is smaller than a second threshold, determining a second data segment corresponding to the second parameter as a data segment that fails to be transmitted in the second data packet.
In this embodiment, the second threshold may measure whether the link quality of the second signal link is poor. And when the parameter value of the second parameter is smaller than the second threshold, determining that the second data segment corresponding to the second parameter is the data segment which fails to be transmitted in the second data packet.
Step 4300, sending a second identifier corresponding to the data segment that fails to be transmitted in the second data packet to the master earphone, so that the master earphone sends the first data segment corresponding to the data segment that fails to be transmitted in the second data packet according to the second identifier.
In this embodiment, the second identifier is used to identify the data segment in the second data packet that failed to be transmitted. Illustratively, the second identifier may be a time slot corresponding to a data segment of the second data packet that failed to be transmitted.
In this embodiment, when the second data packet is received from the earphone through the second signal link, in combination with the link quality of the second signal link, a data segment in which transmission failure may occur in the second data packet may be predicted, and the second data packet does not need to be checked, so that the processing operation amount may be reduced, and the delay may be further reduced.
It should be noted that, in this embodiment, before the second data packet is verified to obtain the second verification result, the link quality of the second signal link may be combined to determine the data segment that fails to be transmitted in the second data packet, and retransmit the data segment that fails to be transmitted in the first data packet, and then, the integrity and the correctness of the second data packet are verified again by using a verification method, so as to ensure the correctness of data transmission.
In the data transmission method provided by the embodiment of the application, the execution main body can be a data transmission device. In the embodiment of the present application, a method for performing data transmission by a data transmission device is taken as an example, and a data transmission device provided in the embodiment of the present application is described.
As shown in fig. 5, an embodiment of the present application further provides a data transmission apparatus 500, where the data transmission apparatus 500 includes a receiving module 501, a checking module 502, and a processing module 503.
The receiving module 501 is configured to receive a first data packet sent by an electronic device;
the checking module 502 is configured to check the first data packet to obtain a first checking result;
the processing module 503 is configured to send the first verification result to the slave earphone, so that the slave earphone determines a data segment that fails to be transmitted in the first data packet according to the first verification result and a second verification result of a second data packet, and receives the second data segment that is sent by the slave earphone and corresponds to the data segment that fails to be transmitted in the first data packet; or, receiving the second check result sent by the slave earphone, determining a data segment failed to be transmitted in the second data packet according to the first check result and the second check result, and sending a first data segment corresponding to the data segment failed to be transmitted in the second data packet to the slave earphone;
the first data packet is divided into a plurality of first data segments, the second data packet corresponds to the first data packet, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
Optionally, the apparatus further comprises: an obtaining module, configured to obtain a first parameter corresponding to each of the plurality of first data segments, where the first parameter is used to measure a link quality of a first signal link, and the first signal link is a signal link between the main headset and the electronic device; a determining module, configured to determine, when a parameter value of the first parameter is smaller than a first threshold, a first data segment corresponding to the first parameter as a data segment that fails to be transmitted in the first data packet; a sending module, configured to send, to the slave earphone, a first identifier corresponding to a data segment that fails to be transmitted in the first data packet, so that the slave earphone sends, according to the first identifier, a second data segment corresponding to the data segment that fails to be transmitted in the first data packet.
Optionally, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the processing module 503 is specifically configured to:
and under the condition that the first check information indicates that the first data packet is complete and the second check information indicates that the second data packet is not complete, determining the data segments which fail to be transmitted in the second data packet according to the first check code of each first data segment and the second check code of each second data segment.
Optionally, the dividing of the first data packet into a plurality of first data segments includes: the first data packet is divided into a plurality of first data segments according to set parameters; the second data packet is divided into a plurality of second data segments, and the method comprises the following steps: the second data packet is divided into a plurality of first data segments according to set parameters; wherein the setting parameter is determined according to the time slot of the transmission data.
In this embodiment of the application, the master earphone checks the first data packet to obtain a first check result when receiving the first data packet sent by the electronic device, and sends the first check result to the slave earphone, so that the slave earphone can determine a data segment failed to be transmitted in the first data packet according to the first check result and the second check result, and receive a second data segment sent by the slave earphone and corresponding to the data segment failed to be transmitted in the first data packet. And after the first data packet is verified to obtain the first verification result, the master earphone may further receive a second verification result of the second data packet sent from the earphone, so as to determine the data segment failed in transmission in the second data packet according to the first verification result and the second verification result, and send the first data segment corresponding to the data segment failed in transmission in the second data packet to the slave earphone. Therefore, the master earphone and the slave earphone can perform mutual compensation based on the stored effective data, the data compensation effect of the master earphone and the slave earphone can be improved, a complete data packet does not need to be retransmitted, the transmission quantity of data can be reduced, the transmission time is saved, and the sound blocking is prevented. In addition, data compensation is performed by using the transmission time slot, so that the utilization rate of the time slot can be improved, and the improvement of the communication bandwidth and the reduction of the communication delay are facilitated.
As shown in fig. 6, an embodiment of the present application further provides a data transmission apparatus 600, where the data transmission apparatus 600 includes a verification module 601 and a processing module 602.
The checking module 601 is configured to, in a case that a second data packet corresponding to a first data packet is received, check the second data packet to obtain a second checking result;
the processing module 602 is configured to receive a first check result sent by a master earphone, determine a data segment that fails to be transmitted in the first data packet according to the first check result and the second check result, and send a second data segment corresponding to the data segment that fails to be transmitted in the first data packet to the master earphone; or sending the second check result to the master earphone, so that the master earphone determines the data segment which fails to be transmitted in the second data packet according to the second check result and the first check result, and receives the first data segment which is sent by the master earphone and corresponds to the data segment which fails to be transmitted in the second data packet;
the first data packet is divided into a plurality of first data segments, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments are in one-to-one correspondence with the plurality of first data segments of the first data packet.
Optionally, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the processing module 602 is specifically configured to:
and under the condition that the first check information indicates that the first data packet is incomplete and the second check information indicates that the second data packet is complete, determining the data segment which fails to be transmitted in the first data packet according to the first check code of each first data segment and the second check code of each second data segment.
Optionally, the apparatus further comprises: an obtaining module, configured to obtain a second parameter corresponding to each of the second data segments, where the second parameter is used to measure link quality of a second signal link, and the second signal link is a listening link of the slave headset; a determining module, configured to determine, when a parameter value of the second parameter is smaller than a second threshold, a second data segment corresponding to the second parameter as a data segment that fails to be transmitted in the second data packet; and the sending module is used for sending a second identifier corresponding to the data segment which fails to be transmitted in the second data packet to the master earphone so that the master earphone sends a first data segment corresponding to the data segment which fails to be transmitted in the second data packet according to the second identifier.
In this embodiment of the application, when a second data packet corresponding to a first data packet is received from a headset, the second data packet is verified to obtain a second verification result, and when a first verification result of the first data packet sent by a master headset is received, a data segment failed in transmission in the first data packet is determined according to the first verification result and the second verification result, and a second data segment corresponding to the data segment failed in transmission is sent to the master headset. And after the slave earphone checks the second data packet to obtain a second check result, the slave earphone may also send the second check result to the master earphone, so that the master earphone determines the data segment failed in transmission in the second data packet according to the second check result and the first check result, and receives the first data segment sent by the master earphone and corresponding to the data segment failed in transmission in the second data packet. Therefore, the master earphone and the slave earphone can perform mutual compensation based on the stored effective data, the data compensation effect of the master earphone and the slave earphone can be improved, a complete data packet does not need to be retransmitted, the transmission quantity of data can be reduced, the transmission time is saved, and the sound blocking is prevented. In addition, data compensation is performed by using the transmission time slot, so that the utilization rate of the time slot can be improved, and the improvement of the communication bandwidth and the reduction of the communication delay are facilitated.
The data transmission device in the embodiment of the present application may be an electronic device, or may be a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The electronic Device may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The data transmission device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The data transmission device provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to fig. 4, and is not described here again to avoid repetition.
Optionally, as shown in fig. 7, an electronic device 700 is further provided in this embodiment of the present application, and includes a processor 701 and a memory 702, where the memory 702 stores a program or an instruction that can be executed on the processor 701, and when the program or the instruction is executed by the processor 701, the steps of the data transmission method embodiment are implemented, and the same technical effects can be achieved, and are not described again to avoid repetition.
Fig. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810.
Those skilled in the art will appreciate that the electronic device 800 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 810 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
Wherein, the processor 810 is configured to: receiving a first data packet sent by electronic equipment; checking the first data packet to obtain a first checking result; the first check result is sent to the slave earphone, so that the slave earphone determines the data segment which fails to be transmitted in the first data packet according to the first check result and the second check result of the second data packet, and the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet is received; or, receiving the second check result sent by the slave earphone, determining a data segment failed to be transmitted in the second data packet according to the first check result and the second check result, and sending a first data segment corresponding to the data segment failed to be transmitted in the second data packet to the slave earphone; the first data packet is divided into a plurality of first data segments, the second data packet corresponds to the first data packet, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
Optionally, the processor 810 is further configured to, after receiving the first data packet sent by the electronic device: acquiring a first parameter corresponding to each of the plurality of first data segments, wherein the first parameter is used for measuring link quality of a first signal link, and the first signal link is a signal link between the main earphone and the electronic device; determining a first data segment corresponding to the first parameter as a data segment failed in transmission in the first data packet when the parameter value of the first parameter is smaller than a first threshold value; and sending a first identifier corresponding to the data segment which fails to be transmitted in the first data packet to the slave earphone, so that the slave earphone sends a second data segment corresponding to the data segment which fails to be transmitted in the first data packet according to the first identifier.
Optionally, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; when determining the data segment failed to be transmitted in the second data packet according to the first check result and the second check result, the processor 810 is configured to: and under the condition that the first check information indicates that the first data packet is complete and the second check information indicates that the second data packet is not complete, determining the data segments which fail to be transmitted in the second data packet according to the first check code of each first data segment and the second check code of each second data segment.
Optionally, when the first data packet is divided into a plurality of first data segments, the processor 810 is configured to: the first data packet is divided into a plurality of first data segments according to set parameters; the processor 810, when dividing the second data packet into a plurality of second data segments, is configured to: the second data packet is divided into a plurality of first data segments according to set parameters; wherein the setting parameter is determined according to the time slot of the transmission data.
In this embodiment of the application, the master earphone checks the first data packet to obtain a first check result when receiving the first data packet sent by the electronic device, and sends the first check result to the slave earphone, so that the slave earphone can determine a data segment failed to be transmitted in the first data packet according to the first check result and the second check result, and receive a second data segment sent by the slave earphone and corresponding to the data segment failed to be transmitted in the first data packet. And after the first data packet is verified to obtain the first verification result, the master earphone may further receive a second verification result of the second data packet sent from the earphone, so as to determine the data segment failed in transmission in the second data packet according to the first verification result and the second verification result, and send the first data segment corresponding to the data segment failed in transmission in the second data packet to the slave earphone. Therefore, the master earphone and the slave earphone can perform mutual compensation based on the stored effective data, the data compensation effect of the master earphone and the slave earphone can be improved, a complete data packet does not need to be retransmitted, the transmission quantity of data can be reduced, the transmission time is saved, and the sound blocking is prevented. In addition, data compensation is performed by using the transmission time slot, so that the utilization rate of the time slot can be improved, and the improvement of the communication bandwidth and the reduction of the communication delay are facilitated.
It should be understood that in the embodiment of the present application, the input Unit 804 may include a Graphics Processing Unit (GPU) 8041 and a microphone 8042, and the Graphics Processing Unit 8041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. A touch panel 8071, also referred to as a touch screen. The touch panel 8071 may include two portions of a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 809 may be used to store software programs as well as various data. The memory 809 may mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playing function, an image playing function, and the like), and the like. Further, the memory 809 can include volatile memory or nonvolatile memory, or the memory 809 can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous Link DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). The memory 809 in the present embodiment of the application includes, but is not limited to, these and any other suitable types of memory.
Processor 810 may include one or more processing units; optionally, the processor 810 integrates an application processor, which primarily handles operations related to the operating system, user interface, and applications, and a modem processor, which primarily handles wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into processor 810.
Fig. 9 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application.
The electronic device 900 includes, but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910.
Those skilled in the art will appreciate that the electronic device 900 may further include a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 910 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system. The electronic device structure shown in fig. 9 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is not repeated here.
Wherein, the processor 910 is configured to: under the condition that a second data packet corresponding to the first data packet is received, verifying the second data packet to obtain a second verification result; receiving a first check result sent by a master earphone, determining a data segment which fails to be transmitted in the first data packet according to the first check result and the second check result, and sending a second data segment which corresponds to the data segment which fails to be transmitted in the first data packet to the master earphone; or sending the second check result to the master earphone, so that the master earphone determines the data segment which fails to be transmitted in the second data packet according to the second check result and the first check result, and receives the first data segment which is sent by the master earphone and corresponds to the data segment which fails to be transmitted in the second data packet; the first data packet is divided into a plurality of first data segments, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments are in one-to-one correspondence with the plurality of first data segments of the first data packet.
Optionally, the first check result includes first check information indicating whether the first data packet is complete, and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; when determining the data segment failed to be transmitted in the first data packet according to the first check result and the second check result, the processor 910 is configured to: and under the condition that the first check information indicates that the first data packet is incomplete and the second check information indicates that the second data packet is complete, determining the data segment which fails to be transmitted in the first data packet according to the first check code of each first data segment and the second check code of each second data segment.
Optionally, before the performing the verification on the second data packet to obtain the second verification result, the processor 910 is further configured to: acquiring a second parameter corresponding to each second data segment in the second data segments, wherein the second parameter is used for measuring link quality of a second signal link, and the second signal link is a monitoring link of the slave earphone; determining a second data segment corresponding to the second parameter as a data segment failed to be transmitted in the second data packet when the parameter value of the second parameter is smaller than a second threshold value; and sending a second identifier corresponding to the data segment failed to be transmitted in the second data packet to the master earphone, so that the master earphone sends a first data segment corresponding to the data segment failed to be transmitted in the second data packet according to the second identifier.
In this embodiment of the application, when a second data packet corresponding to a first data packet is received from a headset, the second data packet is verified to obtain a second verification result, and when a first verification result of the first data packet sent by a master headset is received, a data segment failed in transmission in the first data packet is determined according to the first verification result and the second verification result, and a second data segment corresponding to the data segment failed in transmission is sent to the master headset. And after the slave earphone checks the second data packet to obtain a second check result, the slave earphone may also send the second check result to the master earphone, so that the master earphone determines the data segment failed in transmission in the second data packet according to the second check result and the first check result, and receives the first data segment sent by the master earphone and corresponding to the data segment failed in transmission in the second data packet. Therefore, the master earphone and the slave earphone can perform mutual compensation based on the stored effective data, the data compensation effect of the master earphone and the slave earphone can be improved, a complete data packet does not need to be retransmitted, the transmission quantity of data can be reduced, the transmission time is saved, and the sound blocking is prevented. In addition, data compensation is performed by using the transmission time slot, so that the utilization rate of the time slot can be improved, and the improvement of the communication bandwidth and the reduction of the communication delay are facilitated.
It should be understood that in the embodiment of the present application, the input unit 904 may include a graphics processor GPU10041 and a microphone 9042, and the graphics processor 9041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 907 includes at least one of a touch panel 9071 and other input devices 9072. A touch panel 9071 also referred to as a touch screen. The touch panel 9071 may include two parts, a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 909 may be used to store software programs as well as various data. The memory 909 may mainly include a first storage area storing a program or an instruction and a second storage area storing data, wherein the first storage area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, and the like) required for at least one function, and the like. Further, the memory 909 may include volatile memory or nonvolatile memory, or the memory 909 may include both volatile and nonvolatile memory. The nonvolatile memory can be a read only memory ROM, a programmable read only memory PROM, an erasable programmable read only memory EPROM, an electrically erasable programmable read only memory EEPROM or a flash memory. The volatile memory may be a random access memory RAM, static random access memory SRAM, dynamic random access memory DRAM, synchronous dynamic random access memory SDRAM, double data rate synchronous dynamic random access memory ddr SDRAM, enhanced synchronous dynamic random access memory ESDRAM, synchronous link dynamic random access memory SLDRAM, and direct memory bus random access memory DRRAM. The memory 909 in the embodiments of the subject application includes, but is not limited to, these and any other suitable types of memory.
Processor 910 may include one or more processing units; optionally, the processor 910 integrates an application processor, which mainly handles operations related to the operating system, user interface, and applications, and a modem processor, which mainly handles wireless communication signals, such as a baseband processor. It is to be appreciated that the modem processor described above may not be integrated into processor 910.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the data transmission method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the data transmission method embodiment, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the foregoing data transmission method embodiments, and achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (14)

1. A data transmission method applied to a master earphone is characterized by comprising the following steps:
receiving a first data packet sent by electronic equipment;
checking the first data packet to obtain a first checking result;
sending the first check result to a slave earphone, so that the slave earphone determines a data segment which fails to be transmitted in the first data packet according to the first check result and a second check result of a second data packet, and receives the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet; or, receiving the second check result sent by the slave earphone, determining a data segment failed to be transmitted in the second data packet according to the first check result and the second check result, and sending a first data segment corresponding to the data segment failed to be transmitted in the second data packet to the slave earphone;
the first data packet is divided into a plurality of first data segments, the second data packet corresponds to the first data packet, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
2. The method of claim 1, wherein after receiving the first data packet sent by the electronic device, the method further comprises:
acquiring a first parameter corresponding to each of the plurality of first data segments, wherein the first parameter is used for measuring link quality of a first signal link, and the first signal link is a signal link between the main earphone and the electronic device;
determining a first data segment corresponding to the first parameter as a data segment with failed transmission in the first data packet under the condition that the parameter value of the first parameter is smaller than a first threshold value;
and sending a first identifier corresponding to the data segment which fails to be transmitted in the first data packet to the slave earphone, so that the slave earphone sends a second data segment corresponding to the data segment which fails to be transmitted in the first data packet according to the first identifier.
3. The method of claim 1, wherein the first check result comprises first check information indicating whether the first data packet is complete and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the determining, according to the first check result and the second check result, a data segment in the second data packet, which is failed to be transmitted, includes:
and under the condition that the first check information indicates that the first data packet is complete and the second check information indicates that the second data packet is not complete, determining the data segments which fail to be transmitted in the second data packet according to the first check code of each first data segment and the second check code of each second data segment.
4. The method of claim 1, wherein the dividing of the first packet into the plurality of first data segments comprises:
the first data packet is divided into a plurality of first data segments according to set parameters;
the second data packet is divided into a plurality of second data segments, and the method comprises the following steps:
the second data packet is divided into a plurality of first data segments according to set parameters;
wherein the setting parameter is determined according to the time slot of the transmission data.
5. A data transmission method applied to a slave headset, the method comprising:
under the condition that a second data packet corresponding to the first data packet is received, verifying the second data packet to obtain a second verification result;
receiving a first check result sent by a master earphone, determining a data segment which fails to be transmitted in the first data packet according to the first check result and the second check result, and sending a second data segment which corresponds to the data segment which fails to be transmitted in the first data packet to the master earphone; or sending the second check result to the master earphone, so that the master earphone determines the data segment which fails to be transmitted in the second data packet according to the second check result and the first check result, and receives the first data segment which is sent by the master earphone and corresponds to the data segment which fails to be transmitted in the second data packet;
the first data packet is divided into a plurality of first data segments, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments are in one-to-one correspondence with the plurality of first data segments of the first data packet.
6. The method of claim 5, wherein the first check result comprises first check information indicating whether the first data packet is complete and a first check code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the determining, according to the first check result and the second check result, a data segment in the first data packet, which is failed to be transmitted, includes:
and under the condition that the first check information indicates that the first data packet is incomplete and the second check information indicates that the second data packet is complete, determining the data segment which fails to be transmitted in the first data packet according to the first check code of each first data segment and the second check code of each second data segment.
7. The method of claim 5, before said checking said second packet to obtain a second checking result, said method further comprising:
acquiring a second parameter corresponding to each second data segment in the second data segments, wherein the second parameter is used for measuring link quality of a second signal link, and the second signal link is a monitoring link of the slave earphone;
determining a second data segment corresponding to the second parameter as a data segment with failed transmission in the second data packet under the condition that the parameter value of the second parameter is smaller than a second threshold value;
and sending a second identifier corresponding to the data segment failed to be transmitted in the second data packet to the master earphone, so that the master earphone sends a first data segment corresponding to the data segment failed to be transmitted in the second data packet according to the second identifier.
8. A data transmission device for use with a primary earpiece, the device comprising:
the receiving module is used for receiving a first data packet sent by the electronic equipment;
the checking module is used for checking the first data packet to obtain a first checking result;
the processing module is used for sending the first check result to a slave earphone, so that the slave earphone determines a data segment which fails to be transmitted in the first data packet according to the first check result and a second check result of a second data packet, and receives the second data segment which is sent by the slave earphone and corresponds to the data segment which fails to be transmitted in the first data packet; or, receiving the second check result sent by the slave earphone, determining a data segment failed to be transmitted in the second data packet according to the first check result and the second check result, and sending a first data segment corresponding to the data segment failed to be transmitted in the second data packet to the slave earphone;
the first data packet is divided into a plurality of first data segments, the second data packet corresponds to the first data packet, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments correspond to the plurality of first data segments one to one.
9. The apparatus of claim 8, further comprising:
an obtaining module, configured to obtain a first parameter corresponding to each of the plurality of first data segments, where the first parameter is used to measure a link quality of a first signal link, and the first signal link is a signal link between the main headset and the electronic device;
a determining module, configured to determine, when a parameter value of the first parameter is smaller than a first threshold, a first data segment corresponding to the first parameter as a data segment that fails to be transmitted in the first data packet;
a sending module, configured to send, to the slave earphone, a first identifier corresponding to a data segment that fails to be transmitted in the first data packet, so that the slave earphone sends, according to the first identifier, a second data segment corresponding to the data segment that fails to be transmitted in the first data packet.
10. The apparatus of claim 8, wherein the first parity result comprises first parity information indicating whether the first data packet is complete and a first parity code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the processing module is specifically configured to:
and under the condition that the first check information indicates that the first data packet is complete and the second check information indicates that the second data packet is not complete, determining the data segments which fail to be transmitted in the second data packet according to the first check code of each first data segment and the second check code of each second data segment.
11. The apparatus of claim 8, wherein the first packet is divided into a plurality of first data segments, comprising:
the first data packet is divided into a plurality of first data segments according to set parameters;
the second data packet is divided into a plurality of second data segments, and the method comprises the following steps:
the second data packet is divided into a plurality of first data segments according to set parameters;
wherein the setting parameter is determined according to the time slot of the transmission data.
12. A data transmission device for use with a slave earphone, the device comprising:
the verification module is used for verifying the second data packet under the condition of receiving the second data packet corresponding to the first data packet to obtain a second verification result;
the processing module is used for receiving a first check result sent by a main earphone, determining a data segment which fails to be transmitted in the first data packet according to the first check result and the second check result, and sending a second data segment which corresponds to the data segment which fails to be transmitted in the first data packet to the main earphone; or sending the second check result to the master earphone, so that the master earphone determines the data segment which fails to be transmitted in the second data packet according to the second check result and the first check result, and receives the first data segment which is sent by the master earphone and corresponds to the data segment which fails to be transmitted in the second data packet;
the first data packet is divided into a plurality of first data segments, the second data packet is divided into a plurality of second data segments, and the plurality of second data segments are in one-to-one correspondence with the plurality of first data segments of the first data packet.
13. The apparatus of claim 12, wherein the first parity result comprises first parity information indicating whether the first data packet is complete and a first parity code of each of the plurality of first data segments; the second parity result includes second parity information indicating whether the second data packet is complete and second parity code for each of the plurality of second data segments; the processing module is specifically configured to:
and under the condition that the first check information indicates that the first data packet is incomplete and the second check information indicates that the second data packet is complete, determining the data segment which fails to be transmitted in the first data packet according to the first check code of each first data segment and the second check code of each second data segment.
14. The apparatus of claim 12, further comprising:
an obtaining module, configured to obtain a second parameter corresponding to each of the second data segments, where the second parameter is used to measure link quality of a second signal link, and the second signal link is a listening link of the slave headset;
a determining module, configured to determine, when a parameter value of the second parameter is smaller than a second threshold, a second data segment corresponding to the second parameter as a data segment that fails to be transmitted in the second data packet;
and the sending module is used for sending a second identifier corresponding to the data segment which fails to be transmitted in the second data packet to the master earphone so that the master earphone sends a first data segment corresponding to the data segment which fails to be transmitted in the second data packet according to the second identifier.
CN202210029608.1A 2022-01-11 2022-01-11 Data transmission method and device Pending CN114499776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210029608.1A CN114499776A (en) 2022-01-11 2022-01-11 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210029608.1A CN114499776A (en) 2022-01-11 2022-01-11 Data transmission method and device

Publications (1)

Publication Number Publication Date
CN114499776A true CN114499776A (en) 2022-05-13

Family

ID=81511095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210029608.1A Pending CN114499776A (en) 2022-01-11 2022-01-11 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN114499776A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135256A (en) * 2017-04-27 2017-09-05 建荣半导体(深圳)有限公司 Bluetooth communication method, communicator, communication system and electronic equipment
CN108923892A (en) * 2018-06-20 2018-11-30 南京中感微电子有限公司 A kind of bluetooth method of reseptance, bluetooth receiver and Bluetooth audio equipment
CN109361493A (en) * 2018-10-29 2019-02-19 南京中感微电子有限公司 Bluetooth method of reseptance, bluetooth receiver and bluetooth equipment
CN110931026A (en) * 2019-11-27 2020-03-27 南京中感微电子有限公司 Audio data communication method, equipment and system
CN111436044A (en) * 2019-11-06 2020-07-21 珠海市杰理科技股份有限公司 Method, device and system for processing packet loss data of dual-wireless Bluetooth communication network
CN111447603A (en) * 2020-06-18 2020-07-24 展讯通信(上海)有限公司 Data transmission method and device
CN111757348A (en) * 2019-03-29 2020-10-09 华为技术有限公司 Communication method and device
CN112205014A (en) * 2020-08-26 2021-01-08 深圳市中科蓝讯科技股份有限公司 Communication method of wireless device, device and computer readable storage medium
CN113489570A (en) * 2021-06-30 2021-10-08 郑州云海信息技术有限公司 Data transmission method, device and equipment for PCIe link
CN113645600A (en) * 2021-08-13 2021-11-12 Oppo广东移动通信有限公司 Data transmission method, device, terminal and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135256A (en) * 2017-04-27 2017-09-05 建荣半导体(深圳)有限公司 Bluetooth communication method, communicator, communication system and electronic equipment
CN108923892A (en) * 2018-06-20 2018-11-30 南京中感微电子有限公司 A kind of bluetooth method of reseptance, bluetooth receiver and Bluetooth audio equipment
CN109361493A (en) * 2018-10-29 2019-02-19 南京中感微电子有限公司 Bluetooth method of reseptance, bluetooth receiver and bluetooth equipment
CN111757348A (en) * 2019-03-29 2020-10-09 华为技术有限公司 Communication method and device
CN111436044A (en) * 2019-11-06 2020-07-21 珠海市杰理科技股份有限公司 Method, device and system for processing packet loss data of dual-wireless Bluetooth communication network
CN110931026A (en) * 2019-11-27 2020-03-27 南京中感微电子有限公司 Audio data communication method, equipment and system
CN111447603A (en) * 2020-06-18 2020-07-24 展讯通信(上海)有限公司 Data transmission method and device
CN112205014A (en) * 2020-08-26 2021-01-08 深圳市中科蓝讯科技股份有限公司 Communication method of wireless device, device and computer readable storage medium
CN113489570A (en) * 2021-06-30 2021-10-08 郑州云海信息技术有限公司 Data transmission method, device and equipment for PCIe link
CN113645600A (en) * 2021-08-13 2021-11-12 Oppo广东移动通信有限公司 Data transmission method, device, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN109496419B (en) File processing method, device and system
CN108848163B (en) Upgrading method of TWS earphone and TWS earphone
US11304090B2 (en) Method for correcting audio data during dual wireless communication and wireless playback system
CN111277388A (en) HARQ-ACK codebook generating method, information sending method and equipment
CN113395687B (en) Reconnection method, reconnection device, electronic equipment and storage medium
CN111128203B (en) Audio data encoding method, audio data decoding method, audio data encoding device, audio data decoding device, electronic equipment and storage medium
CN113472488B (en) HARQ-ACK feedback mode determining method, HARQ-ACK feedback mode configuring method and HARQ-ACK feedback mode configuring equipment
CN104796385A (en) Terminal binding method, device and system
CN108040355B (en) Network access method and system
US20230224654A1 (en) Earphone debugging method and device, and storage medium
CN112187406B (en) Error correction method, device and medium for true wireless earphone
KR102221021B1 (en) Electronic device and method for processing packet in internet protocol based network
CN108738008A (en) Bluetooth pairing methods and system
CN113301572B (en) Connection method and device of Bluetooth equipment, storage medium and Bluetooth equipment
CN110719542A (en) TWS earphone, upgrading method and device thereof, and computer storage medium
CN110764806B (en) TWS earphone and upgrading method and device thereof
CN112382304A (en) Bluetooth audio repairing method, device, equipment and medium
JP7114747B2 (en) Random access resource selection method and terminal device
CN114499776A (en) Data transmission method and device
CN111615137A (en) Wireless network state detection method and related equipment thereof
CN114285657B (en) Firewall security policy change verification method and device
CN117439703A (en) Data verification result determining method and device, electronic equipment and storage medium
CN109495226B (en) Method for transmitting control signal, user terminal and network side equipment
CN111031576A (en) Upgrading method of TWS wireless earphone and wireless audio equipment
CN113595697B (en) DAI counting method, DAI counting control method, terminal and network equipment

Legal Events

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