CN116367294A - Communication time slot allocation method, data transmission method, device and earphone - Google Patents
Communication time slot allocation method, data transmission method, device and earphone Download PDFInfo
- Publication number
- CN116367294A CN116367294A CN202111583096.5A CN202111583096A CN116367294A CN 116367294 A CN116367294 A CN 116367294A CN 202111583096 A CN202111583096 A CN 202111583096A CN 116367294 A CN116367294 A CN 116367294A
- Authority
- CN
- China
- Prior art keywords
- time slot
- recording data
- earphone
- slave
- data packet
- 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
Links
- 238000004891 communication Methods 0.000 title claims abstract description 119
- 238000000034 method Methods 0.000 title claims abstract description 86
- 230000005540 biological transmission Effects 0.000 title claims abstract description 64
- 230000001360 synchronised effect Effects 0.000 claims abstract description 26
- 238000004590 computer program Methods 0.000 claims description 14
- 238000012544 monitoring process Methods 0.000 claims description 4
- 230000008859 change Effects 0.000 description 7
- 230000003993 interaction Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 230000003139 buffering effect Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
- 210000003454 tympanic membrane Anatomy 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W56/00—Synchronisation arrangements
- H04W56/001—Synchronization between nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
- H04R1/1041—Mechanical or electronic switches, or control elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/04—Wireless resource allocation
- H04W72/044—Wireless resource allocation based on the type of the allocated resource
- H04W72/0446—Resources in time domain, e.g. slots or frames
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Time-Division Multiplex Systems (AREA)
Abstract
The application relates to a communication time slot allocation method, a data transmission method, a device and a headset. The method comprises the following steps: identifying the number of the cached master recording data packets and the number of the slave recording data packets; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and sent to the master earphone; determining the time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the slave recording data packets; wherein, the first time slot is a communication time slot allocated to the terminal equipment and is used for sending the binaural data packet to the terminal equipment; the second time slot is a communication time slot allocated to the slave earphone and is used for receiving a slave recording data packet sent by the slave earphone; binaural data packets are generated based on the synchronized master recording data packets and slave recording data packets; sending a time slot adjustment notice according to the time slot ratio; the slot adjustment notification is used to notify the terminal device and adjust the slot allocation from the headset. The method can improve the stability of recording data transmission.
Description
Technical Field
The present disclosure relates to the field of audio devices, and in particular, to a communication timeslot allocation method, a data transmission device, and an earphone.
Background
Along with the rapid development of technology, the earphone is also increasingly widely applied. Some headphones with microphones are used to record audio in addition to playing the audio. In order to realize stereo recording, microphones of two earphones can be used for respectively receiving and recording, and then synthesizing processing is carried out.
Disclosure of Invention
The embodiment of the application provides a communication time slot allocation method, a data transmission method, a device, an earphone and a computer readable storage medium, which can improve the stability of recording data transmission.
A communication time slot allocation method is applied to a master earphone in an earphone set, and the earphone set further comprises a slave earphone; the method comprises the following steps: identifying the number of the cached master recording data packets and the number of the slave recording data packets; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and sent to the master earphone; determining the time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the slave recording data packets; wherein, the first time slot is a communication time slot allocated to the terminal equipment and is used for sending the binaural data packet to the terminal equipment; the second time slot is a communication time slot allocated to the slave earphone and is used for receiving a slave recording data packet sent by the slave earphone; binaural data packets are generated based on the synchronized master recording data packets and slave recording data packets; sending a time slot adjustment notice to the terminal equipment and the slave earphone according to the time slot ratio; the slot adjustment notification is used to notify the terminal device and adjust the slot allocation from the headset.
A communication time slot allocation method is applied to a master earphone in an earphone set, and the earphone set further comprises a slave earphone; the method comprises the following steps:
determining the transmitted number of binaural data packets transmitted to the terminal device within a preset time and the received number of slave recording data packets transmitted from the headphones; binaural data packets are generated based on the synchronized master recording data packets and slave recording data packets; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and sent to the master earphone;
determining the time slot ratio of the first time slot to the second time slot according to the sent number and the received number; wherein, the first time slot is a communication time slot allocated to the terminal equipment and is used for sending the binaural data packet to the terminal equipment; the second time slot is a communication time slot allocated to the slave earphone and is used for receiving a slave recording data packet sent by the slave earphone;
sending a time slot adjustment notice to the terminal equipment and the slave earphone according to the time slot ratio; the slot adjustment notification is used to notify the terminal device and adjust the slot allocation from the headset.
A data transmission method applied to a master earphone in an earphone set, wherein the earphone set further comprises a slave earphone; the method comprises the following steps: receiving a slave recording data packet sent by a slave earphone in a second time slot; if the cached master recording data packet is synchronous with the slave recording data packet, clathrating the master recording data packet with the slave recording data packet and generating a binaural data packet; transmitting the binaural data packet to the terminal device in the first time slot; wherein the time slot ratio of the first time slot to the second time slot is determined according to the communication time slot allocation method.
A communication time slot allocation method is applied to a system, and the system comprises an earphone set with a master earphone and a slave earphone and terminal equipment; the method comprises the following steps: the master earphone determines the time slot ratio of the first time slot to the second time slot according to the number of the cached master recording data packets and the number of the slave recording data packets, and sends a time slot adjustment notice according to the time slot ratio; the terminal equipment adjusts the time slot allocation when monitoring the time slot adjustment notification so as to receive the binaural data packet sent by the main earphone in the first time slot; the slave earphone adjusts the time slot allocation when hearing the time slot adjustment notification to transmit the slave recording data packet to the master earphone at the second time slot.
A communication time slot allocation device is applied to a master earphone in an earphone set, and the master earphone also comprises a slave earphone; the device comprises: the number identification module is used for identifying the number of the cached master recording data packets and the number of the slave recording data packets; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and sent to the master earphone; the time slot ratio determining module is used for determining the time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the auxiliary recording data packets; wherein, the first time slot is a communication time slot allocated to the terminal equipment and is used for sending the binaural data packet to the terminal equipment; the second time slot is a communication time slot allocated to the slave earphone and is used for receiving a slave recording data packet sent by the slave earphone; binaural data packets are generated based on the synchronized master recording data packets and slave recording data packets; and the notification module is used for sending a time slot adjustment notification to the terminal equipment and the slave earphone according to the time slot ratio so as to notify the terminal equipment and the slave earphone of time slot allocation adjustment.
A data transmission device for a main earphone in a set of earphone, the device comprising: the data receiving module is used for receiving the slave recording data packet sent by the slave earphone in the second time slot; the binaural data packet generation module is used for clathrating the master recording data packet and the slave recording data and generating a binaural data packet when the cached master recording data packet and the slave recording data packet are synchronous; a data packet transmitting module, configured to transmit the binaural data packet to the terminal device in the first time slot; wherein the time slot ratio of the first time slot to the second time slot is determined according to the communication time slot allocation method.
An earphone comprising a memory and a processor, wherein the memory stores a computer program which, when executed by the processor, causes the processor to perform the steps of: identifying the number of the cached master recording data packets and the number of the slave recording data packets; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and sent to the master earphone; determining the time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the slave recording data packets; wherein, the first time slot is a communication time slot allocated to the terminal equipment and is used for sending the binaural data packet to the terminal equipment; the second time slot is a communication time slot allocated to the slave earphone and is used for receiving a slave recording data packet sent by the slave earphone; binaural data packets are generated based on the synchronized master recording data packets and slave recording data packets; sending a time slot adjustment notice to the terminal equipment and the slave earphone according to the time slot ratio; the slot adjustment notification is used to notify the terminal device and adjust the slot allocation from the headset.
A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor performs the steps of: identifying the number of the cached master recording data packets and the number of the slave recording data packets; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and sent to the master earphone; determining the time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the slave recording data packets; wherein, the first time slot is a communication time slot allocated to the terminal equipment and is used for sending the binaural data packet to the terminal equipment; the second time slot is a communication time slot allocated to the slave earphone and is used for receiving a slave recording data packet sent by the slave earphone; binaural data packets are generated based on the synchronized master recording data packets and slave recording data packets; sending a time slot adjustment notice to the terminal equipment and the slave earphone according to the time slot ratio; the slot adjustment notification is used to notify the terminal device and adjust the slot allocation from the headset.
According to the communication time slot allocation method, the data transmission method, the device, the earphone and the computer readable storage medium, the communication signal intensity change between the master earphone and the terminal equipment is judged by identifying the number of the master recording data packets and the number of the slave recording data packets cached by the master earphone, the time slot ratio of the first time slot allocated to the terminal equipment to the second time slot allocated to the slave earphone is determined according to the number of the master recording data packets and the number of the slave recording data packets, a time slot adjustment notice is sent according to the time slot ratio, the terminal equipment and the slave earphone are informed to adjust the time slot allocation, the communication bandwidth of the master earphone, the slave earphone and the terminal equipment respectively in interaction is dynamically adjusted, and the stability of data transmission is improved.
Drawings
In order to more clearly illustrate the technical solutions of embodiments or conventional techniques of the present application, the drawings required for the descriptions of the embodiments or conventional techniques will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is an application environment diagram of a communication time slot allocation method and a data transmission method in one embodiment;
FIG. 2 is a flow chart of a communication slot allocation method in one embodiment;
FIG. 3 is a flowchart illustrating a step of determining a time slot ratio of a first time slot to a second time slot according to the number of main recording data packets and the number of sub recording data packets according to one embodiment;
FIG. 4 is a second flowchart illustrating a step of determining a time slot ratio of the first time slot to the second time slot according to the number of the master recording data packets and the number of the slave recording data packets according to one embodiment;
FIG. 5 is a third flowchart illustrating a step of determining a time slot ratio of the first time slot to the second time slot according to the number of the master recording data packets and the number of the slave recording data packets according to one embodiment;
Fig. 6 is a flowchart of a communication slot allocation method according to another embodiment;
FIG. 7 is a flow chart of a data transmission method in one embodiment;
FIG. 8 is a flow chart of a data transmission method in another embodiment;
fig. 9 is a flowchart of a communication slot allocation method according to another embodiment;
fig. 10 is a block diagram of a communication slot allocation apparatus in one embodiment;
FIG. 11 is a block diagram of a data transmission device in one embodiment;
fig. 12 is an internal structural diagram of a tympanic membrane in one embodiment.
Detailed Description
In order to facilitate an understanding of the present application, a more complete description of the present application will now be provided with reference to the relevant figures. Examples of the present application are given in the accompanying drawings. This application may, however, be embodied in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various features, but these features are not limited by these terms. These terms are only used to distinguish one feature from another feature.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless explicitly defined otherwise.
The communication time slot allocation method provided in the embodiment of the present application may be applied to an application environment shown in fig. 1, where the application environment includes a terminal device 101 and an earphone set 102, and the earphone set 102 includes a master earphone 1021 and a slave earphone 1022. The terminal 101 performs data transmission with the headset 102 through interaction with the master headset 1021, and the slave headset 1022 performs data transmission through interaction with the master headset 1021, when the terminal device 101 needs to send data to the headset 102, the terminal device 101 sends the data to the master headset 1021, and then the master headset 1021 sends corresponding data to the slave headset 1022 according to the need. Similarly, when the slave earphone 1022 needs to transmit data to the terminal apparatus 101, the data needs to be transmitted to the master earphone 1021, and the master earphone 1021 is transmitted to the terminal apparatus 101. The terminal device 101 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The earphone set 102 is a true wireless stereo earphone.
The communication time slot allocation method provided by the embodiment of the application is applied to a data transmission process when the earphone set 102 performs binaural recording, after the earphone set 102 and the terminal equipment 101 are successfully connected in a communication manner, a recording action is performed in response to a recording starting instruction sent by the terminal equipment 101, the master earphone 1021 and the slave earphone 1022 respectively acquire audio data through microphones and respectively encode the acquired audio data, the slave earphone 1022 stores a slave recording data packet generated after encoding into a buffer zone, and the slave recording data packet is sent to the master earphone 1021 through a communication connection established with the master earphone 1021; the master earphone 1021 encodes the audio data collected by the microphone thereof to generate a master recording data packet, and stores the master recording data packet in the local master buffer area, and the master earphone 1021 receives a slave recording data packet sent by the slave earphone 1022 and stores the slave recording data packet in the slave buffer area. When the uplink transmission is started, the master earphone 1021 acquires a master recording data packet in a local master buffer, sequentially acquires a slave recording data packet and the master recording data packet in a slave buffer for synchronous comparison, the master recording data packet and the slave recording data packet which are synchronous in comparison are combined into a binaural data packet, the binaural data packet is transmitted to the terminal equipment 101 through communication connection with the terminal equipment 101, the data corresponding to the successfully transmitted binaural data packet is cleared from the buffer by the master earphone 1021, the corresponding master recording data packet is cleared from the master buffer, and the corresponding slave recording data packet is cleared from the slave buffer.
In one embodiment, as shown in fig. 2, a communication time slot allocation method is provided, and the method is applied to the master earphone in fig. 1 for illustration, and includes the following steps:
step 201, identifying the number of buffered master record data packets and the number of slave record data packets.
The main recording data packet is an audio data packet which is recorded and generated by the main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and transmitted to the master earphone.
Step 202, determining a time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the slave recording data packets.
The method comprises the steps that a first time slot is a communication time slot allocated to terminal equipment, a master earphone sends a double-ear data packet to the terminal equipment in the first time slot, and the double-ear data packet is generated by the master earphone based on a synchronous master recording data packet and a slave recording data packet; the second time slot is a communication time slot allocated to the slave earphone, and the master earphone receives the slave recording data packet sent by the slave earphone in the second time slot. The communication time slot refers to time slices of time division multiplexing, the communication device divides a communication period into a plurality of time slices, and the time slices are distributed to different devices for communication interaction, so that the interaction with the different devices is avoided, and the time division multiplexing communication is realized. In the embodiment of the present application, the sum of the first time slot and the second time slot is constant, and when the first time slot increases, the second time slot decreases; conversely, as the first time slot decreases, the second time slot increases. When the time slot ratio is increased, namely the first time slot is increased, more communication bandwidth is allocated to the terminal equipment at the moment; when the slot ratio is reduced, that is, the second slot is increased, the communication bandwidth allocated to the terminal device is reduced, the communication bandwidth allocated to the slave earphone is increased, and the increase of the communication bandwidth can improve the data transmission efficiency.
When the communication signal strength between the terminal equipment and the main earphone is poor, if the original communication bandwidth is maintained, the data transmission efficiency is reduced, even the data cannot be successfully transmitted, at the moment, the time slot ratio can be increased, and therefore the data transmission stability between the main earphone and the terminal equipment is ensured. If the communication signal strength between the master earphone and the slave earphone is poor, if the original communication bandwidth is maintained, the slave earphone may not transmit the slave recording data packet, the master earphone may not generate the binaural data packet and transmit the binaural data packet to the terminal device, and at this time, the duty ratio of the second time slot may be increased, so as to ensure the stability of recording data transmission.
According to the number of the main recording data packets and the auxiliary recording data packets cached by the main earphone, the communication signal intensity between the main earphone and the terminal equipment and between the main earphone and the auxiliary earphone can be judged. Specifically, when the communication signal strength between the master earphone and the terminal device is poor, uplink data transmission cannot be normally realized, and at this time, the slave earphone continuously transmits slave recording data packets according to the originally allocated second time slot, which can lead to continuous increase of the number of data packets buffered by the master earphone, that is, continuous accumulation of the data packets to be transmitted to the terminal device, and at this time, the first time slot can be increased, that is, the time slot ratio is improved. When the communication signal intensity between the master earphone and the slave earphone is poor, the success rate of the slave earphone for transmitting the slave recording data packet is reduced, but at the moment, the terminal equipment still receives the double-ear data packet according to the allocated first time slot, so that the slave recording data packet cached by the master earphone is less or even zero, and the data transmission between the master earphone and the slave earphone can be ensured by increasing the second time slot, namely reducing the time slot ratio.
Step 203, sending a time slot adjustment notice to the terminal device and the slave earphone according to the time slot ratio.
Wherein the slot adjustment notification is used to notify the terminal device and adjust the slot allocation from the headset. The terminal equipment and the slave earphone notify corresponding adjustment time slot allocation according to the monitoring time slot adjustment, thereby ensuring that binaural recording data of the earphone set can be stably transmitted.
According to the communication time slot allocation method, the communication signal intensity change between the master earphone and the terminal equipment is judged by identifying the number of the master recording data packets and the number of the slave recording data packets cached by the master earphone, the time slot ratio of the first time slot allocated to the terminal equipment to the second time slot allocated to the slave earphone is determined according to the number of the master recording data packets and the number of the slave recording data packets, and the time slot adjustment notification is sent according to the time slot ratio to inform the terminal equipment and the slave earphone to adjust the time slot allocation, so that the communication bandwidth of interaction between the master earphone and the slave earphone and the terminal equipment respectively is dynamically adjusted, and the stability of data transmission is improved.
In one embodiment, as shown in fig. 3, the determining the time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the slave recording data packets includes:
The first threshold is used for measuring whether the number of the main recording data packets exceeds the due buffering quantity under the normal signal strength, and the second threshold is used for measuring whether the number of the auxiliary recording data packets exceeds the applied buffering quantity under the normal signal strength. The first threshold value and the second threshold value may be equal or different.
In step 302, if the number of the master recording data packets is greater than the first threshold and the number of the slave recording data packets is greater than the second threshold, the timeslot ratio is determined as a first preset timeslot ratio.
When the number of the master recording data packets is greater than the first threshold and the number of the slave recording data packets is greater than the second threshold, that is, both the master recording data packets and the slave recording data packets exceed the normal buffer when the communication signals between the master earphone and the terminal equipment and between the master earphone and the slave earphone are normal respectively, the communication signal strength between the master earphone and the terminal equipment may be poor at this time, for example, the bluetooth signal between the master audio equipment and the terminal equipment is interfered or the communication signal is weak because the distance between the master earphone and the terminal equipment is far, so that the master earphone cannot normally upload the binaural data packets to release the buffer, the ratio of the first time slot needs to be improved at this time, and the time slot ratio should be determined as a first preset time slot ratio.
In step 303, if the number of the master recording data packets is not greater than the first threshold, or the number of the slave recording data packets is not greater than the second threshold, the timeslot ratio is determined as the second preset timeslot ratio or the third preset timeslot ratio.
When the number of the main recording data packets is not greater than the first threshold value or the number of the auxiliary recording data packets is not greater than the second threshold value, the communication signal intensity between the main earphone and the terminal equipment is normal, the duty ratio of the first time slot can be properly reduced, but the time slot ratio is finally determined to be the second preset time slot ratio or the third preset time slot ratio according to the communication signal intensity between the main earphone and the auxiliary earphone. Wherein the first preset time slot ratio is greater than a third preset time slot ratio, which is greater than the second preset time slot ratio.
It should be noted that, there is no sequence between the step 302 and the step 303, which are the steps to be executed under different conditions.
In one embodiment, if the number of the master recording data packets is not greater than the first threshold value, or the number of the slave recording data packets is not greater than the second threshold value, comparing whether the difference between the number of the master recording data packets and the number of the slave recording data packets is greater than the third threshold value; if the difference between the number of the master recording data packets and the number of the slave recording data packets is larger than a third threshold value, the time slot ratio is determined as a second preset time slot ratio.
The third threshold is used for measuring whether the difference between the number of the main recording data packets and the number of the auxiliary recording data packets exceeds the difference between the communication signals of the main earphone and the auxiliary earphone when the communication signals are normal.
When the difference between the number of the master recording data packets and the number of the slave recording data packets exceeds a normal value, the fact that more master recording data packets cannot generate binaural recording data packets for transmission and release is indicated, namely the success rate of transmitting the slave recording data packets from the slave earphone is reduced, so that fewer slave recording data packets are buffered by the master earphone, namely the communication signal strength between the master earphone and the slave earphone is poor. At this time, the duty ratio of the second time slot can be increased, and a smaller second preset time slot ratio is selected, so that the communication bandwidth of the master earphone and the slave earphone is increased, and the success rate of the slave earphone for transmitting the slave recording data packet is ensured.
In one embodiment, if the number of the master recording data packets is not greater than the first threshold value, or the number of the slave recording data packets is not greater than the second threshold value, comparing whether the difference between the number of the master recording data packets and the number of the slave recording data packets is greater than the third threshold value; if the difference between the number of the master recording data packets and the number of the slave recording data packets is smaller than or equal to a third threshold value, the time slot ratio is determined as a third preset time slot ratio.
When the difference between the number of the master recording data packets and the number of the slave recording data packets does not exceed the difference between the communication signals of the master earphone and the slave earphone when the communication signals of the master earphone and the slave earphone are normal, the ratio of the number of the currently cached master recording data packets to the number of the slave recording data packets is normal, and the binaural data packets can be normally sent, namely, the communication signal intensity between the master earphone and the slave earphone is normal. And the number of the main recording data packets is not more than a first threshold value and the number of the auxiliary recording data packets is not more than a second threshold value, namely the communication signal strength between the main earphone and the terminal equipment is normal. In this case, the timeslot ratio corresponding to the normal signal strength may be selected, and since the data amount of the single binaural data packet is obviously larger than the data amount of the single slave recording data packet, in order to ensure the data transmission stability, a certain communication bandwidth needs to be allocated to the terminal device appropriately, so that a third preset timeslot ratio larger than the second preset timeslot ratio may be selected.
Illustratively, the first preset slot ratio may be 4:1, the second preset slot ratio may be 1:1, the third preset slot ratio may be 2:1.
as shown in fig. 4, the determining the time slot ratio of the first time slot to the second time slot according to the number of the master recording data packets and the number of the slave recording data packets includes:
step 402, if the difference between the number of the master recording data packets and the number of the slave recording data packets is greater than a third threshold, determining the timeslot ratio as a second preset timeslot ratio;
step 403, if the difference between the number of the master recording data packets and the number of the slave recording data packets is less than or equal to the third threshold, determining the timeslot ratio as a third preset timeslot ratio.
It should be noted that, there is no sequence between step 402 and step 403, and steps of correspondingly determining different slot ratios under two conditions are respectively performed.
In one embodiment, the third predetermined time slot ratio is a default time slot ratio, i.e., the third predetermined time slot ratio is preferentially selected after the recording is started.
In order to avoid frequent adjustment of the timeslot ratio due to the change of the number of the master recording data packets and the number of the slave recording data packets buffered by the master earphone, referring to fig. 5, in one embodiment, the determining the timeslot ratio as the first preset timeslot ratio includes the following steps:
In step 501, a first duration is obtained in which the number of primary recording data packets is greater than a first threshold and the number of secondary recording data packets is greater than a second threshold.
Wherein the first duration is a maintenance time of a state in which the number of main recording data packets is greater than the first threshold value and the number of sub recording data packets is greater than the second threshold value, it is understood that once the number of main recording data packets is not greater than the first threshold value or the number of sub recording data packets is not greater than the second threshold value, the calculation of the first duration is stopped until the state is re-entered again.
In step 503, if the first duration reaches the first preset duration, determining the timeslot ratio as the first preset timeslot ratio is performed.
In step 504, if the first duration does not reach the first preset duration, the timeslot ratio is temporarily not adjusted.
Judging whether the time slot ratio needs to be adjusted or not through the first preset time length, and when the first duration reaches the first preset time length, namely the communication signal strength between the terminal equipment and the main earphone cannot be recovered to be normal temporarily, maintaining the stability of the transmission of the recording data through intervening the time slot ratio.
Similarly, in one embodiment, the determining the slot ratio as the second preset slot ratio includes the following steps:
step 505, obtaining a second duration in which a difference between the number of master recording data packets and the number of slave recording data packets is greater than a third threshold.
Wherein the second duration is a maintenance time of a state in which a difference between the number of the master recording data packets and the number of the slave recording data packets is greater than a third threshold, it is understood that once the difference between the number of the master recording data packets and the number of the slave recording data packets is not greater than the third threshold, the calculation of the second duration is stopped until the second duration is recalculated when the state is re-entered.
If the second duration reaches the second preset duration, step 507, determining the timeslot ratio as the second preset timeslot ratio is performed.
In step 508, if the second duration does not reach the second preset duration, the timeslot ratio is not adjusted.
Judging whether the time slot ratio needs to be adjusted or not through the second preset time length, and when the second duration time reaches the second preset time length, namely the communication signal strength between the slave earphone and the master earphone cannot be recovered to be normal temporarily, maintaining the stability of the transmission of the recording data through intervening the time slot ratio.
In one embodiment, on the other hand, the determining the slot ratio as the third preset slot ratio includes the following steps:
step 509, obtaining a third duration in which a difference between the number of master recording packets and the number of slave recording packets is less than or equal to a third threshold.
Wherein the third duration is a maintenance time of a state in which a difference between the number of the master recording data packets and the number of the slave recording data packets is less than or equal to a third threshold, it is understood that once the difference between the number of the master recording data packets and the number of the slave recording data packets is greater than the third threshold, the calculation of the third duration is stopped until the third duration is recalculated when the state is re-entered.
In step 511, it is determined whether the third duration reaches a third preset duration.
If the third duration reaches the third preset duration, step 512 is executed to determine the slot ratio as the third preset slot ratio.
In step 513, if the third duration does not reach the third preset duration, the timeslot ratio is temporarily not adjusted.
Judging whether the time slot ratio needs to be adjusted or not through the third preset time length, and when the third duration time reaches the third preset time length, namely the communication signal strength between the master earphone and the slave earphone as well as between the master earphone and the terminal equipment is normal, selecting the third time slot ratio to maintain normal recording data transmission.
In one embodiment, as shown in fig. 6, a communication time slot allocation method is provided, and the method is applied to the master earphone in fig. 1 for illustration, and includes the following steps:
step 601, determining a transmitted number of binaural data packets to be transmitted to a terminal device within a preset time and a received number of slave recording data packets to be received from a headset.
Wherein the binaural data packet is generated based on the synchronized master recording data packet and slave recording data packet; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and transmitted to the master earphone. The preset time is a period of time ending at the current time, i.e. the transmitted number of binaural data packets and the received number of slave recording data packets from before the preset time to the current time are determined. The number of transmitted binaural data packets may be determined by collecting the amount of transmitted during a preset time or determined from the transmission record, and the number of received binaural data packets may be determined from the recorded audio data packets by collecting the amount of received during a preset time or determined from the received record.
By way of example, the preset time may be 20ms, i.e. the transmitted data of the binaural data packets and the received number of slave recording data packets within 20ms from the current time instant onwards are determined. The preset time can be set as required.
Step 602, determining a slot ratio of the first slot to the second slot according to the transmitted number and the received number.
The definition of the first time slot and the second time slot is the same as that of the foregoing embodiment, and will not be described herein.
Whether the success rate of uplink data transmission is reduced due to the change of communication signals can be judged according to the sent quantity, whether the reason for the reduction of the success rate of uplink data transmission is poor in signal strength between the master earphone and the terminal equipment or poor in signal strength between the master earphone and the slave earphone can be judged by combining the received quantity, and further dynamic adjustment of communication time slots is achieved.
Step 603, sending a time slot adjustment notification to the terminal device and the slave earphone according to the time slot ratio.
Wherein the slot adjustment notification is used to notify the terminal device and adjust the slot allocation from the headset. The terminal equipment and the slave earphone notify corresponding adjustment time slot allocation according to the monitoring time slot adjustment, thereby ensuring that binaural recording data of the earphone set can be stably transmitted.
According to the communication time slot allocation method, the communication signal intensity change between the master earphone and the terminal equipment can be judged according to the sent quantity and the received quantity of the preset time, the time slot ratio of the first time slot allocated to the terminal equipment to the second time slot allocated to the slave earphone is further determined, the time slot adjustment notification is sent according to the time slot ratio, the terminal equipment and the slave earphone are informed of time slot allocation adjustment, the communication bandwidth of interaction between the master earphone and the slave earphone and the terminal equipment respectively is dynamically adjusted, and the stability of data transmission is improved.
In one embodiment, if the transmitted number is less than the transmission amount threshold and the received number is not less than the reception amount threshold, the slot ratio is determined as a first preset slot ratio.
The transmission amount threshold is the number of binaural data packets to be transmitted in a preset time when communication signals between the master earphone and the terminal device and between the master earphone are normal. The reception amount threshold is the number of the received slave ear data packets within a preset time when the communication signal between the master earphone and the slave earphone is normal.
When the transmitted number of the binaural data packets is smaller than the transmission amount threshold, the success rate of transmitting the binaural data packets may be reduced due to poor communication signals between the master earphone and the terminal device; it may also be that the number of slave recording packets is insufficient due to poor communication signals between the master earphone and the slave earphone, resulting in a reduced number of generated binaural data packets and thus reduced transmitted binaural data packets. The reason can be determined by judging the received number of the slave recording data packets in combination with the master earphone in the preset time. If the received number is not less than the threshold of the received amount, that is, the communication signal between the slave earphone and the master earphone is normal, the transmission success rate of the binaural data packet is reduced because the communication signal between the master earphone and the terminal device is poor, so that the duty ratio of the first time slot needs to be increased, and the time slot ratio should be determined as the first preset time slot ratio.
In one embodiment, if the transmitted number is less than the transmission amount threshold and the received number is less than the reception amount threshold, the slot ratio is determined to be a second preset slot ratio.
When the transmitted number is smaller than the transmission amount threshold, if the received number is smaller than the reception amount threshold, that is, the communication signal between the slave earphone and the master earphone is poor, the received amount of the slave recording data packet is reduced, and the transmission amount of the binaural data packet is reduced, so that the duty ratio of the second time slot needs to be increased, and the time slot ratio should be determined as a second preset time slot ratio. Wherein the second preset time slot ratio is smaller than the first preset time slot ratio.
In one embodiment, if the number of transmitted transmissions is not less than the threshold transmission amount, the slot ratio is determined to be a third preset slot ratio.
When the transmitted number is not less than the threshold of the transmission amount, that is, the communication signals of the master earphone, the terminal device and the slave earphone are normal, the received number at the moment is not necessarily less than the threshold of the reception amount, so that the time slot ratio corresponding to the normal signal strength can be selected, and the time slot ratio can be determined as a third preset time slot ratio. In one embodiment, since the data amount of the single binaural data packet is obviously larger than the data amount of the single slave recording data packet, a certain communication bandwidth needs to be allocated to the terminal device appropriately in order to ensure the data transmission stability, so that the third preset time slot ratio larger than the second preset time slot ratio and smaller than the first preset time slot ratio can be selected.
As shown in fig. 7, the embodiment of the present application further provides a data transmission method, which is applied to a master earphone in an earphone set, where the earphone set further includes a slave earphone; the method comprises the following steps:
in step 701, a slave recording packet sent from the headset is received in a second time slot.
In step 702, if the buffered master recording data packet is synchronized with the slave recording data packet, the master recording data packet is included with the slave recording data packet and a binaural data packet is generated.
The synchronization refers to that the master recording data packet and the slave recording data packet correspond to audio data within the same time, and specifically can be judged through sequence number comparison, time frame comparison or other synchronization comparison methods.
In step 703, the binaural data packet is transmitted to the terminal device in the first time slot.
The time slot ratio of the first time slot to the second time slot is determined according to the communication time slot allocation method.
In this embodiment, the master earphone and the slave earphone are used for recording respectively, and then the master earphone is used for synchronously comparing the audio data recorded by the master earphone and the slave earphone to generate true stereo recording data, the true stereo recording data is sent to the terminal equipment, the true sound field is restored, and meanwhile, the first time slot and the second time slot are dynamically adjusted, so that stable data transmission is ensured, the recording effect is ensured, and the problem of intermittent recording is avoided.
As shown in fig. 8, in one embodiment, the data transmission method further includes the steps of:
step 801, comparing the first synchronization information of the master recording data packet with the second synchronization information of the slave recording data packet, and judging whether the first synchronization information and the second synchronization information are matched.
The first synchronization information is identification information added to the recorded audio data by the main earphone; the second synchronization information is identification information added to the recorded audio data from the headphones. The first synchronization information and the second synchronization information may be information for identifying time frames, or sequence number information for identifying recording sequence
In one embodiment, the first synchronization information and the second synchronization information are added before encoding the audio data. In this embodiment, the master earphone needs to compare the second synchronization information obtained after decoding the slave recording data packet with the first synchronization information, and then encode the synchronized master recording data packet and slave recording data packet to generate the binaural data packet.
In one embodiment, the first synchronization information and the second synchronization information are added after encoding the audio data. In this embodiment, the master earphone may directly compare the synchronization information of the received encoded slave recording data packet, and if the comparison is synchronous, the master recording data packet and the slave recording data packet are directly combined into the binaural data packet to be sent, so that the data processing process of the master earphone is reduced, and the data transmission efficiency is improved.
Step 802, if the first synchronization information matches the second synchronization information, determining that the master recording data packet is synchronized with the slave recording data packet.
Step 803, if the first synchronization information and the second synchronization information are not matched, another slave recording data packet is obtained and compared with the master recording data packet until the master recording data packet is matched with the synchronized slave recording data packet.
Taking the first synchronization information and the second synchronization information as serial numbers for illustration, wherein the first synchronization information and the second synchronization information are serial numbers allocated to a master earphone and a slave earphone based on the sequence of data packets generated by recording respectively, when the master earphone performs synchronization comparison, the master earphone extracts a master recording data packet with the minimum serial number from a master cache area, and performs serial number comparison of a slave recording data packet with the minimum serial number from a slave cache area, if the serial numbers are consistent, the synchronization is judged, if the serial numbers are inconsistent, the serial number comparison of a slave recording data packet with the next serial number is extracted from the slave cache area, until the synchronous slave recording data packet is found, or the comparison is stopped when all the slave recording data packets are found, and the synchronization comparison is tried again after waiting for a certain time.
The embodiment adopts a synchronous information comparison mode to judge whether the main recording data packet is matched with the auxiliary recording data packet, and has simple judging process and easy execution.
As shown in fig. 9, the embodiment of the present application further provides a communication time slot allocation method, which is applied to the system shown in fig. 1; the method comprises the following steps:
step 901, determining a time slot ratio of a first time slot to a second time slot by a master earphone according to the number of the cached master recording data packets and the number of slave recording data packets;
in step 902, the master earphone sends a slot adjustment notification according to the slot ratio.
In step 903, the terminal device adjusts the timeslot allocation when it monitors the timeslot adjustment notification, so as to receive, in the first timeslot, the binaural data packet sent by the master earphone.
Step 904, the slave earphone adjusts the time slot allocation when the slave earphone monitors the time slot adjustment notification to transmit the slave recording data packet to the master earphone in the second time slot.
The time slot is the data transmission time allocation agreed between two communication ends, when the main earphone determines that the time slot ratio needs to be adjusted, besides self-adjusting the time slot allocation, the main earphone also needs to inform the auxiliary earphone and the terminal equipment to make corresponding adjustment.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a communication time slot allocation device for realizing the above related communication time slot allocation method. The implementation of the solution provided by the apparatus is similar to the implementation described in the above method, so the specific limitation in the embodiments of the communication slot allocation apparatus or apparatuses provided below may refer to the limitation of the communication slot allocation method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 10, a communication time slot allocation apparatus 1000 is provided, applied to a master earphone in an earphone set, where the earphone set further includes a slave earphone; the device comprises: a quantity identification module 1010, a slot ratio determination module 1020, and a notification module 1030, wherein:
a number identifying module 1010, configured to identify the number of buffered master recording packets and the number of slave recording packets; the main recording data packet is an audio data packet which is recorded and generated by a main earphone; the slave recording data packet is an audio data packet recorded by the slave earphone and sent to the master earphone;
a timeslot ratio determining module 1020, configured to determine a timeslot ratio of the first timeslot to the second timeslot according to the number of the master recording data packets and the number of the slave recording data packets; wherein, the first time slot is a communication time slot allocated to the terminal equipment and is used for sending the binaural data packet to the terminal equipment; the second time slot is a communication time slot allocated to the slave earphone and is used for receiving a slave recording data packet sent by the slave earphone; binaural data packets are generated based on the synchronized master recording data packets and slave recording data packets;
a notification module 1030, configured to send a slot adjustment notification to the terminal device and the slave earphone according to the slot ratio, so as to notify the terminal device and the slave earphone to adjust slot allocation.
In one embodiment, the slot ratio determining module includes:
the first judging unit is used for judging whether the number of the main recording data packets is larger than a first threshold value and whether the number of the auxiliary recording data packets is larger than a second threshold value.
And the first determining unit is used for determining the time slot ratio as a first preset time slot ratio when the number of the main recording data packets is larger than a first threshold value and the number of the auxiliary recording data packets is larger than a second threshold value.
In one embodiment, the slot ratio determining module further includes:
and the second judging unit is used for comparing whether the difference between the number of the main recording data packets and the number of the slave recording data packets is larger than a third threshold value or not when the number of the main recording data packets is not larger than a first threshold value or the number of the slave recording data packets is not larger than a second threshold value.
And a second determining unit for determining the time slot ratio as a second preset time slot ratio when the difference between the number of the master recording data packets and the number of the slave recording data packets is greater than a third threshold.
And a third determining unit configured to determine the slot ratio as a third preset slot ratio when a difference between the number of the master recording data packets and the number of the slave recording data packets is less than or equal to a third threshold.
In one embodiment, the first determining unit is further configured to obtain a first duration in which the number of primary recording data packets is greater than the first threshold and the number of secondary recording data packets is greater than the second threshold, and determine the slot ratio as the first preset slot ratio when the first duration reaches a first preset duration.
In one embodiment, the second determining unit is further configured to obtain a second duration in which a difference between the number of the master recording data packets and the number of the slave recording data packets is greater than a third threshold, and perform determining the slot ratio as the second preset slot ratio when the second duration reaches a second preset duration.
In one embodiment, the third determining unit is further configured to obtain a third duration in which a difference between the number of the master recording data packets and the number of the slave recording data packets is less than or equal to a third threshold, and perform determining the slot ratio as the third preset slot ratio when the third duration reaches a third preset duration.
Based on the same inventive concept, the embodiment of the application also provides a data transmission device for realizing the above related data transmission method. The implementation of the solution provided by the apparatus is similar to the implementation described in the above method, so the specific limitation in the embodiments of the communication slot allocation apparatus or apparatuses provided below may refer to the limitation of the data transmission method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 11, a data transmission device 1100 is provided, for use with a master earphone in an earphone set, the earphone set further including a slave earphone; the device comprises:
A data receiving module 1101, configured to receive, in a second time slot, a slave recording data packet sent from the headset;
a binaural data packet generating module 1102, configured to, when the buffered master recording data packet is synchronized with the slave recording data packet, clathrate the master recording data packet with the slave recording data packet and generate a binaural data packet;
a data packet sending module 1103, configured to send the binaural data packet to a terminal device in a first time slot; wherein the time slot ratio of the first time slot to the second time slot is determined according to the communication time slot allocation method.
The above-mentioned communication time slot allocation device and each module in the data transmission device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Fig. 12 is a schematic diagram of an internal structure of an audio device in one embodiment. The audio device may be a master earphone or a slave earphone in a set of earphones. The audio device includes a processor and a memory connected by a system bus. Wherein the processor may comprise one or more processing units. The processor may be a CPU (Central Processing Unit ) or DSP (Digital Signal Processing, digital signal processor), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program may be executed by a processor for implementing a communication slot allocation method or a data transmission method provided by the above respective embodiments. The internal memory provides a cached operating environment for operating system computer programs in the non-volatile storage medium.
The implementation of each module in the communication time slot allocation device and the data transmission device provided in the embodiments of the present application may be in the form of a computer program. The computer program may be run on a headset. Program modules of the computer program may be stored in the memory of the headset. Which when executed by a processor, performs the steps of the methods described in the embodiments of the present application.
Embodiments of the present application also provide a computer-readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of the communication slot allocation method or data transmission method described above.
The embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the communication slot allocation method or the data transmission method described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.
Claims (18)
1. A communication time slot allocation method, characterized in that it is applied to a master earphone in an earphone set, said earphone set further comprising slave earphones; the method comprises the following steps:
identifying the number of the cached master recording data packets and the number of the slave recording data packets; the main recording data packet is an audio data packet recorded and generated by the main earphone; the secondary recording data packet is an audio data packet recorded by the secondary earphone and sent to the primary earphone;
Determining a time slot ratio of a first time slot to a second time slot according to the number of the main recording data packets and the number of the auxiliary recording data packets; wherein, the first time slot is a communication time slot allocated to a terminal device and is used for sending a binaural data packet to the terminal device; the second time slot is a communication time slot allocated to a slave earphone and is used for receiving the slave recording data packet sent by the slave earphone; the binaural data packet is generated based on the synchronized master recording data packet and slave recording data packet;
sending a time slot adjustment notice to the terminal equipment and the slave earphone according to the time slot ratio; the time slot adjustment notification is used for notifying the terminal equipment and the slave earphone to adjust time slot allocation.
2. The method of claim 1, wherein said determining a slot ratio of a first slot to a second slot based on the number of said master recording packets and the number of said slave recording packets comprises:
and if the number of the main recording data packets is larger than a first threshold value and the number of the auxiliary recording data packets is larger than a second threshold value, determining the time slot ratio as a first preset time slot ratio.
3. The method of claim 2, wherein the determining the slot ratio as the first preset slot ratio comprises:
Acquiring a first duration time when the number of the main recording data packets is larger than a first threshold value and the number of the auxiliary recording data packets is larger than a second threshold value;
and if the first duration reaches a first preset duration, determining the time slot ratio as the first preset time slot ratio.
4. The method of claim 1 or 2, wherein said determining a slot ratio of a first slot to a second slot based on the number of said master recording packets and the number of said slave recording packets comprises:
and if the number of the main recording data packets does not reach the first threshold value or the number of the auxiliary recording data packets does not reach the second threshold value, and the difference between the number of the main recording data packets and the number of the auxiliary recording data packets is larger than the third threshold value, determining the time slot ratio as a second preset time slot ratio.
5. The method of claim 4, wherein the second preset slot ratio is less than the first preset slot ratio;
the first preset time slot ratio is determined in a state that the number of the main recording data packets is larger than the first threshold value and the number of the auxiliary recording data packets is larger than the second threshold value.
6. The method of claim 4, wherein said determining the slot ratio as a second preset slot ratio comprises:
acquiring a second duration time when the difference between the number of the main recording data packets and the number of the auxiliary recording data packets is larger than the third threshold value;
and if the second duration reaches a second preset duration, determining the time slot ratio as the second preset time slot ratio.
7. The method of claim 1 or 2, wherein said determining a slot ratio of a first slot to a second slot based on the number of said master recording packets and the number of said slave recording packets comprises:
and if the number of the main recording data packets does not reach the first threshold value or the number of the auxiliary recording data packets does not reach the second threshold value, and the difference between the number of the main recording data packets and the number of the auxiliary recording data packets is smaller than or equal to a third threshold value, determining the time slot ratio as a third preset time slot ratio.
8. The method of claim 7, wherein the third predetermined time slot ratio is less than the first predetermined time slot ratio and greater than the second predetermined time slot ratio;
the first preset time slot ratio is determined in a state that the number of the main recording data packets is larger than the first threshold value and the number of the auxiliary recording data packets is larger than the second threshold value; the second preset time slot ratio is determined in a state that the number of the main recording data packets does not reach a first threshold value or the number of the auxiliary recording data packets does not reach a second threshold value, and the difference between the number of the main recording data packets and the number of the auxiliary recording data packets is larger than the third threshold value.
9. A communication time slot allocation method, applied to a master earphone in an earphone set, the earphone set further including a slave earphone, the method comprising:
determining the transmitted number of binaural data packets transmitted to the terminal device within a preset time and the received number of slave recording data packets transmitted from the headphones; the binaural data packet is generated based on the synchronized master recording data packet and slave recording data packet; the main recording data packet is an audio data packet recorded and generated by the main earphone; the secondary recording data packet is an audio data packet recorded by a secondary earphone and sent to the primary earphone;
determining a time slot ratio of the first time slot to the second time slot according to the sent number and the received number; wherein, the first time slot is a communication time slot allocated to a terminal device and is used for sending the binaural data packet to the terminal device; the second time slot is a communication time slot allocated to a slave earphone and is used for receiving the slave recording data packet sent by the slave earphone;
sending a time slot adjustment notice to the terminal equipment and the slave earphone according to the time slot ratio; the time slot adjustment notification is used for notifying the terminal equipment and the slave earphone to adjust time slot allocation.
10. The method of claim 9, wherein said determining a slot ratio of a first slot to a second slot based on said transmitted number and said received number comprises:
and if the sent number is smaller than the sending amount threshold and the received number is not smaller than the receiving amount threshold, determining the time slot ratio as a first preset time slot ratio.
11. The method of claim 9, wherein said determining a slot ratio of a first slot to a second slot based on said transmitted number and said received number comprises:
and if the transmitted number is smaller than the transmission amount threshold and the received number is smaller than the receiving amount threshold, determining the time slot ratio as a second preset time slot ratio.
12. The method of claim 9, wherein said determining a slot ratio of a first slot to a second slot based on said transmitted number and said received number comprises:
and if the transmitted quantity is not smaller than the transmission quantity threshold value, determining the time slot ratio as a third preset time slot ratio.
13. A data transmission method, characterized in that it is applied to a master earphone in an earphone set, said earphone set further comprising slave earphones; the method comprises the following steps:
Receiving a slave recording data packet sent by the slave earphone in a second time slot;
if the cached master recording data packet is synchronous with the slave recording data packet, the master recording data packet is included with the slave recording data packet, and a binaural data packet is generated;
transmitting the binaural data packet to a terminal device in a first time slot;
wherein the time slot ratio of the first time slot to the second time slot is determined according to the communication time slot allocation method according to any one of claims 1 to 12.
14. A communication time slot allocation method, characterized by being applied to a system, the system comprising a set of headphones with a master headphone and a slave headphone, and a terminal device; the method comprises the following steps:
the master earphone determines the time slot ratio of the first time slot to the second time slot according to the number of the cached master recording data packets and the number of the slave recording data packets, and sends a time slot adjustment notice according to the time slot ratio;
the terminal equipment adjusts time slot allocation when monitoring the time slot adjustment notification so as to receive the binaural data packet sent by the master earphone in the first time slot;
and the slave earphone adjusts the time slot allocation when hearing the time slot adjustment notification so as to send a slave recording data packet to the master earphone in the second time slot.
15. A communication time slot allocation device, characterized by being applied to a master earphone in an earphone set, said earphone set further comprising slave earphones; the device comprises:
the number identification module is used for identifying the number of the cached master recording data packets and the number of the slave recording data packets; the main recording data packet is an audio data packet recorded and generated by the main earphone; the secondary recording data packet is an audio data packet recorded by the secondary earphone and sent to the primary earphone;
the time slot ratio determining module is used for determining the time slot ratio of the first time slot to the second time slot according to the number of the main recording data packets and the number of the auxiliary recording data packets; wherein, the first time slot is a communication time slot allocated to a terminal device and is used for sending a binaural data packet to the terminal device; the second time slot is a communication time slot allocated to a slave earphone and is used for receiving the slave recording data packet sent by the slave earphone; the binaural data packet is generated based on the synchronized master recording data packet and slave recording data packet;
and the notification module is used for sending a time slot adjustment notification to the terminal equipment and the slave earphone according to the time slot ratio so as to notify the terminal equipment and the slave earphone of adjusting time slot allocation.
16. A data transmission device, characterized by a master earphone for use in an earphone set, the earphone set further comprising a slave earphone; the device comprises:
the data receiving module is used for receiving the slave recording data packet sent by the slave earphone in a second time slot;
the binaural data packet generation module is used for clathrating the master recording data packet and the slave recording data and generating a binaural data packet when the cached master recording data packet and the slave recording data packet are synchronous;
a data packet sending module, configured to send the binaural data packet to a terminal device in a first time slot; wherein the time slot ratio of the first time slot to the second time slot is determined according to the communication time slot allocation method as claimed in any one of claims 1 to 7.
17. A headset comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 13.
18. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 13.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111583096.5A CN116367294A (en) | 2021-12-22 | 2021-12-22 | Communication time slot allocation method, data transmission method, device and earphone |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111583096.5A CN116367294A (en) | 2021-12-22 | 2021-12-22 | Communication time slot allocation method, data transmission method, device and earphone |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116367294A true CN116367294A (en) | 2023-06-30 |
Family
ID=86938977
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111583096.5A Pending CN116367294A (en) | 2021-12-22 | 2021-12-22 | Communication time slot allocation method, data transmission method, device and earphone |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116367294A (en) |
-
2021
- 2021-12-22 CN CN202111583096.5A patent/CN116367294A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108337595B (en) | Bluetooth headset realizes the method being precisely played simultaneously | |
US11350486B2 (en) | Wireless communication method for earphones, master earphone, slave earphone, earphone system | |
EP4002358A1 (en) | Adaptive audio processing method, device, computer program, and recording medium thereof in wireless communication system | |
WO2021008614A1 (en) | Method for establishing communication connection and wearable device | |
US20220248333A1 (en) | Method For Operating A Bluetooth Device | |
CN113542479B (en) | Recording method, recording device, wireless earphone and storage medium | |
CN111527733B (en) | Control bimodulus bluetooth low energy consumption multimedia device | |
CN110460931A (en) | Method, bluetooth headset and the storage medium of call are realized based on bluetooth headset | |
JP2019531670A (en) | Controlling connected multimedia devices | |
CN113453114B (en) | Encoding control method, encoding control device, wireless headset and storage medium | |
CN115174538B (en) | Data transmission method, device, electronic equipment and computer readable medium | |
US20220256314A1 (en) | Method, apparatus and computer program for broadcast discovery service in wireless communication system, and recording medium therefor | |
CN113314133A (en) | Audio transmission method and electronic equipment | |
CN112866970B (en) | Communication connection method and device, electronic equipment and wireless transmission system | |
US11989485B2 (en) | Method, device and computer program for controlling audio data in wireless communication system, and recording medium therefor | |
CN116367294A (en) | Communication time slot allocation method, data transmission method, device and earphone | |
CN112382304A (en) | Bluetooth audio repairing method, device, equipment and medium | |
CN110719651A (en) | Data transmission method and device | |
US20220103948A1 (en) | Method and system for performing audio ducking for headsets | |
US11956676B2 (en) | Dynamic transmission rates for isochronous streaming | |
CN113316129B (en) | Method for acquiring coding and decoding capabilities in Bluetooth device and electronic device | |
CN115694742A (en) | Method and electronic device for transmitting acknowledgement signal in wireless communication system | |
CN115669210A (en) | Communication method, device and system | |
US12081347B2 (en) | Reception terminal and method | |
CN113613125B (en) | Audio synchronous control method, device, audio equipment and system |
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 |