[go: up one dir, main page]

CN109194998B - Data transmission method, apparatus, electronic device and computer readable medium - Google Patents

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

Info

Publication number
CN109194998B
CN109194998B CN201810925253.8A CN201810925253A CN109194998B CN 109194998 B CN109194998 B CN 109194998B CN 201810925253 A CN201810925253 A CN 201810925253A CN 109194998 B CN109194998 B CN 109194998B
Authority
CN
China
Prior art keywords
data
audio
electronic device
audio data
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
CN201810925253.8A
Other languages
Chinese (zh)
Other versions
CN109194998A (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 CN201810925253.8A priority Critical patent/CN109194998B/en
Publication of CN109194998A publication Critical patent/CN109194998A/en
Application granted granted Critical
Publication of CN109194998B publication Critical patent/CN109194998B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4126The peripheral being portable, e.g. PDAs or mobile phones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/647Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
    • H04N21/64723Monitoring of network processes or resources, e.g. monitoring of network load
    • H04N21/64738Monitoring network characteristics, e.g. bandwidth, congestion level

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请实施例公开了一种数据传输方法、装置、电子设备及计算机可读介质,涉及通信技术领域。该方法包括:当电子设备连接无线音频播放设备时,检测所述电子设备是否接收到音频数据的播放请求;若接收到播放请求,降低所述电子设备与所述无线音频播放设备之间的数据重传的上限次数;根据降低后的所述数据重传的上限次数,将所述音频数据发送至所述无线音频播放设备,指示所述无线音频播放设备播放所述音频数据。

Figure 201810925253

The embodiments of the present application disclose a data transmission method, an apparatus, an electronic device, and a computer-readable medium, which relate to the technical field of communications. The method includes: when an electronic device is connected to a wireless audio playback device, detecting whether the electronic device receives a playback request for audio data; if a playback request is received, reducing the data between the electronic device and the wireless audio playback device The upper limit number of retransmissions; according to the reduced upper limit number of data retransmissions, the audio data is sent to the wireless audio playback device, and the wireless audio playback device is instructed to play the audio data.

Figure 201810925253

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
At present, the inconvenience brought by wired earphones can be reduced by using wireless audio playing equipment to play audio data in electronic equipment, but due to the fact that audio is transmitted through wireless networks such as bluetooth, audio delay exists, particularly when video is played, audio in the video can be delayed, for example, the delay is about 100-plus-300 ms, and therefore the picture and the audio are not synchronous, for example, bullet sound in a gunfight game in a game picture is delayed, and the user experience is greatly reduced.
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, reducing the upper limit times of data retransmission between the electronic equipment and the wireless audio playing equipment; and sending the audio data to the wireless audio playing equipment according to the reduced upper limit times of data retransmission, and instructing the wireless audio playing equipment to play the audio data.
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, an adjustment 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 adjusting unit is used for reducing the upper limit times of data retransmission between the electronic equipment and the wireless audio playing equipment if a playing request is received. And the sending unit is used for sending the audio data to the wireless audio playing equipment according to the reduced upper limit times of data retransmission and instructing the wireless audio playing equipment to play the audio data.
In a third aspect, an embodiment of the present application further provides an electronic device, including a memory and a processor, where the memory is coupled with the processor; the memory stores instructions that, when executed by the processor, the processor performs the above-described method.
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 the electronic equipment is connected with the wireless audio playing equipment, whether the electronic equipment plays audio data or not is detected, when the electronic equipment plays audio, the upper limit times of data retransmission between the electronic equipment and the wireless audio playing equipment is reduced, then the audio data are sent to the wireless audio playing equipment according to the upper limit times of the data retransmission, and the wireless audio playing equipment is instructed to play the audio data. Therefore, the upper limit times of data retransmission is reduced, the time for prolonging the audio data to be received by the wireless earphone due to the data retransmission between the electronic equipment and the wireless audio playing equipment can be reduced, and the phenomenon that the received audio is too high in delay and the user experience is reduced is avoided.
Additional features and advantages of embodiments of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of embodiments of the present application. The objectives and other advantages of the embodiments of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
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 flow chart of a method of data transmission according to another embodiment of the present application;
FIG. 5 is a flow chart of a method of data transmission according to yet another embodiment of the present application;
fig. 6 shows a block diagram of a data transmission apparatus according to an embodiment of the present application;
FIG. 7 shows a block diagram of an electronic device provided by an embodiment of the present application;
fig. 8 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 9 shows a block diagram of an electronic device for performing the method provided by the embodiment of the present application.
Detailed Description
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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
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 wired earphones can be reduced by playing audio data in electronic equipment by using wireless audio playing equipment, but the inventor finds that, when the wireless audio playing equipment is used for playing audio, the audio is transmitted through a wireless network such as bluetooth, so that the audio has time delay, particularly when the video is played, the playing of a video picture is played after being analyzed by the electronic equipment, and the audio corresponding to the video needs to be transmitted to the wireless audio playing equipment after a series of operations such as coding and the like by the electronic equipment, and in the transmission process, the time delay exists, for example, the time delay is about 100 and 300ms, so that the picture and the audio are not synchronous, for example, the bullet sound in a gunfight game in a game picture is delayed, and the user experience is greatly reduced.
The inventor finds out in research that one reason for the above delay is that, due to the transmission between the electronic device and the wireless audio playing device via the bluetooth transmission protocol, in order to ensure the integrity of the data, when the data is sent from the sending end to the receiving end, if the receiving end receives the data, an identifier indicating that the data has been received, for example, a parameter variable, is fed back by the receiving end. If the receiving end does not receive the data and feeds back an identifier for indicating that the data is not received, the sending end sends the data once again, namely, the data is a retransmission mechanism under the Bluetooth transmission protocol. Although the mechanism can ensure that the data of the sending end is sent to the receiving end more completely, and the receiving end is prevented from missing the data, the data can be received by the receiving end in a delayed manner when the data is sent repeatedly, and meanwhile, the data after the data in the sending sequence can also be received in a delayed manner. If the retransmission mechanism is adopted when the wireless audio playing device plays the audio data sent by the electronic device, the audio signal is delayed, so that the picture and the audio are not synchronous, and the user experience is reduced.
Therefore, in order to solve the above problem, referring to fig. 2, an embodiment of the present application provides a data transmission method applied to an electronic device, and specifically, the method includes: s201 to S203.
S201: when the electronic equipment is connected with the wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data or not 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 is connected with an external Bluetooth device, a system of the electronic device acquires a state value indicating that the electronic device is currently connected with the Bluetooth device. Therefore, the electronic device can detect the connected 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.
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, whether the electronic device receives a playing request is detected, wherein the playing request is a request for requesting to play audio data.
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, whether the electronic device currently receives a playing request of audio data can be determined, 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 obtained playing button corresponding to the touch operation, the video to be played selected by the user can be determined, so that the playing request and the audio corresponding to the playing request can be obtained.
S202: and reducing the upper limit times of data retransmission between the electronic equipment and the wireless audio playing equipment.
If a play request is received, it indicates that the current electronic device is in a state of preparing to play audio data, and then an upper limit number of data retransmission between the electronic device and the wireless audio playing device is obtained, specifically, the upper limit number of data retransmission is related to a bluetooth protocol used between the electronic device and the wireless audio playing device, and the upper limit number of data retransmission corresponding to the protocol is generally a fixed numerical value corresponding to the protocol, for example, the upper limit number of data retransmission is 3.
In addition, when audio data is transmitted, the audio data is encoded into a plurality of audio data packets, and the plurality of audio data packets are sent to the wireless audio playing device according to a certain data sending sequence, specifically, whether a target audio data packet sent to the wireless audio playing device by the electronic device is lost is detected, where the target audio data packet is one of a plurality of data packets corresponding to the audio data to be played by the electronic device. If the state value is not received within a certain time, the electronic device determines that the wireless audio playing device has not successfully received the target audio data packet, that is, the target audio data packet sent to the wireless audio playing device by the electronic device is lost, and then determines whether the transmission times corresponding to the audio data packet are less than the upper limit times of data retransmission. The transmission times is the number of times of sending the target audio data packet, specifically, the number of times of sending the target audio data packet, during the process of sending the audio data to the wireless audio playing device by the electronic device this time, and the number of times of sending the target audio data packet is allowed to be modified as the sending times change, for example, a parameter value s is set, and the parameter value s is used for recording the number of times of sending the target audio data packet, that is, if 1 time is sent, s is 1. After the target data packet is successfully sent, s is cleared. Assuming a parameter value d, which is used to indicate the upper limit number of data retransmissions, e.g. the upper limit number of data retransmissions is 3, the parameter value d is 3. And comparing s with d to judge the size between the two.
If the transmission times corresponding to the audio data packets are judged to be less than the upper limit times of data retransmission, the target audio data packets are sent to the wireless audio playing equipment again; and if the target audio data packet is larger than or equal to the preset data transmission sequence, stopping transmitting the target audio data packet, and transmitting the audio data after the target audio data packet to the wireless audio playing equipment according to the preset data transmission sequence.
Specifically, it is assumed that packet 1, packet 2, packet 3, packet 4, packet 5, and the like are included in the data transmission sequence. Taking the target audio data packet as the data packet 1 as an example, after the data packet 1 fails to be transmitted, if the number of transmission times of the data packet 1 is greater than the upper limit number of data retransmission, the data packet 1 is discarded, and the data packet 2 and the subsequent data packets are continuously transmitted.
It can be seen that increasing the upper limit number of data retransmission can ensure the integrity of data transmission and avoid losing a certain data, while if decreasing the upper limit number of data retransmission, although a certain data will be lost, the acquisition delay of the data after the data will be reduced, for example, if the data packet 1 is immediately discarded after a transmission failure and the data packet 2 is transmitted, although the data packet 1 is lost, the data packet 2 can be quickly obtained without waiting until the data packet 1 is attempted to be transmitted again.
Therefore, in the embodiment of the present application, in order to reduce the delay of audio playing, the upper limit number of data retransmission between the electronic device and the wireless audio playing device is reduced. As an embodiment, the upper limit number of data retransmissions between the electronic device and the wireless audio playing device is modified to a preset number, where the preset number is 1 or 0, specifically, if the upper limit number of data retransmissions is greater than 1, the upper limit number of data retransmissions may be modified to 1 or 0, and if the upper limit number of data retransmissions is equal to 1, the upper limit number of data retransmissions may be modified to 0.
S203: and sending the audio data to the wireless audio playing equipment according to the reduced upper limit times of data retransmission, and instructing the wireless audio playing equipment to play the audio data.
Specifically, whether an audio data packet sent by the electronic device to the wireless audio playing device is lost is detected; if so, judging whether the transmission times corresponding to the audio data packet are less than the reduced upper limit times of data retransmission; if the number of the audio data packets is smaller than the preset number, the audio data packets are sent to the wireless audio playing equipment again; and if the number of the audio data packets is larger than or equal to the number of the audio data packets, stopping sending the audio data packets, and sending the audio data after the audio data packets to the wireless audio playing equipment according to a preset data sending sequence. The preset data transmission sequence is a transmission sequence of a plurality of data packets obtained by dividing audio data acquired by the electronic device, and the transmission data can be divided according to a time axis of audio playing.
In addition, it should be noted that, when the electronic device sends the non-audio data to the wireless audio playing device, the upper limit number of data retransmission used may be used instead of being reduced, and a default upper limit number may be used.
Therefore, by reducing the upper limit times of data retransmission, the time delay of sending the whole audio data to the wireless audio playing device due to the excessive times of retransmitting a certain data packet in the audio data can be avoided.
Specifically, on the basis of the foregoing embodiments, the method of the present application may also be applied to audio data playing corresponding to image data, so as to avoid asynchronous sound and picture, and specifically, referring to fig. 3, a data transmission method is shown, which is applied to an electronic device, and specifically, the method includes: s301 to S304.
S301: when the electronic equipment is connected with the wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data or not is detected.
S302: and judging whether the audio data belongs to the audio data played corresponding to the image data.
Specifically, the audio data may be data corresponding to an independent audio file, for example, a song or a recording in mp3 or flac format, or may be video data, specifically, the video data includes image data and audio data played corresponding to 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 frame of the image data corresponds to a playing time point of one audio data, and the image and the audio in the video can be separated by some software.
It is considered that if the audio data played corresponding to the image data is played with a delay, the audio and image data will be out of synchronization, which affects the viewing experience of the user. Therefore, after it is detected that the electronic device receives a play request of audio data, it is determined whether the audio data belongs to audio data played corresponding to the image data.
As an embodiment, an identifier of an application program that sends the playback request of the audio data may be obtained, whether the identifier of the application program belongs to audio-only software or video-only software may be determined, and if the identifier belongs to video-only software, whether the audio data belongs to audio data that is played in correspondence with the image data may be determined.
As another example, since there is some software that can play both video and pure audio, judging whether the audio data belongs to the audio data played corresponding to the image data by judging whether the video is played currently, specifically, when the electronic device plays the video, extracting the audio data played corresponding to the image data and sending the audio data to an audio processing module in the system to call an audio processing circuit in the electronic device, that is, the audio data is sent to the audio processing circuit for audio encoding and other operations, so that after receiving a play request of the audio data, it is determined whether the video is currently being played, if yes, it means that the audio to be played currently belongs to the audio data in the video being played currently, that is, the audio data belongs to the audio data played corresponding to the image data.
In another embodiment, the electronic device performs video playing procedures including data de-agreement and de-encapsulation, then performs audio decoding and image decoding, sends the decoded audio data to the audio playing device for playing, and sends the image data to the video playing device for playing. Therefore, in order to facilitate synchronous playing of images and audio, similar identifiers are set for audio data and video frames played corresponding to image data, for example, the audio and video frames both use an identifier format of a + B, where a is a preamble and is used to indicate that the audio and video frames belong to a certain video, and when the audio data to be played is acquired, whether the audio corresponds to an image frame, that is, whether the audio belongs to the audio data played corresponding to the image data can be determined according to the format of the identifier of the audio data.
After determining that the audio data belongs to the audio data played corresponding to the image data, operation S303 is performed.
In addition, considering that in different video types, not all videos need to reduce the upper limit number of data retransmissions to transmit the audio data corresponding to the video, specifically, if the audio data belongs to the audio data played corresponding to the image data, a specific implementation manner of reducing the upper limit number of data retransmissions between the electronic device and the wireless audio playing device may be: if the audio data belong to the audio data played corresponding to the image data, determining the video type of the target video corresponding to the audio data, and judging whether the video type is a preset video type; and if the video type is the preset video type, reducing the upper limit times of data retransmission between the electronic equipment and the wireless audio playing equipment.
Specifically, the target video corresponding to the audio data is determined, and specifically, the target audio matching the identifier of the audio data may be determined according to the identifier of the audio data, such as the identifier format of a + B described above, where a is a preamble and is used to indicate that a video belongs to a certain video. Thus, the target video corresponding to the audio data can be determined. Then, the type of the target video is determined, specifically, the video includes summary information, the content of the video can be determined through the summary information, and it is convenient to classify the video and find the video through the summary information, specifically, the summary information may be an image of a certain frame in the video, or may be a text description. The type of the video can be determined according to the summary information, for example, the content indicated by the summary information includes description of the video content, and the type of the video is determined according to the video content, for example, the type of the video can be a game type, a movie, a television series, a video call, and the like.
In addition, after the audio data is determined to belong to the audio data played corresponding to the image data, the target video corresponding to the audio data is determined, then the application program corresponding to the target video is determined, and the video type of the target video is determined according to the application program. Specifically, the implementation manner of determining the video type of the target video corresponding to the audio is as follows: determining a target video corresponding to the audio data, determining the type of an application program playing the target video, and determining the video type of the target video according to the type of the application program.
Specifically, after acquiring the identifier of the application program of the target video, the type of the application program is determined according to the identifier, wherein the identifier of the 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 1 below:
TABLE 1
Identification of applications Categories of applications
Apk1 Game machine
Apk2 Video
Apk3 Audio frequency
Thus, the type of the application program corresponding to the target video can be specified from the correspondence between the application program identifier and the type of the application program shown in table 1. 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 video type of the target video is determined according to the type of the application, specifically, the type of the application may be taken as the video type of the target video, for example, the type of the application is a game, and the video type of the target video is also a game.
In one embodiment, the type of the application may be a type set for the application by a developer of the application when the developer of the application is open, or a type set for the application by a user after the application is installed on the electronic device. Which category the application belongs to in particular may be set by the user as desired, for example, the user may set a certain social software to an audio category, or to a video category, or to a social category.
In addition, application installation software, such as Appstore in ios systems, is installed in the electronic device. An application list is provided within the application installation software where the user can download applications and update and open applications, and the application installation software can display different applications by category, such as audio, video, or game. Therefore, the user can already know the category of the application when installing the application using the application installation software. Furthermore, if some application programs can play video and can also play audio, the type of the application program is set as the video type if the application program supports the function of video playing, and the type of the application program is set as the audio type if the application program does not support the function of video playing but only supports the function of audio playing. Specifically, whether the application supports the video playing function or not may be determined by determining whether the application supports the video playing function according to the function description included in the function description information of the application, for example, the supported playing format, or by detecting whether the video playing module is played in the program module of the application, for example, a certain video playing codec algorithm, and the like.
As another embodiment, if some application programs can play video and audio, for example, some video playing software can play audio-only files and also video, the category of the application program can be determined according to the usage record of the application program, that is, according to the usage record of the application program within a certain period of time, it is determined whether the user tends to play video or more tends to play audio by using the application program.
Specifically, operation behavior data of all users of the application program within a preset time period is obtained, where all users refer to all users who have installed the application program, and the operation behavior data may be obtained from a server corresponding to the application program, that is, when a user uses the application program, the user logs in the application program using a user account corresponding to the user, and the operation behavior data corresponding to the user account is sent to the server corresponding to the application program, and the server stores the obtained operation behavior data in correspondence with the user account. In some embodiments, the electronic device sends an operation behavior query request for an application program to a server corresponding to the application program, and the server sends operation behavior data of all users within a certain preset time period to the electronic device.
The operation behavior data comprises the name and time of the played audio file and the name and time of the played video file, the number and total time of the audio file played by the application program in a certain preset time period can be determined by analyzing the operation behavior data, the number and total time of the video file played by the application program can also be obtained, the category of the application program is determined according to the ratio of the total playing time of the audio and video files in the preset time period, specifically, the ratio of the total playing time of the audio and video files in the preset time period is obtained, for convenience of description, the ratio of the total playing time of the audio file in the preset time period is recorded as the audio playing ratio, the ratio of the total playing time of the video file in the preset time period is recorded as the video playing ratio, if the video playing ratio is greater than the audio playing ratio, the category of the application program is set as the video type, and if the audio play proportion is greater than the video play proportion, the category of the application program is set as the audio type. For example, if the preset time period is 30 days, that is, 720 hours, and the total playing time of the audio file is 200 hours, the audio playing proportion is 27.8%, and the total playing time of the video file is 330 hours, the video playing proportion is 45.8%, and the video playing proportion is greater than the audio playing proportion, the category of the application program is set as the video type.
In other embodiments, the electronic device sends a category query request for the application program to the server, and the server determines the audio playing proportion and the video playing proportion according to the operation behavior data corresponding to the application program, which is obtained in advance, and determines the category of the application program according to a size relationship between the audio playing proportion and the video playing proportion, which may specifically refer to the foregoing description.
After the video type of the target video is determined, whether the video type is a preset video type is judged, wherein the preset video type is a type which is preset and needs to reduce audio playing delay, and can be set by a user according to requirements, for example, the preset video type can be a game type, a video type and the like. If the video type is a preset video type, S303 is performed.
S303: and reducing the upper limit times of data retransmission between the electronic equipment and the wireless audio playing equipment.
S304: and sending the audio data to the wireless audio playing equipment according to the reduced upper limit times of data retransmission, and instructing the wireless audio playing equipment to play the audio data.
Therefore, in the embodiment of the present application, the transmission of audio data in a video being played can be reduced by the upper limit number of data retransmission, so as to reduce the delay of audio data, for example, a video includes a plurality of video frames and a segment of voice, where the voice is "i am a chinese and i am a country", the voice is broken into a plurality of data packets "i am", and if "i am" is not successfully transmitted, that is, the wireless audio playing device does not receive, in the prior art, an electronic device will transmit once again after the failure of this transmission of "i am", until the transmission is successful or the number of transmissions reaches the upper limit number of data retransmission, whereas in the method provided in the embodiment of the present application, the electronic device will transmit once again after the failure of this transmission of "i am", regardless of whether this transmission is successful or not, the method does not repeatedly send the 'my yes', or directly abandons sending the 'my yes' after the failure of sending the 'my yes' this time, but continues to send the 'Chinese' after the 'my yes'. Therefore, although the user cannot hear the 'my yes' because the 'my yes' is not successfully transmitted, if the 'Chinese', 'I love', 'My country' can be transmitted successfully, the user can quickly hear the 'Chinese' and the subsequent voice, and the pictures corresponding to the voice can be ensured to be synchronous when the 'Chinese', 'I love', 'My country' are played.
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.
In addition, considering that some audio is not video, but the real-time performance of the audio itself is high, if there is a high delay, the user experience is too low, so to overcome this drawback, please refer to fig. 4, which shows a data transmission method, including: s401 to S405.
S401: when the electronic equipment is connected with the wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data or not is detected.
S402: and determining the real-time performance level corresponding to the audio data.
And if the playing request of the audio data is received, determining the real-time level of the audio data. 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 an application program that sends the play request of the audio data is determined, and in determining a type of the application program corresponding to the identifier of the application program, reference may be made to the above-described embodiment.
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 2 below:
TABLE 2
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
According to the corresponding relation, the real-time performance level corresponding to the audio data can be determined. For example, if the identifier of the application program corresponding to the audio data is Apk4, the corresponding category is social, and the corresponding real-time level is J1. Of these, J1 is ranked the highest, and next, J2 and J3 decrease in order.
S403: and judging whether the real-time level of the audio data meets a preset level or not.
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 satisfies a preset level, and then S404 is performed.
If the real-time level corresponding to the audio data is J3, and the real-time level of the audio data does not meet the preset level, the method may be ended, or the step of S302 may be executed, so that, if a certain application is a newly installed application and the real-time level is not set, it may be further determined whether the upper limit number of data retransmission between the electronic device and the wireless audio playing device needs to be reduced through the operation of S302.
Alternatively, S302 may be executed before step S402 is executed, and S402 may be executed when the audio data belongs to audio data played in correspondence with the image data as a result of the determination at S302.
S405: and sending the audio data to the wireless audio playing equipment according to the reduced upper limit times of data retransmission, and instructing the wireless audio playing equipment to play the audio data.
The determination of the real-time level of the audio data may be performed after the determination result of S302 is yes, or the determination of the real-time level may be performed before S302 is performed.
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.
In view of the fact that when the channel quality of a channel for transmitting data between an electronic device and the wireless audio playing device is different, the number of retransmissions may be different, for example, when the channel quality is good, the number of retransmissions is large, and when the channel quality is poor, the number of retransmissions is small, and therefore, the reduction range of the upper limit number of data retransmissions between the electronic device and the wireless audio playing device may be adjusted based on the channel quality, specifically, referring to fig. 5, a data transmission method provided by an embodiment of the present application is shown, and specifically, the method includes: s501 to S504.
S501: when the electronic equipment is connected with the wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data or not is detected.
S502: and acquiring the channel quality of a channel for transmitting data between the electronic equipment and the wireless audio playing equipment.
The channel quality may be an error vector magnitude of a channel, a number of access points, a signal strength, and the like. An Error Vector Magnitude (EVM) is a Vector difference between an ideal Error-free reference signal and an actually transmitted signal at a given time, and is used for measuring an amplitude Error and a phase Error of a modulated signal, and the EVM specifically indicates a proximity degree of an IQ component generated when a receiving terminal demodulates the signal and an ideal signal component, and is an index for considering the quality of the modulated signal. The smaller the EVM, the better the channel quality of the channel. The number of the access points can also acquire the access points on each channel when the channels are scanned, so that the number of the access points on each channel can be determined, and the larger the number of the access points is, the worse the channel quality is, and vice versa, the better the channel quality is. Similarly, the signal strength can also be obtained during channel scanning, and the higher the signal strength is, the higher the channel quality is, and vice versa, the lower the channel quality is.
When entering a new network environment, the mobile terminal scans a plurality of supported channels according to a preset channel scanning sequence, and in the scanning process of each channel, a wireless access point on the channel can be obtained, so that the channel where each wireless access point is located can be determined. Therefore, the channel where the connected wireless audio playing equipment is located can be determined, and the error vector magnitude corresponding to the channel is further obtained.
S503: and reducing the upper limit times of data retransmission between the electronic equipment and the wireless audio playing equipment according to the channel quality.
The channel quality is inversely proportional to the reduction amplitude of the upper limit number of data retransmission between the electronic device and the wireless audio playing device, that is, the higher the channel quality is, the smaller the reduction amplitude is, the smaller the channel quality is, the larger the reduction amplitude is, therefore, when the channel quality is higher, the speed of data transmission is faster, the time consumed by retransmission is shorter, in order to ensure the integrity of data, multiple retransmission times can be considered, that is, the reduction amplitude of the upper limit number of data retransmission is smaller, whereas if the channel quality is poorer, the speed of data transmission is likely to be lower, in order to ensure the timeliness of data transmission, the reduction amplitude of the upper limit number of data retransmission is larger, that is, the upper limit number of initial data retransmission is 3, if the number of times needs to be reduced, and if the channel quality is poorer, the upper limit number of times is reduced to 1, if the channel quality is good, the upper limit number is reduced to 2.
S504: and sending the audio data to the wireless audio playing equipment according to the reduced upper limit times of data retransmission, and instructing the wireless audio playing equipment to play the audio data.
It should be noted that, the above-mentioned S502 and S503 are specific embodiments of how to reduce the upper limit number of times of data retransmission between the electronic device and the wireless audio playing device, and they can be regarded as specific embodiments of S202 in fig. 2, S303 in fig. 3, and S404 in fig. 4, which can be combined with the above-mentioned embodiments.
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. 6, a data transmission apparatus provided in an embodiment of the present application is shown, specifically, the apparatus includes: detection section 601, adjustment section 602, and transmission section 603.
The detecting unit 601 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.
An adjusting unit 602, configured to reduce an upper limit number of data retransmissions between the electronic device and the wireless audio playing device if a playing request is received.
A sending unit 603, configured to send the audio data to the wireless audio playing device according to the reduced upper limit number of times of data retransmission, and instruct the wireless audio playing device to play the audio data.
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. 7, an electronic device provided by an embodiment of the present application is shown, which includes a memory 104 and a processor 102, where the memory 104 is coupled to the processor 102; the memory 104 stores instructions that, when executed by the processor 102, the processor 102 performs the above-described method.
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. 8, based on the above method and apparatus, the embodiment of the present application further provides an electronic device 100, and for example, the electronic device 100 may be any of various types of computer system devices that are mobile or portable and perform wireless communication (only one form is exemplarily shown in fig. 8). Specifically, the electronic device 100 may be a mobile phone or a smart phone (e.g., an iPhone (TM) based, Android (TM) based phone), a Portable game device (e.g., a Nintendo DS (TM), a PlayStation Portable (TM), a Game Advance (TM), an iPhone (TM)), a laptop, a PDA, a Portable Internet device, a music player and a data storage device, other handheld devices and head-mounted devices such as a watch, a headset, a pendant, a headset, etc., and the electronic device 100 may also be other wearable devices (e.g., a head-mounted device (HMD) such as electronic glasses, electronic clothing, an electronic bracelet, an electronic necklace, an electronic tattoo, an electronic device, or a smart watch).
The electronic device 100 may also be any of a number of electronic devices including, but not limited to, cellular phones, smart phones, other wireless communication devices, personal digital assistants, audio players, other media players, music recorders, video recorders, cameras, other media recorders, radios, medical devices, vehicle transportation equipment, calculators, programmable remote controllers, pagers, laptop computers, desktop computers, printers, netbook computers, Personal Digital Assistants (PDAs), Portable Multimedia Players (PMPs), moving Picture experts group (MPEG-1 or MPEG-2) Audio layer 3(MP3) players, portable medical devices, and digital cameras, and combinations thereof.
In some cases, electronic device 100 may perform multiple functions (e.g., playing music, displaying videos, storing pictures, and receiving and sending telephone calls). If desired, the electronic device 100 may be a portable device such as a cellular telephone, media player, other handheld device, wrist watch device, pendant device, earpiece device, or other compact portable device.
The electronic device 100 includes an electronic main body 10, and the electronic main body 10 includes a housing 12 and a main display 120 disposed on the housing 12. The housing 12 may be made of metal, such as steel or aluminum alloy. In this embodiment, the main display 120 generally includes a display panel 111, and may also include a circuit or the like for responding to a touch operation performed on the display panel 111. The Display panel 111 may be a Liquid Crystal Display (LCD) panel, and in some embodiments, the Display panel 111 is a touch screen 109.
Referring to fig. 9, in an actual application scenario, the electronic device 100 may be used as a smartphone terminal, in which case the electronic body 10 generally further includes one or more processors 102 (only one is shown in the figure), a memory 104, an RF (Radio Frequency) module 106, an audio circuit 110, a sensor 114, an input module 118, and a power module 122. It will be understood by those skilled in the art that the structure shown in fig. 9 is merely illustrative and is not intended to limit the structure of the electronic body 10. For example, the electronics body section 10 may also include more or fewer components than shown in FIG. 9, or have a different configuration than shown in FIG. 8.
Those skilled in the art will appreciate that all other components are peripheral devices with respect to the processor 102, and the processor 102 is coupled to the peripheral devices through a plurality of peripheral interfaces 124. The peripheral interface 124 may be implemented based on the following criteria: universal Asynchronous Receiver/Transmitter (UART), General Purpose Input/Output (GPIO), Serial Peripheral Interface (SPI), and Inter-Integrated Circuit (I2C), but the present invention is not limited to these standards. In some examples, the peripheral interface 124 may comprise only a bus; in other examples, the peripheral interface 124 may also include other elements, such as one or more controllers, for example, a display controller for interfacing with the display panel 111 or a memory controller for interfacing with a memory. These controllers may also be separate from the peripheral interface 124 and integrated within the processor 102 or a corresponding peripheral.
The memory 104 may be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 104. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the electronic body portion 10 or the primary display 120 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The RF module 106 is configured to receive and transmit electromagnetic waves, and achieve interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. The RF module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF module 106 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communication (GSM), Enhanced Mobile Communication (Enhanced Data GSM Environment, EDGE), wideband Code division multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (WiFi) (e.g., Institute of Electrical and Electronics Engineers (IEEE) standard IEEE 802.10A, IEEE802.11 b, IEEE802.11g, and/or IEEE802.11 n), Voice over internet protocol (VoIP), world wide internet for Microwave Access (Wi-11), and any other suitable protocol for short message Communication (sms), including, but not limited to, short message Access (wimax), and may even include those protocols that have not yet been developed.
The audio circuitry 110, earpiece 101, sound jack 103, microphone 105 collectively provide an audio interface between a user and the electronic body portion 10 or the main display 120. Specifically, the audio circuit 110 receives sound data from the processor 102, converts the sound data into an electrical signal, and transmits the electrical signal to the earpiece 101. The earpiece 101 converts the electrical signal into sound waves that can be heard by the human ear. The audio circuitry 110 also receives electrical signals from the microphone 105, converts the electrical signals to sound data, and transmits the sound data to the processor 102 for further processing. Audio data may be retrieved from the memory 104 or through the RF module 106. In addition, audio data may also be stored in the memory 104 or transmitted through the RF module 106.
The sensor 114 is disposed in the electronic body portion 10 or the main display 120, examples of the sensor 114 include, but are not limited to: light sensors, pressure sensors, acceleration sensors 114F, proximity sensors 114J, and other sensors.
In particular, the light sensor may comprise a light line sensor. The light sensor can adjust the brightness of the screen according to the light of the environment where the electronic equipment is located. For example, in a well-lit area, the screen may be bright, whereas in a dark area, the screen may be dark (depending on the brightness setting of the screen), which both protects the eyes and saves power.
Among them, the pressure sensor may detect a pressure generated by pressing on the electronic device 100. That is, the pressure sensor detects pressure resulting from contact or depression between the user and the electronic device, such as contact or depression between the user's ear and the electronic device. Thus, the pressure sensor may be used to determine whether contact or pressure has occurred between the user and the electronic device 100, as well as the magnitude of the pressure.
Referring to fig. 8 again, in the embodiment shown in fig. 8, the light sensor and the pressure sensor are disposed adjacent to the display panel 111. The light sensor may turn off the display output by the processor 102 when an object is near the main display 120, for example, when the electronic body portion 10 is moved to the ear.
As one of the motion sensors, the acceleration sensor 114F can detect the magnitude of acceleration in various directions (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping) and the like for recognizing the posture of the electronic device 100. In addition, the electronic body 10 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer and a thermometer, which are not described herein,
in this embodiment, the input module 118 may include the touch screen 109 disposed on the main display 120, and the touch screen 109 may collect touch operations of the user (for example, operations of the user on or near the touch screen 109 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. Optionally, the touch screen 109 may include a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 102, and can receive and execute commands sent by the processor 102. In addition, the touch detection function of the touch screen 109 may be implemented by various types, such as resistive, capacitive, infrared, and surface acoustic wave.
The main display 120 is used to display information input by a user, information provided to the user, and various graphic user interfaces of the electronic body section 10, which may be composed of graphics, text, icons, numbers, video, and any combination thereof, and in one example, the touch screen 109 may be provided on the display panel 111 so as to be integrated with the display panel 111.
The power module 122 is used to provide power supply to the processor 102 and other components. Specifically, the power module 122 may include a power management system, one or more power sources (e.g., batteries or ac power), a charging circuit, a power failure detection circuit, an inverter, a power status indicator light, and any other components associated with the generation, management, and distribution of power within the electronic body portion 10 or the primary display 120.
The electronic device 100 further comprises a locator 119, the locator 119 being configured to determine an actual location of the electronic device 100. In this embodiment, the locator 119 implements the positioning of the electronic device 100 by using a positioning service, which is understood to be a technology or a service for obtaining the position information (e.g., longitude and latitude coordinates) of the electronic device 100 by using a specific positioning technology and marking the position of the positioned object on the electronic map.
To sum up, according to the data transmission method, the data transmission device, the electronic device, and the computer-readable medium provided in the embodiments of the present application, when the electronic device is connected to the wireless audio playback device, it is detected whether the electronic device is playing audio data, when the electronic device is playing audio, the upper limit number of times of data retransmission between the electronic device and the wireless audio playback device is reduced, and then the audio data is sent to the wireless audio playback device according to the upper limit number of times of data retransmission, so as to instruct the wireless audio playback device to play the audio data. Therefore, the upper limit times of data retransmission is reduced, the time for prolonging the audio data to be received by the wireless earphone due to the data retransmission between the electronic equipment and the wireless audio playing equipment can be reduced, and the phenomenon that the received audio is too high in delay and the user experience is reduced is avoided.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments. In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
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 (5)

1.一种数据传输方法,其特征在于,应用于电子设备,所述方法包括:1. a data transmission method, is characterized in that, is applied to electronic equipment, described method comprises: 当电子设备连接无线音频播放设备时,检测所述电子设备是否接收到音频数据的播放请求;When the electronic device is connected to the wireless audio playback device, detecting whether the electronic device receives a playback request for audio data; 若接收到播放请求,判断所述音频数据是否属于与图像数据对应播放的音频数据;If a playback request is received, determine whether the audio data belongs to the audio data played corresponding to the image data; 若属于,则确定发送所述音频数据的播放请求的应用程序的标识;If it belongs, then determine the identifier of the application that sends the playback request of the audio data; 确定所述应用程序的标识所对应的应用程序的类型;determining the type of the application corresponding to the identifier of the application; 根据所述应用程序的类型确定音频数据对应的实时性级别;Determine the real-time level corresponding to the audio data according to the type of the application; 若所述实时性级别满足预设级别,则降低所述电子设备与所述无线音频播放设备之间的数据重传的上限次数;If the real-time level satisfies a preset level, reducing the upper limit number of data retransmissions between the electronic device and the wireless audio playback device; 根据降低后的所述数据重传的上限次数,将所述音频数据发送至所述无线音频播放设备,指示所述无线音频播放设备播放所述音频数据。Send the audio data to the wireless audio playback device according to the reduced upper limit of the data retransmission times, and instruct the wireless audio playback device to play the audio data. 2.根据权利要求1所述的方法,其特征在于,所述降低所述电子设备与所述无线音频播放设备之间的数据重传的上限次数,包括:2. The method according to claim 1, wherein the reducing the upper limit times of data retransmission between the electronic device and the wireless audio playback device comprises: 若接收到播放请求,将所述电子设备与所述无线音频播放设备之间的数据重传的上限次数修改为预设数值。If a playback request is received, the upper limit number of data retransmissions between the electronic device and the wireless audio playback device is modified to a preset value. 3.一种数据传输装置,其特征在于,应用于电子设备,所述装置包括:3. A data transmission device, characterized in that, applied to electronic equipment, the device comprising: 检测单元,用于当电子设备连接无线音频播放设备时,检测所述电子设备是否接收到音频数据的播放请求;a detection unit, configured to detect whether the electronic device receives a playback request of audio data when the electronic device is connected to the wireless audio playback device; 调整单元,用于若接收到播放请求,判断所述音频数据是否属于与图像数据对应播放的音频数据;若属于,则确定发送所述音频数据的播放请求的应用程序的标识;确定所述应用程序的标识所对应的应用程序的类型;根据所述应用程序的类型确定音频数据对应的实时性级别;若所述实时性级别满足预设级别,则降低所述电子设备与所述无线音频播放设备之间的数据重传的上限次数;an adjustment unit, used to determine whether the audio data belongs to the audio data played corresponding to the image data if a playback request is received; if so, determine the identifier of the application program that sends the playback request of the audio data; determine the application The type of the application program corresponding to the identifier of the program; determine the real-time level corresponding to the audio data according to the type of the application program; if the real-time level satisfies the preset level, then reduce the electronic device and the wireless audio playback The upper limit of the number of data retransmissions between devices; 发送单元,用于根据降低后的所述数据重传的上限次数,将所述音频数据发送至所述无线音频播放设备,指示所述无线音频播放设备播放所述音频数据。A sending unit, configured to send the audio data to the wireless audio playback device according to the reduced upper limit number of data retransmissions, and instruct the wireless audio playback device to play the audio data. 4.一种电子设备,其特征在于,包括存储器和处理器,所述存储器与所述处理器耦合;所述存储器存储指令,当所述指令由所述处理器执行时,所述处理器执行所述权利要求1-2任一项所述方法。4. An electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor; the memory stores instructions, and when the instructions are executed by the processor, the processor executes The method of any one of claims 1-2. 5.一种计算机可读介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行所述权利要求1-2任一项所述方法。5. A computer-readable medium, wherein a program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the method of any one of claims 1-2 .
CN201810925253.8A 2018-08-14 2018-08-14 Data transmission method, apparatus, electronic device and computer readable medium Active CN109194998B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN109194998A CN109194998A (en) 2019-01-11
CN109194998B true CN109194998B (en) 2021-05-11

Family

ID=64921771

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN109194998B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110958484B (en) * 2019-12-13 2021-12-07 深圳市爱图仕影像器材有限公司 Audio data transmitting and receiving method and device, audio data transmission system and storage medium
CN113472764B (en) * 2021-06-24 2024-03-08 深圳市亚昱科技有限公司 Electronic device and audio transmission method
CN115567086B (en) * 2022-09-09 2024-03-26 安克创新科技股份有限公司 Audio transmission device, audio playing device and audio transmission and synchronization system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101416510A (en) * 2006-03-29 2009-04-22 索尼爱立信移动通讯有限公司 Method and system for managing audio data
CN101964996A (en) * 2010-01-18 2011-02-02 华为终端有限公司 Method and devices for optimizing wireless data transmission
CN102340389A (en) * 2011-09-30 2012-02-01 歌尔声学股份有限公司 Wireless digital communication method
CN104221317A (en) * 2012-06-04 2014-12-17 松下知识产权经营株式会社 Transmission device, reception device, transmission method, and reception method
CN105451164A (en) * 2015-11-30 2016-03-30 深圳市金立通信设备有限公司 Data transmission control method, device and system and relevant equipment
JP2016082245A (en) * 2014-10-09 2016-05-16 Kddi株式会社 Radio communication apparatus, radio communication method, and radio communication program
CN106470472A (en) * 2015-08-18 2017-03-01 Gn瑞声达A/S Method of exchanging data packets of different sizes between first and second portable communication devices
US9729630B2 (en) * 2004-06-04 2017-08-08 Apple Inc. System and method for synchronizing media presentation at multiple recipients
CN108111194A (en) * 2018-02-09 2018-06-01 南京中感微电子有限公司 Bluetooth communication method and system, and Bluetooth receiving method and device
CN108337074A (en) * 2018-06-22 2018-07-27 恒玄科技(上海)有限公司 The bluetooth headset wireless communications method of high reliability

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8423854B2 (en) * 2009-03-02 2013-04-16 Clearwire Ip Holdings Llc Communication retransmission based on transmission performance relative to expected quality of service
JP5931815B2 (en) * 2013-08-20 2016-06-08 株式会社東芝 COMMUNICATION CONTROL DEVICE, COMMUNICATION CONTROL METHOD, AND PROGRAM
CN104243111B (en) * 2014-09-01 2017-12-26 广州华多网络科技有限公司 A kind of method and apparatus of packet transmission
CN105812439B (en) * 2014-12-31 2019-10-25 华为技术有限公司 Audio transmission method and device
CN105827849A (en) * 2016-04-28 2016-08-03 维沃移动通信有限公司 Method for adjusting sound effect and mobile terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9729630B2 (en) * 2004-06-04 2017-08-08 Apple Inc. System and method for synchronizing media presentation at multiple recipients
CN101416510A (en) * 2006-03-29 2009-04-22 索尼爱立信移动通讯有限公司 Method and system for managing audio data
CN101964996A (en) * 2010-01-18 2011-02-02 华为终端有限公司 Method and devices for optimizing wireless data transmission
CN102340389A (en) * 2011-09-30 2012-02-01 歌尔声学股份有限公司 Wireless digital communication method
CN104221317A (en) * 2012-06-04 2014-12-17 松下知识产权经营株式会社 Transmission device, reception device, transmission method, and reception method
JP2016082245A (en) * 2014-10-09 2016-05-16 Kddi株式会社 Radio communication apparatus, radio communication method, and radio communication program
CN106470472A (en) * 2015-08-18 2017-03-01 Gn瑞声达A/S Method of exchanging data packets of different sizes between first and second portable communication devices
CN105451164A (en) * 2015-11-30 2016-03-30 深圳市金立通信设备有限公司 Data transmission control method, device and system and relevant equipment
CN108111194A (en) * 2018-02-09 2018-06-01 南京中感微电子有限公司 Bluetooth communication method and system, and Bluetooth receiving method and device
CN108337074A (en) * 2018-06-22 2018-07-27 恒玄科技(上海)有限公司 The bluetooth headset wireless communications method of high reliability

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Evaluating Bluetooth Low Energy Suitability for Time-Critical Industrial IoT Applications;Raul Rondon,Mikael Gidlund,Krister Landernas;《Int J Wireless Inf Networks》;20170523;全文 *

Also Published As

Publication number Publication date
CN109194998A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
CN109274405B (en) Data transmission method, apparatus, electronic device and computer readable medium
CN107464557B (en) Call recording method and device, mobile terminal and storage medium
CN109062535B (en) Voice control method, device, electronic device and computer readable medium
CN112997471B (en) Audio path switching method and apparatus, readable storage medium, and electronic equipment
WO2020006711A1 (en) Message playing method and terminal
CN112689191B (en) Screen projection control method, terminal and computer readable storage medium
WO2015043505A1 (en) Method, apparatus, and system for sending and receiving social network information
CN106330211B (en) LTE frequency band selection method and device
CN106940997B (en) Method and device for sending voice signal to voice recognition system
CN109194998B (en) Data transmission method, apparatus, electronic device and computer readable medium
CN106791916B (en) Method, device and system for recommending audio data
CN106506437B (en) Audio data processing method and device
WO2017215661A1 (en) Scenario-based sound effect control method and electronic device
WO2016029351A1 (en) Method and terminal for processing media file
WO2019076250A1 (en) Push message management method and related products
CN113805837A (en) Audio processing method, mobile terminal and storage medium
CN113596904B (en) Transmission methods and equipment for non-periodic positioning reports
CN106850949A (en) Voice call method, device and mobile terminal
CN105281811A (en) Voice data transmission processing method and terminal
CN114639392A (en) Audio processing method and device, electronic equipment and storage medium
US11477591B2 (en) Audio data processing method, terminal device, and storage medium
CN108901062A (en) wireless communication transmission method, device, mobile terminal and computer readable storage medium
CN113132440B (en) Audio transmission method, audio transmission system and electronic equipment
CN108848566B (en) Wireless communication transmission method, device, mobile terminal, and computer-readable storage medium
CN106713668B (en) Method and device for controlling vibration of terminal

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