CN111586152A - 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
CN111586152A
CN111586152A CN202010366265.9A CN202010366265A CN111586152A CN 111586152 A CN111586152 A CN 111586152A CN 202010366265 A CN202010366265 A CN 202010366265A CN 111586152 A CN111586152 A CN 111586152A
Authority
CN
China
Prior art keywords
data packet
data
sending
receiving
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.)
Granted
Application number
CN202010366265.9A
Other languages
Chinese (zh)
Other versions
CN111586152B (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

Abstract

The disclosure relates to a method and a device for playing Bluetooth transmission data and a method and a device for sending the Bluetooth transmission data. The Bluetooth data playing method is applied to receiving equipment, the receiving equipment is connected with sending equipment through Bluetooth, and the method comprises the following steps: receiving a data packet sent by sending equipment by an independent data receiving thread, and storing the data packet in a buffer memory area of receiving equipment, wherein the data packet comprises a data packet at a current playing position and a data packet behind the current playing position, and the data packet is audio data and/or video data; and playing the data packet. Through the data package of buffering present broadcast position department and the data package of not broadcasting behind the present broadcast position, reduce the broadcast delay, guarantee the broadcast synchronization between receiving equipment and the transmitting device, when the bluetooth signal is not good, normal broadcast still can be maintained to receiving equipment, avoids sound break and card pause, has improved user experience.

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 and an apparatus for playing bluetooth transmission data, a method and an apparatus for transmitting bluetooth transmission data, an electronic device and a computer-readable storage medium.
Background
Bluetooth (Bluetooth), a wireless technology standard, enables short-range data exchange between fixed devices, mobile devices and building personal area networks (using UHF radio waves in the ISM band of 2.4-2.485 GHz). Under the condition that the current Bluetooth data transmission is poor in Bluetooth signals, the playing fluency of the multimedia data by the receiving equipment is influenced. When the distance between the sending device and the receiving device is long or the electromagnetic interference of the wireless transmission environment is strong, the music playing of the receiving device has the problem of sound interruption, and the video playing has the problems of frame skipping and blocking. This problem is currently a common problem common to 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 audio data to the receiving device through a bluetooth antenna. The receiving device decodes the received audio compression data and then sends the audio compression data to a loudspeaker for playing.
Since the transmitting device transmits only the audio data currently being played to the receiving device. The audio data is buffered by a small buffer area (generally, the capacity of the buffer area only stores hundreds of milliseconds of audio data) by the receiving device and then played by the loudspeaker. Once the wireless transmission signal is deteriorated, the receiving device cannot receive more audio data in time, the audio data in the buffer storage area are all played, and no audio data is left, so that the receiving device can generate sound interruption.
In addition, when the current bluetooth playing device plays, it needs to wait for receiving the currently played data, and then play the data after the buffer storage area is full, so that the playing progress of the bluetooth device has a certain delay, which is tens of milliseconds less and hundreds of milliseconds more, relative to the playing progress of the control device (such as an intelligent mobile terminal or a PC), and the two devices play asynchronously, which affects the user experience.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method and an apparatus for playing bluetooth transmission data, a method and an apparatus for transmitting bluetooth transmission data, an electronic device and a computer-readable storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for playing data transmitted by bluetooth, which is applied to a receiving device, where the receiving device is connected to a sending device via bluetooth, and the method includes: receiving a data packet sent by sending equipment by an independent data receiving thread, and storing the data packet in a buffer memory area of receiving equipment, wherein the data packet comprises a data packet at a current playing position and a data packet behind the current playing position, and the data packet is audio data and/or video data; and playing the data packet.
In one embodiment, receiving the data packet sent by the sending device includes: when the buffer storage area has no more residual space for storing the data packet, stopping receiving the new data packet, and feeding back insufficient space information to the sending equipment to enable the sending equipment to suspend sending the data packet; when the buffer storage area obtains enough space again to store the data packet, the information of enough space is fed back to the sending equipment, so that the sending equipment continues to send the data packet.
In one embodiment, receiving the data packet sent by the sending device includes: carrying out data check 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.
In one embodiment, playing the data packet comprises: and receiving the control command sent by the sending equipment by an independent play control thread, and controlling the play operation of the data packet according to the control command.
In one embodiment, the data packet includes a display time stamp location, and controlling the data packet playing operation according to the control command includes: the control command comprises a display timestamp position of command execution; in the buffer memory area, the position of a display time stamp for executing the command is searched; 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.
In one embodiment, the controlling the packet playing operation 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 memory area, feeding back data request information to the sending equipment, and enabling the sending equipment to send the data packet from the display time stamp position of the command execution.
In one embodiment, the data packet does not include the display time stamp position, and the controlling the data packet playing operation according to the control command includes: emptying the buffer storage area; and after receiving the data packet sent by the sending device, starting from the initial position of the buffer storage area, executing the playing operation corresponding to the control command.
In one embodiment, the control commands include start 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 data by bluetooth, the method being applied to a transmitting device, where the transmitting device is connected to a receiving device by bluetooth, and the method includes: dividing a file to be played into a plurality of data packets, wherein the data packets comprise a data packet at a current playing position and a data packet which is not played after the current playing position, and the data packets are audio data and/or video data; a separate data transmission thread transmits data packets to the receiving device, which causes the receiving device to store the data packets in the buffer memory area and play the data packets.
In one embodiment, sending the data packet to the receiving device comprises: when receiving the insufficient space information fed back by the receiving equipment because the buffer storage area has no more remaining space for storing the data packet, suspending the transmission of the data packet; when receiving the sufficient space information fed back by the receiving device because the buffer storage area regains the sufficient space to store the data packet, the receiving device continues to send the data packet.
In one embodiment, sending the data packet to the receiving device comprises: and when receiving the check failure information fed back by the sending equipment due to the check failure of the data packet, resending the data packet with the check failure.
In an embodiment, the method further comprises: a single 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 an embodiment, the data packet includes a display timestamp position, and a control command is sent to the receiving device, so that the receiving device controls the data packet playing operation 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 the buffer memory area, and starts from a data packet corresponding to the display time stamp position of command execution to execute the playing operation corresponding to the control command.
In one embodiment, sending a control command to a receiving device to enable the receiving device to control a packet playing operation according to the control command further includes: and receiving data request information fed back by the receiving equipment because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, and transmitting 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 a control command is sent to the receiving device, so that the receiving device controls the data packet to play according to the control command, including: and the control command enables the receiving equipment to empty the buffer storage area, and after the sent data packet is received, the playing operation corresponding to the control command is executed from the initial position of the buffer storage area.
In one embodiment, the control commands include start 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 apparatus for bluetooth data transmission, which is applied to a receiving device, where the receiving device is connected to a sending device via bluetooth, and the apparatus includes: the data receiving unit is used for receiving a data packet sent by the sending equipment through an independent data receiving thread and storing the data packet in a buffer memory area of the receiving equipment, wherein the data packet comprises a data packet at a current playing position and a data packet behind the current playing position, and the data packet is audio data and/or video data; and the playing 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 has no more residual space for storing the data packet, stopping receiving the new data packet, and feeding back insufficient space information to the sending equipment to enable the sending equipment to suspend sending the data packet; when the buffer storage area obtains enough space again to store the data packet, the information of enough space is fed back to the sending equipment, so that the sending equipment continues to send the data packet.
In an embodiment, the data receiving unit is further configured to: carrying out data check 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.
In an embodiment, the playback control unit is further configured to: and receiving the control command sent by the sending equipment through an independent 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 time stamp position, and the play control unit is further configured to: the control command comprises a display timestamp position of command execution; in the buffer memory area, the position of a display time stamp for executing the command is searched; 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.
In an embodiment, 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 memory area, feeding back data request information to the sending equipment, and enabling the sending equipment to send the data packet from the display time stamp position of the command execution.
In an embodiment, the display time stamp position is not included in the data packet, and the play control unit is further configured to: emptying the buffer storage area; and after receiving the data packet sent by the sending device, starting from the initial position of the buffer storage area, executing the playing operation corresponding to the control command.
In one embodiment, the control commands include start 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 data transmission, which is applied to a transmitting device, where the transmitting device is connected to a receiving device via bluetooth, the apparatus including: the transmission preparation unit is used for dividing a file to be played into a plurality of data packets, wherein the data packets comprise a data packet at a current playing position and a data packet which is not played after the current playing position, and the data packets are audio data and/or video data; and the data sending unit is used for sending the data packet to the receiving equipment through a single data sending thread, so that the receiving equipment stores the data packet in the buffer storage area and plays the data packet.
In one embodiment, the data sending unit is further configured to: when receiving the insufficient space information fed back by the receiving equipment because the buffer storage area has no more remaining space for storing the data packet, suspending the transmission of the data packet; when receiving the sufficient space information fed back by the receiving device because the buffer storage area regains the sufficient space to store the data packet, the receiving device continues to send the data packet.
In an embodiment, the data sending unit is further configured to: and when receiving the check failure information fed back by the sending equipment due to the check failure of the data packet, resending the data packet with the check failure.
In an embodiment, 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.
In an embodiment, the data packet includes a display time stamp location, 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 memory area, and starts from a data packet corresponding to the display time stamp position of command execution to execute the 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 equipment because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, and transmitting the data packet from the display time stamp position of the command execution.
In an embodiment, the display time stamp position is not included in the data packet, and the command sending unit is further configured to: the control command enables the receiving device to empty the buffer storage area, and after receiving the transmitted data packet, the playing operation corresponding to the control command is executed from the initial position of the buffer storage area.
In one embodiment, the control commands include start 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 to store instructions; and the processor is used for calling the instruction stored in the memory to execute the playing method of the Bluetooth transmission data in the first aspect.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a transmission apparatus including: a memory to store instructions; and the processor is used for calling the instructions stored in the memory to execute the method for transmitting the Bluetooth transmission data in the second aspect.
According to a seventh aspect of the embodiments of the present disclosure, a computer-readable storage medium stores instructions, and when executed by a processor, the instructions perform the playing method of the bluetooth transmission data of the first aspect.
According to an eighth aspect of the embodiments of the present disclosure, a computer-readable storage medium stores instructions that, when executed by a processor, perform the method for transmitting bluetooth transmission data of the second aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: through the data package of buffering present broadcast position department and the data package of not broadcasting behind the present broadcast position, reduce the broadcast delay, guarantee the broadcast synchronization between receiving equipment and the transmitting device, when the bluetooth signal is not good, normal broadcast still can be maintained to receiving equipment, avoids sound break and card pause, has improved user experience.
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 present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart illustrating a playing method of 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 flow chart illustrating another method of transmitting bluetooth transmission data according to an example embodiment.
Fig. 4 is a schematic block diagram of a playback apparatus for bluetooth data transmission according to an exemplary embodiment.
Fig. 5 is a schematic block diagram illustrating a transmitting apparatus for bluetooth transmission data according to an exemplary embodiment.
Fig. 6 is a schematic block diagram illustrating another transmitting apparatus for bluetooth transmission data according to an example embodiment.
FIG. 7 is a schematic block diagram illustrating an apparatus in accordance with an exemplary embodiment.
FIG. 8 is a schematic block diagram illustrating an electronic device in accordance with an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The present disclosure provides a playing method 10 of bluetooth transmission data, which is applied to a receiving device, the receiving device is connected with a sending device through bluetooth, wherein the receiving device may be a playing device such as a sound box, a display screen, a television, etc., the sending device may be a terminal device such as a mobile phone, a tablet computer, a desktop, etc., and the receiving device receives and plays audio and video data transmitted by the sending device. The Bluetooth connection is very convenient, but the play fluency of audio and video data is greatly influenced by the condition of a Bluetooth signal, and the play synchronism of the two devices is poor, for example, a progress bar on the sending device or the video progress is inconsistent with the audio play progress of the receiving device. For this reason, in the playing method 10 of bluetooth transmission data provided in the embodiment of the present disclosure, as shown in fig. 1, the playing method 10 of bluetooth transmission data 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 memory area of the receiving device, wherein the data packet comprises the data packet at the current playing position and the data packet behind the current playing position, and the data packet is audio data and/or video data.
When the Bluetooth signal is better, the receiving equipment continuously receives data and caches the data in the buffer storage area according to the playing sequence. The playing start position and the data after the playing start position can be prestored before playing, and when the playing needs to be started, the receiving device can immediately start playing from the data at the playing start position, so that the synchronization of the playing progress of the sending device is realized. And, when the bluetooth signal transmission fluctuates and worsens, can maintain the normal broadcast of certain time, avoid audio frequency sound break and video card to pause to take place.
Step S12: and playing the data packet.
Taking audio playing as an example, before playing, because a buffer storage area stores certain data, when a user starts playing, a loudspeaker can directly read the data from the buffer to start playing, and does not need to wait for buffering enough audio data. Because the data after the playing position is continuously received, when the Bluetooth signal is better, the playing speed of the loudspeaker is lower than the Bluetooth transmission speed, and the data in the buffer storage area is always kept to wait for playing; when the bluetooth signal fluctuates and becomes worse, even if the playing speed is higher than the transmission speed, the loudspeaker still has enough data playing in a certain time, and the playing fluency is ensured.
The receiving equipment establishes a single thread which is specially responsible for receiving the Bluetooth data, thereby being distinguished from other task processing, realizing parallel processing and ensuring that the Bluetooth data is received and cached in time.
In one embodiment, step S11 includes: when the buffer storage area has no more residual space for storing the data packet, stopping receiving the new data packet, and feeding back insufficient space information to the sending equipment to enable the sending equipment to suspend sending the data packet; when the buffer storage area obtains enough space again to store the data packet, the information of enough space is fed back to the sending equipment, so that the sending equipment continues to send the data packet.
In this embodiment, when the buffer storage area of the receiving device has no more remaining space, the receiving device stops receiving new data, feeds back the sending device, suspends sending data, and continues sending the latter data when the buffer storage area has enough space, thereby ensuring that the buffer storage area does not overflow data when the bluetooth signal is good, and also ensuring that the sending device transmits the data ready for playing in time, and ensuring that the data in the buffer storage area is sufficient. 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 responds according to the feedback information to control the transmission process at the receiving device.
In one embodiment, step S11 further includes: and continuously receiving the remaining space query requests sent by the sending equipment, and feeding back insufficient space information or sufficient space information for each remaining space query request.
In this embodiment, the sending device actively queries the storage space condition, and the receiving device feeds back the received request, and controls the transmission process at the sending device side.
In one embodiment, step S11 includes: carrying out data check 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.
In this embodiment, the receiving device performs data check on each received data packet, the sending device may add a check code to each data packet, the receiving device calculates the check code of the received data packet, and determines whether the transmission of the data packet is correct by determining whether the two are the same, and if the two values are the same, it indicates that the transmitted data is complete and error-free and has not been tampered, so that the data can be used with ease, and specifically, MD5 check or CRC check may be used. Through the verification-retransmission process, the data packet damage 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, in the playing method 10 of bluetooth transmission data, step S12 may further include:
and an independent play control thread receives the control command sent by the sending equipment and controls the play operation of the data packet according to the control command.
In this embodiment, after receiving the control command from the sending device, the receiving device may take out the data from the buffer storage area in the order from the data at the play start position according to the play position indicated by the command, and start playing the data. The receiving device does not need to wait for enough audio data to be buffered to begin playback. After receiving the control command, the receiving device needs to feed back the success control of the sending device in time, and if the sending device does not receive the feedback within a certain time, the sending device sends the control command again.
In this embodiment, the receiving device establishes a separate thread to be specially responsible for play control according to the received control command, so as to distinguish from other data receiving threads which process tasks including receiving bluetooth data, implement parallel processing, and ensure that the control command is executed in time.
In one embodiment, the display time stamp position is included in the data packet, and step S12 includes: the control command comprises a display timestamp position of command execution; in the buffer memory area, the position of a display time stamp for executing the command is searched; and playing the data packet in the buffer storage area from the data packet corresponding to the display time stamp position of the command execution.
In this embodiment, for the play control of the data stream, including the audio stream play and the video stream play, a data stream control mode with a Presentation Time Stamp (PTS) is used. The data flow control mode with the display time stamp is characterized in that the display time stamp is sequentially added to each data packet of a file to be played to serve as a packet header, the sending equipment sends the data packet to the receiving equipment according to the time sequence of the display time stamp, and the receiving equipment stores the received data packet in the 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 together every time the transmitting device transmits the control command. For example: the audio playing start command shows that the position of the time stamp is the current playing position, after receiving the command, the receiving device finds the data of the position of the time stamp from the buffer storage area and takes out the data to be played by the loudspeaker, and the audio fast forward command can enable the receiving device to directly jump to the corresponding position of the time stamp in the buffer storage area to start playing. Therefore, the receiving device can directly start playing from the existing data in the buffer memory area without waiting, and the delay of the effect of the control command is shortened.
In one embodiment, step S12 further includes: and if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer memory area, feeding back data request information to the sending equipment, and enabling the sending equipment 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 that needs to be played currently can be played in time.
In one embodiment, the display time stamp position is not included in the data packet, and step S12 includes: emptying the buffer storage area; and after receiving the data packet sent by the sending device, playing the data packet in the buffer storage area from the initial position of the buffer storage area.
In this embodiment, for the play control of the data stream, a data flow control method without a display timestamp is used, and display timestamp information does not need to be added to the data packet. Each time the transmitting device executes a play start, fast forward, fast reverse command, the receiving device cannot know whether the audio data are already pre-stored in the buffer memory area because the time stamp location information is not displayed. The sending 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 store and play continuously from the initial 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 simple.
In one embodiment, the control commands include start play, play pause, fast forward, or fast reverse.
In this embodiment, the play position of the play start command is a position where the play is paused before or a start position of certain audio or video data, the fast forward play position is after the current play position, and the fast backward play position is before the current play position.
According to the playing method 10 for bluetooth transmission data provided by the embodiment of the present disclosure, by caching the data packet at the current playing position and the data packet that is not played after the current playing position, the playing delay is reduced, the synchronization of the playing between the receiving device and the sending device is ensured, when the bluetooth signal is not good, the receiving device can still maintain normal playing, the sound interruption and the jamming are avoided, and the 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, and the sending device and a receiving device are connected through bluetooth. As shown in fig. 2, the method 20 for transmitting bluetooth transmission data provided in the embodiment of the present disclosure includes step S21 and step S22:
step S21: dividing a file to be played into a plurality of data packets, wherein the data packets comprise a data packet at a current playing position and a data packet which is not played after the current playing position, and the data packets are audio data and/or video data.
Before playing begins, dividing an audio or video file to be played into a plurality of data packets, wherein the data packets can be divided into data packets with equal playing time length, and data at the current playing position and data which are not played after the current playing position are both packaged to prepare for Bluetooth data transmission.
Step S22: and sending the data packet to the receiving device through a single data sending thread, so that the receiving device stores the data packet in the buffer storage area and plays the data packet.
When the Bluetooth signal is better, the sending equipment continuously sends data, receives the data which can be prestored in the playing starting position before playing, and when the playing needs to be started, the receiving equipment can immediately start playing from the data of the playing starting position, so that the synchronization of the playing progress of the sending equipment is realized. And, when the bluetooth signal transmission fluctuates and worsens, can maintain the normal broadcast of certain time, avoid audio frequency sound break and video card to pause to take place.
The sending equipment establishes a single thread and is specially responsible for sending the Bluetooth data, so that the Bluetooth data is distinguished from other task processing, parallel processing is realized, and the Bluetooth data is guaranteed to be sent in time.
In one embodiment, step S22 includes: when receiving the insufficient space information fed back by the receiving equipment because the buffer storage area has no more remaining space for storing the data packet, suspending the transmission of the data packet; when receiving the sufficient space information fed back by the receiving device because the buffer storage area regains the sufficient space to store the data packet, the receiving device continues to send the data packet.
In this embodiment, the feedback information can ensure that the buffer storage area will not overflow when the bluetooth signal is good, and also can enable the sending device to transmit the data ready for playing in time, thereby ensuring that the data in the buffer storage area is sufficient. 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 responds according to the feedback information to control the transmission process at the receiving device.
In one embodiment, step S22 includes: and continuously sending the remaining space query requests to the receiving equipment, so that the receiving equipment feeds back insufficient space information or sufficient space information to each remaining space query request.
In this embodiment, the sending device actively queries the storage space condition, and the receiving device feeds back the received request, and controls the transmission process at the sending device side.
In one embodiment, step S22 includes: and when receiving the check failure information fed back by the sending equipment due to the check failure of the data packet, resending the data packet with the check failure.
In this embodiment, the sending device may add a check code to each data packet. Through the verification-retransmission process, the data packet damage 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, as shown in fig. 3, the method 20 for transmitting data by bluetooth further includes: step S23: and 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.
In this embodiment, the sending device sends out a control command according to an operation of a user. After receiving the control command from the sending device, the receiving device may take out the data in the buffer memory area in order from the data at the play start position according to the play position indicated by the command to start playing. The receiving device does not need to wait for enough audio data to be buffered to begin playback. After receiving the control command, the receiving device needs to feed back the success control of the sending device in time, and if the sending device does not receive the feedback within a certain time, the sending device sends the control command again.
The sending equipment establishes an independent thread and is specially responsible for sending the corresponding control command to control the playing of the receiving equipment according to the operation of a user, so that the parallel processing is realized and the control command is ensured to be sent in time by being distinguished from other data sending threads which process tasks and comprise the sending of Bluetooth data.
In one embodiment, the display time stamp position is included in the data packet, 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 the buffer memory area, and starts from a data packet corresponding to the display time stamp position of command execution to execute the playing operation corresponding to the control command.
In this embodiment, for the play control of the data stream, including the audio stream play and the video stream play, a data stream control mode with a display timestamp is used. The data flow control mode with the display time stamp is characterized in that the display time stamp is sequentially added to each data packet of a file to be played to serve as a packet header, the sending equipment sends the data packet to the receiving equipment according to the time sequence of the display time stamp, and the receiving equipment stores the received data packet in the 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 together every time the transmitting device transmits the control command. Therefore, the receiving device can directly start playing from the existing data in the buffer memory area without waiting, and the delay of the effect of the control command is shortened.
In one 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 data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage 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 at present can be played in time.
In one embodiment, the display time stamp position is not included in the data packet, and step S23 includes: and the control command enables the receiving equipment to empty the buffer storage area, and after the sent data packet is received, the playing operation corresponding to the control command is executed from the initial position of the buffer storage area.
In this embodiment, for the play control of the data stream, a data flow control method without a display timestamp is used, and display timestamp information does not need to be added to the data packet. When the sending device executes the commands of starting playing, fast forwarding and fast rewinding each time, the sending device needs to retransmit data to the receiving device from a new playing position, and the receiving device needs to empty the buffer storage area and start to continuously store and play the data from the initial position of the buffer storage area.
In one embodiment, the control commands include start play, play pause, fast forward, or fast reverse.
In this embodiment, the play position of the play start command is a position where the play is paused before or a start position of certain audio or video data, the fast forward play position is after the current play position, and the fast backward play position is before the current play position.
Based on the same inventive concept, the present disclosure provides a playing apparatus 100 for bluetooth data transmission, which is applied to a receiving device, the receiving device is connected with a sending device via bluetooth, and the playing apparatus 100 for bluetooth data transmission, as shown in fig. 4, includes: the data receiving unit 110 is configured to receive, through a single data receiving thread, a data packet sent by a sending device, and store the data packet in a buffer memory area of a 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, configured to play the data packet.
In an embodiment, the data receiving unit 110 is further configured to: when the buffer storage area has no more residual space for storing the data packet, stopping receiving the new data packet, and feeding back insufficient space information to the sending equipment to enable the sending equipment to suspend sending the data packet; when the buffer storage area obtains enough space again to store the data packet, the information of enough space is fed back to the sending equipment, so that the sending equipment continues to send the data packet.
In an embodiment, the data receiving unit 110 is further configured to: and continuously receiving the remaining space query requests sent by the sending equipment, and feeding back insufficient space information or sufficient space information for each remaining space query request.
In an embodiment, the data receiving unit 110 is further configured to: carrying out data check 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.
In an embodiment, the playing apparatus 100 for bluetooth data transmission is further configured to: and receiving the control command sent by the sending equipment through an independent 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 time stamp position, and the play control unit 120 is further configured to: the control command comprises a display timestamp position of command execution; in the buffer memory area, the position of a display time stamp for executing the command is searched; 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.
In one embodiment, the playback control unit 120 further includes: and if the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer memory area, feeding back the audio data request information to the sending equipment, and enabling the sending equipment to send the data packet from the display time stamp position of the command execution.
In an embodiment, the display time stamp position is not included in the data packet, and the play control unit 120 is further configured to: emptying the buffer storage area; and after receiving the data packet sent by the sending device, starting from the initial position of the buffer storage area, executing the playing operation corresponding to the control command.
In one embodiment, the control commands include start play, play pause, fast forward, or fast reverse.
With respect to the playing apparatus 100 for bluetooth data transmission in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment related to the method, and will not be described in detail here.
Under the same inventive concept, corresponding to the playing apparatus 100 for bluetooth data transmission, the present disclosure provides a transmitting apparatus 200 for bluetooth data transmission, which is applied to a transmitting device, the transmitting device is connected with a receiving device via bluetooth, and the transmitting apparatus 200 for bluetooth data transmission, 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 through a single data sending thread, where the data packets include a data packet at a current playing position and a data packet that is not played after the current playing position, where the data packet is audio data and/or video data; a data sending unit 220, configured to continuously send the data packet to the receiving device, so that the receiving device stores the data packet in the buffer storage area and plays the data packet.
In an embodiment, the data sending unit 220 is further configured to: when receiving the insufficient space information fed back by the receiving equipment because the buffer storage area has no more remaining space for storing the data packet, suspending the transmission of the data packet; when receiving the sufficient space information fed back by the receiving device because the buffer storage area regains the sufficient space to store the data packet, the receiving device continues to send the data packet.
In an embodiment, the data sending unit 220 is further configured to: and continuously sending the remaining space query requests to the receiving equipment, so that the receiving equipment feeds back insufficient space information or sufficient space information to each remaining space query request.
In an embodiment, the data sending unit 220 is further configured to: and when receiving the check failure information fed back by the sending equipment due to the check failure of the data packet, resending the data packet with the check failure.
In an embodiment, the transmitting apparatus 200 for bluetooth data transmission, 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 single 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 time stamp 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 plays the data packet in the buffer memory area from the data packet corresponding to the display time stamp position of command execution.
In an embodiment, the command sending unit 230 is further configured to: and receiving data request information fed back by the receiving equipment because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer storage area, and transmitting the data packet from the display time stamp position of the command execution.
In an embodiment, the display time stamp position is not included in the data packet, and the command sending unit 230 is further configured to: the control command makes the receiving device clear the buffer memory area, and after receiving the transmitted data packet, the playing operation corresponding to the control command is executed from the initial position of the buffer memory area.
In one embodiment, the control commands include start play, play pause, fast forward, or fast reverse.
With regard to the transmitting apparatus 200 for bluetooth transmission data in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
Fig. 7 is a schematic block diagram illustrating an apparatus of any of the previous embodiments in accordance with an exemplary embodiment. For example, the apparatus 300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, a bluetooth speaker, a bluetooth display screen, or the like.
Referring to fig. 7, the apparatus 300 may include one or more of the following components: processing component 302, memory 304, power component 306, multimedia component 308, audio component 310, input/output (I/O) interface 312, sensor component 314, and communication component 316.
The processing component 302 generally controls overall operation of the device 300, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 302 may include one or more processors 320 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 302 can include one or more modules that facilitate interaction 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.
The memory 304 is configured to store various types of data to support operations at the apparatus 300. Examples of such data include instructions for any application or method operating on device 300, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 304 may be implemented by any type or combination of volatile or non-volatile 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 disks.
The power supply component 306 provides power to the various components of the device 300. The power 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 apparatus 300.
The multimedia component 308 includes a screen that provides an output interface between the device 300 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect 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 camera and/or the rear camera may receive external multimedia data when the device 300 is in an operating 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 a focal length and optical zoom capability.
The audio component 310 is configured to output and/or input audio signals. For example, audio component 310 includes a Microphone (MIC) configured to receive external audio signals when apparatus 300 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 304 or transmitted via the communication component 316. In some embodiments, audio component 310 also includes 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 keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 314 includes one or more sensors for providing various aspects of status assessment for the device 300. For example, sensor assembly 314 may detect an open/closed state of device 300, the relative positioning of components, such as a display and keypad of device 300, the change in position of device 300 or a component of device 300, the presence or absence of user contact with device 300, the orientation or acceleration/deceleration of device 300, and the change in temperature of device 300. Sensor assembly 314 may include a proximity sensor configured to detect the presence of a nearby object without 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 gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 316 is configured to facilitate wired or wireless communication between the apparatus 300 and other devices. The device 300 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 304 comprising instructions, executable by the processor 320 of the apparatus 300 to perform the above-described method is also provided. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 8 is a block diagram illustrating an electronic device 400 according to an example embodiment. For example, the apparatus 400 may be provided as a server. Referring to fig. 8, apparatus 400 includes a processing component 422 that further includes one or more processors and memory resources, represented by memory 442, for storing instructions, such as application programs, that are executable by processing component 422. The application programs stored in memory 442 may include one or more modules that each correspond 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 the 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 will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (36)

1. A playing method of Bluetooth transmission data is applied to a receiving device, wherein the receiving device is connected with a sending device through Bluetooth, and the method comprises the following steps:
receiving a data packet sent by the sending device by a single data receiving thread, and storing the data packet in a buffer memory 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.
2. The method for playing back bluetooth transmission data according to claim 1, wherein the receiving the data packet sent by the sending device comprises:
when the buffer storage area has no more residual space for storing the data packet, stopping receiving the new data packet, and feeding back insufficient space information to the sending equipment to enable the sending equipment to suspend sending the data packet;
and when the buffer storage area obtains enough space again to store the data packet, feeding back the information of enough space to the sending equipment, and enabling the sending equipment to continue sending the data packet.
3. The method for playing back bluetooth transmission data according to claim 1, wherein the receiving the data packet sent by the sending device comprises:
carrying out data check 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 verification failure.
4. The method for playing back bluetooth transmission data according to claim 1, wherein the playing back the data packet comprises:
and receiving the control command sent by the sending equipment by an independent play control thread, and controlling the play operation of the data packet according to the control command.
5. The playback method of bluetooth transmission data according to claim 4, wherein the data packet includes a display time stamp location;
the controlling the playing operation of the data packet according to the control command further comprises:
the control command comprises a display timestamp position of command execution;
searching the display time stamp position of the command execution in the buffer memory area;
and starting from the data packet corresponding to the display timestamp position executed by the command, executing the playing operation corresponding to the control command.
6. The method of claim 5, wherein the 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 memory area, feeding back data request information to the sending equipment, and enabling the sending equipment to send the data packet from the display time stamp position of the command execution.
7. The playback method of bluetooth transmission data according to claim 4, wherein the data packet does not include a display time stamp position;
the controlling the playing operation of the data packet according to the control command further comprises:
emptying the buffer memory area;
and after receiving the data packet sent by the sending equipment, starting from the initial position of the buffer storage area, executing the playing operation corresponding to the control command.
8. A playback method as claimed in any one of claims 4 to 7, characterized in that the control command comprises start of playback, pause of playback, fast forward or fast reverse.
9. A method for transmitting data by Bluetooth is characterized in that the method is applied to a transmitting device, the transmitting device is connected with a receiving device by Bluetooth, and the method comprises the following steps:
dividing a file to be played into a plurality of data packets, wherein the data packets comprise a data packet at a current playing position and a data packet which is not played after the current playing position, and the data packets are audio data and/or video data;
and sending the data packet to the receiving equipment by a single data sending thread, so that the receiving equipment stores the data packet in a buffer storage area and plays the data packet.
10. The method according to claim 9, wherein the sending the data packet to the receiving device comprises:
when receiving the insufficient space information fed back by the receiving equipment because the buffer storage area has no more remaining space for storing the data packet, suspending the data packet transmission;
and when receiving sufficient space information fed back by the receiving equipment because the buffer storage area regains sufficient space to store the data packet, continuing to send the data packet.
11. The method according to claim 9, wherein the sending the data packet to the receiving device comprises:
and when receiving the check failure information fed back by the sending equipment due to the check failure of the data packet, resending the data packet with the check failure.
12. The method of claim 9, wherein the method further comprises:
and sending a control command to the receiving equipment by a single command sending thread so that the receiving equipment controls the data packet playing operation according to the control command.
13. The method according to claim 12, wherein the data packet includes a display time stamp position,
the sending a control command to the receiving device to enable the receiving device to control a data packet playing operation 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 command execution in the buffer memory area, and starts to execute the playing operation corresponding to the control command from a data packet corresponding to the display time stamp position of command execution.
14. The method according to claim 13, wherein the sending a control command to the receiving device to enable the receiving device to control a packet playing operation according to the control command further comprises:
and receiving data request information fed back by the receiving equipment because the data packet corresponding to the display time stamp position of the command execution does not exist in the buffer memory area, and sending the data packet from the display time stamp position of the command execution.
15. The method of claim 12, wherein the data packet does not include a display time stamp location,
the sending a control command to the receiving device to enable the receiving device to control a data packet playing operation according to the control command includes:
and the control command enables the receiving equipment to empty the buffer memory area, and after the sent data packet is received, the playing operation corresponding to the control command is executed from the initial position of the buffer memory area.
16. The method according to any of claims 12-15, wherein the control command comprises start of play, pause of play, fast forward or fast reverse.
17. A playing device of Bluetooth transmission data is applied to a receiving device, the receiving device is connected with a sending device through Bluetooth, and the device comprises:
the data receiving unit is used for receiving a data packet sent by the sending equipment through an independent data receiving thread and storing the data packet in a buffer memory area of the receiving equipment, wherein the data packet comprises a data packet at a current playing position and a data packet behind the current playing position, and the data is audio data and/or video data;
and the playing control unit is used for playing the data packet.
18. The playback apparatus for bluetooth data according to claim 17, wherein the data receiving unit is further configured to:
when the buffer storage area has no more residual space for storing the data packet, stopping receiving the new data packet, and feeding back insufficient space information to the sending equipment to enable the sending equipment to suspend sending the data packet;
and when the buffer storage area obtains enough space again to store the data packet, feeding back the information of enough space to the sending equipment, and enabling the sending equipment to continue sending the data packet.
19. The playback apparatus for bluetooth data according to claim 17, wherein the data receiving unit is further configured to:
carrying out data check 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 verification failure.
20. The playback apparatus for bluetooth data transmission according to claim 17, wherein the playback control unit is further configured to:
and receiving the control command sent by the sending equipment through an independent play control thread, and controlling the play operation of the data packet according to the control command.
21. The playback apparatus for bluetooth data according to claim 20, wherein the data packet includes a display time stamp position,
the playback control unit is further configured to:
the control command comprises a display timestamp position of command execution;
searching the display time stamp position of the command execution in the buffer memory area;
and starting from the data packet corresponding to the display timestamp position executed by the command, executing the playing operation corresponding to the control command.
22. The playback apparatus for bluetooth data according to claim 21, 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 memory area, feeding back data request information to the sending equipment, and enabling the sending equipment to send the data packet from the display time stamp position of the command execution.
23. The playback apparatus for bluetooth data transmission according to claim 20, wherein the data packet does not include a display time stamp position,
the playback control unit is further configured to:
emptying the buffer memory area; and after receiving the data packet sent by the sending equipment, starting from the initial position of the buffer storage area, executing the playing operation corresponding to the control command.
24. A playback device as claimed in any one of the claims 20 to 23, characterized in that the control commands comprise start of playback, pause of playback, fast forward or fast reverse.
25. A transmitting apparatus for Bluetooth data transmission, applied to a transmitting device, wherein the transmitting device is connected to a receiving device via Bluetooth, the apparatus comprising:
the file playing device comprises a transmission preparation unit, a playing unit and a playing unit, wherein the transmission preparation unit is used for dividing a file to be played into a plurality of data packets, the data packets comprise a data packet at a current playing position and a data packet which is not played after the current playing position, and the data packets are audio data and/or video data;
and the data sending unit is used for sending the data packet to the receiving equipment through an independent data sending thread, so that the receiving equipment stores the data packet in a buffer memory area and plays the data packet.
26. The apparatus for transmitting bluetooth transmission data according to claim 25, wherein the data transmitting unit is further configured to:
when receiving the insufficient space information fed back by the receiving equipment because the buffer storage area has no more remaining space for storing the data packet, suspending the data packet transmission;
and when receiving sufficient space information fed back by the receiving equipment because the buffer storage area regains sufficient space to store the data packet, continuing to send the data packet.
27. The apparatus for transmitting bluetooth transmission data according to claim 25, wherein the data transmitting unit is further configured to:
and when receiving the check failure information fed back by the sending equipment due to the check failure of the data packet, resending the data packet with the check failure.
28. The apparatus for transmitting bluetooth transmission data according to claim 25, wherein 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.
29. The apparatus for transmitting Bluetooth transmission data as claimed in claim 28, wherein the data packet includes a display time stamp position,
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 memory area, and starts to execute the playing operation corresponding to the control command from a data packet corresponding to the display time stamp position of command execution.
30. The apparatus for transmitting bluetooth transmission data according to claim 29, wherein the 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, and enabling the data transmitting unit to transmit the data packet from the display time stamp position of the command execution.
31. The apparatus for transmitting bluetooth transmission data according to claim 28, wherein the data packet does not include a display time stamp position,
the command sending unit is further configured to:
and the control command enables the receiving equipment to empty the buffer memory area, and after the sent data packet is received, the playing operation corresponding to the control command is executed from the initial position of the buffer memory area.
32. The apparatus as claimed in any one of claims 28-31, wherein the control command comprises start of play, pause of play, fast forward or fast reverse.
33. A receiving device, comprising:
a memory to store instructions; and
a processor for calling the instructions stored in the memory to execute the playing method of the bluetooth transmission data according to any one of claims 1 to 8.
34. A transmitting device, comprising:
a memory to store instructions; and
a processor for invoking the memory stored instructions to perform a method of transmitting bluetooth data according to any of claims 9-16.
35. A computer-readable storage medium storing instructions which, when executed by a processor, perform a method of playing back bluetooth transmission data according to any one of claims 1 to 8.
36. A computer-readable storage medium storing instructions which, when executed by a processor, perform a method of transmitting bluetooth transmission data according to any one of claims 9-16.
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 true CN111586152A (en) 2020-08-25
CN111586152B 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)

Cited By (1)

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

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040228367A1 (en) * 2002-09-06 2004-11-18 Rudiger Mosig Synchronous play-out of media data packets
CN105163155A (en) * 2015-08-26 2015-12-16 小米科技有限责任公司 Method and device for synchronous playing
CN105306110A (en) * 2015-09-18 2016-02-03 深圳市冠旭电子有限公司 Methods and system for realizing music synchronous play
WO2016127687A1 (en) * 2015-02-13 2016-08-18 广东欧珀移动通信有限公司 Media file playback progress synchronization method, device and system
CN106792073A (en) * 2016-12-29 2017-05-31 北京奇艺世纪科技有限公司 Method, playback equipment and system that the audio, video data of striding equipment is synchronously played
US20170155692A1 (en) * 2015-11-27 2017-06-01 Beijing Xiaoniao Tingting Technology Co., LTD. Playing method and playing device
CN108616818A (en) * 2018-03-23 2018-10-02 南京中感微电子有限公司 A kind of data repeating method, Bluetooth slave devices and wireless communication system
CN109348464A (en) * 2018-11-23 2019-02-15 深圳时空壶技术有限公司 Data transmission method and receiving device for low-power consumption bluetooth receiving device
CN109451346A (en) * 2018-10-18 2019-03-08 青岛海信电器股份有限公司 Audio data processing method, terminal device and storage medium based on Bluetooth communication

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040228367A1 (en) * 2002-09-06 2004-11-18 Rudiger Mosig Synchronous play-out of media data packets
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
CN105306110A (en) * 2015-09-18 2016-02-03 深圳市冠旭电子有限公司 Methods and system for realizing music synchronous play
US20170155692A1 (en) * 2015-11-27 2017-06-01 Beijing Xiaoniao Tingting Technology Co., LTD. Playing method and playing device
CN106792073A (en) * 2016-12-29 2017-05-31 北京奇艺世纪科技有限公司 Method, playback equipment and system that the audio, video data of striding equipment is synchronously played
CN108616818A (en) * 2018-03-23 2018-10-02 南京中感微电子有限公司 A kind of data repeating method, Bluetooth slave devices and wireless communication system
CN109451346A (en) * 2018-10-18 2019-03-08 青岛海信电器股份有限公司 Audio data processing method, terminal device and storage medium based on Bluetooth communication
CN109348464A (en) * 2018-11-23 2019-02-15 深圳时空壶技术有限公司 Data transmission method and receiving device for low-power consumption bluetooth receiving device

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" *
查辉,余胜生,马彦明,王有成,周敬利: "基于蓝牙的连续媒体实时传输技术的研究" *

Cited By (2)

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

Also Published As

Publication number Publication date
CN111586152B (en) 2023-06-02

Similar Documents

Publication Publication Date Title
CN108831448B (en) Method and device for controlling intelligent equipment through voice and storage medium
US11688389B2 (en) Method for processing voice signals and terminal thereof
WO2020253566A1 (en) Audio playing method, device and storage medium
CN111314768A (en) Screen projection method, screen projection device, electronic equipment and computer readable storage medium
CN106686446B (en) Content projection method and mobile terminal
WO2022022193A1 (en) Video source switching method and apparatus, playback method and apparatus, device, and storage medium
WO2021143479A1 (en) Media stream transmission method and system
CN109698794B (en) Congestion control method and device, electronic equipment and storage medium
US8515461B2 (en) Mobile terminal and controlling method thereof
US11457250B2 (en) Method, device, and storage medium for transmitting data
US11503642B2 (en) Method and device for determining an uplink-downlink switching point
CN109005438B (en) Video playing method and device
US20220095020A1 (en) Method for switching a bit rate, and electronic device
KR20200085595A (en) Contents reproducing apparatus and method thereof
CN106792024B (en) Multimedia information sharing method and device
CN112165645A (en) Control method of playback device, and computer storage medium
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
CN112015359A (en) Display method and electronic equipment
CN113660513A (en) Method, device and storage medium for synchronizing playing time
JP2020512769A (en) System information transmitting method and device, system information receiving method, device and program
CN113238887A (en) Data processing method, device and storage medium
US11689690B2 (en) Method and device for audio and video synchronization
WO2023185590A1 (en) Media information acquisition method and electronic device
US20230297324A1 (en) Audio Control Method, System, and Electronic Device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant