Audio data transmission method and device, electronic equipment and storage medium
By obtaining information about the occupied broadcast channel and time period and determining the new transmission channel and time period, the problem of mutual interference between audio data in Bluetooth devices is solved and the transmission efficiency is improved.
Patent Information
- Application Number
- CN202311023096.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2025-02-21
AI Technical Summary
In an environment where multiple audio source devices coexist, Bluetooth devices are prone to interference with each other, resulting in high packet loss rate and low effective transmission rate.
By obtaining information about the occupied broadcast channel and occupied time period, a new broadcast channel and time period is determined to ensure that the audio data is transmitted on different channels and time periods, thereby avoiding interference.
It effectively avoids mutual interference between audio data of different devices, reduces packet loss rate, and improves the transmission efficiency of audio data.
Smart Images

Figure CN119496580A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of audio transmission, and in particular to a method, device, electronic device and storage medium for transmitting audio data. Background Art
[0002] Low-power Bluetooth audio broadcast technology has been used in many electronic devices. In terms of audio data transmission, by using low-power Bluetooth audio broadcast technology, Bluetooth devices can play audio without connecting to the audio source device that plays the audio, greatly improving the flexibility of audio sharing. However, when there are multiple audio source devices in the same environment, it is easy for at least two audio source devices to transmit audio data on the same channel at the same time, that is, the audio data of at least two audio source devices interfere with each other, resulting in a high packet loss rate of audio data and a low effective transmission rate. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a method, device, electronic device and storage medium for transmitting audio data.
[0004] According to a first aspect of an embodiment of the present disclosure, a method for transmitting audio data is provided, the method comprising:
[0005] Acquire first broadcast information, where the first broadcast information includes at least one first broadcast channel that is monitored and occupied and a first time period in which the first broadcast channel is occupied;
[0006] Determine second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize a second broadcast channel and a second time period occupying the second broadcast channel, where the second broadcast channel is a channel used to transmit audio data of the first device; wherein the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period;
[0007] In the second time period, the audio data of the first device is transmitted through the second broadcast channel.
[0008] In some embodiments, determining the second broadcast information based on the first broadcast information includes:
[0009] Acquire initial broadcast information of the first device, where the initial broadcast information is used to characterize an initial broadcast channel and an initial time period for occupying the initial broadcast channel;
[0010] The second broadcast information is determined based on the initial broadcast channel, the initial time period, and the first broadcast information.
[0011] In some embodiments, the determining the second broadcast information based on the initial broadcast channel, the initial time period, and the first broadcast information includes:
[0012] When the initial broadcast channel is different from the first broadcast channel and / or the initial time period is different from the first time period, determining the initial broadcast information as the second broadcast information;
[0013] When the initial broadcast channel is the same as the first broadcast channel and the initial time period is the same as the first time period, the initial broadcast information is updated to obtain the second broadcast information.
[0014] In some embodiments, updating the initial broadcast information to obtain the second broadcast information includes:
[0015] The initial time period is updated to the second time period different from the first time period, and / or the initial broadcast channel is updated to the second broadcast channel different from the first broadcast channel, to obtain the second broadcast information.
[0016] In some embodiments, updating the initial broadcast channel to the second broadcast channel different from the first broadcast channel includes:
[0017] Generate random numbers;
[0018] The second broadcast channel is determined based on the initial broadcast channel and the random number.
[0019] In some embodiments, the determining the second broadcast channel based on the initial broadcast channel and the random number includes:
[0020] When the sum of the initial broadcast channel and the random number is less than or equal to a preset threshold, determining the sum of the initial broadcast channel and the random number as the second broadcast channel; or,
[0021] When the sum of the initial broadcast channel and the random number is greater than the preset threshold, a mapping channel corresponding to the sum of the initial broadcast channel and the random number is determined according to a preset mapping relationship, and the mapping channel is determined as the second broadcast channel; wherein the preset mapping relationship is used to characterize the relationship between a numerical value greater than the preset threshold and the corresponding mapping channel, and the mapping channel is less than or equal to the preset threshold.
[0022] In some embodiments, the second broadcast information is used to characterize the initial broadcast channel, a first identifier corresponding to the initial broadcast channel, the second broadcast channel, a second identifier corresponding to the second broadcast channel, and the second time period, the first identifier is used to characterize the channel before modification, the second identifier is used to characterize the channel after modification, and the third device is used to determine that the second broadcast channel is a channel for transmitting audio data based on the first identifier and the second identifier, and receive audio data of the first device through the second broadcast channel during the second time period.
[0023] In some embodiments, determining the second broadcast information based on the first broadcast information includes:
[0024] Determine the second broadcast channel and the second time period based on the first broadcast channel and the first time period;
[0025] The second broadcast information is determined based on the second broadcast channel and the second time period.
[0026] In some embodiments, the second broadcast information includes a first broadcast packet, the first broadcast packet includes first data, the first data is used to characterize a third broadcast channel for transmitting the second broadcast packet and a third time period occupying the third broadcast channel, the second broadcast packet includes second data, the second data is used to characterize a fourth broadcast channel for transmitting the third broadcast packet and a fourth time period occupying the fourth broadcast channel, the third broadcast packet includes third data, the third data includes a fifth broadcast channel for transmitting an audio data packet and a fifth time period occupying the fifth broadcast channel, and the audio data packet includes audio data of the first device;
[0027] The second broadcast channel includes the third broadcast channel, the fourth broadcast channel and the fifth broadcast channel, and the second time period includes the third time period, the fourth time period and the fifth time period;
[0028] The second broadcast channel and the second time period satisfy at least one of the following:
[0029] The third broadcast channel is different from the first broadcast channel;
[0030] The third time period is different from the first time period;
[0031] The fourth broadcast channel is different from the first broadcast channel;
[0032] The fourth time period is different from the first time period;
[0033] The fifth broadcast channel is different from the first broadcast channel;
[0034] The fifth time period is different from the first time period.
[0035] In some embodiments, the obtaining the first broadcast information includes:
[0036] monitoring all broadcast channels in the spatial area where the first device is located;
[0037] When it is monitored that the second device transmits audio data through any of the broadcast channels, the first broadcast information occupying the broadcast channel is acquired.
[0038] According to a second aspect of an embodiment of the present disclosure, there is provided a device for transmitting audio data, the device comprising:
[0039] A first information acquisition module is configured to acquire first broadcast information, where the first broadcast information includes at least one first broadcast channel that has been monitored and occupied and a first time period for occupying the first broadcast channel;
[0040] A second information determination module is configured to determine second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize a second broadcast channel and a second time period occupying the second broadcast channel, where the second broadcast channel is a channel for transmitting audio data of the first device; wherein the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period;
[0041] The audio data transmission module is configured to transmit the audio data of the first device through the second broadcast channel during the second time period.
[0042] In some embodiments, the second information determination module is configured to:
[0043] Acquire initial broadcast information of the first device, where the initial broadcast information is used to characterize an initial broadcast channel and an initial time period for occupying the initial broadcast channel;
[0044] The second broadcast information is determined based on the initial broadcast channel, the initial time period, and the first broadcast information.
[0045] In some embodiments, the second information determination module is configured to:
[0046] When the initial broadcast channel is different from the first broadcast channel and / or the initial time period is different from the first time period, determining the initial broadcast information as the second broadcast information;
[0047] When the initial broadcast channel is the same as the first broadcast channel and the initial time period is the same as the first time period, the initial broadcast information is updated to obtain the second broadcast information.
[0048] In some embodiments, the second information determination module is configured to:
[0049] The initial time period is updated to the second time period different from the first time period, and / or the initial broadcast channel is updated to the second broadcast channel different from the first broadcast channel, to obtain the second broadcast information.
[0050] In some embodiments, the second information determination module is configured to:
[0051] Generate random numbers;
[0052] The second broadcast channel is determined based on the initial broadcast channel and the random number.
[0053] In some embodiments, the second information determination module is configured to:
[0054] When the sum of the initial broadcast channel and the random number is less than or equal to a preset threshold, determining the sum of the initial broadcast channel and the random number as the second broadcast channel; or,
[0055] When the sum of the initial broadcast channel and the random number is greater than the preset threshold, a mapping channel corresponding to the sum of the initial broadcast channel and the random number is determined according to a preset mapping relationship, and the mapping channel is determined as the second broadcast channel; wherein the preset mapping relationship is used to characterize the relationship between a numerical value greater than the preset threshold and the corresponding mapping channel, and the mapping channel is less than or equal to the preset threshold.
[0056] In some embodiments, the second broadcast information is used to characterize the initial broadcast channel, a first identifier corresponding to the initial broadcast channel, the second broadcast channel, a second identifier corresponding to the second broadcast channel, and the second time period, the first identifier is used to characterize the channel before modification, the second identifier is used to characterize the channel after modification, and the third device is used to determine that the second broadcast channel is a channel for transmitting audio data based on the first identifier and the second identifier, and receive audio data of the first device through the second broadcast channel during the second time period.
[0057] In some embodiments, the second information determination module is configured to:
[0058] Determine the second broadcast channel and the second time period based on the first broadcast channel and the first time period;
[0059] The second broadcast information is determined based on the second broadcast channel and the second time period.
[0060] In some embodiments, the second broadcast information includes a first broadcast packet, the first broadcast packet includes first data, the first data is used to characterize a third broadcast channel for transmitting the second broadcast packet and a third time period occupying the third broadcast channel, the second broadcast packet includes second data, the second data is used to characterize a fourth broadcast channel for transmitting the third broadcast packet and a fourth time period occupying the fourth broadcast channel, the third broadcast packet includes third data, the third data includes a fifth broadcast channel for transmitting an audio data packet and a fifth time period occupying the fifth broadcast channel, and the audio data packet includes audio data of the first device;
[0061] The second broadcast channel includes the third broadcast channel, the fourth broadcast channel and the fifth broadcast channel, and the second time period includes the third time period, the fourth time period and the fifth time period;
[0062] The second broadcast channel and the second time period satisfy at least one of the following:
[0063] The third broadcast channel is different from the first broadcast channel;
[0064] The third time period is different from the first time period;
[0065] The fourth broadcast channel is different from the first broadcast channel;
[0066] The fourth time period is different from the first time period;
[0067] The fifth broadcast channel is different from the first broadcast channel;
[0068] The fifth time period is different from the first time period.
[0069] In some embodiments, the first information acquisition module is configured to:
[0070] monitoring all broadcast channels in the spatial area where the first device is located;
[0071] When it is monitored that the second device transmits audio data through any of the broadcast channels, the first broadcast information occupying the broadcast channel is acquired.
[0072] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0073] processor;
[0074] a memory for storing processor-executable instructions;
[0075] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.
[0076] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure.
[0077] The above method of the present disclosure has the following beneficial effects:
[0078] According to the method provided by the embodiment of the present disclosure, the first device first obtains the first broadcast information, that is, obtains at least one occupied first broadcast channel and the first time period of occupying the first broadcast channel, and then determines the second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize the second broadcast channel and the second time period of occupying the second broadcast channel, the second broadcast channel is a channel used to transmit the audio data of the first device, the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period, and finally, in the second time period, the audio data of the first device is transmitted through the second broadcast channel, which can avoid the first device and other devices from transmitting audio data on the same channel at the same time, that is, avoid mutual interference of audio data of different devices, thereby reducing the packet loss rate of audio data and improving the effective transmission rate.
[0079] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0081] Figure 1 is a schematic diagram showing a conflict occurring when a sound source device broadcasts audio data according to an exemplary embodiment;
[0082] Figure 2 is a schematic diagram showing broadcast audio data according to an exemplary embodiment;
[0083] Figure 3 is a flow chart of a method for transmitting audio data according to an exemplary embodiment;
[0084] Figure 4 is a flow chart showing another method for transmitting audio data according to an exemplary embodiment;
[0085] Figure 5is a flow chart showing another method for transmitting audio data according to an exemplary embodiment;
[0086] Figure 6 is a flow chart showing another method for transmitting audio data according to an exemplary embodiment;
[0087] Figure 7 is a block diagram of a device for transmitting audio data according to an exemplary embodiment;
[0088] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0089] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0090] Low-power Bluetooth audio broadcasting technology is becoming increasingly popular. The Bluetooth Special Interest Group (SIG), the international standardization organization for the Bluetooth protocol, has proposed a connectionless broadcast audio sharing technology, which allows Bluetooth headsets (Bluetooth devices) to listen to music without being connected to the audio source device that plays the audio, greatly improving the flexibility of audio sharing.
[0091] According to the Bluetooth technology protocol standard, multiple audio source devices can broadcast audio data on the Bluetooth low energy advertising channel and data channel. When any two audio source devices transmit audio data on the same channel, they will interfere with each other, causing the Bluetooth device to be unable to receive audio data normally. For example, see Figure 1 The diagram shows a conflict between audio source devices when broadcasting audio data. Figure 1 Taking two audio source data as an example, audio source device A and audio source device B share media audio through broadcasting at the same time. Although the two audio devices use Bluetooth frequency hopping technology when transmitting data through 2.4GHZ radio frequency technology, during the long data transmission process, the two devices still have a high probability of transmitting data on the same channel at the same time, and conflicts will occur at this time.
[0092] In the related art, when transmitting data, Bluetooth frequency hopping technology is used, for example, see Figure 2The schematic diagram of broadcast audio data shown in the figure, first, the sound source device sends an ADV_EXT_IND broadcast packet on any of the primary advertising channels 37, 38 and 39, and the ADV_EXT_IND broadcast packet carries AuxPtr data, wherein the AuxPtr data includes the channel and time point of the AUX_ADV_IND broadcast packet. Then, the sound source device sends an AUX_ADV_IND broadcast packet on any of the second-type secondary advertising channels 0-36, and the AUX_ADV_IND broadcast packet carries SyncInfo data, wherein the SyncInfo data includes the channel and time point of the AUX_SYNC_IND broadcast packet. Then, the sound source device sends an AUX_SYNC_IND broadcast packet on any of the second-type secondary advertising channels 0-36, and the AUX_SYNC_IND broadcast packet carries BIGInfo data, wherein the BIGInfo data includes the channel and time point of the audio data packet. Finally, the audio device sends an audio data packet on any of the general-purpose channels 0-36. For a Bluetooth device, after receiving the ADV_EXT_IND broadcast packet, the Bluetooth device obtains the channel and time point of the audio data packet transmission through AuxPtr data, SyncInfo data and BIGInfo data in sequence, and monitors the audio data packet at the corresponding time point and channel. Among them, the second type of secondary broadcast channel is the same as the general channel.
[0093] In the above-mentioned related technologies, although audio data packets and broadcast packets such as AUX_ADV_IND, AUX_SYNC_IND, etc. are sent in a frequency hopping manner, when multiple audio source devices are in the same environment, there is still a high probability that two audio source devices transmit data on the same channel, thereby causing interference.
[0094] In response to the above problems, an embodiment of the present disclosure provides a method for transmitting audio data, wherein a first device first obtains first broadcast information, that is, obtains at least one occupied first broadcast channel and a first time period of occupying the first broadcast channel, and then determines second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize the second broadcast channel and the second time period of occupying the second broadcast channel. The second broadcast channel is a channel used to transmit the audio data of the first device, the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period. Finally, in the second time period, the audio data of the first device is transmitted through the second broadcast channel, which can avoid the first device and other devices from transmitting audio data on the same channel at the same time, that is, avoid mutual interference between audio data of different devices, thereby reducing the packet loss rate of the audio data and improving the effective transmission rate.
[0095] In the disclosed embodiment, the execution subject is a first device (i.e., a sound source device), and the first device is an electronic device such as a mobile phone, a tablet, a laptop computer, a wearable device, etc. that can be connected to a Bluetooth device.
[0096] Figure 3 is a flowchart of a method for transmitting audio data according to an exemplary embodiment, which is executed by a first device, see Figure 3 , the method comprises the following steps:
[0097] Step S301: Acquire first broadcast information, where the first broadcast information includes at least one first broadcast channel that is monitored and occupied and a first time period of occupying the first broadcast channel.
[0098] Among them, the first broadcast information is the broadcast information of other devices monitored by the first device. The first broadcast information can be one or more. For example, the first broadcast information can be the broadcast information when a second device transmits audio data. Multiple first broadcast information is the broadcast information when multiple second devices transmit audio data.
[0099] The first broadcast information includes at least one first broadcast channel that has been monitored and occupied and a first time period of occupying the first broadcast channel. The first broadcast channel is a channel that is currently occupied among the channels used to transmit data. For example, the first broadcast channel can be any one of the second-class secondary broadcast channels 0-36. The first time period is the time period of occupying the first broadcast channel. Optionally, the first time period can be a continuous time period, or a time period composed of multiple discontinuous time periods. Alternatively, the first time period can also be a certain time point.
[0100] It should be noted that in addition to the first broadcast channel and the first time period, the first broadcast information may also include other information. For example, the first broadcast information may also include transmitted audio data, sending device information, receiving device information, etc. In the embodiments of the present disclosure, there is no restriction on other information included in the first broadcast information.
[0101] Step S302: Based on the first broadcast information, determine the second broadcast information, where the second broadcast information is used to characterize a second broadcast channel and a second time period occupying the second broadcast channel, where the second broadcast channel is a channel used to transmit audio data of the first device; wherein the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period.
[0102] In the disclosed embodiment, in order to avoid mutual interference of audio data of different devices, it is necessary to make the audio data of different devices transmitted through different channels, or to transmit through the same channel but occupy different time periods of the channel, that is, to ensure that the audio data of different devices are not transmitted through the same channel in the same time period. To achieve this purpose, it is necessary to determine the second broadcast information of the first device based on the acquired first broadcast information.
[0103] The second broadcast information is used to characterize the second broadcast channel and the second time period occupying the second broadcast channel, the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period. That is, the second broadcast channel and the second time period need to satisfy at least one of the following: the second broadcast channel is different from the first broadcast channel; the second time period is different from the first time period.
[0104] The second broadcast channel is a channel for transmitting audio data of the first device, and the audio data may be music, video sound, and the second broadcast channel is an unused channel in the channels for transmitting data, for example, the second broadcast channel is any unused one of the second-class secondary broadcast channels 0-36. The second time period is different from the first time period, which means that the second time period does not overlap with the first time period. For example, if the first time period is 8:00-8:01, the second time period may be any time period except 8:00-8:01. Optionally, the second time period may also be a certain time point.
[0105] It should be noted that, similar to the first broadcast information, the second broadcast information may include other information in addition to the second broadcast channel and the second time period. For example, the second broadcast information may also include transmitted audio data, sending device information, receiving device information, etc. In the embodiments of the present disclosure, there is no restriction on other information included in the second broadcast information.
[0106] Step S303: In a second time period, the audio data of the first device is transmitted through a second broadcast channel.
[0107] For the first device, after determining the second broadcast channel and the second time period, the audio data of the first device can be transmitted through the second broadcast channel in the second time period.
[0108] According to the method provided by the embodiment of the present disclosure, the first device first obtains the first broadcast information, that is, obtains at least one occupied first broadcast channel and the first time period of occupying the first broadcast channel, and then determines the second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize the second broadcast channel and the second time period of occupying the second broadcast channel, the second broadcast channel is a channel used to transmit the audio data of the first device, the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period, and finally, in the second time period, the audio data of the first device is transmitted through the second broadcast channel, which can avoid the first device and other devices from transmitting audio data on the same channel at the same time, that is, avoid mutual interference of audio data of different devices, thereby reducing the packet loss rate of audio data and improving the effective transmission rate.
[0109] In some embodiments, when the first device determines the second broadcast information based on the first broadcast information, the first device may first obtain the initial broadcast information, and then update the initial broadcast information according to the first broadcast information to obtain the second broadcast information. In this way, it is possible to avoid introducing other information when generating the initial broadcast information; or, the first device may directly determine the second broadcast information based on the first broadcast information, without first obtaining the initial broadcast information, and may obtain the second broadcast information more quickly. Figure 4 and Figure 5 The embodiments shown illustrate these two implementations:
[0110] Figure 4 is a flowchart of another method for transmitting audio data according to an exemplary embodiment, which is executed by a first device, see Figure 4 , the method comprises the following steps:
[0111] Step S401: monitor all broadcast channels in the spatial area where the first device is located.
[0112] In the embodiment of the present disclosure, the first device monitors all broadcast channels in the spatial area where it is located to determine whether there are other devices currently transmitting audio data through the broadcast channel. The spatial area where the first device is located is an area with the first device as the center and a preset distance as the radius. For example, the preset distance is 15 meters, and all broadcast channels within 15 meters of the first device are monitored. All broadcast channels refer to broadcast channels used for Bluetooth transmission. For example, all broadcast channels include primary broadcast channels 37-39 and second-class secondary broadcast channels 0-36.
[0113] In some embodiments, after the first device turns on the Bluetooth function, it monitors all broadcast channels in the spatial area where the first device is located once every preset time period. For example, the first device monitors all broadcast channels in the spatial area where the first device is located once every 1 minute.
[0114] In some embodiments, when the first device turns on the Bluetooth function and determines that audio data needs to be transmitted, it monitors all broadcast channels in the spatial area where the first device is located to obtain the usage of the broadcast channels in real time.
[0115] Step S402: when it is monitored that the second device transmits audio data through any broadcast channel, first broadcast information occupying the broadcast channel is obtained.
[0116] When it is monitored that the second device transmits audio data through any broadcast channel, it means that the broadcast channel has been occupied. At this time, the first broadcast information occupying the broadcast channel is obtained. The first broadcast information includes the occupied broadcast channel and the time period of occupying the broadcast channel, that is, the first broadcast information includes the first broadcast channel and the first time period.
[0117] In some embodiments, the first broadcast information is recorded in a channel usage list, which includes an occupied broadcast channel and a time period for occupying the broadcast channel. There is a corresponding relationship between the broadcast channel and the time period, and the same broadcast channel can correspond to different time periods, and the same time period can correspond to different broadcast channels.
[0118] It should be noted that after obtaining the first broadcast information, the first device can continue to monitor all broadcast channels. When a new occupied broadcast channel and a time period occupied by the broadcast channel are monitored, the newly monitored broadcast channel and time period are added to the channel usage list; or when it is monitored that an occupied broadcast channel and a time period occupied by the broadcast channel are no longer occupied, the no longer occupied broadcast channel and time period are deleted from the channel usage list.
[0119] Step S403: Acquire initial broadcast information of the first device, where the initial broadcast information is used to represent an initial broadcast channel and an initial time period for occupying the initial broadcast channel.
[0120] The initial broadcast information is the broadcast information generated by the first device. When generating the initial broadcast information, the first device does not consider whether the channel and time period are the same as the channels and time periods occupied by other devices. Therefore, the initial broadcast channel may be the same as the first broadcast channel, and / or the initial time period may be the same as the first time period. Optionally, the initial broadcast channel is a channel randomly selected from all broadcast channels, and the first time period is a time period close to the current time point.
[0121] It should be noted that, similar to the second broadcast information, the initial broadcast information may include other information in addition to the initial broadcast channel and the initial time period. For example, the initial broadcast information may also include transmitted audio data, sending device information, receiving device information, etc. In the embodiments of the present disclosure, there is no restriction on other information included in the initial broadcast information.
[0122] Step S404: determining second broadcast information based on the initial broadcast channel, the initial time period and the first broadcast information.
[0123] In the embodiment of the present disclosure, whether the initial broadcast information needs to be updated is determined based on whether the initial broadcast channel is the same as the first broadcast channel and whether the initial time period is the same as the first time period to obtain the second broadcast information.
[0124] In some embodiments, when the initial broadcast channel is different from the first broadcast channel, and / or the initial time period is different from the first time period, the initial broadcast information is determined as the second broadcast information. If the initial broadcast channel is different from the first broadcast channel, the audio data of the first device and the audio data of other devices are transmitted through different broadcast channels and will not interfere with each other. If the initial time period is different from the first time period, the audio data of the first device and the audio data of other devices are transmitted in different time periods and will not interfere with each other. Therefore, if the initial broadcast channel is different from the first broadcast channel, and / or the initial time period is different from the first time period, the audio data will not interfere with each other, so that the initial broadcast channel is different from the first broadcast channel, and / or the initial time period is different from the first time period, the audio data will not interfere with each other, thereby directly determining the initial broadcast information as the second broadcast information, and there is no need to modify the initial broadcast channel and the initial time period.
[0125] In some embodiments, when the initial broadcast channel is the same as the first broadcast channel, and the initial time period is the same as the first time period, the initial broadcast information is updated to obtain the second broadcast information. If the initial broadcast channel is the same as the first broadcast channel, and the initial time period is the same as the first time period, then the audio data of the first device and the audio data of other devices will be transmitted through the same broadcast channel at the same time, and will interfere with each other. Therefore, the initial broadcast information needs to be updated so that the updated time period is different from the first time period, and / or the updated broadcast channel is different from the first broadcast channel, so as to obtain the second broadcast information. Optionally, when updating the broadcast channel, the initial broadcast channel is modified to a randomly selected channel different from the first broadcast channel.
[0126] Optionally, the initial time period is updated to a second time period different from the first time period, and / or the initial broadcast channel is updated to a second broadcast channel different from the first broadcast channel, to obtain the second broadcast information.
[0127] In some embodiments, updating the initial broadcast channel to a second broadcast channel different from the first broadcast channel includes: generating a random number; and determining the second broadcast channel based on the initial broadcast channel and the random number. The random number is a value randomly generated by the first device, and the random number can be any value.
[0128] Optionally, since the broadcast channel for transmitting audio data is fixed, for example, the broadcast channel is 0-36, and the sum of the initial broadcast channel and the random number may exceed 36. In this case, when the sum of the initial broadcast channel and the random number is less than or equal to the preset threshold, the sum of the initial broadcast channel and the random number is determined as the second broadcast channel. Among them, the preset threshold is the largest broadcast channel. When the sum of the initial broadcast channel and the random number is less than or equal to the preset threshold, it means that the sum of the initial broadcast channel and the random number is still an available channel. Therefore, the sum of the initial broadcast channel and the random number is directly determined as the second broadcast channel. For example, if the initial broadcast channel is 5 and the random number is 3, then the second broadcast channel is determined to be 8.
[0129] Alternatively, when the sum of the initial broadcast channel and the random number is greater than a preset threshold, the mapping channel corresponding to the sum of the initial broadcast channel and the random number is determined according to a preset mapping relationship, and the mapping channel is determined as a second broadcast channel; wherein the preset mapping relationship is used to characterize the relationship between a numerical value greater than the preset threshold and the corresponding mapping channel, and the mapping channel is less than the preset threshold. When the sum of the initial broadcast channel and the random number is greater than the preset threshold, it means that the sum of the initial broadcast channel and the random number is not an available channel. Therefore, according to the preset mapping relationship, an available mapping channel is determined, and the mapping channel is determined as the second broadcast channel. For example, the broadcast channels are 0-36, and there are 37 broadcast channels in total. The preset mapping relationship is the remainder of the sum of the initial broadcast channel and the random number divided by 37. When the initial broadcast channel is 30 and the random number is 10, the second broadcast channel is determined to be 3.
[0130] It should be noted that when the broadcast channel determined based on the initial broadcast channel and the random number is still an occupied broadcast channel, the second broadcast channel is determined based on the determined broadcast channel and the random number, and the implementation method of determining the second broadcast channel based on the determined broadcast channel and the random number is the same as the implementation method of determining the second broadcast channel based on the initial broadcast channel and the random number. Alternatively, a random number is regenerated, and the second broadcast channel is determined based on the initial broadcast channel and the regenerated random number.
[0131] In some embodiments, when the initial time period is the same as the first time period and the initial broadcast channel is the same as the first broadcast channel, the initial broadcast channel is updated to a second broadcast channel different from the first broadcast channel, and the initial time period is determined to be the second time period.
[0132] Step S405: In a second time period, the audio data of the first device is transmitted through a second broadcast channel.
[0133] The first device broadcasts the second broadcast information, and the third device receives the second broadcast information, and the third device is a device for receiving audio data. For the third device receiving audio data, the third device receives the second broadcast information, determines the second time period and the second broadcast channel based on the received second broadcast information, and receives the audio data of the first device through the second broadcast channel in the second time period.
[0134] In some embodiments, the second broadcast information is used to characterize an initial broadcast channel, a first identifier corresponding to the initial broadcast channel, a second broadcast channel, a second identifier corresponding to the second broadcast channel, and a second time period, the first identifier is used to characterize the channel before modification, the second identifier is used to characterize the channel after modification, the first identifier is a pre-set identifier used to characterize the channel as the channel before modification, the second identifier is a pre-set identifier used to characterize the channel as the channel before modification, and the first identifier and the second identifier are identifiers permitted by the Bluetooth protocol standard. The third device receives the second broadcast information, determines that the second broadcast channel is a channel for transmitting audio data based on the first identifier and the second identifier, and receives the audio data of the first device through the second broadcast channel in the second time period.
[0135] According to the method provided by the embodiment of the present disclosure, the first device first obtains the first broadcast information, then determines the second broadcast information based on the first broadcast information and the initial broadcast information, and finally transmits the audio data of the first device through the second broadcast channel in the second time period. This can avoid the first device and other devices from transmitting audio data on the same channel at the same time, that is, avoid mutual interference between audio data of different devices, thereby reducing the packet loss rate of audio data and improving the effective transmission rate.
[0136] Figure 5 is a flowchart of another method for transmitting audio data according to an exemplary embodiment, which is executed by a first device, see Figure 5 , the method comprises the following steps:
[0137] Step S501: monitor all broadcast channels in the spatial area where the first device is located.
[0138] Step S502: when it is monitored that the second device transmits audio data through any broadcast channel, first broadcast information occupying the broadcast channel is obtained.
[0139] The implementation of steps S501 and S502 refers to the above steps S401 and S402, which will not be described in detail here.
[0140] Step S503: Determine a second broadcast channel and a second time period based on the first broadcast channel and the first time period.
[0141] Step S504: determine second broadcast information based on the second broadcast channel and the second time period.
[0142] In the embodiment of the present disclosure, in order to prevent the first device from transmitting audio data on the same channel at the same time as other devices, when determining the second broadcast information, first determine a second broadcast channel different from the first broadcast channel based on the first broadcast channel, and / or determine a second time period different from the first time period based on the first time period, and then determine the second broadcast information based on the second broadcast channel and the second time period.
[0143] In some embodiments, based on the first broadcast channel, a second broadcast channel different from the first broadcast channel is determined, and a second time period is determined, and the second time period may be the same as or different from the first time period. Alternatively, based on the first time period, a second time period different from the first time period is determined, and a second broadcast channel is determined, and the second broadcast channel may be the same as or different from the first broadcast channel.
[0144] Step S505: In a second time period, the audio data of the first device is transmitted through a second broadcast channel.
[0145] According to the method provided by the embodiment of the present disclosure, the first device first obtains the first broadcast information, then determines the second broadcast information based on the first broadcast information, and finally transmits the audio data of the first device through the second broadcast channel in the second time period. This can avoid the first device and other devices from transmitting audio data on the same channel at the same time, that is, avoid mutual interference between audio data of different devices, thereby reducing the packet loss rate of audio data and improving the effective transmission rate.
[0146] In some embodiments, in order to further avoid interference, frequency hopping transmission is adopted, that is, when transmitting audio data, multiple broadcast packets can be transmitted in sequence through different broadcast channels.
[0147] The second broadcast information includes a first broadcast packet, the first broadcast packet includes first data, the first data is used to characterize the third broadcast channel used to transmit the second broadcast packet and the third time period occupied by the third broadcast channel, the second broadcast packet includes second data, the second data is used to characterize the fourth broadcast channel used to transmit the third broadcast packet and the fourth time period occupied by the fourth broadcast channel, the third broadcast packet includes third data, the third data includes the fifth broadcast channel used to transmit the audio data packet and the fifth time period occupied by the fifth broadcast channel, and the audio data packet includes the audio data of the first device. Among them, the first broadcast packet is a broadcast packet transmitted through the main broadcast channel, and the second broadcast packet, the third broadcast packet and the fourth broadcast packet are broadcast packets transmitted through the second type of secondary broadcast packets. For example, the first broadcast packet is an ADV_EXT_IND broadcast packet, the second broadcast packet is an AUX_ADV_IND broadcast packet, and the third broadcast packet is an AUX_SYNC_IND broadcast packet.
[0148] The second broadcast channel includes a third broadcast channel, a fourth broadcast channel and a fifth broadcast channel, which may be the same or different; the second time period includes a third time period, a fourth time period and a fifth time period.
[0149] Among them, the second broadcast channel and the second time period satisfy at least one of the following: the third broadcast channel is different from the first broadcast channel; the third time period is different from the first time period; the fourth broadcast channel is different from the first broadcast channel; the fourth time period is different from the first time period; the fifth broadcast channel is different from the first broadcast channel; the fifth time period is different from the first time period.
[0150] Below through Figure 6 The embodiment shown in the figure has the same frequency hopping mode as the above Figure 4 The embodiments shown are described in conjunction with the following embodiments:
[0151] Figure 6 is a flowchart of another method for transmitting audio data according to an exemplary embodiment, which is executed by a first device, see Figure 6 , the method comprises the following steps:
[0152] Step S601: Acquire first broadcast information.
[0153] The first broadcast information includes a fourth broadcast packet, the fourth broadcast packet includes fourth data, the fourth data is used to characterize the sixth broadcast channel used to transmit the fifth broadcast packet and the sixth time period occupied by the sixth broadcast channel, the fifth broadcast packet includes fifth data, the fifth data is used to characterize the seventh broadcast channel used to transmit the sixth broadcast packet and the seventh time period occupied by the seventh broadcast channel, the sixth broadcast packet includes sixth data, the sixth data includes the eighth broadcast channel used to transmit the audio data packet and the eighth time period occupied by the eighth broadcast channel, and the audio data packet includes the audio data of the second device. The first broadcast channel includes the sixth broadcast channel, the seventh broadcast channel and the eighth broadcast channel, and the first time period includes the sixth time period, the seventh time period and the eighth time period.
[0154] For other implementations of step S601, refer to the above steps S401 and S402, which will not be described in detail here.
[0155] Step S602: Acquire initial broadcast information.
[0156] The initial broadcast information includes a first initial broadcast packet, the first initial broadcast packet includes first initial data, the first initial data is used to characterize a first initial broadcast channel for transmitting a second initial broadcast packet and a first initial time period for occupying the first initial broadcast channel, the second initial broadcast packet includes second initial data, the second initial data is used to characterize a second initial broadcast channel for transmitting a third initial broadcast packet and a second initial time period for occupying the second initial broadcast channel, the third initial broadcast packet includes third initial data, the third initial data includes a third initial broadcast channel for transmitting an audio initial data packet and a third initial time period for occupying the third initial broadcast channel, and the audio initial data packet includes audio data of the first device. The initial broadcast channels include the first initial broadcast channel, the second initial broadcast channel and the third initial broadcast channel, and the initial time period includes the first initial time period, the second initial time period and the third initial time period.
[0157] Step S603: Update the first initial data, the second initial data and the third initial data according to the fourth data, the fifth data and the sixth data in the first broadcast information to obtain the first data, the second data and the third data.
[0158] In some embodiments, an unoccupied broadcast channel is determined based on the fourth data, the fifth data, and the sixth data. When at least one broadcast channel among the first initial data, the second initial data, and the third initial data is an unoccupied broadcast channel, the first initial data, the second initial data, and the third initial data are kept unchanged, that is, the first initial data, the second initial data, and the third initial data are used as the first data, the second data, and the third data.
[0159] In some embodiments, an unoccupied time period is determined based on the fourth data, the fifth data, and the sixth data. When at least one time period among the first initial data, the second initial data, and the third initial data is an unoccupied time period, the first initial data, the second initial data, and the third initial data are kept unchanged, that is, the first initial data, the second initial data, and the third initial data are used as the first data, the second data, and the third data.
[0160] In some embodiments, the above two embodiments are combined, that is, when at least one time period among the first initial data, the second initial data and the third initial data is an unoccupied time period, and / or at least one broadcast channel among the first initial data, the second initial data and the third initial data is an unoccupied broadcast channel, the first initial data, the second initial data and the third initial data are kept unchanged.
[0161] In some embodiments, when each broadcast channel in the first initial data, the second initial data, and the third initial data is an occupied broadcast channel, and the time period of occupying each broadcast channel is the occupied time period of each broadcast channel, the first initial data, the second initial data, and the third initial data are updated to obtain the first data, the second data, and the third data.
[0162] In some embodiments, the first initial data is compared with the fourth data, the second initial data is compared with the fifth data, and the third initial data is compared with the sixth data, that is, the sixth broadcast channel is compared with the first initial broadcast channel, and the sixth time period is compared with the first initial time period, the seventh broadcast channel is compared with the second initial broadcast channel, and the seventh time period is compared with the second initial time period, and the eighth broadcast channel is compared with the third initial broadcast channel, and the eighth time period is compared with the third initial time period. Determine a third broadcast channel different from the sixth broadcast channel, and / or a third time period different from the sixth time period, determine a fourth broadcast channel different from the seventh broadcast channel, and / or a fourth time period different from the seventh time period, determine a fifth broadcast channel different from the eighth broadcast channel, and / or a fifth time period different from the eighth time period.
[0163] Optionally, only the initial broadcast channel and the occupied broadcast channel are compared, or only the initial time period and the occupied time period are compared.
[0164] For example, only the initial broadcast channel and the occupied broadcast channel are compared. If multiple first broadcast information is obtained, multiple fourth data are recorded as AuxPtr_ext, multiple fifth data are recorded as SyncInfo_ext, and multiple sixth data are recorded as BIGInfo_ext. The initial broadcast information is obtained, the first initial data is AuxPtr_self, the second initial data is SyncInfo_self, and the third initial data is BigInfo_self, and then AuxPtr_self, SyncInfo_self and BigInfo_sel are updated according to AuxPtr_ext, SyncInfo_ext and BigInfo_ext. That is, according to AuxPtr_ext, an unoccupied broadcast channel is obtained. When the first initial broadcast channel in AuxPtr_self is an unoccupied broadcast channel, AuxPtr_self is kept unchanged, otherwise the first initial broadcast channel is modified to a randomly selected unoccupied broadcast channel. Similarly, obtain an unoccupied broadcast channel according to SyncInfo_ext. When the second initial broadcast channel in SyncInfo_self is an unoccupied broadcast channel, keep SyncInfo_self unchanged; otherwise, modify the second initial broadcast channel to a randomly selected unoccupied broadcast channel; obtain an unoccupied broadcast channel according to BIGInfo_ext. When the third initial broadcast channel in BIGInfo self is an unoccupied broadcast channel, keep BIGInfo self unchanged; otherwise, modify the third initial broadcast channel to a randomly selected unoccupied broadcast channel.
[0165] Step S604: Transmit the audio data of the first device according to the first data, the second data and the third data.
[0166] It should be noted that when the second initial broadcast channel in the second initial broadcast packet is an occupied channel and the fourth broadcast channel is determined, the fourth broadcast channel and the second initial broadcast channel are both added to the modified second broadcast packet, and the fourth broadcast channel corresponds to the second identifier, and the second initial broadcast channel corresponds to the first identifier. For the third device, after obtaining the second broadcast packet, when the third device determines that the second initial broadcast channel corresponding to the first identifier and the fourth broadcast channel corresponding to the second identifier are included in the second broadcast packet, it is determined that the second initial broadcast channel is an occupied channel and data needs to be received on the fourth broadcast channel. Therefore, the third broadcast packet is received on the fourth broadcast channel in the fourth time period.
[0167] Similarly, when the third initial broadcast channel in the third initial broadcast packet is an occupied channel and the fifth broadcast channel is determined, the fifth broadcast channel and the third initial broadcast channel are both added to the modified third broadcast packet, and the fifth broadcast channel corresponds to the second identifier, and the third initial broadcast channel corresponds to the first identifier. For the third device, after obtaining the third broadcast packet, when the third device determines that the third initial broadcast channel corresponding to the first identifier and the fifth broadcast channel corresponding to the second identifier are included in the third broadcast packet, it is determined that the third initial broadcast channel is an occupied channel and data needs to be received on the fifth broadcast channel. Therefore, in the fifth time period, an audio data packet is received on the fifth broadcast channel.
[0168] According to the method provided by the embodiment of the present disclosure, the first device first obtains the first broadcast information, then determines the second broadcast information based on the first broadcast information, and finally transmits the audio data of the first device according to the first data, the second data and the third data. This can avoid the first device and other devices from transmitting audio data on the same channel at the same time, that is, avoid mutual interference between audio data of different devices, thereby reducing the packet loss rate of the audio data and improving the effective transmission rate.
[0169] Figure 7 is a block diagram of an audio data transmission device according to an exemplary embodiment. Figure 7 , the device comprises:
[0170] The first information acquisition module 701 is configured to acquire first broadcast information, where the first broadcast information includes at least one first broadcast channel monitored to be occupied and a first time period of occupying the first broadcast channel;
[0171] The second information determination module 702 is configured to determine second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize a second broadcast channel and a second time period occupying the second broadcast channel, where the second broadcast channel is a channel used to transmit audio data of the first device; wherein the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period;
[0172] The audio data transmission module 703 is configured to transmit the audio data of the first device through the second broadcast channel in the second time period.
[0173] In the apparatus provided by the embodiment of the present disclosure, the first device first obtains the first broadcast information, that is, obtains at least one occupied first broadcast channel and the first time period of occupying the first broadcast channel, and then determines the second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize the second broadcast channel and the second time period of occupying the second broadcast channel, the second broadcast channel is a channel used to transmit the audio data of the first device, the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period, and finally, in the second time period, the audio data of the first device is transmitted through the second broadcast channel, which can avoid the first device and other devices from transmitting audio data on the same channel at the same time, that is, avoid mutual interference of audio data of different devices, thereby reducing the packet loss rate of the audio data and improving the effective transmission rate.
[0174] In some embodiments, the second information determination module 702 is configured to:
[0175] Acquire initial broadcast information of the first device, where the initial broadcast information is used to characterize an initial broadcast channel and an initial time period for occupying the initial broadcast channel;
[0176] Based on the initial broadcast channel, the initial time period, and the first broadcast information, second broadcast information is determined.
[0177] In some embodiments, the second information determination module 702 is configured to:
[0178] When the initial broadcast channel is different from the first broadcast channel and / or the initial time period is different from the first time period, determining the initial broadcast information as the second broadcast information;
[0179] When the initial broadcast channel is the same as the first broadcast channel, and the initial time period is the same as the first time period, the initial broadcast information is updated to obtain the second broadcast information.
[0180] In some embodiments, the second information determination module 702 is configured to:
[0181] The initial time period is updated to a second time period different from the first time period, and / or the initial broadcast channel is updated to a second broadcast channel different from the first broadcast channel, to obtain second broadcast information.
[0182] In some embodiments, the second information determination module 702 is configured to:
[0183] Generate random numbers;
[0184] Based on the initial broadcast channel and the random number, a second broadcast channel is determined.
[0185] In some embodiments, the second information determination module 702 is configured to:
[0186] When the sum of the initial broadcast channel and the random number is less than or equal to a preset threshold, the sum of the initial broadcast channel and the random number is determined as the second broadcast channel; or,
[0187] When the sum of the initial broadcast channel and the random number is greater than a preset threshold, the mapping channel corresponding to the sum of the initial broadcast channel and the random number is determined according to the preset mapping relationship, and the mapping channel is determined as the second broadcast channel; wherein the preset mapping relationship is used to characterize the relationship between a numerical value greater than the preset threshold and the corresponding mapping channel, and the mapping channel is less than or equal to the preset threshold.
[0188] In some embodiments, the second broadcast information is used to characterize an initial broadcast channel, a first identifier corresponding to the initial broadcast channel, a second broadcast channel, a second identifier corresponding to the second broadcast channel, and a second time period. The first identifier is used to characterize the channel before modification, and the second identifier is used to characterize the channel after modification. The third device is used to determine that the second broadcast channel is a channel for transmitting audio data based on the first identifier and the second identifier, and in a second time period, receives audio data from the first device through the second broadcast channel.
[0189] In some embodiments, the second information determination module 702 is configured to:
[0190] Determining a second broadcast channel and a second time period based on the first broadcast channel and the first time period;
[0191] Second broadcast information is determined based on the second broadcast channel and the second time period.
[0192] In some embodiments, the second broadcast information includes a first broadcast packet, the first broadcast packet includes first data, the first data is used to characterize a third broadcast channel for transmitting the second broadcast packet and a third time period occupying the third broadcast channel, the second broadcast packet includes second data, the second data is used to characterize a fourth broadcast channel for transmitting the third broadcast packet and a fourth time period occupying the fourth broadcast channel, the third broadcast packet includes third data, the third data includes a fifth broadcast channel for transmitting an audio data packet and a fifth time period occupying the fifth broadcast channel, and the audio data packet includes audio data of the first device;
[0193] The second broadcast channel includes a third broadcast channel, a fourth broadcast channel and a fifth broadcast channel, and the second time period includes a third time period, a fourth time period and a fifth time period;
[0194] The second broadcast channel and the second time period satisfy at least one of the following:
[0195] The third broadcast channel is different from the first broadcast channel;
[0196] The third time period is different from the first time period;
[0197] The fourth broadcast channel is different from the first broadcast channel;
[0198] The fourth time period is different from the first time period;
[0199] The fifth broadcast channel is different from the first broadcast channel;
[0200] The fifth time period is different from the first time period.
[0201] In some embodiments, the first information acquisition module 701 is configured to:
[0202] monitoring all broadcast channels in the spatial area where the first device is located;
[0203] When it is monitored that the second device transmits audio data through any broadcast channel, first broadcast information occupying the broadcast channel is acquired.
[0204] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0205] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the audio data transmission method in the above embodiment.
[0206] Figure 8 is a block diagram of an electronic device 800 according to an exemplary embodiment.
[0207] Reference Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0208] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0209] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0210] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0211] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0212] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0213] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0214] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0215] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0216] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0217] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0218] The embodiments of the present disclosure also provide a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the audio data transmission method in the above embodiment.
[0219] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0220] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for transmitting audio data, characterized in that: The method comprises: Acquire first broadcast information, where the first broadcast information includes at least one first broadcast channel that is monitored and occupied and a first time period in which the first broadcast channel is occupied; Determine second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize a second broadcast channel and a second time period occupying the second broadcast channel, where the second broadcast channel is a channel used to transmit audio data of the first device; wherein the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period; In the second time period, the audio data of the first device is transmitted through the second broadcast channel.
2. The method according to claim 1, characterized in that The determining the second broadcast information based on the first broadcast information includes: Acquire initial broadcast information of the first device, where the initial broadcast information is used to characterize an initial broadcast channel and an initial time period for occupying the initial broadcast channel; The second broadcast information is determined based on the initial broadcast channel, the initial time period, and the first broadcast information.
3. The method according to claim 2, characterized in that The determining the second broadcast information based on the initial broadcast channel, the initial time period, and the first broadcast information includes: When the initial broadcast channel is different from the first broadcast channel and / or the initial time period is different from the first time period, determining the initial broadcast information as the second broadcast information; When the initial broadcast channel is the same as the first broadcast channel and the initial time period is the same as the first time period, the initial broadcast information is updated to obtain the second broadcast information.
4. The method according to claim 3, characterized in that The updating of the initial broadcast information to obtain the second broadcast information includes: The initial time period is updated to the second time period different from the first time period, and / or the initial broadcast channel is updated to the second broadcast channel different from the first broadcast channel, to obtain the second broadcast information.
5. The method according to claim 4, characterized in that The updating the initial broadcast channel to the second broadcast channel different from the first broadcast channel comprises: Generate random numbers; The second broadcast channel is determined based on the initial broadcast channel and the random number.
6. The method according to claim 5, characterized in that The determining the second broadcast channel based on the initial broadcast channel and the random number includes: When the sum of the initial broadcast channel and the random number is less than or equal to a preset threshold, determining the sum of the initial broadcast channel and the random number as the second broadcast channel; or, When the sum of the initial broadcast channel and the random number is greater than the preset threshold, a mapping channel corresponding to the sum of the initial broadcast channel and the random number is determined according to a preset mapping relationship, and the mapping channel is determined as the second broadcast channel; wherein the preset mapping relationship is used to characterize the relationship between a numerical value greater than the preset threshold and the corresponding mapping channel, and the mapping channel is less than or equal to the preset threshold.
7. The method according to claim 5, characterized in that The second broadcast information is used to represent the initial broadcast channel, the first identifier corresponding to the initial broadcast channel, the second broadcast channel, the second identifier corresponding to the second broadcast channel and the second time period, the first identifier is used to represent the channel before modification, the second identifier is used to represent the channel after modification, and the third device is used to determine that the second broadcast channel is a channel for transmitting audio data based on the first identifier and the second identifier, and receive the audio data of the first device through the second broadcast channel in the second time period.
8. The method according to claim 1, characterized in that: The determining the second broadcast information based on the first broadcast information includes: Determine the second broadcast channel and the second time period based on the first broadcast channel and the first time period; The second broadcast information is determined based on the second broadcast channel and the second time period.
9. The method according to any one of claims 1 to 8, characterized in that: The second broadcast information includes a first broadcast packet, the first broadcast packet includes first data, the first data is used to characterize a third broadcast channel for transmitting the second broadcast packet and a third time period occupying the third broadcast channel, the second broadcast packet includes second data, the second data is used to characterize a fourth broadcast channel for transmitting the third broadcast packet and a fourth time period occupying the fourth broadcast channel, the third broadcast packet includes third data, the third data includes a fifth broadcast channel for transmitting an audio data packet and a fifth time period occupying the fifth broadcast channel, and the audio data packet includes audio data of the first device; The second broadcast channel includes the third broadcast channel, the fourth broadcast channel and the fifth broadcast channel, and the second time period includes the third time period, the fourth time period and the fifth time period; The second broadcast channel and the second time period satisfy at least one of the following: The third broadcast channel is different from the first broadcast channel; The third time period is different from the first time period; The fourth broadcast channel is different from the first broadcast channel; The fourth time period is different from the first time period; The fifth broadcast channel is different from the first broadcast channel; The fifth time period is different from the first time period.
10. The method according to any one of claims 1 to 8, characterized in that: The obtaining of the first broadcast information includes: monitoring all broadcast channels in the spatial area where the first device is located; When it is monitored that the second device transmits audio data through any of the broadcast channels, the first broadcast information occupying the broadcast channel is acquired.
11. An audio data transmission device, characterized in that: The device comprises: A first information acquisition module is configured to acquire first broadcast information, where the first broadcast information includes at least one first broadcast channel that has been monitored and occupied and a first time period for occupying the first broadcast channel; A second information determination module is configured to determine second broadcast information based on the first broadcast information, where the second broadcast information is used to characterize a second broadcast channel and a second time period occupying the second broadcast channel, where the second broadcast channel is a channel for transmitting audio data of the first device; wherein the second broadcast channel is different from the first broadcast channel, and / or the second time period is different from the first time period; The audio data transmission module is configured to transmit the audio data of the first device through the second broadcast channel during the second time period.
12. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 10.