CN109150399B - Data transmission method and device, electronic equipment and computer readable medium - Google Patents

Data transmission method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN109150399B
CN109150399B CN201810923390.8A CN201810923390A CN109150399B CN 109150399 B CN109150399 B CN 109150399B CN 201810923390 A CN201810923390 A CN 201810923390A CN 109150399 B CN109150399 B CN 109150399B
Authority
CN
China
Prior art keywords
bandwidth
audio
data
electronic device
playing
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.)
Active
Application number
CN201810923390.8A
Other languages
Chinese (zh)
Other versions
CN109150399A (en
Inventor
龚金华
严锋贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810923390.8A priority Critical patent/CN109150399B/en
Publication of CN109150399A publication Critical patent/CN109150399A/en
Application granted granted Critical
Publication of CN109150399B publication Critical patent/CN109150399B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0015Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the adaptation strategy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities

Landscapes

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

Abstract

The application discloses a data transmission method, a data transmission device, electronic equipment and a computer readable medium, and relates to the technical field of communication. The method comprises the following steps: when the electronic equipment is connected with the wireless audio playing equipment, detecting whether an audio playing module of the electronic equipment receives a playing request of audio data; if a playing request is received, determining the encoding rate for sending the audio data to the wireless audio playing equipment; according to the corresponding relation between the preset bandwidth and the encoding rate, the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment is improved; and sending the audio data to the wireless audio playing equipment through the target data link with the improved bandwidth. When the encoding rate is high, the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment is large, the transmission speed of data with high encoding rate can be improved, and the occurrence of a pause phenomenon in the audio playing process is reduced.

Description

Data transmission method and device, electronic equipment and computer readable medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method, an apparatus, an electronic device, and a computer-readable medium.
Background
With the development of science and technology, electronic devices have become one of the most common electronic products in people's daily life. Moreover, a user often receives audio information of the electronic device through an audio playing device connected to the electronic device, but audio data received by the audio playing device may be jammed, which causes a problem of poor user experience.
Disclosure of Invention
The application provides a data transmission method, a data transmission device, an electronic device and a computer readable medium, so as to overcome the defects.
In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to an electronic device. The method comprises the following steps: when the electronic equipment is connected with the wireless audio playing equipment, detecting whether the electronic equipment receives a playing request of audio data; if a playing request is received, determining the encoding rate for sending the audio data to the wireless audio playing equipment; according to the corresponding relation between the preset bandwidth and the encoding rate, the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment is increased; and sending the audio data to the wireless audio playing equipment through the target data link with the increased bandwidth.
In a second aspect, an embodiment of the present application further provides a data transmission device, which is applied to an electronic device. The device comprises: the device comprises a detection unit, a determination unit, an improvement unit and a sending unit. The detection unit is used for detecting whether the electronic equipment receives a playing request of audio data or not when the electronic equipment is connected with the wireless audio playing equipment. And the determining unit is used for determining the coding rate corresponding to the audio data if the playing request is received. And the improving unit is used for improving the bandwidth of the target data link between the electronic equipment and the wireless audio playing equipment according to the corresponding relation between the preset bandwidth and the encoding rate. And the sending unit is used for sending the audio data to the wireless audio playing equipment through the target data link with the bandwidth increased.
In a third aspect, an embodiment of the present application further provides an electronic device, including one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the above-described methods.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be called by a processor to execute the above method.
According to the data transmission method, the data transmission device, the electronic equipment and the computer readable medium, when audio data are played, the encoding rate corresponding to the audio data is determined, the encoding rate is used for sending the audio data to the wireless audio playing equipment, and the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment is improved according to the encoding rate, so that when the encoding rate is high, the bandwidth of the target data link between the electronic equipment and the wireless audio playing equipment is large, the transmission speed of the data with the high encoding rate can be improved, and the occurrence of the pause phenomenon in the audio playing process is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a speech system provided by an embodiment of the present application;
fig. 2 is a flowchart illustrating a method of data transmission according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a method of data transmission according to another embodiment of the present application;
fig. 4 is a schematic diagram illustrating a WiFi list provided by an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a method flow of one embodiment of step S304 of the method flow diagram of the data transmission method shown in FIG. 3;
FIG. 6 is a diagram illustrating a bandwidth of a target data link between an electronic device and the wireless audio playback device according to an embodiment of the present application;
FIG. 7 is a diagram illustrating a bandwidth of a target data link between an electronic device and the wireless audio playback device according to another embodiment of the present application;
FIG. 8 is a flow chart of a method of data transmission according to another embodiment of the present application;
fig. 9 shows a block diagram of a data transmission apparatus according to an embodiment of the present application;
FIG. 10 shows a block diagram of an electronic device provided by an embodiment of the present application;
fig. 11 illustrates a storage unit, provided in an embodiment of the present application, for storing or carrying program codes for implementing a data transmission method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Referring to fig. 1, a block diagram of a speech system 1 according to an embodiment of the present application is shown. Specifically, the speech system 1 includes an electronic apparatus 100 and a wireless audio playback apparatus 200.
In the embodiment of the present invention, an application capable of playing audio is installed in the electronic device 100, and specifically, the application may be audio playing software, video playing software, or call software. The electronic device 100 sends the audio to be played to the wireless audio playing device 200, and the wireless audio playing device 200 plays the voice.
The wireless audio playing device 200 is a device for playing audio, which is independent from the electronic device 100 and is capable of receiving and playing audio data sent by the electronic device 100. For example: when a user uses the electronic device to play a song, the user may start a music playing application program on a display interface of the electronic device 100, or play a locally stored song by using a player of an operating system of the electronic device 100, the electronic device 100 processes the song during the process of playing the song to obtain digitized audio data and sends the processed audio data to the wireless audio playing device 200, and the wireless audio playing device 200 performs digital-to-analog conversion on the audio data after receiving the audio data to obtain an analog signal, and plays the analog signal by using a playing function of an external sound device, so as to realize song playing through the external sound device.
In the embodiment of the present invention, the electronic device 100 and the wireless audio playing device 200 interact with each other through a wireless network to transmit signals, wherein the wireless network may be a bluetooth, wifi, LTE network, or NFC.
In this embodiment of the present invention, the wireless audio playing device 200 is a bluetooth sound device or a bluetooth earphone, the wireless audio playing device 200 can realize connection with the electronic device 100 by starting a bluetooth function, and after the connection is established, the electronic device 100 sends the voice to be played to the bluetooth sound device, so that the bluetooth sound device realizes voice playing.
Specifically, after the bluetooth functions of the electronic device 100 and the wireless audio playing device 200 are started, the electronic device 100 searches for bluetooth devices within a preset distance of the electronic device 100 and displays names of the searched bluetooth devices on a display interface of the electronic device, after a user clicks or selects the wireless audio playing device 200 on the display interface, the electronic device 100 sends a connection request to the wireless audio playing device 200, and after receiving the connection request, the wireless audio playing device 200 establishes a connection with the electronic device 100 and feeds back a connection success message.
After the electronic device 100 establishes connection with the wireless audio playing device 200, if the electronic device 100 has audio such as a song or a video that needs to be played, the electronic device processes the audio data into a digital signal and sends the audio data to the wireless audio playing device 200, and after receiving the audio data, the wireless audio playing device 200 processes and plays the audio data, thereby playing the audio. Specifically, the electronic device 100 needs to encode the audio data and then transmit the encoded audio data to the wireless audio playback device 200, specifically, the electronic device 100 and the wireless audio playback device 200 are connected via bluetooth, and data and instructions between the electronic device 100 and the wireless audio playback device 200 are transmitted according to a certain bluetooth protocol, when the electronic device 100 transmits the audio data to the wireless audio playback device 200, the audio data needs to be encoded according to an encoding format under the supported bluetooth protocol, for example, for audio, an Apt-X, SBC, AAC, or LDAC encoding algorithm is often used.
The electronic device 100 encodes the Audio data to generate an Audio data packet, and then transmits the Audio data packet to the wireless Audio playback device 200 through a bluetooth transmission channel between the electronic device 100 and the wireless Audio playback device 200, and after the wireless Audio playback device 200 acquires the Audio data packet, the wireless Audio playback device 200 can acquire the Audio data packet by decoding the data packet, for example, SBC, which is an encoding format mandatory by an A2DP (Advanced Audio Distribution Profile, bluetooth Audio transmission protocol) protocol. All bluetooth can support the protocol, so all bluetooth audio chips can also support the protocol, taking MP3 format audio as an example, the encoding process is that the electronic device samples and discretizes an MP3 file after PCM encoding, converts the MP3 file into an SBC encoding format, then sends the SBC encoding format to the wireless audio playing device, the wireless audio playing device decodes the SBC format audio to obtain PCM format audio data, and drives components such as a voice coil of the wireless audio playing device to vibrate and sound according to the PCM encoding.
Further illustratively, if the user a makes a call to the user B by using the electronic device 100, and the call is connected, the electronic device 100 used by the user a receives the voice transmitted by the electronic device of the user B, and the electronic device 100 used by the user a transmits the received voice to the wireless audio playing device 200, and the voice is played by the wireless audio playing device 200, so that the user a can hear the voice of the user B. As an embodiment, a microphone is disposed on the wireless audio playing device 200, when the user a speaks, the wireless audio playing device 200 will collect the sound of the user a and generate voice, and send the generated voice to the electronic device 100 of the user a, and the voice is sent to the electronic device used by the user B by the electronic device 100, so that the conversation between the user a and the user B can be realized.
Further exemplarily, when the user a performs a video session with the user B by using the instant messaging software installed in the electronic device 100, the electronic device 100 of the user a receives video data sent by the electronic device of the user B, the electronic device 100 processes the video data to obtain video picture data and video sound data, wherein the electronic device 100 displays the video picture data on a display interface and sends the video sound data to the wireless audio playback device 200 connected to the electronic device 100, the wireless audio playback device 200 synchronously plays the video sound data, a camera on the electronic device 100 collects a captured video image, the wireless audio playback device 200 collects a sound during the speech of the user a to obtain voice data, and the wireless audio playback device 200 sends the collected voice data to the electronic device 100, the electronic device 100 processes the video image collected by the camera and the voice data collected by the wireless audio playing device 200 to obtain video data, and feeds the video data back to the electronic device used by the user B, so that the electronic device used by the user B can complete video playing, and video conversation between the user a and the user B is realized.
At present, the inconvenience brought by a wired earphone can be reduced by using the wireless audio playing device to play audio data in the electronic device, but the inventor finds out in research that when the wireless audio playing device is used to play audio, the audio is delayed or blocked due to the fact that the audio is transmitted through wireless networks such as bluetooth, and the like, so that the user experience degree is greatly reduced.
The inventor finds out in research that one reason for the delay is that the existing electronic equipment generally comprises a bluetooth module and a WiFi module, the electronic equipment can be connected to audio playing equipment such as a bluetooth headset through the bluetooth module, music playing is performed on the electronic equipment, then audio data is transmitted to the audio playing equipment through bluetooth, and the audio playing equipment receives the audio data and outputs the audio data. However, the WiFi of the electronic device supports a 2.4G band and a 5G band, wherein the WiFi2.4G band and the bluetooth 2.4G band overlap, and the WiFi and the bluetooth share a radio frequency antenna, so if both the bluetooth and the WiFi use the 2.4G band, there is a problem of preempting antenna resources, i.e. a problem of BT/WiFi coexistence, thereby causing a problem of audio data blockage.
Therefore, in order to solve the above-mentioned drawbacks, an embodiment of the present application provides a data transmission method, which is applied to the above-mentioned electronic device, for reducing a pause phenomenon during playing of audio data, and specifically, the method includes: s201 to S204.
S201: when the electronic equipment is connected with the wireless audio playing equipment, whether an audio playing module of the electronic equipment receives a playing request of audio data is detected.
When the bluetooth function of the electronic device is turned on, the electronic device scans the bluetooth devices within a certain distance range around, and specifically, after receiving a scanning command, a bluetooth chip or other underlying network modules of the electronic device scans according to a preset channel scanning sequence, such as scanning common channels 1, 7, and 13 first, and then scanning other channels that are not common, thereby obtaining the identifiers of all bluetooth devices within the current range, and displaying the identifiers in a bluetooth list interface of the electronic device.
If the Bluetooth device which is already connected and has better signal strength exists in the scanned Bluetooth device identification, the electronic device can automatically connect with the Bluetooth device, and the user can also select one Bluetooth device in the Bluetooth list interface for connection.
When the electronic device connects to an external bluetooth device, the system of the electronic device may go to a status value indicating that the electronic device is currently connected to the bluetooth device. Therefore, the electronic device can detect the Bluetooth device, and acquire the device identifier of the Bluetooth device.
After the device identifier of the connected bluetooth device is obtained, it is determined whether the connected bluetooth device is a wireless audio playing device according to the device identifier, specifically, the device identifier may include a name or a brand of the device, for example, it can be determined whether the device is a wireless audio playing device such as an earphone or a sound device according to the device identifier, so as to determine whether the wireless audio playing device is connected. In addition, the device identifier of the connected bluetooth device may be determined, and then the device type corresponding to the currently connected device identifier is obtained from the preset correspondence between the device identifier and the device type, so that whether the currently connected device type is the wireless audio playing device or not can be determined.
Whether the device connected with the electronic device through the Bluetooth is an audio playing device or not can be detected, wherein in the electronic device based on the android operating system, the type of the device connected with the electronic device through the Bluetooth currently can be determined through a return value obtained based on instantiation of a Bluetooth class. If the returned value is AUDIO _ VIDEO _ CAMCORDER, the image acquisition equipment is characterized; if the returned value is AUDIO _ VIDEO _ CAR _ AUDIO, the vehicle-mounted equipment is characterized; if the returned value is AUDIO _ VIDEO _ HIFI _ AUDIO, the AUDIO or VIDEO playing device is characterized as an AUDIO playing device or a VIDEO playing device, such as a bluetooth headset; if the returned value is AUDIO _ VIDEO _ MICROPHONE, it is characterized as a MICROPHONE.
When the electronic device is determined to be connected with the wireless audio playing device, that is, after the electronic device is connected with the wireless audio playing device, it is detected whether a playing request is received by an audio playing module of the electronic device, where the playing request is a request for requesting to play audio data.
The audio playing module may be an audio playing program of the electronic device. Specifically, when the electronic device is connected with the wireless audio playing device and the audio data to be played needs to be sent to the wireless audio playing device for playing, the audio playing module can encode the audio data, and when the electronic device acquires the audio data and needs to play through a loudspeaker of the electronic device, the audio module can decode the audio data and send the audio data to the loudspeaker for playing.
Specifically, the audio data may be a pure audio file, or audio data played in correspondence with the image data, for example, audio data in a video, specifically, the video data includes image data and audio data played in correspondence with the image data, specifically, the video includes multi-frame image data and audio data, when the video data is played, the multi-frame image data is displayed by a display device of the electronic device or a peripheral display device connected to the electronic device, and the audio data is played by an audio player, for example, a wireless audio playing device, specifically, a playing time point of one audio data corresponds to a playing time point of one frame of the image data. The audio data in the game is similar, and the audio data needs to be played corresponding to the game picture in the game.
When the electronic device plays a pure audio file or a video file and a video in a game scene, the audio playing module obtains a playing request of audio data to be played, and can obtain the audio data by analyzing the playing request.
Specifically, the play request may be a reminder message or a voice play request. The reminding information comprises information for reminding a user that some events are triggered, such as call reminding information, short message reminding information, alarm reminding information and the like. For example, the call reminding information is used for reminding the user of the current incoming call.
As another embodiment, the utterance request may be a request to play a voice every time the electronic device utters a voice. The utterance request may be an audio utterance request, a video utterance request, or a call utterance request.
Specifically, a plurality of audio playing software are installed in the electronic device, and the software may be a music playing APP, a video playing APP, or a recording APP. For example, a video playing key is arranged on a video playing interface, and by detecting the touch of the video playing key, it can be determined whether an audio playing module of the electronic device currently receives a playing request of audio data, for example, a user selects a video, enters the video playing interface, and clicks a playing button of the playing interface, and an application program can detect what type of video the user currently clicks through monitoring the user touch operation, specifically, the playing button is provided with a preset attribute, and by detecting the attribute of the playing button corresponding to the acquired touch operation, it can be determined what type of video the user currently clicks, and further, the playing request and the audio corresponding to the playing request can be acquired.
S202: an encoding rate for transmitting the audio data to the wireless audio playback device is determined.
When the electronic device sends the audio data to the wireless audio playing device, in order to increase the data transmission speed, the audio data needs to be compressed, so as to reduce the size of the audio data, and then the process is to encode the audio data. Specifically, there are multiple encoding algorithms for sending the audio data to the wireless audio playing device, and the encoding rate corresponding to each encoding algorithm is different, that is, when different encoding algorithms encode the same audio data, the size of the obtained encoded audio data is also different.
The process from receiving the sound input by the user to sending the sound to the wireless audio playing device for playing by the electronic device comprises sampling, quantizing and encoding an analog signal of the sound. Sound is a time-continuous signal whose digitization, i.e., discretization, is accomplished by sampling and quantizing the sound to form audio data. For example, if the sound is a time-continuous sinusoid, it is collected by the electronic device, for example, by a microphone, after the sound is acquired. The electronic device samples the sound into a number of points, a process called sampling. Obviously, the greater the sampling density, i.e. the greater the sampling rate, the closer the resulting discrete signal is to the original continuous signal. Since each sample point occupies a storage space, the higher the sampling rate is, the larger the audio data obtained is.
Sampling is only the first step in audio processing. After sampling, the acquired data is also stored. Storage is space-demanding, as is the audio encoding rate, how much space is used for a second of sampled data to store. It can be seen that, on the premise of the same sampling rate, the lower the coding rate, the smaller the data. However, both the sampling and encoding steps degrade the sound quality. The encoding is actually compression, and like mp3, is lossy compression, discarding most of the acoustic data that the human ear perceives as not being, and thus is small in size.
The improvement of the audio coding rate may be to increase the sampling rate, or to reduce the discarding of useless information and to retain more useful information during the coding process, i.e. to reduce the compression ratio, for example, an encoding algorithm that stores 16-bit data of each sample in an audio stream at 4-bit, the compression ratio is 4: 1, 25% of the useful information is retained, and if the compression ratio is changed to 8 bits, the compression ratio is changed to 2:1, the compression ratio is reduced, and 50% of the useful information is retained, more useful information is retained, but the data amount of the audio data becomes larger.
In the above encoding process of sound to audio data, after the audio data is acquired, the audio data needs to be transmitted to the wireless audio playing device through bluetooth, and in order to ensure the speed of data transmission, the audio data needs to be encoded according to the bluetooth transmission protocol between the electronic device and the wireless audio playing device to form a format for user transmission, for example, the PCM is encoded into the SBC format, and in order to increase the transmission speed and increase the fault-tolerant rate of transmission, the audio data needs to be sampled and encoded, so as to reduce the size of the audio data and facilitate transmission. Similarly, for an increase in the encoding rate used for transmitting audio data, the sampling rate of audio data at the time of transmission may be increased or the compression rate at the time of encoding may be decreased.
The specific encoding rate used by the electronic device for transmitting the audio data to the wireless audio playing device may be set by the user, or may be set by the user actively, or may be an encoding rate used last time or an encoding rate with a higher number of times of use within a preset time period, for example, when the user connects the electronic device with the wireless audio playing device, the encoding rate for audio transmission is set, and the encoding rate is used as a default encoding rate, then when the electronic device transmits the audio data to the wireless audio playing device, the audio data is encoded and transmitted by using the default encoding rate.
S203: and according to the corresponding relation between the preset bandwidth and the encoding rate, improving the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment.
It is assumed that the electronic device encodes the audio data to generate audio data packets at the encoding rate when transmitting the audio data to the wireless audio playback device, and the sizes of the generated audio data packets are different at different encoding rates. For some data packets with large data volume, the bandwidth needs to be increased to send the data packets, otherwise, the bandwidth is too low, and the maximum data volume capable of being transmitted each time is too small, which may cause the phenomenon of stuttering when the audio is played due to too slow speed of the transmitted data.
As an embodiment, the bandwidth of the target data link between the electronic device and the wireless audio playing device may be increased according to a preset correspondence relationship between the bandwidth and the encoding rate, where in the correspondence relationship, the size of the bandwidth is positively correlated with the height of the encoding rate, that is, the larger the bandwidth is, the higher the encoding rate is.
Specifically, the correspondence is shown in table 1 below:
TABLE 1
Bandwidth of Coding algorithm
1MHz SBC
2MHz ACC
3MHz APTX
4MHz LDAC
As in table 1 above, SBC, ACC, APTX and LDAC are several different encoding algorithms, i.e., formats when audio data is transmitted through bluetooth, and in table 1 above, from top to bottom, the encoding rate gradually increases, i.e., the encoding rate: SBC < ACC < APTX < LDAC, and the corresponding bandwidth is also gradually increased.
Specifically, when audio data is sent to the wireless audio playing device by using bluetooth, bluetooth transmission parameters in the bluetooth module are configured, where the bluetooth transmission parameters include transmission power, transmission rate, bandwidth, and the like, and thus, the bandwidth of the target data link between the electronic device and the wireless audio playing device can be determined by reading the bluetooth transmission parameters.
Then, after determining the bandwidth corresponding to the encoding rate through the correspondence, for example, if the found bandwidth is greater than the current bandwidth, the current bandwidth is adjusted to the found bandwidth, for example, if the encoding algorithm corresponding to the encoding rate for transmitting the audio data to the wireless audio playing device is LDAC, the corresponding bandwidth is 4MHz, and if the current bandwidth is 2MHz, the 4MHz is greater than 2MHz, the current bandwidth is adjusted to 4 MHz.
As another embodiment, when the encoding rate for transmitting the audio data to the wireless audio playing device is determined, whether the encoding rate belongs to a preset encoding rate is determined, and if so, the bandwidth of the target data link between the electronic device and the wireless audio playing device is increased, specifically, the increased amplitude may be a preset fixed value, for example, a fixed increase of 4MHz, or may be adjusted according to the correspondence shown in table 1 above.
The preset encoding rate is encoding rates corresponding to several preset different types of encoding algorithms, for example, the preset encoding rate is APTX and LDAC, if the current encoding rate is SBC, the current encoding rate does not belong to the preset encoding rate, the bandwidth of the target data link between the electronic device and the wireless audio playing device does not need to be increased, and if the current encoding rate is LDAC, the current encoding rate belongs to the preset encoding rate, the bandwidth of the target data link between the electronic device and the wireless audio playing device is increased.
S204: and sending the audio data to the wireless audio playing equipment through the target data link with the increased bandwidth.
And after the audio data are coded according to the coding algorithm, generating an audio data packet, and sending the audio data packet to the wireless audio playing equipment through the target data link, so that the audio data can be sent to the wireless audio playing equipment.
Due to the fact that the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment is improved, the data volume of data which can be sent at each time is larger, the audio data can be sent to the wireless audio playing equipment more quickly, the wireless audio playing equipment can obtain the audio data continuously and at high speed, the phenomenon that the audio data are jammed in the playing process due to waiting for the receiving of the audio data is avoided, in addition, higher encoding rate can be supported, and the tone quality of the audio data is higher.
In addition, considering that when the communication frequency band used by the target data link between the electronic device and the wireless audio playback device is shared with other data links, the resource of the communication frequency band is occupied, and the bandwidth of the target data link is more likely to be insufficient, and therefore, the bandwidth of the target data link can be increased for the case that the communication frequency band is shared, specifically, as shown in fig. 3, the method includes: s301 to S305.
S301: when the electronic equipment is connected with the wireless audio playing equipment, whether an audio playing module of the electronic equipment receives a playing request of audio data is detected.
S302: an encoding rate for transmitting the audio data to the wireless audio playback device is determined.
S303: and determining a communication frequency band used by the target data link.
When the electronic device is connected with the external wireless device, the electronic device selects bluetooth, WiFi or other connection modes to send a connection request to the external wireless device, and then the external wireless device can be searched in a frequency band of a communication mode supported by the external wireless device, for example, when the electronic device turns on bluetooth, the external device which also turns on bluetooth can be searched in a communication frequency band corresponding to bluetooth, for example, 2.4 GHz.
Specifically, after the electronic device and the wireless audio playing device are connected, the electronic device can determine a communication mode used by the electronic device and the wireless audio playing device, for example, bluetooth, and data communication between the electronic device and the wireless audio playing device requires an antenna of the electronic device to transmit data to the wireless audio playing device or receive data transmitted by the wireless audio playing device, and frequency bands used by different communication modes are different, for example, 2.4GHz is used by bluetooth, and 2.4GHz or 5GHz can be used by WiFi. After a communication mode is selected, it can be determined that the communication frequency band corresponding to the communication mode, for example, bluetooth corresponds to 2.4GHz, and the electronic device has different frequency bands corresponding to routers or hotspots connected by WiFi, and the corresponding communication frequency bands are different, for example, after the electronic device turns on WiFi, it scans surrounding WiFi hotspots to obtain a WiFi list, as shown in fig. 4, and displays the identifiers of a plurality of hotspots in the list, where some hotspots correspond to 2.4GHz and some hotspots correspond to 5GHz, as shown in fig. 4, WiFi-1 corresponds to 2.4GHz and WiFi-1-5GHz corresponds to 5GHz, and the user selects WiFi-1, then the electronic device is connected with WiFi-1 by the communication frequency band of 2.4GHz, and if the user selects WiFi-1-5GHz, the electronic device is connected with the WiFi-1 through a communication frequency band of 5 GHz. Thus, the electronic device can determine the communication frequency band between the electronic device and the connected WiFi hotspot.
S304: and if other data links and the target data link share the communication frequency band, improving the bandwidth of the target data link between the electronic equipment and the wireless audio playing equipment according to the corresponding relation between the preset bandwidth and the encoding rate.
When the electronic equipment and the wireless audio playing equipment are determined, the connection mode between the electronic equipment and the wireless audio playing equipment and the target data link between the electronic equipment and the wireless audio playing equipment can be determined, and therefore the communication frequency band corresponding to the target data link between the electronic equipment and the wireless audio playing equipment can be determined. Then, it is determined whether other data links are using the communication band.
As one embodiment, the electronic device includes a Bluetooth module and a WiFi module.
The WiFi module is used for realizing connection with the WiFi access point and data interaction with the WiFi access point. Specifically, the communication connection may be established with the peripheral device through a Wireless Fidelity (WiFi) protocol (such as IEEE 802.10A, IEEE802.11b, IEEE802.11g, and/or IEEE802.11 n standards of the institute of electrical and electronics engineers), and the WiFi module may include a power amplifier, a Wireless transceiver, a transceiver switch, a low noise amplifier, an antenna, and the like. When sending signals, the transceiver itself will directly output a low-Power weak rf signal, which is sent to a Power Amplifier (PA) for Power amplification, and then radiated to the space through an Antenna (Antenna) by a Transmit/Receive Switch (Transmit/Receive Switch). When receiving signals, the antenna senses electromagnetic signals in the space, and the electromagnetic signals are sent to a Low Noise Amplifier (LNA) for amplification after passing through the switcher, so that the amplified signals can be directly sent to the transceiver for processing and demodulation. The WiFi module may use a first communication band and a second communication band, wherein the first communication band may be 2.4GHz, and the second communication band may be 5 GHz.
Similarly, the bluetooth module is used for realizing bluetooth connection between the electronic device and the bluetooth device and data interaction between the electronic device and the bluetooth device. Specifically, the bluetooth protocol may be used with the bluetooth device by 5.0/4.2/4.1/2.1/2.0, or may also be used by Bluetooth Low Energy (BLE), bluetooth Enhanced Data Rate (EDR), or bluetooth Basic Rate (BR). The basic circuit structure is similar to the WiFi module, and can also be composed of a power amplifier, a wireless transceiver, a transceiver switcher, a low noise amplifier, an antenna, and the like. The bluetooth module may use a first communication band.
When the bluetooth module and the WiFi module of the electronic device operate simultaneously and the WiFi module uses the first communication band, the bluetooth module and the WiFi module are caused to use the 2.4GHz communication band simultaneously, and therefore, as shown in fig. 5, the specific implementation of S304 may include steps S3041 to S3042.
When the electronic device is connected with the wireless audio playing device through the bluetooth, a target data link between the electronic device and the wireless audio playing device can be determined, and a communication frequency band corresponding to the target data link is determined to be changed into a first communication frequency band, namely a 2.4GHz communication frequency band.
Then, S3401 is executed again: and judging whether the WiFi module is using the first communication frequency band.
Whether the electronic device is connected with an external device (for example, a wireless router or the like) through the WiFi module is judged, and whether the used communication frequency band is a first communication frequency band, that is, a 2.4GHz communication frequency band is judged, if the used communication frequency band is the first communication frequency band, it is judged that the WiFi module is using the first communication frequency band, and if the used communication frequency band is not the first communication frequency band, for example, the used communication frequency band is a second communication frequency band, the step returns to re-execute S3401.
Since both the WiFi module and the bluetooth module use the first communication band, the bluetooth module and the WiFi module use one rf antenna at the same time, and the bandwidth of the first communication band is limited, for example, the bandwidth of the first communication band is 2.4GHz to 2.48GHz, WiFi is selected from one of 12 overlapping channels in the 22MHz bandwidth, and bluetooth hops among 79 1MHz channels at an average interval in the frequency band. Thus, regardless of which channel WiFi is using, there is mutual interference between the two. The WiFi may affect the transmission of the bluetooth, so that the bandwidth corresponding to the bluetooth cannot obtain the highest transmission value, and therefore, the bandwidth of the bluetooth needs to be increased, so as to increase the rate of output transmission between the bluetooth and the wireless audio playing device and the upper limit of the data amount that can be transmitted each time by the electronic device.
That is, when it is determined that the WiFi module is using the first communication band, S3402 is performed: and according to the corresponding relation between the preset bandwidth and the encoding rate, improving the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment.
Specifically, the bandwidth of the target data link between the electronic device and the wireless audio playing device can be increased according to a mode that the WiFi module and the bluetooth module share a 2.4GHz frequency band. For example, the mode sharing the 2.4GHz band includes time division multiplexing of the WiFi module and the bluetooth module, and the WiFi module and the bluetooth module may also use a certain frequency band respectively.
In one embodiment, the WiFi module and the Bluetooth module are time division multiplexed. Assuming that the data link corresponding to the WiFi module is a WiFi link and the target data link is between the electronic device and the wireless audio playing device, when the WiFi module and the bluetooth module of the electronic device use the 2.4GHz band simultaneously, the electronic device allocates different time points for using the 2.4GHz band to the target data link and the WiFi link, so that the target data link and the WiFi link use the 2.4GHz band alternately, that is, the WiFi module and the bluetooth module use the 2.4GHz antenna alternately. The time that the bluetooth module can be used determines the speed of data transmission between the electronic device and the wireless audio playing device through bluetooth, and the amount of data that can be transmitted in no second, i.e., the bandwidth.
Then, in this case, the implementation of increasing the bandwidth of the target data link between the electronic device and the wireless audio playing device may be to increase the time length that the target data link between the electronic device and the wireless audio playing device can use the 2.4GHz antenna, and accordingly, the time length that the WiFi link can use the 2.4GHz antenna may be reduced. For example, every second before the adjustment, time 1/3, the target data link uses a 2.4GHz antenna, while the remaining 2/3 time, the WiFi link uses a 2.4GHz antenna. After the adjustment, every second, at 2/3, the target data link uses 2.4GHz antenna, and the remaining 1/3 time, the WiFi link uses 2.4GHz antenna, so the target data link can transmit more time per second, and the amount of data that can be transmitted increases, i.e., the bandwidth increases.
As another embodiment, the WiFi module and the bluetooth module each use a part of the first communication frequency band, specifically, the frequency band used by the WiFi module is different from the frequency band used by the bluetooth module, and in some embodiments, the frequency band used by the WiFi module is not overlapped with the frequency band used by the bluetooth module. As shown in fig. 6, a schematic diagram of a frequency band used by the WiFi module and a frequency band used by the bluetooth module in the first communication frequency band is shown, where it is assumed that the frequency band used by the WiFi module is named as a WiFi frequency band, and the frequency band used by the bluetooth module, i.e. the frequency band of the target data link in the first communication frequency band is named as a bluetooth frequency band. As shown in fig. 6, the area denoted by p1 is the bandwidth of the bluetooth band, and the area denoted by p2 is the bandwidth of the WiFi band. Then p1 and p2 are two separate regions and do not interfere with each other. Then, as shown in fig. 6, the bluetooth band and the WiFi band are both continuous areas, but as another implementation, they may not be continuous areas, as shown in fig. 7, where the slashed area indicates the bandwidth of the WiFi band, and the other areas are the bandwidth of the bluetooth band.
Specifically, the bandwidth of the bluetooth frequency band is not necessarily larger than the bandwidth of the WiFi frequency band, as long as when the electronic device needs to encode the audio data by using the encoding algorithm with a high encoding rate and then transmit the encoded audio data to the wireless audio playing device, the bandwidth of the bluetooth frequency band can be sufficiently large to meet the requirement of the transmission speed of the audio data encoded by using the audio encoding algorithm with the encoding rate, that is, fig. 6 and 7 are only one embodiment, and do not limit the size relationship between the bandwidth of the bluetooth frequency band and the bandwidth of the WiFi frequency band.
In some embodiments, when the electronic device uses the WiFi module, in order to ensure that the speed of data transmitted using WiFi is not too slow, it is necessary to ensure that the bandwidth of WiFi satisfies a minimum value. Therefore, according to the preset correspondence between the bandwidth and the encoding rate, the specific implementation manner of increasing the bandwidth of the target data link between the electronic device and the wireless audio playing device is as follows: and acquiring the lowest bandwidth requirement of the WiFi module for using the first communication frequency band, and increasing the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment in the first communication frequency band according to the lowest bandwidth requirement of the WiFi module and the encoding rate.
The minimum bandwidth requirement of the WiFi module may be set by a user according to a requirement, for example, some downloaded software may set an upper limit and a lower limit for downloading when downloading, and the lower limit may be used as the minimum bandwidth requirement of the WiFi module. In addition, the data content can be set according to the data content required to be downloaded by the user, for example, when the user listens to the audio, the audio quality of the audio selected by the user is different, and the corresponding data volume is different, the data volume of the audio and the playing time of the audio are obtained, so that the data volume downloaded per second can be obtained, and the condition that when the user listens to the music, the audio data behind the current playing node is not timely buffered and downloaded to cause the playing pause is avoided. Therefore, the data amount of the data to be downloaded and the time length required for playing the data can be set according to, for example, 10M data, the playing time is 10 seconds, in order to avoid the card-pause bandwidth requirement being greater than or equal to 1M/S, i.e. the minimum bandwidth requirement of the WiFi module is 1M/S.
Then, according to the minimum bandwidth requirement and the encoding rate of the WiFi module, increasing the bandwidth of the target data link between the electronic device and the wireless audio playing device in the first communication frequency band, that is, when increasing the bandwidth of the target data link between the electronic device and the wireless audio playing device in the first communication frequency band, it is required to ensure that the bandwidth of the WiFi module in the first communication frequency band is not lower than the minimum bandwidth requirement of the WiFi module.
Specifically, a first sub-band region in the first communication band is configured to the WiFi module, where a bandwidth of the first sub-band region matches a minimum bandwidth requirement of the WiFi module. As shown in fig. 6, where the bandwidth of the region corresponding to p2 matches the minimum bandwidth requirement of the WiFi module, then the p2 corresponds to the first sub-band region in the first communication band. For example, the lowest bandwidth of the WiFi module is acbps, and the bandwidth of the first sub-band region in the first communication band is also acbps, thereby ensuring the lowest bandwidth requirement of the WiFi module.
Exemplarily, assuming that the total bandwidth of the first communication band is 100Mbps, the current bandwidths of the WiFi module and the bluetooth module are both 50Mbps, and the lowest bandwidth requirement of the WiFi module is 20Mbps, modifying the bandwidth of the WiFi module from 50Mbps to 20Mbps can modify the current bandwidth of the bluetooth module to 80Mbps, thereby increasing the bandwidth of the bluetooth module. Certainly, the bandwidth of the bluetooth module can also be increased to XMbps, wherein the value of X is greater than 50 and less than 80, for example, the bandwidth of the bluetooth module is increased to 70Mbps, so that not only the bandwidth of the bluetooth module can be increased, but also the excessive power consumption of the electronic device caused by the excessively high bandwidth of the bluetooth module can be avoided, in addition, a part of standby bandwidth can be reserved for the WiFi module, when the demand of the WiFi module for the bandwidth is increased, the bandwidth of the WiFi module can be properly increased, and meanwhile, the bandwidth of the bluetooth module is not affected.
Then, the frequency band region except the first sub-frequency band region in the first communication frequency band is a second sub-frequency band region, and then the bandwidth of the target data link in the second sub-frequency band region is increased according to the coding rate. That is to say, in the first communication frequency band, the area of the bandwidth which is the same as the lowest bandwidth of the WiFi module is configured to the WiFi module, and then, from the remaining area, that is, in the second sub-frequency band area, the frequency band is allocated to the bluetooth module according to the encoding rate, so that when the bandwidth is increased for the bluetooth module, the normal use of the bandwidth by the WiFi module is ensured, and the situation that the WiFi module cannot be used normally due to the fact that the bandwidth of the bluetooth module is increased without limitation is avoided.
Then if the bandwidth of the WiFi module before adjustment is large, the bandwidth of the WiFi module can be reduced to the minimum requirement by this way, while the bandwidth of the bluetooth is increased.
S305: and sending the audio data to the wireless audio playing equipment through the target data link with the increased bandwidth.
Therefore, when the WiFi module and the bluetooth module use the 2.4GHz antenna together, since the WiF module also uses the 2.4GHz communication band, the bandwidth that the bluetooth module can use can be limited, the bandwidth that the bluetooth module can use can be reduced, the bandwidth of the WiFi module is reduced, so that the upper limit value of the bandwidth that the bluetooth can improve is increased, that is, the bandwidth of the bluetooth module can be improved more.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
Specifically, on the basis of the foregoing embodiments, the method of the embodiments of the present application may also be applied to audio playing in a video to avoid asynchronous sound and picture, and specifically, referring to fig. 8, a data transmission method is shown and applied to an electronic device, and specifically, the method includes: s801 to S806.
S801: when the electronic equipment is connected with the wireless audio playing equipment, whether an audio playing module of the electronic equipment receives a playing request of audio data is detected.
S802: and determining the real-time performance level corresponding to the audio data.
Audio data exists at a real-time level, and some data have high real-time requirements, such as audio data in a voice chat or a video chat, or voice during a call, or audio played synchronously with video. Some data, for example, songs that are played, i.e., pure songs rather than videos, have low real-time requirements.
In one embodiment, an identifier of an application program corresponding to the audio data is determined, and then a real-time level of the audio data is determined according to the identifier of the application program. Specifically, an identifier of a target application program that sends the playback request of the audio data is determined, and then a type of the application program corresponding to the identifier of the target application program is determined.
After acquiring the identifier of the target application program, determining the type of the target application program according to the identifier, wherein the identifier of the target application program may be a package name, a name and the like of the application program. For example, the electronic device stores in advance the correspondence between the identifier of the application program and the category of the application program, as shown in table 2 below:
TABLE 2
Identification of applications Categories of applications
Apk1 Game machine
Apk2 Video
Apk3 Audio frequency
Thus, the application type corresponding to the target application can be specified based on the correspondence between the application identifier and the application type shown in table 2. For example, in the embodiment of the present application, a game screen of game software of an electronic device is played through a wireless audio playing device, where the game screen includes an image and music, and the music may be game music, game sound effects, and the like, and for example, the game sound effects may be a gunshot sound or a footstep sound. As an embodiment, the audio data may be a game sound, the application corresponding to the game sound is a certain game APP, the category to which the application belongs is a game type, and then the type of the audio data is determined according to the type of the application.
Then, the real-time level corresponding to the audio data is determined according to the type of the application program. Specifically, the real-time performance level corresponding to the type of the application program is stored in the electronic device, as shown in table 3 below:
TABLE 3
Identification of applications Categories of applications Level of real-time
Apk1 Game machine J1
Apk2 Video J2
Apk3 Audio frequency J3
Apk4 Social interaction J1
Thereby enabling the determination of the corresponding level of real-time of the audio data. In addition, if it is determined that the category of the application program corresponding to the audio data is audio, the application program capable of playing audio may also play video, and it is necessary to determine whether the audio data is audio in the video.
Specifically, in some embodiments, it is determined whether a video is currently being played, specifically, when the electronic device plays the video, audio data in the video is extracted and sent to an audio processing module in the system to invoke an audio processing circuit in the electronic device, that is, the audio data is sent to the audio processing circuit to perform operations such as encoding of the audio, so that after a play request of the audio data is received, it is determined whether the video is currently being played, and if so, it indicates that the audio to be currently played belongs to the audio data in the video currently being played, that is, the audio data belongs to the audio in the video.
In other embodiments, the process of playing the video by the electronic device includes, after data de-agreement and de-encapsulation, dividing into audio decoding and video decoding, sending the decoded audio data to the audio playing device for playing, and sending the video data to the video playing device for playing. Therefore, in order to facilitate the synchronous playing of the video and the audio, similar identifiers are set for the audio and the video frames in the video, for example, the audio and the video frames both use an identifier format of a + B, where a is a preamble and is used to indicate that the audio and the video frames belong to a certain video, and when the audio data to be played is acquired, whether the audio corresponds to a video frame, that is, whether the audio belongs to the audio in the video can be determined according to the format of the identifier of the audio data.
And if the type of the application program corresponding to the audio data is determined to be the audio type, determining whether the audio data is the audio in the video, and if so, determining to change the real-time performance level of the audio data to be the real-time performance level corresponding to the video type application program but not the real-time performance level corresponding to the audio type application program.
S803: and judging whether the real-time level is higher than a preset level.
And judging whether the real-time level of the audio data is greater than a preset level. The preset level is a preset real-time level corresponding to the type of audio playing delay reduction required, and can be set by a user according to requirements. For example, the preset level is J2 and above. If the real-time level corresponding to the audio data is J1, the real-time level of the audio data is greater than the preset level, otherwise, it is determined to be less than or equal to the preset level.
S804: an encoding rate for transmitting the audio data to the wireless audio playback device is determined.
S805: and according to the corresponding relation between the preset bandwidth and the encoding rate, improving the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment.
S806: and sending the audio data to the wireless audio playing equipment through the target data link with the increased bandwidth.
Therefore, the bandwidth of the target data link between the electronic equipment and the wireless audio playing equipment can be increased aiming at the audio data with high real-time performance level, so that the audio data can be sent to the wireless audio playing equipment more quickly.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
Referring to fig. 9, a data transmission apparatus 900 according to an embodiment of the present application is shown, where the apparatus is applied to the electronic device, and specifically, the apparatus includes: detection unit 901, determination unit 902, boosting unit 903, and transmission unit 904.
The detecting unit 901 is configured to detect whether the electronic device receives a playing request of audio data when the electronic device is connected to a wireless audio playing device.
The determining unit 902 is configured to determine, if a play request is received, an encoding rate corresponding to the audio data.
The increasing unit 903 is configured to increase a bandwidth of a target data link between the electronic device and the wireless audio playing device according to a preset correspondence between a bandwidth and a coding rate.
A sending unit 904, configured to send the audio data to the wireless audio playing device through the target data link with the increased bandwidth.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Referring to fig. 10, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a bluetooth module 140, a WiFi module 160, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall electronic device 100 using various interfaces and lines, and performs various functions of the electronic device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip. The processor 110 can control devices to which the WiFi module 160 and the bluetooth module 140 are connected. Therefore, the electronic equipment can be connected with the external equipment through WiFi or Bluetooth.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like. The memory 120 is also connected to the WiFi module 160 and the bluetooth module 140, and is used for storing data received by the WiFi module 160 and the bluetooth module 140, data to be transmitted, communication parameters, and the like.
The WiFi module 160 is used for implementing connection with a WiFi access point and data interaction with the WiFi access point. Specifically, the communication connection may be established with the peripheral device through a Wireless Fidelity (WiFi) protocol (such as IEEE 802.10A, IEEE802.11b, IEEE802.11g, and/or IEEE802.11 n standards of the institute of electrical and electronics engineers), and the WiFi module may include a power amplifier, a Wireless transceiver, a transceiver switch, a low noise amplifier, an antenna, and the like. When sending signals, the transceiver itself will directly output a low-Power weak rf signal, which is sent to a Power Amplifier (PA) for Power amplification, and then radiated to the space through an Antenna (Antenna) by a Transmit/Receive Switch (Transmit/Receive Switch). When receiving signals, the antenna senses electromagnetic signals in the space, and the electromagnetic signals are sent to a Low Noise Amplifier (LNA) for amplification after passing through the switcher, so that the amplified signals can be directly sent to the transceiver for processing and demodulation. The WiFi module 160 may use the first communication frequency band and the second communication frequency band, wherein the first communication frequency band may be 2.4GHz, and the second communication frequency band may be 5 GHz.
Similarly, the bluetooth module 140 is configured to implement bluetooth connection between the electronic device and the bluetooth device, and data interaction between the electronic device and the bluetooth device. Specifically, the bluetooth protocol may be used with the bluetooth device by 5.0/4.2/4.1/2.1/2.0, or may also be used by Bluetooth Low Energy (BLE), bluetooth Enhanced Data Rate (EDR), or bluetooth Basic Rate (BR). The basic circuit structure is similar to the WiFi module, and can also be composed of a power amplifier, a wireless transceiver, a transceiver switcher, a low noise amplifier, an antenna, and the like. The bluetooth module 140 may use the first communication band.
Referring to fig. 11, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 1100 has stored therein program code that can be called by a processor to perform the method described in the above-described method embodiments.
The computer-readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 1100 includes a non-volatile computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 1110 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (9)

1. A data transmission method, applied to an electronic device, the method comprising:
when the electronic equipment is connected with the wireless audio playing equipment, detecting whether an audio playing module of the electronic equipment receives a playing request of audio data;
if a playing request is received, determining the identifier of a target application program which sends the playing request of the audio data;
determining the type of the application program corresponding to the identification of the target application program;
determining a real-time level corresponding to the audio data according to the type of the target application program, wherein the real-time level is used for representing the requirement of the audio data on real-time;
judging whether the real-time level is higher than a preset level;
if the audio data is higher than the preset threshold value, determining the encoding rate for sending the audio data to the wireless audio playing equipment;
according to the corresponding relation between the preset bandwidth and the encoding rate, the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment is increased, wherein the bandwidth is the data volume which can be transmitted by the data link every second;
and sending the audio data to the wireless audio playing equipment through the target data link with the increased bandwidth.
2. The method of claim 1, wherein the increasing the bandwidth of the target data link between the electronic device and the wireless audio playback device according to the preset corresponding relationship between the bandwidth and the encoding rate comprises:
determining a communication frequency band used by the target data link;
and if other data links and the target data link share the communication frequency band, improving the bandwidth of the target data link between the electronic equipment and the wireless audio playing equipment according to the corresponding relation between the preset bandwidth and the encoding rate.
3. The method of claim 2, wherein the electronic device comprises a bluetooth module and a WiFi module, the bluetooth module can use a first communication frequency band, the WiFi module can use a first communication frequency band or a second communication frequency band, and the electronic device is connected to the wireless audio playing device through the bluetooth module;
if there are other data links sharing the communication frequency band with the target data link, then according to the corresponding relationship between the preset bandwidth and the encoding rate, the method for increasing the bandwidth of the target data link between the electronic device and the wireless audio playing device includes:
judging whether the WiFi module uses the first communication frequency band;
and if the first communication frequency band is used, improving the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment according to the corresponding relation between the preset bandwidth and the encoding rate.
4. The method of claim 3, wherein said increasing the bandwidth of the target data link between the electronic device and the wireless audio playback device according to the preset corresponding relationship between the bandwidth and the encoding rate comprises:
acquiring the lowest bandwidth requirement of the WiFi module for using the first communication frequency band;
and according to the lowest bandwidth requirement and the encoding rate of the WiFi module, increasing the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment in the first communication frequency band.
5. The method of claim 4, wherein said increasing the bandwidth of the target data link within the first communication band in accordance with the minimum bandwidth requirement of the WiFi module and the encoding rate comprises:
configuring a first sub-band region in the first communication band to the WiFi module, wherein the bandwidth of the first sub-band region is matched with the lowest bandwidth requirement of the WiFi module;
and increasing the bandwidth of the target data link in a second sub-frequency band region according to the coding rate, wherein the second sub-frequency band region is a frequency band region except the first sub-frequency band region in the first communication frequency band.
6. The method according to any one of claims 1 to 5,
in the corresponding relationship between the preset bandwidth and the coding rate, the size of the bandwidth is positively correlated with the height of the coding rate.
7. A data transmission apparatus, applied to an electronic device, the apparatus comprising:
the device comprises a detection unit, a processing unit and a processing unit, wherein the detection unit is used for detecting whether the electronic equipment receives a playing request of audio data or not when the electronic equipment is connected with wireless audio playing equipment;
the determining unit is used for determining the identifier of a target application program which sends the playing request of the audio data if the playing request is received; determining the type of the application program corresponding to the identification of the target application program; determining a real-time level corresponding to the audio data according to the type of the target application program, wherein the real-time level is used for representing the requirement of the audio data on real-time; judging whether the real-time level is higher than a preset level; if the audio data is higher than the preset threshold value, determining the encoding rate for sending the audio data to the wireless audio playing equipment;
the improving unit is used for improving the bandwidth of a target data link between the electronic equipment and the wireless audio playing equipment according to the corresponding relation between the preset bandwidth and the encoding rate, wherein the bandwidth is the data volume which can be transmitted by the data link every second;
and the sending unit is used for sending the audio data to the wireless audio playing equipment through the target data link with the bandwidth increased.
8. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-6.
9. A computer-readable storage medium having program code stored therein, the program code being invoked by a processor to perform the method of any of claims 1-6.
CN201810923390.8A 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium Active CN109150399B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810923390.8A CN109150399B (en) 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810923390.8A CN109150399B (en) 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN109150399A CN109150399A (en) 2019-01-04
CN109150399B true CN109150399B (en) 2021-04-13

Family

ID=64792974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810923390.8A Active CN109150399B (en) 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN109150399B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020147024A1 (en) * 2019-01-16 2020-07-23 深圳市大疆创新科技有限公司 Data transmission method and electronic device
CN110191461B (en) * 2019-06-14 2022-05-17 Oppo广东移动通信有限公司 Data transmission control method and device and electronic equipment
CN112995963A (en) * 2019-12-17 2021-06-18 中兴通讯股份有限公司 Bluetooth audio transmission method, device, terminal and readable storage medium
CN111432384B (en) * 2020-03-18 2023-05-09 合肥讯飞读写科技有限公司 Large-data-volume audio Bluetooth real-time transmission method for equipment with recording function
CN111552454B (en) * 2020-04-29 2023-10-27 广州酷狗计算机科技有限公司 Audio playing method, device, terminal and storage medium
CN111466910B (en) * 2020-04-30 2023-11-21 电子科技大学 Sleep monitoring method, system, storage medium, computer program and device
CN113157238A (en) * 2021-04-19 2021-07-23 深圳市艾酷通信软件有限公司 Audio playing method and device, earphone, electronic equipment and storage medium
CN113766306B (en) * 2021-04-21 2023-11-14 腾讯科技(北京)有限公司 Method, device, computer equipment and storage medium for detecting video clamping
CN113838470B (en) * 2021-09-15 2023-10-03 Oppo广东移动通信有限公司 Audio processing method, device, electronic equipment, computer readable medium and product
CN117597902A (en) * 2022-06-16 2024-02-23 北京小米移动软件有限公司 Audio processing system, method, electronic device and storage medium
CN115174538A (en) * 2022-06-30 2022-10-11 Oppo广东移动通信有限公司 Data transmission method and device, electronic equipment and computer readable medium
CN115482827A (en) * 2022-09-15 2022-12-16 哲库科技(上海)有限公司 Audio data transmission method and device and chip

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103354618A (en) * 2013-06-24 2013-10-16 西安交通大学 HLS-based multi-scenario streaming media adaptive live broadcast method
WO2015043161A1 (en) * 2013-09-26 2015-04-02 华为技术有限公司 Method and device for bandwidth extension
CN107170460A (en) * 2017-06-30 2017-09-15 深圳Tcl新技术有限公司 Sound quality adjusting method, system, host side and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102399798B1 (en) * 2015-10-07 2022-05-19 삼성전자주식회사 Adaptive communication method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103354618A (en) * 2013-06-24 2013-10-16 西安交通大学 HLS-based multi-scenario streaming media adaptive live broadcast method
WO2015043161A1 (en) * 2013-09-26 2015-04-02 华为技术有限公司 Method and device for bandwidth extension
CN107170460A (en) * 2017-06-30 2017-09-15 深圳Tcl新技术有限公司 Sound quality adjusting method, system, host side and storage medium

Also Published As

Publication number Publication date
CN109150399A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109150399B (en) Data transmission method and device, electronic equipment and computer readable medium
CN109445740B (en) Audio playing method and device, electronic equipment and storage medium
EP3629561B1 (en) Data transmission method and system, and bluetooth headphone
CN109246671B (en) Data transmission method, device and system
CN114726946B (en) Method for automatically switching Bluetooth audio coding modes, electronic equipment and readable storage medium
CN109257500B (en) Audio playing method and device, electronic equipment and storage medium
CN109445739B (en) Audio playing method and device, electronic equipment and computer readable medium
CN109274407B (en) Data transmission method, device, electronic equipment and storage medium
US10950238B2 (en) Bluetooth speaker base, method and system for controlling thereof
CN109041024B (en) Code rate optimization method and device, electronic equipment and storage medium
CN215187283U (en) Low wireless earphone receiver and wireless earphone that postpones
CN109151194B (en) Data transmission method, device, electronic equipment and storage medium
CN109379490B (en) Audio playing method and device, electronic equipment and computer readable medium
CN111199743A (en) Audio coding format determining method and device, storage medium and electronic equipment
CN109102816B (en) Encoding control method and device and electronic equipment
EP3745813A1 (en) Method for operating a bluetooth device
WO2020056751A1 (en) Transmission configuration method and apparatus, device, system, and storage medium
WO2024055583A1 (en) Audio data transmission method and apparatus, and chip
CN109298846B (en) Audio transmission method and device, electronic equipment and storage medium
CN109150400B (en) Data transmission method and device, electronic equipment and computer readable medium
CN115022766A (en) Audio data playing method and equipment
CN114501239A (en) Master-slave switching method and device of earphone, Bluetooth earphone and storage medium
CN117193685A (en) Screen projection data processing method, electronic equipment and storage medium
CN113708858A (en) Signal processing method and wireless network access equipment
CN113316129A (en) Method for acquiring coding and decoding capabilities in Bluetooth device and electronic device

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
GR01 Patent grant
GR01 Patent grant