Data transmission method, device, electronic device and computer readable storage medium

By adjusting the time interval for audio data transmission in the voice broadcasting device and dynamically adjusting according to the cache space of the playback end, the problem of difficult to balance the audio data transmission rate and broadcast fluency in the prior art is solved, and more efficient audio data transmission and smoother broadcasting effects are achieved.

CN114416013BActive Publication Date: 2025-03-11SHENZHEN TCL NEW-TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210001992.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2025-03-11
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

During the audio data transmission process, existing voice broadcasting devices are difficult to balance the transmission rate and broadcast fluency, resulting in the possible loss of sound or lag. In addition, the flow control protocol requires real-time transmission of available data for cache space, occupying bandwidth and complex control process.

Method used

By sending the decoded audio data to the playback end according to the data packet with the preset playback time and the preset initial time interval, and determining the node that modifys the preset initial time interval based on the total storage time of the cache space of the playback end, the time interval is modified to the same as the playback time period, ensuring balanced transmission of audio data.

Benefits of technology

The control process of audio data transmission is simplified, the use of transmission bandwidth is reduced, and the fluency of audio data at the playback end is improved, avoiding cache space overflow and lag.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416013B_ABST
    Figure CN114416013B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a data sending method, device, electronic device and computer-readable storage medium, including: sending decoded audio data to a playback end according to a data packet of a preset playback duration and a preset initial time interval, wherein the preset initial time interval is less than the preset playback duration; determining a total storage duration of audio data that can be stored in a cache space of the playback end; determining a modification node for modifying the preset initial time interval according to the preset initial time interval, the preset playback duration and the total storage duration; at the modification node, modifying the preset initial time interval to the preset playback duration; sending data packets to the playback end according to the modified preset initial time interval until all data packets are sent; the determination of the modification node does not require real-time feedback of available space data of the playback end, thereby reducing the occupancy of the transmission bandwidth, simplifying the control process of audio data transmission, and improving the fluency of audio data broadcasting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and specifically to a data sending method, device, electronic device, and computer-readable storage medium. Background Art

[0002] With the rapid development of computer technology, there are more and more types of voice broadcasting equipment. The evaluation of a voice broadcasting equipment mainly depends on the fluency of the voice broadcasting equipment.

[0003] Among them, the voice broadcasting device mainly includes two processes when broadcasting voice, namely the sending process after decoding the audio data and the broadcasting process after receiving the decoded audio data. Among them, if the audio data is sent too fast, sound loss will occur, and if it is sent too slowly, it will appear. Therefore, in order to ensure the smoothness of voice broadcasting, a flow control protocol will be established between sending and broadcasting. The size and rate of audio data sending are controlled according to the size of the cache space of the real-time transmission broadcast end. However, this method requires real-time transmission of available memory data in the cache space, which occupies the transmission bandwidth, and the control process is relatively cumbersome. Summary of the invention

[0004] The embodiments of the present application provide a data sending method, device, electronic device and computer-readable storage medium, which can simplify the control process of audio data transmission and reduce the occupancy of transmission bandwidth.

[0005] The present application provides a data transmission method, including:

[0006] Sending the decoded audio data to the playback end according to the data packet of preset playback duration and the preset initial time interval, wherein the preset initial time interval is less than the preset playback duration;

[0007] Determine the total storage time of the audio data that can be stored in the cache space of the playback end;

[0008] Determine a modification node for modifying the preset initial time interval according to the preset initial time interval, the preset playback duration, and the total storage duration;

[0009] At the modification node, the preset initial time interval is modified to the preset playback duration;

[0010] Data packets are sent to the playback end according to the modified preset initial time interval until all data packets are sent.

[0011] Accordingly, an embodiment of the present application further provides a data sending device, including:

[0012] An initial sending module, used to send the decoded audio data to the playback end according to a data packet of a preset playback duration and a preset initial time interval, wherein the preset initial time interval is less than the preset playback duration;

[0013] The duration determination module is used to determine the total storage duration of the audio data that can be stored in the cache space of the playback end;

[0014] A node determination module, used to determine a modification node for modifying a preset initial time interval according to a preset initial time interval, a preset playback duration, and a total storage duration;

[0015] The modification interval module is used to modify the preset initial time interval to the preset playback duration at the modification node;

[0016] The target sending module is used to send data packets to the playback end according to the modified preset initial time interval until all data packets are sent.

[0017] Optionally, in some embodiments of the present invention, the node determination module includes:

[0018] A first determining unit, configured to determine, according to a preset initial time interval and a preset playing time, a superimposed playing time of the audio data to be played in the cache space within each preset initial time interval;

[0019] The second determining unit is used to determine a modification node for modifying a preset initial time interval according to the superimposed playback duration and the total storage duration.

[0020] Optionally, in some embodiments of the present invention, modifying the node includes accumulating a target number of times of sending data packets, and the second determining unit includes:

[0021] A first determining subunit is used to determine a critical number of times that a data packet can be sent according to the superimposed playback time and the total storage time;

[0022] The second determining subunit is used to determine a target sending number of times for sending a data packet according to a critical sending number of times, and the target sending number of times is less than or equal to the critical sending number of times.

[0023] Optionally, in some embodiments of the present invention, the modification node includes a total duration of transmittable data corresponding to the transmittable audio data, and the second determining unit includes:

[0024] A third determining subunit is used to determine a critical number of times that a data packet can be sent according to the superimposed playback time and the total storage time;

[0025] A fourth determining subunit, configured to determine a critical accumulated sending time during which the data packet can be sent according to the critical number of sending times and the preset playing time;

[0026] The fifth determining subunit is used to determine the total duration of data that can be sent according to the critical accumulated sending duration, and the total duration of data that can be sent is less than or equal to the critical accumulated sending duration.

[0027] Optionally, in some embodiments of the present invention, the device further comprises:

[0028] A first modifying unit is used to modify the preset playback duration to obtain a preset modified playback duration, and the preset modified playback duration is greater than or less than the preset playback duration;

[0029] Modify the interval module including:

[0030] The second modifying unit is used to modify the preset initial time interval to a preset playback modification duration.

[0031] Optionally, in some embodiments of the present invention, the device further comprises:

[0032] A first acquisition unit, used to acquire the time consumed in the transmission process of the audio data on the data transmission link;

[0033] A third determining unit, configured to determine an actual sending time interval for actually sending the audio data according to a preset initial time interval and a consumed time;

[0034] Initial sending module, including:

[0035] The sending unit is used to send the decoded audio data to the player according to the data packet with preset playing time, the actual sending time interval and the data transmission link.

[0036] Optionally, in some embodiments of the present invention, the duration determination module:

[0037] A second acquisition unit, used to acquire the data format and bit rate of the audio data, and the memory of the cache space;

[0038] The fourth determining unit is used to determine the total storage time of the audio data that can be stored in the cache space according to the memory, data format and bit rate.

[0039] The embodiment of the present application divides the sending of audio data into a first stage and a second stage. In the first stage, the time interval for sending audio is set to be less than the playback duration of each data packet, so that the playback end can still store audio data of a certain playback duration after playing the data in each time interval, thereby avoiding the phenomenon of jamming due to lack of data on the playback end; in the second stage, the modification node of the time interval is determined according to the total storage duration of the playback end cache space and the time interval and the playback duration of the data packet in the first stage, and at the modification node, the time interval and the playback duration are adjusted to be the same, so that the playback end receives and plays audio data to achieve a balance between input and output, thereby preventing the overflow of cache space data and ensuring that audio data is stored in the cache space, thereby achieving smooth playback of audio on the playback end. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 It is a scenario schematic diagram of the data sending method provided in an embodiment of the present application;

[0042] Figure 2 It is a flowchart of a data sending method provided in an embodiment of the present application;

[0043] Figure 3 is a structural diagram of a data sending device provided in an embodiment of the present application;

[0044] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0046] The embodiments of the present application provide a data transmission method, device, electronic device and storage medium. Specifically, the embodiments of the present application provide a data transmission device suitable for electronic devices, wherein the electronic device can be a terminal or a server and other devices. Among them, the terminal can be an air conditioner, a smart phone, a smart TV, a speaker, a loudspeaker and other devices with a voice broadcast function. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms. The server can be directly or indirectly connected via wired or wireless communication.

[0047] It can be understood that the data sending method of the embodiment of the present application can be executed on the terminal, can be executed on the server, or can be executed jointly by the terminal and the server.

[0048] For example, see Figure 1 In the embodiment of the present application, a terminal and a server jointly execute a data sending method as an example, wherein other devices may be added on the basis of the terminal and the server to assist in completing the data sending method, and the types of other devices are not limited here; the terminal and the server are connected via a network, such as a wired or wireless network connection, and the specific execution process is as follows:

[0049] The main control chip in terminal device A obtains audio data from server B. The main control chip decodes the obtained audio data and sends it to the voice chip of terminal device A, and the voice chip broadcasts the decoded audio data.

[0050] Among them, when sending the decoded audio data, the main control chip first sends the decoded audio data to the voice chip (playing end) according to the data packet with the preset playback time length and the preset time interval in the first stage, and then enters the second stage of sending after reaching the modification node. Among them, when entering the second stage, the time interval for sending the above-mentioned data packet is adjusted to the same time interval as the playback time length corresponding to the data packet, so that the duration of the voice chip receiving the audio data and the duration of playing the audio data in the second stage are balanced, and the audio data sending of the second stage is maintained until all data packets are sent.

[0051] Among them, the time interval for sending audio data in the first stage is less than the playback time corresponding to the data packet, which aims to store audio data with a fixed playback duration in the voice chip in sequence to ensure that the voice chip continues to store audio data during the entire broadcast process and ensure the smoothness of the audio broadcast.

[0052] Among them, after continuously storing audio data with a fixed playback duration, the available storage space in the voice chip becomes less and less. In order to avoid data overflow in the storage space, which in turn causes abnormalities such as noise in the audio data broadcast, the time interval modification node can be determined according to the capacity of the voice chip storage space. For example, the storage space is full based on the sending time interval and playback duration of the first stage and the memory of the storage space. The full moment corresponds to the modification node of the sending time interval.

[0053] Among them, since the time interval for sending audio data, the playback time of the data packet, and the memory of the voice chip are determined in the first stage, the modification node can be determined in advance, and the time interval for sending audio data can be automatically triggered after reaching the modification node, so that the control process of sending audio data is completed automatically, and there is no need to transmit the available capacity of the cache space in real time during the process, which reduces the complexity of the sending process control and saves transmission bandwidth.

[0054] The embodiment of the present application divides the sending of audio data into a first stage and a second stage. In the first stage, the time interval for sending audio is set to be less than the playback duration of each data packet, so that the playback end can still store audio data of a certain playback duration after playing the data in each time interval, thereby avoiding the phenomenon of jamming due to lack of data on the playback end; in the second stage, the modification node of the time interval is determined according to the total storage duration of the playback end cache space and the time interval and the playback duration of the data packet in the first stage, and at the modification node, the time interval and the playback duration are adjusted to be the same, so that the playback end receives and plays audio data to achieve a balance between input and output, thereby preventing the overflow of cache space data and ensuring that audio data is stored in the cache space, thereby achieving smooth playback of audio on the playback end.

[0055] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.

[0056] See also Figure 2 , Figure 2 The following is a flow chart of a data transmission method provided in an embodiment of the present application. The specific flow of the data transmission method may be as follows:

[0057] 101. Send decoded audio data to a playback end according to a data packet of a preset playback duration and a preset initial time interval, wherein the preset initial time interval is less than the preset playback duration.

[0058] Among them, the data packet with a preset playback time refers to the transmission of audio data according to the fixed playback time, and based on the preset initial time interval, the audio data with a fixed playback time is sent to the playback end in sequence; after receiving the decoded audio data, the playback end can broadcast the decoded audio data.

[0059] Among them, the preset playback duration and the preset initial time interval can be flexibly set to actual values ​​according to actual needs, and are not limited here. Among them, in an embodiment of the present application, the preset initial time interval is set to be less than the preset playback duration, so that in each time interval, the playback duration of the playback end is less than the playback duration of the received audio data, so that the playback end can still store some of the remaining duration of the audio data to be played after each data is received and the audio data is played within the time interval, so that the playback end can continuously and stably superimpose the audio data with a fixed playback duration, so that the playback end can play smoothly.

[0060] Among them, in the embodiment of the present application, the audio data is transmitted according to data segments (data packets) with a fixed playback duration, which does not break the order of the audio data broadcast frames and is still transmitted in sequence. When the playback end broadcasts the audio data, it also broadcasts it according to the broadcast frames of the audio data, that is, the audio data received in each interval is not broadcast in real time. For example, the audio data output method of the broadcast end is similar to the first-in-first-out in the queue.

[0061] In which, since the audio data consumes a part of the time on the transmission link during the transmission process, the time interval for actually starting to send the data needs to be actually adjusted according to the time consumed on the transmission link, that is, optionally, in some embodiments, the method further includes:

[0062] Obtain the time consumed by the audio data during transmission on the data transmission link;

[0063] Determine an actual sending time interval for actually sending the audio data according to the preset initial time interval and the consumed time;

[0064] Then, the step of "sending the decoded audio data to the playback end according to the data packet of the preset playback duration and the preset initial time interval" may specifically include:

[0065] The decoded audio data is sent to the playback end according to the data packet with preset playback duration, the actual sending time interval and the data transmission link.

[0066] Among them, in the embodiment of the present application, the preset initial time interval is set according to the time when the playback end receives the audio data, and a certain balance is reached according to the preset initial time interval and the preset playback time. However, after the sending end sends the data, the audio data will be transmitted on the data transmission link for a certain time during the transmission process. Therefore, the actual reception time of the receiving end will be affected by the transmission time of the audio data. Therefore, in the embodiment of the present application, the actual sending time interval for the actual start of sending the audio data is determined according to the transmission time (consumed time) on the data transmission link, so that the sending end sends the audio data according to the actual sending time interval, and the audio data is received according to the preset initial time interval.

[0067] 102. Determine the total storage time of the audio data that can be stored in the cache space of the playback end.

[0068] Among them, since the time interval for audio data transmission is less than the playback duration, audio data of a certain playback duration will be continuously accumulated in the cache space of the playback end. However, the memory of the cache space is fixed. Therefore, when the cache space is full of audio data (modify the node), it is necessary to adjust the sending of audio data to prevent overflow of audio data in the cache space.

[0069] Among them, since the audio data is transmitted at fixed time intervals and fixed playback duration, it is necessary to determine the total storage time that can store the audio data in the cache space of the playback end, and adjust the time interval for sending audio data according to the total storage time, so as to provide a reference basis for achieving a balance between the playback end receiving audio data and broadcasting audio data.

[0070] Among them, for audio data of different data formats and bit rates, the playback duration of audio data that can be stored in the cache space is different, so the playback duration of audio data that can be cached in the cache space can be determined according to the format and bit rate of the audio data, that is, optionally, in some embodiments, the step of "determining the total storage duration of audio data that can be stored in the cache space of the playback end" includes:

[0071] Get the data format and bit rate of the audio data, as well as the memory of the cache space;

[0072] The total storage time of the audio data that can be stored in the cache space is determined based on the memory, data format and bit rate.

[0073] Among them, the data format and bit rate of audio data are important parameters for determining the length of time that the cache space can store audio data. However, it is not limited to determining the total storage time only by the data format and bit rate. In order to achieve higher accuracy in obtaining the total storage time, the following corresponding judgment conditions or factors can be added.

[0074] The data format of the audio data includes Moving Picture Experts Group Audio Layer III (MP3), Moving Pictures Experts Group (MPEG), or Windows Media Audio (WMA).

[0075] 103. Determine a modification node for modifying the preset initial time interval according to the preset initial time interval, the preset playback duration, and the total storage duration.

[0076] Among them, the modification node is the node in the cache space that will be full of audio data. Through the determination of this node, when this node is reached, by triggering the adjustment of the preset initial time interval, the overflow of audio data in the cache space can be prevented, ensuring that the playback end can broadcast audio data smoothly.

[0077] Among them, the specific node at which the audio data fills the cache space can be determined through the time interval for sending the audio data, the playback time of the data packet and the total storage time of the cache space.

[0078] Specifically, in an embodiment of the present application, the single cumulative superimposed audio data playback duration in the cache space within each time interval can be determined by the time interval for sending audio data and the playback duration of the data packet. By superimposing the playback duration and the total storage duration of the cache space, the node in the cache space where the audio data is fully stored can be determined. This node is the modification node for adjusting the time interval for sending audio data in the embodiment of the present application. That is, optionally, in some embodiments, the step of "determining the modification node for modifying the preset initial time interval" includes:

[0079] Determine, according to the preset initial time interval and the preset playback duration, the superimposed playback duration of the audio data to be played in the cache space within each preset initial time interval;

[0080] According to the superimposed playback duration and the total storage duration, a modification node for modifying the preset initial time interval is determined.

[0081] Among them, the superimposed playback time can be calculated based on the difference between the preset playback time and the preset initial time interval. For example, the audio data is sent at an interval of 30ms, and the playback time corresponding to the data packet is 60ms. Then, in each interval, the audio data is broadcast for 30ms, and audio data with a duration of 30ms is superimposed in the cache space.

[0082] Among them, by superimposing the playback time of each time interval and the total storage time of the cache space, the node at which the cache space is full can be determined, and this node is the modification node that the embodiment of the present application expects to adjust.

[0083] The modification node may be the number of times the audio data is sent, that is, the number of times the audio data is sent according to the preset initial time interval. Optionally, in some embodiments, the step of “determining the modification node for modifying the preset initial time interval” includes:

[0084] Determine the critical number of times that the data packet can be sent according to the superimposed playback time and the total storage time;

[0085] The target sending number of times for sending the data packet is determined according to the critical sending number, and the target sending number is less than or equal to the critical sending number.

[0086] Among them, after determining the superimposed playback time and the total storage time, the maximum number of times the audio data can be sent (critical number of sending times) can be determined, that is, when the maximum number of sending times is reached, the cache space is full of audio data due to the superimposed playback time; therefore, the target number of sending times can be determined based on the critical number of sending times, so that after the audio data is sent according to the target number of sending times, the cache space audio data will not overflow, that is, the target number of sending times is selected to be less than or equal to the critical number of sending times.

[0087] Therefore, after the audio data is sent according to the preset initial time interval and the preset playback duration, the number of times the audio data is sent can be recorded. When the target number of sending times is reached, the preset initial time interval can be adjusted to prevent the overflow of the audio data in the cache space and ensure the smooth playback of the audio data on the playback end.

[0088] Among them, since in the embodiment of the present application, the number of transmissions only needs to be recorded and the transmission is controlled according to the recording results, and there is no need to receive the available space data of the cache space transmitted from the playback end during the transmission process, the occupancy of the audio data transmission bandwidth is reduced, and at the same time, the complexity of the audio data transmission control is also reduced.

[0089] Among them, since the memory size of the cache space is fixed, and the playing time corresponding to the audio data sent at each time interval is also fixed, the total time of the audio data sent by the sender can be determined when the cache space is about to be full of data. Therefore, the total time of the audio data sent by the sender when the cache space is about to be full can be used as the modification node for adjusting the preset initial time interval;

[0090] That is, the modification node may also be the total duration of the audio data corresponding to the audio data sent by the sender. When the total duration of the audio data sent by the sender reaches a certain value, the preset initial time interval is adjusted and modified. That is, optionally, in some embodiments, the step of "determining the modification node for modifying the preset initial time interval" includes:

[0091] Determine the critical number of times that the data packet can be sent according to the superimposed playback time and the total storage time;

[0092] Determine the critical cumulative sending time during which the data packet can be sent according to the critical sending times and the preset playing time;

[0093] The total duration of data that can be sent is determined according to the critical accumulated sending duration, and the total duration of data that can be sent is less than or equal to the critical accumulated sending duration.

[0094] Among them, the total duration of data that can be sent (i.e. the total duration of the above-mentioned audio data) can be determined when the cache space is full based on the number of times the audio data is sent and the playback duration of the audio data sent each time. For example, the product of the number of times the audio data is sent and the playback duration of the audio data sent each time is used as the maximum total duration of audio data that can be sent by the sending end (total duration of sendable data) when the cache space is full. That is, it can be understood that after the sending end sends the audio data of the above-mentioned total duration of sendable data to the playback end, the cache space of the playback end will be full of audio data.

[0095] Among them, the total duration of data that can be sent can be determined before the audio data is sent, based on the preset playback duration of the data packet, the preset initial time interval and the total storage time of the cache space, so that the time interval for sending audio data can be adjusted and controlled according to the actual duration of the audio data sent by the sender, without the need to make adjustments based on the feedback from the player, thereby saving the transmission bandwidth occupied by the feedback process.

[0096] 104. At the modification node, the preset initial time interval is modified to the preset playback duration.

[0097] Among them, the modification node is the node where the cache space of the playback end is full, and the preset initial time interval is adjusted to be the same as the preset playback duration, so that the playback end can achieve a balance between receiving audio data and playing audio data, that is, the audio data playback duration added by the playback end within a time interval is equal to the playback duration corresponding to the audio data played within this time interval, while preventing audio data overflow, achieving smooth audio broadcasting.

[0098] Among them, it is only necessary to adjust the preset initial time interval to be the same as the preset playback duration to achieve a balance between reception and broadcasting at the playback end. Therefore, in the embodiment of the present application, the preset playback duration can also be adjusted at the modification node, that is, optionally, in some embodiments, the method further includes:

[0099] Modify the preset playback time to obtain the preset playback modification time, and the preset playback modification time is greater than or less than the preset playback time;

[0100] Then, the step of “determining a modification node for modifying the preset initial time interval” includes:

[0101] Modify the preset initial time interval to the preset playback modification duration.

[0102] The preset playback duration may be adjusted to be the same as the preset initial time interval, or the preset playback duration may be adjusted to other values, and then the preset initial time interval may be adjusted accordingly.

[0103] Among them, the above adjustment method for the preset initial time interval increases the flexibility of achieving audio data fluency.

[0104] 105. Send data packets to the playback end according to the modified preset initial time interval until all data packets are sent.

[0105] Among them, audio data is sent to the playback end according to the adjusted preset initial time interval, so that the playback end can achieve a balance between input and output when receiving and broadcasting audio data, which prevents audio data overflow and improves the smoothness of audio data broadcasting at the playback end.

[0106] The embodiment of the present application divides the sending of audio data into a first stage and a second stage. In the first stage, the time interval for sending audio is set to be less than the playback duration of each data packet, so that the playback end can still store audio data of a certain playback duration after playing the data in each time interval, thereby avoiding the phenomenon of jamming due to lack of data on the playback end; in the second stage, the modification node of the time interval is determined according to the total storage duration of the playback end cache space and the time interval and the playback duration of the data packet in the first stage, and at the modification node, the time interval and the playback duration are adjusted to be the same, so that the playback end receives and plays audio data to achieve a balance between input and output, thereby preventing overflow of cache space data and ensuring that audio data is stored in the cache space, thereby achieving smooth playback of audio on the playback end; wherein, the determination of the modification node does not need to be determined based on real-time feedback from the playback end, thereby reducing the occupancy of the audio data transmission bandwidth.

[0107] In order to better implement the data transmission method of the present application, the present application also provides a data transmission device based on the above data transmission method. The meanings of the terms are the same as those in the above data transmission method, and the specific implementation details can refer to the description in the method embodiment.

[0108] See also Figure 3 , Figure 3 The schematic diagram of the structure of the data sending device provided in the present application, wherein the data sending device may include an initial sending module 201, a duration determination module 202, a node determination module 203, a modification interval module 204 and a target sending module 205, which may be specifically as follows:

[0109] The initial sending module 201 is used to send the decoded audio data to the playback end according to the data packet of the preset playback duration and the preset initial time interval, and the preset initial time interval is shorter than the preset playback duration.

[0110] Among them, the data packet with a preset playback time refers to the transmission of audio data according to the fixed playback time, and based on the preset initial time interval, the audio data with a fixed playback time is sent to the playback end in sequence; after receiving the decoded audio data, the playback end can broadcast the decoded audio data.

[0111] Among them, the preset playback duration and the preset initial time interval can be flexibly set to actual values ​​according to actual needs, and are not limited here. Among them, in an embodiment of the present application, the preset initial time interval is set to be less than the preset playback duration, so that in each time interval, the playback duration of the playback end is less than the playback duration of the received audio data, so that the playback end can still store some of the remaining duration of the audio data to be played after each data is received and the audio data is played within the time interval, so that the playback end can continuously and stably superimpose the audio data with a fixed playback duration, so that the playback end can play smoothly.

[0112] Optionally, in some embodiments of the present invention, the device further comprises:

[0113] A first acquisition unit, used to acquire the time consumed in the transmission process of the audio data on the data transmission link;

[0114] A third determining unit, configured to determine an actual sending time interval for actually sending the audio data according to a preset initial time interval and a consumed time;

[0115] Initial sending module, including:

[0116] The sending unit is used to send the decoded audio data to the player according to the data packet with preset playing time, the actual sending time interval and the data transmission link.

[0117] Among them, in the embodiment of the present application, the preset initial time interval is set according to the time when the playback end receives the audio data, and a certain balance is reached according to the preset initial time interval and the preset playback time. However, after the sending end sends the data, the audio data will be transmitted on the data transmission link for a certain time during the transmission process. Therefore, the actual reception time of the receiving end will be affected by the transmission time of the audio data. Therefore, in the embodiment of the present application, the actual sending time interval for the actual start of sending the audio data is determined according to the transmission time (consumed time) on the data transmission link, so that the sending end sends the audio data according to the actual sending time interval, and the audio data is received according to the preset initial time interval.

[0118] The duration determination module 202 is used to determine the total storage duration of the audio data that can be stored in the cache space of the playback end.

[0119] Among them, since the time interval for audio data transmission is less than the playback duration, audio data of a certain playback duration will be continuously accumulated in the cache space of the playback end. However, the memory of the cache space is fixed. Therefore, when the cache space is full of audio data (modify the node), it is necessary to adjust the sending of audio data to prevent overflow of audio data in the cache space.

[0120] Among them, since the audio data is transmitted at fixed time intervals and fixed playback duration, it is necessary to determine the total storage time that can store the audio data in the cache space of the playback end, and adjust the time interval for sending audio data according to the total storage time, so as to provide a reference basis for achieving a balance between the playback end receiving audio data and broadcasting audio data.

[0121] Optionally, in some embodiments of the present invention, the duration determination module:

[0122] A second acquisition unit, used to acquire the data format and bit rate of the audio data, and the memory of the cache space;

[0123] The fourth determining unit is used to determine the total storage time of the audio data that can be stored in the cache space according to the memory, data format and bit rate.

[0124] For audio data of different data formats and bit rates, the playback duration of the audio data that can be stored in the cache space is different. Therefore, the playback duration of the audio data that can be cached in the cache space can be determined according to the format and bit rate of the audio data.

[0125] The node determination module 203 is used to determine a modification node for modifying the preset initial time interval according to the preset initial time interval, the preset playback duration and the total storage duration.

[0126] Among them, the modification node is the node in the cache space that will be full of audio data. Through the determination of this node, when this node is reached, by triggering the adjustment of the preset initial time interval, the overflow of audio data in the cache space can be prevented, ensuring that the playback end can broadcast audio data smoothly.

[0127] Among them, the specific node at which the audio data fills the cache space can be determined through the time interval for sending the audio data, the playback time of the data packet and the total storage time of the cache space.

[0128] Optionally, in some embodiments of the present invention, the node determination module includes:

[0129] A first determining unit, configured to determine, according to a preset initial time interval and a preset playing time, a superimposed playing time of the audio data to be played in the cache space within each preset initial time interval;

[0130] The second determining unit is used to determine a modification node for modifying a preset initial time interval according to the superimposed playback duration and the total storage duration.

[0131] Among them, the superimposed playback time can be calculated based on the difference between the preset playback time and the preset initial time interval. For example, the audio data is sent at an interval of 30ms, and the playback time corresponding to the data packet is 60ms. Then, in each interval, the audio data is broadcast for 30ms, and audio data with a duration of 30ms is superimposed in the cache space.

[0132] Among them, by superimposing the playback time of each time interval and the total storage time of the cache space, the node at which the cache space is full can be determined, and this node is the modification node that the embodiment of the present application expects to adjust.

[0133] Optionally, in some embodiments of the present invention, modifying the node includes accumulating a target number of times of sending data packets, and the second determining unit includes:

[0134] A first determining subunit is used to determine a critical number of times that a data packet can be sent according to the superimposed playback time and the total storage time;

[0135] The second determining subunit is used to determine a target sending number of times for sending a data packet according to a critical sending number of times, and the target sending number of times is less than or equal to the critical sending number of times.

[0136] Among them, after determining the superimposed playback time and the total storage time, the maximum number of times the audio data can be sent (critical number of sending times) can be determined, that is, when the maximum number of sending times is reached, the cache space is full of audio data due to the superimposed playback time; therefore, the target number of sending times can be determined based on the critical number of sending times, so that after the audio data is sent according to the target number of sending times, the cache space audio data will not overflow, that is, the target number of sending times is selected to be less than or equal to the critical number of sending times.

[0137] Therefore, after the audio data is sent according to the preset initial time interval and the preset playback duration, the number of times the audio data is sent can be recorded. When the target number of sending times is reached, the preset initial time interval can be adjusted to prevent the overflow of the audio data in the cache space and ensure the smooth playback of the audio data on the playback end.

[0138] Among them, since in the embodiment of the present application, the number of transmissions only needs to be recorded and the transmission is controlled according to the recording results, and there is no need to receive the available space data of the cache space transmitted from the playback end during the transmission process, the occupancy of the audio data transmission bandwidth is reduced, and at the same time, the complexity of the audio data transmission control is also reduced.

[0139] Optionally, in some embodiments of the present invention, the modification node includes a total duration of transmittable data corresponding to the transmittable audio data, and the second determining unit includes:

[0140] A third determining subunit is used to determine a critical number of times that a data packet can be sent according to the superimposed playback time and the total storage time;

[0141] A fourth determining subunit, configured to determine a critical accumulated sending time during which the data packet can be sent according to the critical number of sending times and the preset playing time;

[0142] The fifth determining subunit is used to determine the total duration of data that can be sent according to the critical accumulated sending duration, and the total duration of data that can be sent is less than or equal to the critical accumulated sending duration.

[0143] Among them, the total duration of data that can be sent (i.e. the total duration of the above-mentioned audio data) can be determined when the cache space is full based on the number of times the audio data is sent and the playback duration of the audio data sent each time. For example, the product of the number of times the audio data is sent and the playback duration of the audio data sent each time is used as the maximum total duration of audio data that can be sent by the sending end (total duration of sendable data) when the cache space is full. That is, it can be understood that after the sending end sends the audio data of the above-mentioned total duration of sendable data to the playback end, the cache space of the playback end will be full of audio data.

[0144] Among them, the total duration of data that can be sent can be determined before the audio data is sent, based on the preset playback duration of the data packet, the preset initial time interval and the total storage time of the cache space, so that the time interval for sending audio data can be adjusted and controlled according to the actual duration of the audio data sent by the sender, without the need to make adjustments based on the feedback from the player, thereby saving the transmission bandwidth occupied by the feedback process.

[0145] The interval modification module 204 is used to modify the preset initial time interval to a preset playback duration at the modification node.

[0146] Among them, the modification node is the node where the cache space of the playback end is full, and the preset initial time interval is adjusted to be the same as the preset playback duration, so that the playback end can achieve a balance between receiving audio data and playing audio data, that is, the audio data playback duration added by the playback end within a time interval is equal to the playback duration corresponding to the audio data played within this time interval, while preventing audio data overflow, achieving smooth audio broadcasting.

[0147] Optionally, in some embodiments of the present invention, the device further comprises:

[0148] A first modifying unit is used to modify the preset playback duration to obtain a preset modified playback duration, and the preset modified playback duration is greater than or less than the preset playback duration;

[0149] Modify the interval module including:

[0150] The second modifying unit is used to modify the preset initial time interval to a preset playback modification duration.

[0151] The preset playback duration may be adjusted to be the same as the preset initial time interval, or the preset playback duration may be adjusted to other values, and then the preset initial time interval may be adjusted accordingly.

[0152] Among them, the above adjustment method for the preset initial time interval increases the flexibility of achieving audio data fluency.

[0153] The target sending module 205 is used to send data packets to the playback end according to the modified preset initial time interval until all data packets are sent.

[0154] Among them, audio data is sent to the playback end according to the adjusted preset initial time interval, so that the playback end can achieve a balance between input and output when receiving and broadcasting audio data, which prevents audio data overflow and improves the smoothness of audio data broadcasting at the playback end.

[0155] In the embodiment of the present application, the initial sending module 201 first sends the decoded audio data to the playback end according to the data packet of the preset playback duration and the preset initial time interval. Secondly, the duration determination module 202 obtains the total storage duration of the audio data that can be stored in the cache space of the playback end. Then, the node determination module 203 determines the modification node for modifying the preset initial time interval according to the preset initial time interval, the preset playback duration and the total storage duration. Then, the modification interval module 204 modifies the preset initial time interval at the modification node so that the preset initial time interval remains the same as the preset playback duration. Finally, the target sending module 205 sends the data packet to the playback end according to the modified preset initial time interval until all the data packets are sent.

[0156] Among them, the embodiment of the present application divides the sending of audio data into a first stage and a second stage. In the first stage, the time interval for sending audio is set to be less than the playback time of each data packet, so that the playback end can still store audio data of a certain playback time after playing the data in each time interval, avoiding the phenomenon of jamming due to lack of data on the playback end; in the second stage, the modification node of the time interval is determined according to the total storage time of the playback end cache space and the time interval and the playback time of the data packet in the first stage, and at the modification node, the time interval and the playback time are adjusted to be the same, so that the playback end receives and plays audio data to achieve a balance between input and output, which prevents the overflow of cache space data and ensures that audio data is stored in the cache space, thereby achieving smooth playback of audio on the playback end; wherein, the determination of the modification node does not need to be determined based on real-time feedback from the playback end, which reduces the occupancy of the audio data transmission bandwidth.

[0157] In addition, the present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:

[0158] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0159] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0160] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0161] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0162] The electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0163] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:

[0164] The decoded audio data is sent to the playback end according to the data packet of the preset playback duration and the preset initial time interval, wherein the preset initial time interval is less than the preset playback duration; the total storage duration of the audio data that can be stored in the cache space of the playback end is determined; according to the preset initial time interval, the preset playback duration and the total storage duration, a modification node for modifying the preset initial time interval is determined; at the modification node, the preset initial time interval is modified to the preset playback duration; and data packets are sent to the playback end according to the modified preset initial time interval until all data packets are sent.

[0165] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0166] The embodiment of the present application divides the sending of audio data into a first stage and a second stage. In the first stage, the time interval for sending audio is set to be less than the playback duration of each data packet, so that the playback end can still store audio data of a certain playback duration after playing the data in each time interval, thereby avoiding the phenomenon of jamming due to lack of data on the playback end; in the second stage, the modification node of the time interval is determined according to the total storage duration of the playback end cache space and the time interval and the playback duration of the data packet in the first stage, and at the modification node, the time interval and the playback duration are adjusted to be the same, so that the playback end receives and plays audio data to achieve a balance between input and output, thereby preventing overflow of cache space data and ensuring that audio data is stored in the cache space, thereby achieving smooth playback of audio on the playback end; wherein, the determination of the modification node does not need to be determined based on real-time feedback from the playback end, thereby reducing the occupancy of the audio data transmission bandwidth.

[0167] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0168] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any data sending method provided in the present application. For example, the instruction can execute the following steps:

[0169] The decoded audio data is sent to the playback end according to the data packet of the preset playback duration and the preset initial time interval, wherein the preset initial time interval is less than the preset playback duration; the total storage duration of the audio data that can be stored in the cache space of the playback end is determined; according to the preset initial time interval, the preset playback duration and the total storage duration, a modification node for modifying the preset initial time interval is determined; at the modification node, the preset initial time interval is modified to the preset playback duration; and data packets are sent to the playback end according to the modified preset initial time interval until all data packets are sent.

[0170] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0171] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0172] Since the instructions stored in the storage medium can execute any step in the data transmission provided in the present application, the beneficial effects that can be achieved by any data transmission method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0173] The above is a detailed introduction to a data sending method, device, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A data transmission method, characterized in that: include: Sending the decoded audio data to the playback end according to the data packet of preset playback duration and the preset initial time interval, wherein the preset initial time interval is less than the preset playback duration; Determine the total storage time of the audio data that can be stored in the cache space of the playback end; Determine, according to the preset initial time interval, the preset playback duration, and the total storage duration, a modification node for modifying the preset initial time interval, the modification node being a node at which the cache space will be fully filled with audio data; At the modification node, modifying the preset initial time interval to the preset playback duration; Sending the data packets to the playback end according to the modified preset initial time interval until all data packets are sent; The determining of a modification node for modifying the preset initial time interval includes: Determine, according to the preset initial time interval and the preset playback duration, the superimposed playback duration of the audio data to be played in the cache space within each of the preset initial time intervals; Determining a modification node for modifying the preset initial time interval according to the superimposed playback duration and the total storage duration; The modification node includes accumulating a target number of times of sending the data packet, and the modification node for determining to modify the preset initial time interval includes: Determining a critical number of times that the data packet can be sent according to the superimposed playback duration and the total storage duration; Determine a target sending number of times for sending the data packet according to the critical sending number, and the target sending number of times is less than or equal to the critical sending number of times; The modification node includes a total duration of transmittable data corresponding to the transmittable audio data, and the determination of modifying the modification node of the preset initial time interval includes: Determining a critical number of times that the data packet can be sent according to the superimposed playback duration and the total storage duration; Determine, according to the critical number of transmissions and the preset playback duration, a critical accumulated transmission duration during which the data packet can be transmitted; The total duration of data that can be sent is determined according to the critical accumulated sending duration, and the total duration of data that can be sent is less than or equal to the critical accumulated sending duration.

2. The method according to claim 1, characterized in that The method further includes: Modifying the preset playback duration to obtain a preset modified playback duration, wherein the preset modified playback duration is greater than or less than the preset playback duration; The step of modifying the preset initial time interval to the preset playback duration includes: The preset initial time interval is modified to the preset playback modification duration.

3. The method according to claim 1, characterized in that The method further includes: Obtaining the time consumed in the transmission of the audio data on the data transmission link; Determine, according to the preset initial time interval and the consumed time, an actual sending time interval for sending the audio data; The method of sending the decoded audio data to the playback end according to the data packet with preset playback duration and the preset initial time interval includes: The decoded audio data is sent to the playback end according to the data packet with the preset playback duration, the actual sending time interval and the data transmission link.

4. The method according to claim 1, characterized in that The determining of the total storage duration of the audio data that can be stored in the cache space of the playback end includes: Acquire the data format and bit rate of the audio data, and the memory of the cache space; The total storage time length of the audio data that can be stored in the cache space is determined according to the memory, the data format and the bit rate.

5. A data sending device, characterized in that: include: An initial sending module, used to send the decoded audio data to the playback end according to a data packet of a preset playback duration and a preset initial time interval, wherein the preset initial time interval is less than the preset playback duration; A duration determination module, used to determine the total storage duration of the audio data that can be stored in the cache space of the playback end; A node determination module, used to determine a modification node for modifying the preset initial time interval according to the preset initial time interval, the preset playback duration and the total storage duration, wherein the modification node is a node where the cache space is about to be full of audio data; An interval modification module, configured to modify the preset initial time interval to the preset playback duration at the modification node; A target sending module, used for sending the data packets to the playback end according to the modified preset initial time interval until all data packets are sent; The determining of a modification node for modifying the preset initial time interval includes: Determine, according to the preset initial time interval and the preset playback duration, the superimposed playback duration of the audio data to be played in the cache space within each of the preset initial time intervals; Determining a modification node for modifying the preset initial time interval according to the superimposed playback duration and the total storage duration; The modification node includes accumulating a target number of times of sending the data packet, and the modification node for determining to modify the preset initial time interval includes: Determining a critical number of times that the data packet can be sent according to the superimposed playback duration and the total storage duration; Determine a target sending number of times for sending the data packet according to the critical sending number, and the target sending number of times is less than or equal to the critical sending number of times; The modification node includes a total duration of transmittable data corresponding to the transmittable audio data, and the determination of modifying the modification node of the preset initial time interval includes: Determining a critical number of times that the data packet can be sent according to the superimposed playback duration and the total storage duration; Determine, according to the critical number of transmissions and the preset playback duration, a critical accumulated transmission duration during which the data packet can be transmitted; The total duration of data that can be sent is determined according to the critical accumulated sending duration, and the total duration of data that can be sent is less than or equal to the critical accumulated sending duration.

6. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the data sending method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data sending method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Streaming media transmission control method and streaming media server

    CN103957431A

  • Data synchronization method and device, equipment and computer readable storage medium

    CN110798458A