CN111586152B - Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device - Google Patents

Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device Download PDF

Info

Publication number
CN111586152B
CN111586152B CN202010366265.9A CN202010366265A CN111586152B CN 111586152 B CN111586152 B CN 111586152B CN 202010366265 A CN202010366265 A CN 202010366265A CN 111586152 B CN111586152 B CN 111586152B
Authority
CN
China
Prior art keywords
data packet
data
receiving
sending
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
CN202010366265.9A
Other languages
Chinese (zh)
Other versions
CN111586152A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202010366265.9A priority Critical patent/CN111586152B/en
Publication of CN111586152A publication Critical patent/CN111586152A/en
Application granted granted Critical
Publication of CN111586152B publication Critical patent/CN111586152B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Reverberation, Karaoke And Other Acoustics (AREA)

Abstract

The disclosure relates to a playing method and device of Bluetooth transmission data and a sending method and device of Bluetooth transmission data. The Bluetooth data playing method is applied to receiving equipment, the receiving equipment is connected with transmitting equipment through Bluetooth, and the method comprises the following steps: receiving a data packet sent by a sending device by an independent data receiving thread, and storing the data packet in a buffer storage area of the receiving device, wherein the data packet comprises a data packet at a current playing position and a data packet after the current playing position, and the data packet is audio data and/or video data; and playing the data packet. By caching the data packet at the current playing position and the data packet which is not played after the current playing position, the playing delay is reduced, the playing synchronization between the receiving equipment and the sending equipment is ensured, the receiving equipment can still maintain normal playing when the Bluetooth signal is bad, the sound interruption and the blocking are avoided, and the user experience is improved.

Description

Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device
Technical Field
The present disclosure relates to the field of data transmission, and in particular, to a method for playing bluetooth transmission data, a device for playing bluetooth transmission data, a method for transmitting bluetooth transmission data, a device for transmitting bluetooth transmission data, an electronic device, and a computer readable storage medium.
Background
Bluetooth (Bluetooth), a wireless technology standard, can implement short-range data exchange between fixed devices, mobile devices and the building personal area network (using UHF radio waves in the ISM band of 2.4-2.485 GHz). In the current bluetooth data transmission, under the condition that the bluetooth signal is poor, the playing fluency of the receiving device on the multimedia data is affected. When the distance between the sending equipment and the receiving equipment is far, or the electromagnetic interference of the wireless transmission environment is strong, the music playing of the receiving equipment can have the problem of sound interruption, and the video playing can have the problems of frame skip and clamping. This problem is currently a common problem with bluetooth devices.
Taking audio data as an example, the current bluetooth audio data transmission is generally based on an A2DP (Advanced Audio Distribution Profile, bluetooth audio transmission model protocol) transmission protocol, and the transmitting device compresses and encodes the audio data currently being played by the music player, and transmits the encoded audio data to the receiving device through the bluetooth antenna. The receiving equipment decodes the received audio compressed data and sends the decoded audio compressed data to the loudspeaker for playing.
Since the transmitting device only transmits audio data currently being played to the receiving device. The receiving device buffers the audio data through a small buffer memory (typically, the buffer memory holds only a few hundred milliseconds of audio data) and then plays it by the loudspeaker. Once the wireless transmission signal is degraded, the receiving device cannot receive more audio data in time, all the audio data in the buffer storage area are played, and no audio data remains, and then the receiving device can generate sound interruption.
In addition, when the current bluetooth playing device plays, the current playing device needs to wait to receive the data currently being played, and play the data after the buffer storage area is full, so that the playing progress of the bluetooth device has a certain delay relative to the playing progress on the control device (such as an intelligent mobile terminal or a PC), the playing progress is tens of milliseconds, hundreds of milliseconds, and the playing of the two devices is asynchronous, thereby affecting the user experience.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method for playing bluetooth transmission data, a device for playing bluetooth transmission data, a method for transmitting bluetooth transmission data, a device for transmitting bluetooth transmission data, an electronic device, and a computer readable storage medium.
According to a first aspect of embodiments of the present disclosure, there is provided a method for playing bluetooth transmission data, applied to a receiving device, where the receiving device is connected to a transmitting device through bluetooth, the method includes: receiving a data packet sent by a sending device by an independent data receiving thread, and storing the data packet in a buffer storage area of the receiving device, wherein the data packet comprises a data packet at a current playing position and a data packet after the current playing position, and the data packet is audio data and/or video data; and playing the data packet.
In one embodiment, receiving a data packet sent by a sending device includes: when the buffer storage area does not have more residual space for storing the data packet, stopping receiving the new data packet, and feeding back the insufficient space information to the sending equipment so as to enable the sending equipment to pause sending the data packet; when the buffer memory area regains enough space to store the data packet, the space sufficient information is fed back to the sending device, so that the sending device continues to send the data packet.
In one embodiment, receiving a data packet sent by a sending device includes: performing data verification on each received data packet; if the verification fails, the verification failure information is fed back to the sending equipment, so that the sending equipment resends the data packet with the verification failure.
In one embodiment, playing the data packet includes: and a separate playing control thread receives the control command sent by the sending device and controls the playing operation of the data packet according to the control command.
In one embodiment, the data packet includes a display time stamp position, and the controlling the playing operation of the data packet according to the control command includes: the control command comprises a display time stamp position of command execution; searching a display time stamp position of command execution in a buffer storage area; and starting from the data packet corresponding to the display timestamp position of the command execution, and executing the playing operation corresponding to the control command.
In one embodiment, controlling the packet playing operation according to the control command further includes: if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, the data request information is fed back to the sending device, and the sending device starts to send the data packet from the display time stamp position of the command execution.
In one embodiment, the data packet does not include a display time stamp position, and the controlling the playing operation of the data packet according to the control command includes: emptying the buffer storage area; after receiving the data packet sent by the sending device, starting from the starting position of the buffer storage area, executing the playing operation corresponding to the control command.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for transmitting bluetooth transmission data, applied to a transmitting device, where the transmitting device and a receiving device are connected through bluetooth, the method including: dividing a file to be played into a plurality of data packets, wherein the data packets comprise data packets at the current playing position and data packets which are not played after the current playing position, and the data packets are audio data and/or video data; and transmitting the data packet to the receiving device by a separate data transmitting thread, so that the receiving device stores the data packet in a buffer storage area and plays the data packet.
In one embodiment, transmitting a data packet to a receiving device includes: when receiving insufficient space information fed back by the receiving device because the buffer storage area does not have more residual space for storing the data packet, suspending sending the data packet; and when receiving the space sufficiency information fed back by the receiving device because the buffer storage area reacquires enough space to store the data packet, continuing to send the data packet.
In one embodiment, transmitting a data packet to a receiving device includes: and when receiving the verification failure information fed back by the sending equipment due to the verification failure of the data packet, retransmitting the data packet with the verification failure.
In an embodiment, the method further comprises: and a separate command sending thread sends a control command to the receiving device, so that the receiving device controls the data packet playing operation according to the control command.
In one embodiment, the data packet includes a display timestamp position, and the method includes sending a control command to the receiving device, so that the receiving device controls the playing operation of the data packet according to the control command, including: the control command comprises a display time stamp position of command execution, so that the receiving device searches the display time stamp position of command execution in a buffer storage area, starts from a data packet corresponding to the display time stamp position of command execution, and executes play operation corresponding to the control command.
In an embodiment, the method further includes sending a control command to the receiving device, so that the receiving device controls the playing operation of the data packet according to the control command, and further includes: and receiving data request information fed back by the receiving device because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, and sending the data packet from the display time stamp position of the command execution.
In an embodiment, the data packet does not include a display timestamp position, and the method includes sending a control command to the receiving device, so that the receiving device controls the data packet to play according to the control command, including: the control command enables the receiving device to empty the buffer storage area, and after the receiving device receives the transmitted data packet, the receiving device starts from the starting position of the buffer storage area and executes the playing operation corresponding to the control command.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
According to a third aspect of the embodiments of the present disclosure, there is provided a playing device for bluetooth transmission data, applied to a receiving device, where the receiving device is connected to a transmitting device through bluetooth, and the device includes: the data receiving unit is used for receiving the data packet sent by the sending equipment through a single data receiving thread and storing the data packet in a buffer storage area of the receiving equipment, wherein the data packet comprises a data packet at the current playing position and a data packet after the current playing position, and the data packet is audio data and/or video data; and the play control unit is used for playing the data packet.
In an embodiment, the data receiving unit is further configured to: when the buffer storage area does not have more residual space for storing the data packet, stopping receiving the new data packet, and feeding back the insufficient space information to the sending equipment so as to enable the sending equipment to pause sending the data packet; when the buffer memory area regains enough space to store the data packet, the space sufficient information is fed back to the sending device, so that the sending device continues to send the data packet.
In an embodiment, the data receiving unit is further configured to: performing data verification on each received data packet; if the verification fails, the verification failure information is fed back to the sending equipment, so that the sending equipment resends the data packet with the verification failure.
In an embodiment, the play control unit is further configured to: and receiving the control command sent by the sending equipment through a single play control thread, and controlling the play operation of the data packet according to the control command.
In an embodiment, the data packet includes a display timestamp position, and the play control unit is further configured to: the control command comprises a display time stamp position of command execution; searching a display time stamp position of command execution in a buffer storage area; and starting from the data packet corresponding to the display timestamp position of the command execution, and executing the playing operation corresponding to the control command.
In an embodiment, the play control unit is further configured to: if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, the data request information is fed back to the sending device, and the sending device starts to send the data packet from the display time stamp position of the command execution.
In an embodiment, the data packet does not include a display time stamp location, and the play control unit is further configured to: emptying the buffer storage area; after receiving the data packet sent by the sending device, starting from the starting position of the buffer storage area, executing the playing operation corresponding to the control command.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a transmitting apparatus for bluetooth transmission data, applied to a transmitting device, the transmitting device and a receiving device being connected through bluetooth, the apparatus comprising: the transmission preparation unit is used for dividing a file to be played into a plurality of data packets, wherein the data packets comprise data packets at the current playing position and data packets which are not played after the current playing position, and the data packets are audio data and/or video data; and the data transmitting unit is used for transmitting the data packet to the receiving equipment through a single data transmitting thread, so that the receiving equipment stores the data packet in the buffer storage area and plays the data packet.
In an embodiment, the data transmission unit is further configured to: when receiving insufficient space information fed back by the receiving device because the buffer storage area does not have more residual space for storing the data packet, suspending sending the data packet; and when receiving the space sufficiency information fed back by the receiving device because the buffer storage area reacquires enough space to store the data packet, continuing to send the data packet.
In an embodiment, the data transmission unit is further configured to: and when receiving the verification failure information fed back by the sending equipment due to the verification failure of the data packet, retransmitting the data packet with the verification failure.
In an embodiment, the apparatus further comprises: and the command sending unit is used for sending a control command to the receiving device through a single command sending thread, so that the receiving device controls the data packet playing operation according to the control command.
In an embodiment, the data packet includes a display timestamp position, and the command sending unit is further configured to: the control command comprises a display time stamp position of command execution, so that the receiving device searches the display time stamp position of command execution in the buffer storage area, starts from a data packet corresponding to the display time stamp position of command execution, and executes playing operation corresponding to the control command.
In an embodiment, the command sending unit is further configured to: and receiving data request information fed back by the receiving device because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, and sending the data packet from the display time stamp position of the command execution.
In an embodiment, the data packet does not include a display timestamp position, and the command sending unit is further configured to: the control command enables the receiving device to empty the buffer memory area, and after receiving the transmitted data packet, the receiving device starts from the starting position of the buffer memory area and executes the playing operation corresponding to the control command.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
According to a fifth aspect of embodiments of the present disclosure, there is provided a receiving apparatus including: a memory for storing instructions; and a processor for invoking the instructions stored in the memory to perform the method of playing the bluetooth transmission data of the first aspect.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a transmitting apparatus including: a memory for storing instructions; and a processor for invoking the instructions stored in the memory to perform the method of transmitting bluetooth transmission data of the second aspect.
According to a seventh aspect of embodiments of the present disclosure, a computer readable storage medium stores instructions that, when executed by a processor, perform the method of playing bluetooth transmission data of the first aspect.
According to an eighth aspect of embodiments of the present disclosure, a computer-readable storage medium stores instructions that, when executed by a processor, perform the method of transmitting bluetooth transmission data of the second aspect.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: by caching the data packet at the current playing position and the data packet which is not played after the current playing position, the playing delay is reduced, the playing synchronization between the receiving equipment and the sending equipment is ensured, the receiving equipment can still maintain normal playing when the Bluetooth signal is bad, the sound interruption and the blocking are avoided, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart illustrating a method for playing bluetooth transmission data according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method for transmitting bluetooth transmission data according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating another method for transmitting bluetooth transmission data according to an exemplary embodiment.
Fig. 4 is a schematic block diagram illustrating a playback apparatus for bluetooth transmission data according to an exemplary embodiment.
Fig. 5 is a schematic block diagram illustrating a transmitting apparatus of bluetooth transmission data according to an exemplary embodiment.
Fig. 6 is a schematic block diagram of another transmitting apparatus for bluetooth transmission data according to an exemplary embodiment.
Fig. 7 is a schematic block diagram of an apparatus according to an example embodiment.
Fig. 8 is a schematic block diagram of an electronic device, according to an example embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The present disclosure provides a playing method 10 of bluetooth transmission data, which is applied to a receiving device, where the receiving device is connected with a sending device through bluetooth, where the receiving device may be a playing device such as a sound box, a display screen, a television, and the sending device may be a terminal device such as a mobile phone, a tablet computer, and a desktop computer, and the receiving device receives and plays audio and video data transmitted by the sending device. The Bluetooth connection is very convenient, but the playing fluency of audio and video data is greatly influenced by the condition of Bluetooth signals, and the playing synchronicity of two devices is poor, for example, the progress bar on the sending device or the video progress is inconsistent with the audio playing progress of the receiving device. For this reason, the method 10 for playing bluetooth transmission data according to the embodiments of the present disclosure, as shown in fig. 1, includes step S11, step S12:
step S11: and a single data receiving thread receives the data packet sent by the sending device and stores the data packet in a buffer storage area of the receiving device, wherein the data packet comprises the data packet at the current playing position and the data packet after the current playing position, and the data packet is audio data and/or video data.
When the Bluetooth signal is good, the receiving device continuously receives the data and caches the data in the buffer storage area according to the playing sequence. The playing start position and the following data can be pre-stored before playing, and when the playing needs to be started, the receiving device can immediately start playing from the data of the playing start position, so that the playing progress synchronization of the sending device is realized. And when the Bluetooth signal transmission fluctuates and becomes poor, normal play can be maintained for a certain time, and audio break and video clip are avoided.
Step S12: and playing the data packet.
Taking audio playing as an example, before playing, because a buffer storage area already stores certain data, when a user starts playing, a loudspeaker can directly read the data from the buffer memory to start playing, and the need of waiting for enough audio data to be buffered is avoided. Because the data after the playing position is continuously received, when the Bluetooth signal is good, the playing speed of the loudspeaker is lower than the Bluetooth transmission speed, and the data is always kept in the buffer storage area to wait for playing; when the Bluetooth signal fluctuates and becomes poor, even if the playing speed is higher than the transmission speed, the loudspeaker still plays enough data in a certain time, so that the smoothness of playing is ensured.
The receiving device establishes a single thread to be specially responsible for receiving the Bluetooth data, so that the Bluetooth data is distinguished from other task processing, parallel processing is realized, and the Bluetooth data is ensured to be received and cached in time.
In one embodiment, step S11 includes: when the buffer storage area does not have more residual space for storing the data packet, stopping receiving the new data packet, and feeding back the insufficient space information to the sending equipment so as to enable the sending equipment to pause sending the data packet; when the buffer memory area regains enough space to store the data packet, the space sufficient information is fed back to the sending device, so that the sending device continues to send the data packet.
In this embodiment, when the buffer storage area of the receiving device does not have more remaining space, the receiving device stops receiving new data, feeds back the sending device, pauses sending data, and continues sending the following data until the buffer storage area has enough space, thereby ensuring that the buffer storage area cannot overflow when the bluetooth signal is good, and also enabling the sending device to timely transmit the data ready for playing, and ensuring that the buffer storage area has sufficient data. In this embodiment, if the sending device does not actively query the storage space, the receiving device actively sends feedback information according to more remaining space in the buffer storage area, and the sending device reacts according to the feedback information, where the control right of the transmission process is at the receiving device.
In an embodiment, step S11 further includes: and continuously receiving the residual space inquiry requests sent by the sending equipment, and feeding back insufficient space information or sufficient space information for each residual space inquiry request.
In this embodiment, the sending device actively queries the storage space, and the receiving device feeds back the control right of the transmission process to the sending device according to the received request.
In one embodiment, step S11 includes: performing data verification on each received data packet; if the verification fails, the verification failure information is fed back to the sending equipment, so that the sending equipment resends the data packet with the verification failure.
In this embodiment, the receiving device performs data verification on each received data packet, the transmitting device may add a check code into each data packet, the receiving device calculates the check code of the received data packet, determines whether the transmission of the data packet is correct by determining whether the two are identical, and if the two values are identical, it indicates that the transmitted data is complete and has not been tampered, so that the data packet can be used with confidence, and specifically, MD5 check or CRC check can be adopted. Through the verification-retransmission process, the damage of the data packet caused by the fluctuation of the Bluetooth signal or the tampering of the data packet by a malicious program can be avoided.
In an embodiment, the playing method 10 of bluetooth transmission data, step S12 may further include:
a separate play control thread receives the control command sent by the sending device and controls the play operation of the data packet according to the control command.
In this embodiment, after receiving the control command of the sending device, the receiving device may take out the data from the buffer storage area in order from the data at the play start position according to the play position indicated by the command, and start playing. The receiving device may begin playing without waiting to buffer enough audio data. After receiving the control command, the receiving device needs to timely feed back the control success of the transmitting device, and if the transmitting device does not receive the feedback within a certain time, the receiving device transmits the control command again.
In this embodiment, the receiving device establishes an independent thread to be specially responsible for playing control according to the received control command, so that the receiving device is distinguished from other task processing data receiving threads including receiving bluetooth data, parallel processing is realized, and timely execution of the control command is ensured.
In one embodiment, the data packet includes a display timestamp location, and step S12 includes: the control command comprises a display time stamp position of command execution; searching a display time stamp position of command execution in a buffer storage area; and starting from the data packet corresponding to the display time stamp position of the command execution, playing the data packet in the buffer storage area.
In this embodiment, for playback control of data streams, including audio stream playback and video stream playback, a data stream control method with presentation time stamps (PTS, presentation time stamp) is used. In the data flow control mode with the display time stamp, each data packet of a file to be played is sequentially added with the display time stamp to serve as a packet header, a sending device sends the data packet to a receiving device according to the time sequence of the display time stamp, and the receiving device stores the received data packet in a buffer storage area according to the time sequence of the display time stamp. The transmitting device transmits the display time stamp of the command execution position to the receiving device each time the transmitting device transmits the control command. For example: and after receiving the command, the receiving equipment finds the data of the display time stamp position from the buffer storage area and takes the data out for the loudspeaker to play, and the fast-forward command of the audio can lead the receiving equipment to directly jump to the corresponding display time stamp position in the buffer storage area to start playing. Thus, the receiving device can directly play from the existing data in the buffer storage area without waiting, and the delay of the control command effect is shortened.
In an embodiment, step S12 further includes: if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, the data request information is fed back to the sending device, and the sending device starts to send the data packet from the display time stamp position of the command execution.
In this embodiment, if the data corresponding to the display timestamp position is not in the buffer storage area, the sending device needs to be requested to retransmit the data packet from the display timestamp position, so as to ensure that the data to be played currently can be played in time.
In one embodiment, the data packet does not include a display timestamp location, and step S12 includes: emptying the buffer storage area; after receiving the data packet sent by the sending device, playing the data packet in the buffer storage area from the starting position of the buffer storage area.
In this embodiment, for the play control of the data stream, a data stream control mode without a display time stamp is used, and display time stamp information does not need to be added in the data packet. Each time the transmitting device executes a start play, fast forward, fast reverse command, the receiving device cannot know whether these audio data are already pre-stored in the buffer memory area because the time stamp location information is not displayed. The transmitting device needs to retransmit data to the receiving device from the new playing position, and the receiving device needs to empty the buffer memory area and start to continuously store and play from the starting position of the buffer memory area. Although some data may already be in the buffer memory area and still need to be retransmitted, the flow control process in this way is simpler.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
In this embodiment, the playing position of the playing start command is at the position where the playing was paused before or at the starting position of a certain audio or video data, the playing position of fast forward is after the current playing position, and the playing position of fast backward is before the current playing position.
According to the playing method 10 for the Bluetooth transmission data, the playing delay is reduced by caching the data packet at the current playing position and the data packet which is not played after the current playing position, playing synchronization between the receiving equipment and the sending equipment is guaranteed, when the Bluetooth signal is bad, the receiving equipment can still maintain normal playing, sound interruption and jamming are avoided, and user experience is improved.
Under the same inventive concept, corresponding to the playing method 10 of bluetooth transmission data, the present disclosure provides a sending method 20 of bluetooth transmission data, which is applied to a sending device, where the sending device and a receiving device are connected through bluetooth. As shown in fig. 2, the method 20 for sending bluetooth transmission data according to the embodiment of the present disclosure includes steps S21 and S22:
Step S21: dividing a file to be played into a plurality of data packets, wherein the data packets comprise data packets at the current playing position and data packets which are not played after the current playing position, and the data packets are audio data and/or video data.
Before playing, the audio or video file to be played is divided into a plurality of data packets, and the data packets with equal playing time length can be divided, wherein the data at the current playing position and the data which are not played after the current playing position are packaged, so that preparation is made for Bluetooth data transmission.
Step S22: and transmitting the data packet to the receiving device through a separate data transmission thread, so that the receiving device stores the data packet in a buffer memory area and plays the data packet.
When the Bluetooth signal is good, the sending device continuously sends data, the playing start position and the later data can be prestored before playing are received, and when the playing needs to be started, the receiving device can immediately start playing from the data of the playing start position, so that the playing progress synchronization of the sending device is realized. And when the Bluetooth signal transmission fluctuates and becomes poor, normal play can be maintained for a certain time, and audio break and video clip are avoided.
The transmitting device establishes a single thread to be specially responsible for transmitting the Bluetooth data, so that the Bluetooth data is distinguished from other task processing, parallel processing is realized, and the Bluetooth data is ensured to be transmitted in time.
In one embodiment, step S22 includes: when receiving insufficient space information fed back by the receiving device because the buffer storage area does not have more residual space for storing the data packet, suspending sending the data packet; and when receiving the space sufficiency information fed back by the receiving device because the buffer storage area reacquires enough space to store the data packet, continuing to send the data packet.
In this embodiment, the feedback information can ensure that the buffer memory area will not overflow when the bluetooth signal is good, and also can make the sending device transmit the data to be played in time, so as to ensure that the buffer memory area has sufficient data. In this embodiment, if the sending device does not actively query the storage space, the receiving device actively sends feedback information according to more remaining space in the buffer storage area, and the sending device reacts according to the feedback information, where the control right of the transmission process is at the receiving device.
In one embodiment, step S22 includes: and continuously sending the residual space inquiry requests to the receiving equipment, so that the receiving equipment feeds back the insufficient space information or the sufficient space information to each residual space inquiry request.
In this embodiment, the sending device actively queries the storage space, and the receiving device feeds back the control right of the transmission process to the sending device according to the received request.
In one embodiment, step S22 includes: and when receiving the verification failure information fed back by the sending equipment due to the verification failure of the data packet, retransmitting the data packet with the verification failure.
In this embodiment, the transmitting device may add a check code to each data packet. Through the verification-retransmission process, the damage of the data packet caused by the fluctuation of the Bluetooth signal or the tampering of the data packet by a malicious program can be avoided.
In one embodiment, the sending method 20 of bluetooth transmission data, as shown in fig. 3, further includes: step S23: and sending a control command to the receiving device through a single command sending thread, so that the receiving device controls the data packet playing operation according to the control command.
In this embodiment, the transmitting apparatus issues the control command according to the operation of the user. After receiving the control command of the sending device, the receiving device can take out the data from the data at the playing start position according to the playing position indicated by the command in the buffer storage area according to the sequence to start playing. The receiving device may begin playing without waiting to buffer enough audio data. After receiving the control command, the receiving device needs to timely feed back the control success of the transmitting device, and if the transmitting device does not receive the feedback within a certain time, the receiving device transmits the control command again.
The transmitting device establishes an independent thread and is specially responsible for transmitting a corresponding control command to control the playing of the receiving device according to the operation of a user, so that the transmitting device is distinguished from other task processing data transmitting threads for transmitting Bluetooth data, parallel processing is realized, and the control command is ensured to be transmitted in time.
In one embodiment, the data packet includes a display timestamp location, and step S23 includes: the control command comprises a display time stamp position of command execution, so that the receiving device searches the display time stamp position of command execution in a buffer storage area, starts from a data packet corresponding to the display time stamp position of command execution, and executes play operation corresponding to the control command.
In this embodiment, for the playback control of the data stream, including audio stream playback and video stream playback, a data stream control manner with a display timestamp is used. In the data flow control mode with the display time stamp, each data packet of a file to be played is sequentially added with the display time stamp to serve as a packet header, a sending device sends the data packet to a receiving device according to the time sequence of the display time stamp, and the receiving device stores the received data packet in a buffer storage area according to the time sequence of the display time stamp. The transmitting device transmits the display time stamp of the command execution position to the receiving device each time the transmitting device transmits the control command. Thus, the receiving device can directly play from the existing data in the buffer storage area without waiting, and the delay of the control command effect is shortened.
In an embodiment, step S23 further includes: the receiving device sends the data packet from the display time stamp position of the command execution, because the data request information fed back by the receiving device does not exist in the buffer memory area.
In this embodiment, if the data corresponding to the display timestamp position is not in the buffer storage area, the sending device needs to respond to the request of the receiving device in time to retransmit the data packet from the display timestamp position, so as to ensure that the data to be played currently can be played in time.
In one embodiment, the data packet does not include a display timestamp location, and step S23 includes: the control command enables the receiving device to empty the buffer storage area, and after the receiving device receives the transmitted data packet, the receiving device starts from the starting position of the buffer storage area and executes the playing operation corresponding to the control command.
In this embodiment, for the play control of the data stream, a data stream control mode without a display time stamp is used, and display time stamp information does not need to be added in the data packet. Each time the transmitting device executes a play start command, a fast forward command and a fast backward command, the transmitting device needs to retransmit data to the receiving device from a new play position, and the receiving device needs to empty the buffer storage area and start to continuously store and play from the start position of the buffer storage area.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
In this embodiment, the playing position of the playing start command is at the position where the playing was paused before or at the starting position of a certain audio or video data, the playing position of fast forward is after the current playing position, and the playing position of fast backward is before the current playing position.
Based on the same inventive concept, the present disclosure provides a playing device 100 for bluetooth transmission data, which is applied to a receiving device, where the receiving device is connected with a transmitting device through bluetooth, and the playing device 100 for bluetooth transmission data, as shown in fig. 4, includes: a data receiving unit 110, configured to receive, by using a separate data receiving thread, a data packet sent by the sending device, and store the data packet in a buffer storage area of the receiving device, where the data packet includes a data packet at a current playing position and a data packet after the current playing position, and the data packet is audio data and/or video data; a play control unit 120 for playing the data packet.
In an embodiment, the data receiving unit 110 is further configured to: when the buffer storage area does not have more residual space for storing the data packet, stopping receiving the new data packet, and feeding back the insufficient space information to the sending equipment so as to enable the sending equipment to pause sending the data packet; when the buffer memory area regains enough space to store the data packet, the space sufficient information is fed back to the sending device, so that the sending device continues to send the data packet.
In an embodiment, the data receiving unit 110 is further configured to: and continuously receiving the residual space inquiry requests sent by the sending equipment, and feeding back insufficient space information or sufficient space information for each residual space inquiry request.
In an embodiment, the data receiving unit 110 is further configured to: performing data verification on each received data packet; if the verification fails, the verification failure information is fed back to the sending equipment, so that the sending equipment resends the data packet with the verification failure.
In an embodiment, the playing device 100 for bluetooth transmission data is further configured to: and receiving the control command sent by the sending equipment through a single play control thread, and controlling the play operation of the data packet according to the control command.
In an embodiment, the data packet includes a display timestamp location, and the play control unit 120 is further configured to: the control command comprises a display time stamp position of command execution; searching a display time stamp position of command execution in a buffer storage area; and starting from the data packet corresponding to the display timestamp position of the command execution, and executing the playing operation corresponding to the control command.
In an embodiment, the play control unit 120 further includes: if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, feeding back the audio data request information to the sending device, and enabling the sending device to start sending the data packet from the display time stamp position of the command execution.
In an embodiment, the data packet does not include a display timestamp location, and the play control unit 120 is further configured to: emptying the buffer storage area; after receiving the data packet sent by the sending device, starting from the starting position of the buffer storage area, executing the playing operation corresponding to the control command.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
The specific manner in which the respective modules perform the operations of the playback apparatus 100 for bluetooth transmission data in the above-described embodiment has been described in detail in the embodiment regarding the method, and will not be described in detail here.
Under the same inventive concept, corresponding to the playing device 100 of bluetooth transmission data, the present disclosure provides a sending device 200 of bluetooth transmission data, applied to a sending device, where the sending device is connected with a receiving device through bluetooth, and the sending device 200 of bluetooth transmission data, as shown in fig. 5, includes: a transmission preparation unit 210, configured to divide a file to be played into a plurality of data packets by a single data sending thread, where the data packets include a data packet at a current playing position and a data packet not played after the current playing position, and the data packets are audio data and/or video data; the data sending unit 220 is configured to continuously send the data packet to the receiving device, so that the receiving device stores the data packet in the buffer memory area and plays the data packet.
In an embodiment, the data sending unit 220 is further configured to: when receiving insufficient space information fed back by the receiving device because the buffer storage area does not have more residual space for storing the data packet, suspending sending the data packet; and when receiving the space sufficiency information fed back by the receiving device because the buffer storage area reacquires enough space to store the data packet, continuing to send the data packet.
In an embodiment, the data sending unit 220 is further configured to: and continuously sending the residual space inquiry requests to the receiving equipment, so that the receiving equipment feeds back the insufficient space information or the sufficient space information to each residual space inquiry request.
In an embodiment, the data sending unit 220 is further configured to: and when receiving the verification failure information fed back by the sending equipment due to the verification failure of the data packet, retransmitting the data packet with the verification failure.
In one embodiment, the sending device 200 of bluetooth transmission data, as shown in fig. 6, further includes: the command sending unit 230 is configured to send a control command to the receiving device through a separate command sending thread, so that the receiving device controls the playing of the data packet according to the control command.
In an embodiment, the data packet includes a display timestamp location, and the command sending unit 230 is further configured to: the control command comprises a display time stamp position of command execution, so that the receiving device searches the display time stamp position of command execution in the buffer memory area, and starts from a data packet corresponding to the display time stamp position of command execution, and plays the data packet in the buffer memory area.
In an embodiment, the command sending unit 230 is further configured to: and receiving data request information fed back by the receiving device because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, and sending the data packet from the display time stamp position of the command execution.
In an embodiment, the data packet does not include a display timestamp location, and the command sending unit 230 is further configured to: the control command enables the receiving device to empty the buffer memory area, and after receiving the transmitted data packet, the receiving device starts from the starting position of the buffer memory area and executes the playing operation corresponding to the control command.
In one embodiment, the control command includes start of play, play pause, fast forward or fast reverse.
With respect to the transmitting apparatus 200 of bluetooth transmission data in the above-described embodiment, a specific manner in which each module performs an operation has been described in detail in the embodiment regarding the method, and will not be described in detail herein.
Fig. 7 is a schematic block diagram of any of the foregoing embodiment apparatus, according to an example embodiment. For example, apparatus 300 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, bluetooth speaker, bluetooth display screen, and the like.
Referring to fig. 7, the apparatus 300 may include one or more of the following components: a processing component 302, a memory 304, a power supply component 306, a multimedia component 308, an audio component 310, an input/output (I/O) interface 312, a sensor component 314, and a communication component 316.
The processing component 302 generally controls overall operation of the apparatus 300, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 302 may include one or more processors 320 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 302 can include one or more modules that facilitate interactions between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate interaction between the multimedia component 308 and the processing component 302.
Memory 304 is configured to store various types of data to support operations at apparatus 300. Examples of such data include instructions for any application or method operating on the device 300, contact data, phonebook data, messages, pictures, videos, and the like. The memory 304 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 306 provides power to the various components of the device 300. The power supply components 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 300.
The multimedia component 308 includes a screen between the device 300 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 308 includes a front-facing camera and/or a rear-facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 300 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 310 is configured to output and/or input audio signals. For example, the audio component 310 includes a Microphone (MIC) configured to receive external audio signals when the device 300 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 304 or transmitted via the communication component 316. In some embodiments, audio component 310 further comprises a speaker for outputting audio signals.
The I/O interface 312 provides an interface between the processing component 302 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 314 includes one or more sensors for providing status assessment of various aspects of the apparatus 300. For example, the sensor assembly 314 may detect the on/off state of the device 300, the relative positioning of the components, such as the display and keypad of the device 300, the sensor assembly 314 may also detect a change in position of the device 300 or a component of the device 300, the presence or absence of user contact with the device 300, the orientation or acceleration/deceleration of the device 300, and a change in temperature of the device 300. The sensor assembly 314 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 314 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 316 is configured to facilitate communication between the apparatus 300 and other devices, either wired or wireless. The device 300 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 316 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a computer-readable storage medium is also provided, such as memory 304, including instructions executable by processor 320 of apparatus 300 to perform the above-described method. For example, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 8 is a block diagram of an electronic device 400, according to an example embodiment. For example, the apparatus 400 may be provided as a server. Referring to fig. 8, the apparatus 400 includes a processing component 422 that further includes one or more processors, and memory resources represented by a memory 442, for storing instructions, such as applications, executable by the processing component 422. The application programs stored in the memory 442 may include one or more modules each corresponding to a set of instructions. Further, the processing component 422 is configured to execute instructions to perform the above-described methods.
The apparatus 400 may also include a power component 426 configured to perform power management of the apparatus 300, a wired or wireless network interface 450 configured to connect the apparatus 400 to a network, and an input output (I/O) interface 458. The apparatus 400 may operate based on an operating system stored in memory 442, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (32)

1. A method for playing bluetooth transmission data, applied to a receiving device, where the receiving device is connected to a transmitting device through bluetooth, the method comprising:
receiving a data packet sent by the sending device by a single data receiving thread, and storing the data packet in a buffer storage area of the receiving device, wherein the data packet comprises a data packet at a current playing position and a data packet after the current playing position, and the data packet is audio data and/or video data;
playing the data packet;
wherein, the playing the data packet includes: and receiving a control command sent by the sending device by a single play control thread, and controlling the play operation of the data packet according to the control command.
2. The method for playing bluetooth transmission data according to claim 1, wherein the receiving the data packet sent by the sending device includes:
Stopping receiving new data packets when the buffer storage area does not have more residual space for storing the data packets, and feeding back insufficient space information to the sending equipment so that the sending equipment pauses sending the data packets;
and when the buffer storage area regains enough space to store the data packet, feeding back the sufficient space information to the sending equipment so that the sending equipment can continue to send the data packet.
3. The method for playing bluetooth transmission data according to claim 1, wherein the receiving the data packet sent by the sending device includes:
performing data verification on each received data packet;
and if the verification fails, feeding back verification failure information to the sending equipment, so that the sending equipment resends the data packet with the verification failure.
4. The method for playing bluetooth transmission data according to claim 1, wherein the data packet includes a display time stamp position;
the operation of controlling the playing of the data packet according to the control command further comprises:
the control command comprises a display time stamp position of command execution;
searching a display time stamp position of the command execution in the buffer storage area;
And starting from the data packet corresponding to the display time stamp position executed by the command, executing the playing operation corresponding to the control command.
5. The method for playing bluetooth transmission data according to claim 4, wherein said controlling the playing operation of the data packet according to the control command further comprises:
and if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, feeding back data request information to the sending equipment, and enabling the sending equipment to start sending the data packet from the display time stamp position of the command execution.
6. The method for playing bluetooth transmission data according to claim 1, wherein the data packet does not include a display time stamp position;
the operation of controlling the playing of the data packet according to the control command further comprises:
emptying the buffer memory area;
after receiving the data packet sent by the sending device, starting from the starting position of the buffer storage area, executing the playing operation corresponding to the control command.
7. The method according to any one of claims 4-6, wherein the control command includes start of playback, pause of playback, fast forward or fast reverse.
8. A transmission method of bluetooth transmission data, applied to a transmission device, the transmission device and a reception device being connected by bluetooth, the method comprising:
dividing a file to be played into a plurality of data packets, wherein the data packets comprise data packets at the current playing position and data packets which are not played after the current playing position, and the data packets are audio data and/or video data;
transmitting the data packet to the receiving device by a separate data transmission thread, so that the receiving device stores the data packet in a buffer memory area and plays the data packet;
the method further comprises the steps of:
and a separate command sending thread sends a control command to the receiving device, so that the receiving device controls the data packet playing operation according to the control command.
9. The method according to claim 8, wherein the transmitting the data packet to the receiving device includes:
when receiving insufficient space information fed back by the receiving device because the buffer storage area does not have more residual space for storing the data packet, suspending sending the data packet;
And when receiving the space sufficient information fed back by the receiving device because the buffer storage area reacquires enough space to store the data packet, continuing to send the data packet.
10. The method according to claim 8, wherein the transmitting the data packet to the receiving device includes:
and retransmitting the data packet with failed verification when receiving the verification failure information fed back by the transmitting equipment due to the data packet verification failure.
11. The method of claim 8, wherein the data packet includes a presentation time stamp location,
the sending a control command to the receiving device, so that the receiving device controls the playing operation of the data packet according to the control command, includes:
the control command comprises a display time stamp position of command execution, so that the receiving device searches the display time stamp position of the command execution in the buffer storage area, starts from a data packet corresponding to the display time stamp position of the command execution, and executes a playing operation corresponding to the control command.
12. The method according to claim 11, wherein the sending a control command to the receiving device causes the receiving device to control a packet playing operation according to the control command, further comprising:
And receiving data request information fed back by the receiving device because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, and starting to send the data packet from the display time stamp position of the command execution.
13. The method of claim 8, wherein the data packet does not include a presentation time stamp location,
the sending a control command to the receiving device, so that the receiving device controls the playing operation of the data packet according to the control command, includes:
and the control command enables the receiving equipment to empty the buffer storage area, and after receiving the transmitted data packet, the receiving equipment starts from the starting position of the buffer storage area and executes the playing operation corresponding to the control command.
14. The method according to any one of claims 11-13, wherein the control command includes start of play, play pause, fast forward or fast reverse.
15. A playback apparatus for bluetooth transmission data, applied to a receiving device, the receiving device being connected to a transmitting device via bluetooth, the apparatus comprising:
The data receiving unit is used for receiving the data packet sent by the sending device through a single data receiving thread and storing the data packet in a buffer storage area of the receiving device, wherein the data packet comprises a data packet at the current playing position and a data packet after the current playing position, and the data is audio data and/or video data;
a play control unit for playing the data packet;
the play control unit is further configured to: and receiving a control command sent by the sending equipment through a single play control thread, and controlling the play operation of the data packet according to the control command.
16. The playback device of bluetooth transmission data according to claim 15, wherein the data receiving unit is further configured to:
stopping receiving new data packets when the buffer storage area does not have more residual space for storing the data packets, and feeding back insufficient space information to the sending equipment so that the sending equipment pauses sending the data packets;
and when the buffer storage area regains enough space to store the data packet, feeding back the sufficient space information to the sending equipment so that the sending equipment can continue to send the data packet.
17. The playback device of bluetooth transmission data according to claim 15, wherein the data receiving unit is further configured to:
performing data verification on each received data packet;
and if the verification fails, feeding back verification failure information to the sending equipment, so that the sending equipment resends the data packet with the verification failure.
18. The apparatus of claim 15, wherein the data packet includes a presentation time stamp location,
the play control unit is further configured to:
the control command comprises a display time stamp position of command execution;
searching a display time stamp position of the command execution in the buffer storage area;
and starting from the data packet corresponding to the display time stamp position executed by the command, executing the playing operation corresponding to the control command.
19. The playback device of claim 18, wherein the playback control unit is further configured to:
and if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, feeding back data request information to the sending equipment, and enabling the sending equipment to start sending the data packet from the display time stamp position of the command execution.
20. The playback device for bluetooth transmission data as recited in claim 15, wherein the data packet does not include a presentation time stamp location,
the play control unit is further configured to:
emptying the buffer memory area; after receiving the data packet sent by the sending device, starting from the starting position of the buffer storage area, executing the playing operation corresponding to the control command.
21. The playback device of any one of claims 18-20, wherein the control command includes a start of playback, a pause of playback, a fast forward, or a fast reverse.
22. A transmitting apparatus for bluetooth transmission data, applied to a transmitting device, the transmitting device and a receiving device being connected by bluetooth, the apparatus comprising:
the transmission preparation unit is used for dividing a file to be played into a plurality of data packets, wherein the data packets comprise data packets at the current playing position and data packets which are not played after the current playing position, and the data packets are audio data and/or video data;
a data sending unit, configured to send the data packet to the receiving device through a separate data sending thread, so that the receiving device stores the data packet in a buffer storage area and plays the data packet;
The apparatus further comprises:
and the command sending unit is used for sending a control command to the receiving equipment through a single command sending thread, so that the receiving equipment controls the data packet playing operation according to the control command.
23. The apparatus for transmitting bluetooth transmission data according to claim 22, wherein the data transmitting unit is further configured to:
when receiving insufficient space information fed back by the receiving device because the buffer storage area does not have more residual space for storing the data packet, suspending sending the data packet;
and when receiving the space sufficient information fed back by the receiving device because the buffer storage area reacquires enough space to store the data packet, continuing to send the data packet.
24. The apparatus for transmitting bluetooth transmission data according to claim 22, wherein the data transmitting unit is further configured to:
and retransmitting the data packet with failed verification when receiving the verification failure information fed back by the transmitting equipment due to the data packet verification failure.
25. The apparatus according to claim 22, wherein the data packet includes a display time stamp position,
The command transmitting unit is further configured to:
the control command comprises a display time stamp position of command execution, so that the receiving device searches the display time stamp position of the command execution in the buffer storage area, starts from a data packet corresponding to the display time stamp position of the command execution, and executes a playing operation corresponding to the control command.
26. The apparatus according to claim 25, wherein said command transmitting unit is further configured to:
and receiving data request information fed back by the receiving device because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, so that the data sending unit starts to send the data packet from the display time stamp position of the command execution.
27. The apparatus according to claim 22, wherein the data packet does not include a presentation time stamp location,
the command transmitting unit is further configured to:
and the control command enables the receiving equipment to empty the buffer storage area, and after receiving the transmitted data packet, the receiving equipment starts from the starting position of the buffer storage area and executes the playing operation corresponding to the control command.
28. The apparatus according to any one of claims 25 to 27, wherein the control command includes start of play, play pause, fast forward or fast reverse.
29. A receiving apparatus, comprising:
a memory for storing instructions; and
a processor for invoking the instructions stored in the memory to perform the method of playing bluetooth transmission data according to any one of claims 1-7.
30. A transmitting apparatus, characterized by comprising:
a memory for storing instructions; and
a processor for invoking the instructions stored in the memory to perform the method of transmitting bluetooth transmission data according to any of claims 8-14.
31. A computer readable storage medium storing instructions which, when executed by a processor, perform the method of playing bluetooth transmission data according to any one of claims 1 to 7.
32. A computer readable storage medium storing instructions which, when executed by a processor, perform the method of transmitting bluetooth transmission data according to any of claims 8-14.
CN202010366265.9A 2020-04-30 2020-04-30 Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device Active CN111586152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010366265.9A CN111586152B (en) 2020-04-30 2020-04-30 Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010366265.9A CN111586152B (en) 2020-04-30 2020-04-30 Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device

Publications (2)

Publication Number Publication Date
CN111586152A CN111586152A (en) 2020-08-25
CN111586152B true CN111586152B (en) 2023-06-02

Family

ID=72112023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010366265.9A Active CN111586152B (en) 2020-04-30 2020-04-30 Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device

Country Status (1)

Country Link
CN (1) CN111586152B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114640740B (en) * 2022-03-22 2024-03-12 Oppo广东移动通信有限公司 Communication processing method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105163155A (en) * 2015-08-26 2015-12-16 小米科技有限责任公司 Method and device for synchronous playing
WO2016127687A1 (en) * 2015-02-13 2016-08-18 广东欧珀移动通信有限公司 Media file playback progress synchronization method, device and system
CN109451346A (en) * 2018-10-18 2019-03-08 青岛海信电器股份有限公司 Audio data processing method, terminal device and storage medium based on Bluetooth communication

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE60211157T2 (en) * 2002-09-06 2007-02-08 Sony Deutschland Gmbh Synchronous playback of media packages
CN105306110B (en) * 2015-09-18 2018-08-17 深圳市冠旭电子股份有限公司 A kind of method and system realized synchronous music and played
CN105430570B (en) * 2015-11-27 2018-03-23 北京小鸟听听科技有限公司 Player method and playing device
CN106792073B (en) * 2016-12-29 2019-09-17 北京奇艺世纪科技有限公司 Method, playback equipment and the system that the audio, video data of striding equipment is played simultaneously
CN108616818B (en) * 2018-03-23 2023-04-21 南京中感微电子有限公司 Data retransmission method, bluetooth slave device and wireless communication system
CN109348464B (en) * 2018-11-23 2021-08-17 深圳时空壶技术有限公司 Data transmission method for low-power-consumption Bluetooth receiving end equipment and receiving end equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016127687A1 (en) * 2015-02-13 2016-08-18 广东欧珀移动通信有限公司 Media file playback progress synchronization method, device and system
CN105163155A (en) * 2015-08-26 2015-12-16 小米科技有限责任公司 Method and device for synchronous playing
CN109451346A (en) * 2018-10-18 2019-03-08 青岛海信电器股份有限公司 Audio data processing method, terminal device and storage medium based on Bluetooth communication

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Lou Bassbouss等.Towards a Wake-up and Synchronization Mechanism for Multiscreen Applications using iBeacon.《2014 international conference onsignal processing and multimedia applications(SIGMAP)》.2016,全文. *
查辉,余胜生,马彦明,王有成,周敬利.基于蓝牙的连续媒体实时传输技术的研究.小型微型计算机系统.2004,(03),全文. *

Also Published As

Publication number Publication date
CN111586152A (en) 2020-08-25

Similar Documents

Publication Publication Date Title
US11688389B2 (en) Method for processing voice signals and terminal thereof
CN108831448B (en) Method and device for controlling intelligent equipment through voice and storage medium
WO2020253566A1 (en) Audio playing method, device and storage medium
CN111314768A (en) Screen projection method, screen projection device, electronic equipment and computer readable storage medium
WO2022022193A1 (en) Video source switching method and apparatus, playback method and apparatus, device, and storage medium
CN106686446B (en) Content projection method and mobile terminal
WO2021143479A1 (en) Media stream transmission method and system
US11457250B2 (en) Method, device, and storage medium for transmitting data
WO2021190466A1 (en) Inter-device multimedia content playback continuing method
WO2021143362A1 (en) Resource transmission method and terminal
US11503642B2 (en) Method and device for determining an uplink-downlink switching point
CN104639977A (en) Program playing method and device
CN110536175A (en) A kind of code rate switching method and apparatus
WO2023109156A1 (en) Screen projection method and device, and storage medium
KR20200085595A (en) Contents reproducing apparatus and method thereof
CN112165645A (en) Control method of playback device, and computer storage medium
US20220095020A1 (en) Method for switching a bit rate, and electronic device
CN106792024B (en) Multimedia information sharing method and device
CN111586152B (en) Bluetooth transmission data playing method and device and Bluetooth transmission data sending method and device
CN113709055A (en) BLE-based communication method, device, equipment, system and storage medium
CN113660513A (en) Method, device and storage medium for synchronizing playing time
CN113238887A (en) Data processing method, device and storage medium
CN114007101B (en) Processing method, device and storage medium of fusion display device
WO2023185590A1 (en) Media information acquisition method and electronic device
US20240064561A1 (en) Apparatus and method for sending and receiving buffer data information

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