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

文档序号:424812 发布日期:2021-12-21 浏览:28次 中文

阅读说明:本技术 数据传输方法、装置、电子设备及计算机存储介质 (Data transmission method and device, electronic equipment and computer storage medium ) 是由 徐慧书 谢佳敏 张宜丰 于 2020-06-19 设计创作,主要内容包括:本申请实施例提供了一种数据传输方法、装置、电子设备及计算机存储介质,其中,数据传输方法包括:获取触发信息,并根据触发信息下载索引信息,索引信息包括至少一个多媒体切片数据对应的至少一个地址信息;按照至少一个地址信息下载对应的至少一个多媒体切片数据,其中,在下载目标多媒体切片数据时,并行下载索引信息中除目标多媒体切片数据之外的其他多媒体切片数据的地址信息。因为索引信息和多媒体切片数据并行下载,下载索引信息不影响多媒体切片数据的下载,提高了索引信息和多媒体切片数据的下载效率,从而提高了多媒体切片数据的播放流畅度。(The embodiment of the application provides a data transmission method, a data transmission device, electronic equipment and a computer storage medium, wherein the data transmission method comprises the following steps: acquiring trigger information, and downloading index information according to the trigger information, wherein the index information comprises at least one address information corresponding to at least one multimedia slice data; and downloading the corresponding at least one piece of multimedia slice data according to at least one piece of address information, wherein when the target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel. Because the index information and the multimedia slice data are downloaded in parallel, the downloading of the multimedia slice data is not influenced by the downloading of the index information, the downloading efficiency of the index information and the multimedia slice data is improved, and the playing fluency of the multimedia slice data is improved.)

1. A method of data transmission, comprising:

acquiring trigger information, and downloading index information according to the trigger information, wherein the index information comprises at least one address information corresponding to at least one multimedia slice data;

and downloading the corresponding at least one piece of multimedia slice data according to the at least one piece of address information, wherein when target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel.

2. The method of claim 1, wherein the method further comprises: caching the downloaded index information as index data;

the downloading of the corresponding at least one multimedia slice data according to the at least one address information includes:

reading address information of the multimedia slice data in the cached index data; and downloading the multimedia slice data according to the address information of the multimedia slice data.

3. The method of claim 2, wherein the obtaining the trigger information and downloading the index information according to the trigger information comprises:

and when the cached index data is determined not to contain the address information of the multimedia slice data, generating the trigger information, and downloading the index information according to the trigger information.

4. The method of claim 3, wherein the method further comprises:

and updating the cached index data according to the downloaded new index information.

5. The method of claim 1, wherein the method further comprises:

and playing the at least one piece of multimedia slice data corresponding to the multimedia data according to the playing progress of the currently played multimedia data.

6. The method of claim 5, wherein before the downloading the corresponding at least one multimedia slice data according to the at least one address information, the method further comprises:

if the downloading duration of the previous multimedia slice data is greater than the preset interval time, determining the next multimedia slice data according to the current playing progress;

the downloading of the corresponding at least one multimedia slice data according to the at least one address information includes:

and downloading the next multimedia slice data according to the address information of the next multimedia slice data.

7. The method of claim 5, wherein before the downloading the corresponding at least one multimedia slice data according to the at least one address information, the method further comprises:

if the downloading duration of the previous multimedia slice data is less than or equal to the preset interval time, determining the next multimedia slice data according to the playing sequence of the multimedia slice data in the index information;

the downloading of the corresponding at least one multimedia slice data according to the at least one address information includes:

and downloading the next multimedia slice data according to the address information of the next multimedia slice data.

8. The method of claim 1, wherein the obtaining the trigger information and downloading the index information according to the trigger information comprises:

starting an automatic updating thread according to a triggering operation and generating the triggering information;

and downloading the index information through the automatic updating thread according to the trigger information.

9. The method of claim 8, wherein the method further comprises:

analyzing the index information;

and if the downloading is determined to be finished according to the analysis result, finishing the automatic updating thread.

10. The method of claim 9, wherein the method further comprises:

if the downloading is determined not to be finished according to the analysis result, controlling the automatic updating thread to enter a sleep mode;

and awakening the automatic updating thread after the sleep time of the automatic updating thread reaches a preset time length.

11. The method of claim 1, wherein the method further comprises:

and sending a downloading request of the index information by using the network connection used for the last downloading, and receiving the index information downloaded this time according to the downloading request.

12. The method of claim 11, wherein the method further comprises:

if the downloading request for sending the index information fails, network connection is reestablished;

and sending a downloading request of the index information by utilizing the reestablished network connection, and receiving the index information downloaded this time according to the downloading request.

13. The method according to any one of claims 1-12, wherein the obtaining the trigger information and downloading the index information according to the trigger information comprises:

receiving a trigger operation for playing a live video, and generating trigger information according to the trigger operation;

and downloading the index information corresponding to the live video generated in the live broadcast process according to the trigger information, wherein the live video comprises the at least one multimedia slice data.

14. The method according to any one of claims 1-12, wherein the obtaining the trigger information and downloading the index information according to the trigger information comprises:

receiving a trigger operation for participating in an online conference, and generating the trigger information according to the trigger operation;

and downloading the index information corresponding to the conference video generated in the conference process according to the trigger information, wherein the conference video comprises the at least one multimedia slice data.

15. A data transmission apparatus, comprising:

the automatic updating module is used for downloading index information according to triggering operation, wherein the index information comprises address information of at least one multimedia slice data;

and the data processing module is used for downloading the multimedia slice data according to the address information of the multimedia slice data, and the multimedia slice data and the index information are downloaded in parallel.

16. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;

the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the data transmission method according to any one of claims 1-14.

17. A computer storage medium, on which a computer program is stored which, when being executed by a processor, carries out the data transmission method according to any one of claims 1 to 14.

Technical Field

The embodiment of the application relates to the technical field of electronic information, in particular to a data transmission method and device, electronic equipment and a computer storage medium.

Background

In the field of electronic information technology, multimedia data, such as video, image, audio, and other data forms, are increasingly used for information transfer. The data transmission amount of multimedia data is also increasing, and the user requirements for the data transmission rate are also increasing.

For example, when a user views a multimedia file using a browser, a terminal device downloads multimedia data from a server and then plays it for the user. However, many factors affect the downloading of multimedia data, resulting in slow downloading speed, severe influence on the transmission rate of multimedia data, and reduction of multimedia file playing fluency.

Disclosure of Invention

In view of the above, embodiments of the present application provide a data transmission method, an apparatus, an electronic device, and a computer storage medium to solve some or all of the above problems.

According to a first aspect of embodiments of the present application, there is provided a data transmission method, including: acquiring trigger information, and downloading index information according to the trigger information, wherein the index information comprises at least one address information corresponding to at least one multimedia slice data; and downloading the corresponding at least one piece of multimedia slice data according to at least one piece of address information, wherein when the target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel.

According to a second aspect of the embodiments of the present application, there is provided a data transmission apparatus, including: the automatic updating module is used for downloading index information according to the triggering operation, and the index information comprises address information of at least one multimedia slice data; and the data processing module is used for downloading the multimedia slice data according to the address information of the multimedia slice data, and the multimedia slice data and the index information are downloaded in parallel.

According to a third aspect of embodiments of the present application, there is provided an electronic apparatus, including: the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the corresponding operation of the data transmission method according to the first aspect.

According to a fourth aspect of embodiments of the present application, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the data transmission method as in the first aspect.

The data transmission method, the data transmission device, the electronic equipment and the computer storage medium, which are provided by the embodiment of the application, acquire the trigger information and download the index information according to the trigger information, wherein the index information comprises at least one address information corresponding to at least one piece of multimedia slice data; and downloading the corresponding at least one piece of multimedia slice data according to at least one piece of address information, wherein when the target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel. Because the index information and the multimedia slice data are downloaded in parallel, the downloading of the multimedia slice data is not influenced by the downloading of the index information, the downloading efficiency of the index information and the multimedia slice data is improved, and the playing fluency of the multimedia slice data is improved.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings can be obtained by those skilled in the art according to the drawings.

FIG. 1 is a schematic diagram of a downloading process in the related art;

fig. 2 is a schematic view of a scenario of a data transmission method according to an embodiment of the present application;

fig. 3 is a flowchart of a data transmission method according to an embodiment of the present application;

fig. 4 is a flowchart of a data transmission method according to a second embodiment of the present application;

fig. 5 is a flowchart of a data transmission method according to a third embodiment of the present application;

fig. 5A is a schematic view of a playing scene of video slice data according to a third embodiment of the present application;

fig. 5B is a schematic view of another playing scene of video slice data according to a third embodiment of the present application;

fig. 6 is a block diagram of a data transmission apparatus according to a fourth embodiment of the present application;

fig. 7 is a block diagram of another data transmission apparatus according to a fourth embodiment of the present application;

fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application.

Detailed Description

In order to make those skilled in the art better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application shall fall within the scope of the protection of the embodiments in the present application.

The following further describes specific implementations of embodiments of the present application with reference to the drawings of the embodiments of the present application.

Fig. 1 is a schematic diagram of a downloading process in the related art, which is shown in fig. 1, and the downloading process includes the following steps:

and step 101, downloading index information.

The index information includes address information of the at least one multimedia slice data and may further include an identification of the at least one multimedia slice data. The multimedia slice data may include slice data in various media forms, such as audio slice data, video slice data, image slice data, and the like, although this is merely an example.

And 102, judging whether the downloading is finished or not according to the index information.

It should be noted that whether the downloading is finished here indicates whether the entire downloading process is finished. Specifically, the index information may be analyzed, and if the result of the analysis indicates that the downloading is finished, the whole downloading process is finished; if the result of the parsing indicates that the downloading is not finished, step 103 is performed.

And 103, determining the next multimedia slice data and downloading.

The next multimedia slice data may be determined according to a playing order of the multimedia slice data or may be determined according to a current playing progress. For example, the index information includes identification and address information of 3 multimedia slice data, if the last downloaded multimedia slice data is the 1 st multimedia slice data, the 2 nd multimedia slice data is determined as the next multimedia slice data according to the playing sequence; for another example, the index information includes identification and address information of 3 multimedia slice data, and if the last downloaded multimedia slice data is the 1 st multimedia slice data, but the current playing progress should play the 3 rd multimedia slice data, the 2 nd multimedia slice data is skipped, and the 3 rd multimedia slice data is taken as the next multimedia slice data.

And step 104, judging whether the downloading duration of the multimedia slice data is greater than a preset interval time.

If the downloading time length of the multimedia slice data is longer than the preset interval time, the downloading time length of the multimedia slice data is too long, the index information needs to be downloaded again, the latest multimedia slice data is downloaded, and the step 101 is returned to be executed; if the download duration of the multimedia slicing data is less than or equal to the preset interval time, which indicates that the download duration of the multimedia slicing data is shorter, the step 103 is returned to and executed to continue downloading the next multimedia slicing data.

In the downloading process described in the foregoing step 101-104, the index information is downloaded first, and then the multimedia slice data is downloaded, where the downloading of the index information and the multimedia slice data is performed alternately, that is, the index information is downloaded, then the multimedia slice data is downloaded, then the index information is downloaded, and then the multimedia slice data is downloaded, and the process is repeated until the downloading is finished. If the downloading of the index information is delayed, the downloading of the multimedia slice data is delayed, and similarly, if the downloading of the multimedia slice data is delayed, the downloading of the index information is delayed, and the downloading efficiency is low.

In order to solve the problem of the downloading process shown in fig. 1, the present application provides a data transmission method, which is described below by using a plurality of embodiments.

Example one

A first data transmission method provided in the embodiment of the present application is applied to an electronic device, and can solve the problem of low downloading efficiency in the downloading flow shown in fig. 1, and of course, the data transmission method described in the first embodiment of the present application is not limited to solving the problem in the downloading flow shown in fig. 1, and is only exemplary for convenience of understanding.

For convenience of understanding, an application scenario of the data transmission method provided in the first embodiment of the present application is described, and fig. 2 is a schematic view of a scenario of the data transmission method provided in the first embodiment of the present application. The scenario shown in fig. 2 includes an electronic device 201 and a cloud 202; the electronic device 201 may be a device for executing the data transmission method provided in the embodiment of the present application, the electronic device 201 and the cloud 202 are connected via a Network, and perform data interaction via the Network, where the Network includes a Local Area Network (LAN), a Wide Area Network (WAN), and a mobile communication Network; such as the World Wide Web (WWW), Long Term Evolution (LTE) networks, 2G networks (2 th Generation Mobile Network), 3G networks (3 th Generation Mobile Network), 5G networks (5 th Generation Mobile Network), etc. Of course, this is merely an example and does not represent a limitation of the present application.

Cloud 202 may include various devices connected by a network, such as servers, relay devices, Device-to-Device (D2D) devices, and so forth.

The electronic device 201 may be a smart speaker, a smart phone, a tablet computer, a notebook computer, or the like. The electronic device 201 may be installed with a browser, and a user may obtain various types of multimedia data through the browser, for example, the user may watch a video, listen to an audio, read a text, and the like through the browser.

As shown in fig. 2, the electronic device 201 downloads the index information and the multimedia slice data from the cloud 202, the electronic device 201 has two independent threads, one thread downloads the index information and the other thread downloads the multimedia slice data, the downloading of the multimedia slice data does not delay the downloading of the index information, and the downloading of the index information also does not delay the downloading of the multimedia slice data, so that the downloading efficiency is improved.

With reference to the scenario shown in fig. 2, a data transmission method provided in a first embodiment of the present application is described in detail, it should be noted that fig. 2 is only an application scenario of the data transmission method provided in the first embodiment of the present application, and does not represent that the data transmission method must be applied to the scenario shown in fig. 2, referring to fig. 3, fig. 3 is a flowchart of a data transmission method provided in the first embodiment of the present application, and the method includes the following steps:

step 301, acquiring the trigger information, and downloading the index information according to the trigger information.

The index information includes at least one address information corresponding to at least one multimedia slice data. The index information may further include an identifier of at least one multimedia slice data, the identifier of at least one multimedia slice data and at least one address information may be stored correspondingly, the identifier of one multimedia slice data corresponds to one address information, and the corresponding address information of the multimedia slice data may be obtained according to the identifier of the multimedia slice data. In some application scenarios, the index information may include an m3u8 index file, which is only an exemplary file and is not meant to limit the present application.

The trigger information may be generated by the electronic device, and two examples are listed here for illustration:

optionally, in a first example, acquiring the trigger information, and downloading the index information according to the trigger information includes: generating trigger information according to the trigger operation; and downloading the index information according to the trigger information. The trigger operation may be an operation of a user performing human-computer interaction with the electronic device. For example, the trigger operation may include a touch operation, a voice interaction, a gesture control, and the like. And generating trigger information according to the trigger operation so as to download the index information, so that a user can actively control the downloading of the index information, and the method is more flexible and better meets the requirements of the user.

Further, acquiring the trigger information, and downloading the index information according to the trigger information, includes: starting an automatic updating thread according to the triggering operation and generating triggering information; and downloading the index information through the automatic updating thread according to the triggering information. The automatic updating thread is used for downloading the index information, namely, a single thread is set for downloading the index information, the downloading of other data is not influenced, and the downloading efficiency is improved.

It should be noted that the automatic update thread may end or enter a sleep mode, for example, in one implementation, the method further includes: analyzing the index information; and if the downloading is determined to be finished according to the analysis result, finishing the automatic updating thread. If the downloading is finished, the automatic updating is finished, and the resources occupied by the thread can be released, because after the downloading is finished, the resources are occupied if the automatic updating thread is continuously maintained, the resource waste can be reduced and the resource utilization rate can be improved by finishing the automatic updating thread.

As another example, in another implementation, the method further comprises: if the downloading is determined not to be finished according to the analysis result, controlling the automatic updating thread to enter a sleep mode; and awakening the automatic updating thread after the sleep time of the automatic updating thread reaches the preset time length. When the downloading is not finished, the index information is downloaded once, the automatic updating thread can enter a sleep mode, and the power consumption of the electronic equipment is reduced. The preset time length can be the playing time length of the multimedia slice data, so that the downloading of the index information and the downloading of the multimedia slice data can be kept synchronous.

Optionally, in a second example, the downloaded index information may be cached as index data; acquiring trigger information, and downloading index information according to the trigger information, wherein the method comprises the following steps: and when the cached index data is determined not to contain the address information of the multimedia slice data, generating trigger information, and downloading the index information according to the trigger information. For a multimedia slice data, taking a target multimedia slice data as an example, the target multimedia slice data can be any multimedia slice data, if the cached index data does not have the target-to-media slice data, trigger information is generated to trigger the downloading of the address information of the target multimedia slice data, the latest address information can be downloaded in time, and the fluency of the multimedia slice data in the playing process is improved.

And 302, downloading at least one corresponding multimedia slice data according to at least one piece of address information, wherein when the target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel.

In some application scenarios, the multimedia slice data may include audio slice data, video slice data, image slice data, and the like, which are only exemplary and not intended to limit the present application. The target multimedia slice data may be any one of the multimedia slice data. Alternatively, when downloading the target multimedia slice data, the address information of other non-downloaded multimedia slice data in the index information except the target multimedia slice data may be downloaded in parallel.

Optionally, the index information may be cached, and when the address information needs to be read, whether the cached index information contains the needed address information is checked first, and the index information does not need to be downloaded once every time one multimedia slice data is downloaded. Optionally, the method further comprises: caching the downloaded index information as index data; downloading corresponding at least one multimedia slice data according to at least one address information, comprising: reading the address information of the multimedia slice data from the cached index data; and downloading the multimedia slice data according to the address information of the multimedia slice data.

If the index data contains the address information of the multimedia slice data, the address information of the multimedia slice data is read from the index data, the corresponding multimedia slice data is downloaded according to the address information of the multimedia slice data, the index information does not need to be downloaded again, the waste of network resources is reduced, the utilization efficiency of the network resources is improved, and in addition, because the index data which is cached is directly read, new index information does not need to wait for downloading, the data processing efficiency is higher. Moreover, in a general case, one index information includes address information of a plurality of multimedia slice data, for example, the 1 st index information includes address information of A, B, C three multimedia slice data, if the multimedia slice data a is downloaded, then the 2 nd index information is downloaded, the 2 nd index information includes address information of B, C, D three multimedia slice data, then the multimedia slice data B is downloaded, then the address information of B, C two multimedia slice data is repeatedly downloaded, which wastes network resources and storage space. And if the 1 st index information is cached and stored as index data, when the multimedia slice data B is downloaded, the address information of the multimedia slice data B is directly acquired from the cached index data, so that repeated downloading is avoided, the data processing efficiency is improved, and the resource waste is reduced.

In order to further improve the transmission efficiency, the same network connection may be used when downloading the index information, for example, the method further includes: and sending a downloading request of the index information by using the network connection used for the last downloading, and receiving the downloaded index information according to the downloading request. The index information is downloaded by using the same network connection, so that the time for reestablishing the network connection is reduced, and the data transmission efficiency is improved.

Further optionally, the method further comprises: if the downloading request for sending the index information fails, network connection is reestablished; and sending a downloading request of the index information by utilizing the reestablished network connection, and receiving the downloaded index information according to the downloading request. If the downloading request is failed to be sent, the network connection is reestablished, and the index information can be normally downloaded.

In some application scenarios, after downloading the multimedia slice data, the multimedia slice data may also be played, for example, optionally, the method further includes: and playing at least one piece of multimedia slice data corresponding to the multimedia data according to the playing progress of the currently played multimedia data.

At least one multimedia slice data corresponding to the multimedia data may also be referred to as multimedia slice data included in the multimedia data. For example, the multimedia data may be a video, and the video includes at least one multimedia slice data as at least one video slice; similarly, the multimedia data may be an audio including at least one multimedia slice data as at least one audio slice. Of course, this is merely an example and does not represent a limitation of the present application.

When playing multimedia slice data, because each multimedia slice data has different download duration, in order to ensure that the multimedia slice data is smoothly played according to the playing progress, the following two implementation manners can be adopted for adjustment:

optionally, in a first implementation manner, before downloading the corresponding at least one multimedia slice data according to the at least one address information, the method further includes: if the downloading duration of the previous multimedia slice data is greater than the preset interval time, determining the next multimedia slice data according to the current playing progress;

downloading corresponding at least one multimedia slice data according to at least one address information, comprising: and downloading the next multimedia slice data according to the address information of the next multimedia slice data.

Optionally, in a second implementation manner, before downloading the corresponding at least one multimedia slice data according to the at least one address information, the method further includes: if the downloading duration of the previous multimedia slice data is less than or equal to the preset interval time, determining the next multimedia slice data according to the playing sequence of the multimedia slice data in the index information;

downloading corresponding at least one multimedia slice data according to at least one address information, comprising: and downloading the next multimedia slice data according to the address information of the next multimedia slice data.

Combining the two implementation modes, if the downloading is faster, determining the next multimedia slice data according to the playing sequence, and then downloading and playing the next multimedia slice data to ensure smooth playing; if the downloading is slow, the next multimedia slice data to be downloaded is determined according to the current playing progress, the multimedia slice data which is not played before the current playing progress is skipped over, the playing progress is not influenced, especially in scenes of watching live video or listening to live audio, the playing progress of a user can be not influenced, and the playing fluency is improved.

With reference to steps 301 and 302, an application scenario of the data transmission method provided in the embodiment of the present application is described, where two specific application scenarios are listed here.

Optionally, in a first application scenario, a user watches a live video through an electronic device, for example, acquiring trigger information, and downloading index information according to the trigger information, where the method includes: receiving a trigger operation for playing a live video, and generating trigger information according to the trigger operation; and downloading index information corresponding to a live video generated in the live broadcast process according to the trigger information, wherein the live video comprises at least one multimedia slice data. Because the index information and the live video are downloaded in parallel, the user can watch the live video more smoothly.

Optionally, in the second application scenario, multiple users may perform an online meeting or participate in an online classroom through respective electronic devices, at this time, one electronic device may display videos of one or more electronic device sides, and the electronic device may also upload a local video. For example, taking an online conference as an example, acquiring trigger information, and downloading index information according to the trigger information includes: receiving a trigger operation for participating in an online conference, and generating trigger information according to the trigger operation; and downloading index information corresponding to the conference video generated in the conference process according to the trigger information, wherein the conference video comprises at least one multimedia slice data. In the application scene, each electronic device can upload the conference video locally acquired in the conference process to the cloud, each electronic device can also download the conference video uploaded by other electronic devices from the cloud, and when the conference video is downloaded, the index information is downloaded in parallel, so that the conference video is played more smoothly.

The data transmission method provided by the embodiment of the application acquires the trigger information and downloads the index information according to the trigger information, wherein the index information comprises at least one address information corresponding to at least one multimedia slice data; and downloading the corresponding at least one piece of multimedia slice data according to at least one piece of address information, wherein when the target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel. Because the index information and the multimedia slice data are downloaded in parallel, the downloading of the multimedia slice data is not influenced by the downloading of the index information, the downloading efficiency of the index information and the multimedia slice data is improved, and the playing fluency of the multimedia slice data is improved.

Example two

Based on the data transmission method described in the first embodiment, the second embodiment of the present application provides a data transmission method, which is used for describing the downloading of the index information in the data transmission method described in the first embodiment in detail, and in this embodiment, the index information may include an m3u8 file, which is, of course, only exemplary and not meant to limit the present application. Referring to fig. 4, the method includes the steps of:

step 401, an automatic update thread is started.

Step 402, downloading index information through an automatic update thread.

In this embodiment, the index information may be an m3u8 index file. The downloading of the index information may be triggered by a triggering operation or a thread request for downloading the multimedia slice data, and reference is made to the description of obtaining the triggering information in the first embodiment, which is not described herein again.

And step 403, updating the cached index data according to the downloaded index information.

Step 404, judging whether the downloading is finished.

If the downloading is finished, the downloading process is finished, and if the downloading is not finished, step 405 is executed.

Optionally, the index information may be analyzed, and whether the downloading is finished is determined according to an analysis result, if the index information includes an identifier for finishing the downloading, the downloading is determined to be finished, and if the index information does not include an identifier for finishing the downloading, the downloading is determined not to be finished.

And step 405, controlling the automatic updating thread to enter a sleep mode.

And step 406, judging whether the sleep time reaches a preset time length.

If the sleep time does not reach the preset time length, the sleep mode is continuously maintained, and if the sleep time reaches the preset time length, step 407 is performed.

Step 407, waking up the automatic update thread, and returning to the execution step 402.

Step 402 and 407 are executed circularly until the downloading is finished.

According to the data transmission method provided by the embodiment of the application, because the index information is downloaded through a single automatic updating thread, the downloading of the index information does not affect the downloading of the multimedia slice data, and is not affected by the downloading of the multimedia slice data, the downloading efficiency of the index information and the multimedia slice data is improved, so that the playing fluency of the multimedia slice data is improved, the downloaded index information is cached, when the multimedia slice data is downloaded, the address information can be directly read from the cache, the repeated downloading is avoided, and the resource waste is reduced.

EXAMPLE III

Based on the data transmission method described in the first embodiment, a third embodiment of the present application provides a data transmission method, which is used for describing downloading of multimedia slice data in the data transmission method described in the first embodiment in detail, in this embodiment, the multimedia slice data includes video slice data, which may also be referred to as a video Transport Stream (TS), that is, a video TS, for example, in a dynamic bitrate adaptive (HTTP Live Streaming, HLS) technology, a video file is sliced and divided into video slice data with a duration of several seconds, which usually includes a track and a track, but this embodiment is only an exemplary illustration, and does not represent that the present application is limited thereto. Referring to fig. 5, the method includes the steps of:

step 501, judging whether the cached index data contains the address information of the multimedia slice data.

If the judgment result is that the index data contains the address information of the multimedia slice data, step 502 is executed, and if the judgment result is that the cached index data does not contain the address information of the multimedia slice data, step 503 is executed.

Step 502, reading the address information of the multimedia slice data from the cached index data. Step 504 is performed.

If the cached index data contains the address information of the multimedia slice data, the address information is directly obtained from the cached index data without downloading, so that the occupation of network resources is reduced, and the processing efficiency is also improved.

Step 503, requesting to download new index information, and obtaining the address information of the multimedia slice data in the new index information.

After steps 502 and 503, the method further comprises:

and 504, downloading the multimedia slice data according to the address information of the multimedia slice data, and playing at least one multimedia slice data corresponding to the multimedia data according to the playing progress of the currently played multimedia data.

In this embodiment, the currently played multimedia data may be a currently played video, and the at least one multimedia slice data corresponding to the multimedia data may be at least one video slice included in the currently played video.

And 505, judging whether the downloading duration of the multimedia slice data is greater than a preset time interval.

If the judgment result is that the downloading duration of the multimedia slice data is greater than the preset time interval, executing step 506; if the determination result is that the download duration of the multimedia slice data is less than or equal to the preset time interval, go to step 507.

The preset time interval may be set according to actual requirements, and optionally, the preset time interval may be set as a playing time of one multimedia slice data.

Step 506, determining the next multimedia slice data according to the current playing progress.

If the downloading duration of the multimedia slice data is longer than the preset time interval, it indicates that the downloading of the currently downloaded multimedia slice data is too slow, and the next multimedia slice data needs to be determined according to the playing progress. For example, A, B, C three multimedia slice data are played in sequence, the download duration of the currently downloaded multimedia slice data a is longer than a preset time interval, and it is determined according to the play progress that the multimedia slice data C should be played, then the multimedia slice data C is determined as the next multimedia slice data, the multimedia slice data B is skipped, the multimedia slice data C is downloaded and played, so that the download is slowed down due to network reasons, but the latest play progress can still be maintained.

And 507, determining the next multimedia slice data according to the playing sequence of the multimedia slice data in the index information.

For example, A, B, C three multimedia slices are played sequentially, the downloading duration of the currently downloaded multimedia slice data a is less than or equal to the preset time interval, and if it is determined that the multimedia slice data B should be played according to the playing sequence, the multimedia slice data B is determined as the next multimedia slice data.

It should be noted that the preset time interval may be a playing time length of one multimedia slice data, for example, the preset time interval may be a playing time length of a currently downloaded and played multimedia slice data, and the preset time interval is constantly changed according to a difference of the currently downloaded multimedia slice data; for another example, if the playing durations of the multimedia slice data are the same, the fixed preset time interval may be set according to the playing durations of the multimedia slice data. Of course, the multimedia slice data may also be smaller than the playing time of the multimedia slice data, which is not limited in this application.

After steps 506 and 507, the method further comprises:

and step 508, returning to the step 501, and downloading the next multimedia slice data.

In combination with the above step 501 and step 508, taking watching the live video as an example, the multimedia data is the currently watched video, and the multimedia slice data is the video slice data. And triggering to play the live video according to the triggering operation of the user, generating triggering information, starting an automatic updating thread, and downloading index information according to the triggering information. One index information may include 3 address information, and for example, the 1 st index information includes video slice data A, B, C, after downloading the 1 st index information, the 1 st index information is cached to update the index data, at this time, no new index information may be downloaded, the automatic update thread may enter a sleep mode, download video slice data a according to the address information of the video slice data a, and download video slice data B, C while playing the video slice data a. When the video slice data A, B, C is downloaded and played, and the sleep time of the automatic update thread reaches the preset time, the automatic update thread is awakened, and the 2 nd index information is downloaded, wherein the 2 nd index information contains the address information of the video slice data D, E, F.

As shown in fig. 5A, if the download duration of the video slice data B is less than or equal to the play duration of the video slice data a, which indicates that the download time is short, the address information of the video slice data C is read from the buffer data in sequence, and the video slice data C is downloaded.

As shown in fig. 5B, if the downloading time of the video slice data B is longer than the playing time of the video slice data a, which indicates that the downloading time is too long, at this time, it is determined that the next video slice data is according to the current playing progress, for example, the current playing progress has already been played to the video slice data D, the video slice data C is skipped, the address information of the video slice data D is read from the cache data, and the video slice data D is downloaded while the video slice data B is played. If the address information of the video slice data D is not in the cache book, the downloading of new index information, i.e., the downloading of the 2 nd index information, is requested.

According to the data transmission method provided by the embodiment of the application, because the index information is downloaded through a single automatic updating thread, the downloading of the index information does not affect the downloading of the multimedia slice data, and is not affected by the downloading of the multimedia slice data, the downloading efficiency of the index information and the multimedia slice data is improved, so that the playing fluency of the multimedia slice data is improved, the downloaded index information is cached, when the multimedia slice data is downloaded, the address information can be directly read from the cache, the repeated downloading is avoided, and the resource waste is reduced.

Example four

Based on the data transmission methods described in the first to third embodiments, a fourth embodiment of the present application provides a data transmission device for executing the data transmission methods described in the first to third embodiments, and as shown in fig. 6, the device includes: an automatic update module 601 and a data processing module 602.

An automatic update module 601, configured to download index information according to a trigger operation, where the index information includes address information of at least one multimedia slice data;

and the data processing module 602 is configured to download the multimedia slice data according to the address information of the multimedia slice data, where the multimedia slice data is downloaded in parallel with the index information.

Optionally, in an embodiment, the automatic updating module 601 is further configured to cache the downloaded index information as index data;

a data processing module 602, configured to read address information of the multimedia slice data from the cached index data; and downloading the multimedia slice data according to the address information of the multimedia slice data.

Optionally, in an embodiment, the automatic updating module 601 is configured to generate the trigger information when it is determined that the cached index data does not include the address information of the multimedia slice data, and download the index information according to the trigger information.

Optionally, in an embodiment, the automatic updating module 601 is configured to update the cached index data according to the downloaded new index information.

Optionally, in an embodiment, as shown in fig. 7, the data transmission apparatus further includes a playing module 603, where the playing module 603 is configured to play at least one multimedia slice data corresponding to the multimedia data according to a playing progress of the currently played multimedia data.

Optionally, in an embodiment, the data processing module 602 is further configured to determine, when the downloading duration of the previous multimedia slice data is greater than the preset interval time, a next multimedia slice data according to the current playing progress; and downloading the next multimedia slice data according to the address information of the next multimedia slice data.

Optionally, in an embodiment, the data processing module 602 is further configured to determine, when a downloading duration of a previous multimedia slice data is less than or equal to a preset interval time, a next multimedia slice data according to a playing sequence of the multimedia slice data in the index information; and downloading the next multimedia slice data according to the address information of the next multimedia slice data.

Optionally, in an embodiment, the automatic update module 601 is configured to start an automatic update thread according to a trigger operation, and generate the trigger information; and downloading the index information through the automatic updating thread according to the trigger information.

Optionally, in an embodiment, the automatic updating module 601 is configured to parse the index information; and if the downloading is determined to be finished according to the analysis result, finishing the automatic updating thread.

Optionally, in an embodiment, the automatic update module 601 is configured to control the automatic update thread to enter a sleep mode if it is determined that the downloading is not finished according to the parsing result; and awakening the automatic updating thread after the sleep time of the automatic updating thread reaches a preset time length.

Optionally, in an embodiment, the automatic updating module 601 is further configured to send a downloading request of the index information by using a network connection used for the last downloading, and receive the index information downloaded this time according to the downloading request.

Optionally, in an embodiment, the automatic updating module 601 is further configured to reestablish a network connection when the request for sending the index information fails to be downloaded; and sending a downloading request of the index information by utilizing the reestablished network connection, and receiving the index information downloaded this time according to the downloading request.

The data transmission device provided by the embodiment of the application acquires the trigger information and downloads the index information according to the trigger information, wherein the index information comprises at least one address information corresponding to at least one multimedia slice data; and downloading the corresponding at least one piece of multimedia slice data according to at least one piece of address information, wherein when the target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel. Because the index information and the multimedia slice data are downloaded in parallel, the downloading of the multimedia slice data is not influenced by the downloading of the index information, the downloading efficiency of the index information and the multimedia slice data is improved, and the playing fluency of the multimedia slice data is improved.

EXAMPLE five

Based on the data transmission methods described in the first to third embodiments, a fifth embodiment of the present application provides an electronic device, configured to execute the data transmission methods described in the first to third embodiments, and referring to fig. 8, fig. 8 is a schematic structural diagram of the electronic device provided in the fifth embodiment of the present application, and a specific embodiment of the present application does not limit a specific implementation of the electronic device.

As shown in fig. 8, the electronic device may include: a processor (processor)802, a Communications Interface 804, a memory 806, and a communication bus 808.

Wherein:

the processor 802, communication interface 804, and memory 806 communicate with one another via a communication bus 808.

A communication interface 804 for communicating with other electronic devices, such as a terminal device or a server.

The processor 802 is configured to execute the program 810, and may specifically perform relevant steps in the above-described data transmission method embodiment.

In particular, the program 810 may include program code comprising computer operating instructions.

The processor 802 may be a central processing unit CPU, or an application Specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present application. The electronic device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.

The memory 806 stores a program 810. The memory 806 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.

The program 810 may be specifically configured to cause the processor 802 to execute any one of the data transmission methods of the first to third embodiments.

For specific implementation of each step in the program 810, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing data transmission method embodiments, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.

The electronic device provided by the embodiment of the application acquires the trigger information and downloads the index information according to the trigger information, wherein the index information comprises at least one address information corresponding to at least one multimedia slice data; and downloading the corresponding at least one piece of multimedia slice data according to at least one piece of address information, wherein when the target multimedia slice data is downloaded, the address information of other multimedia slice data except the target multimedia slice data in the index information is downloaded in parallel. Because the index information and the multimedia slice data are downloaded in parallel, the downloading of the multimedia slice data is not influenced by the downloading of the index information, the downloading efficiency of the index information and the multimedia slice data is improved, and the playing fluency of the multimedia slice data is improved.

EXAMPLE six

Based on the data transmission methods described in the first to third embodiments, a fifth embodiment of the present application provides a computer storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the data transmission methods described in the first to third embodiments.

It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present application may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present application.

The above-described methods according to embodiments of the present application may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the methods described herein may be stored in such software processes on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the data transmission methods described herein. Further, when a general-purpose computer accesses code for implementing the data transmission method illustrated herein, execution of the code transforms the general-purpose computer into a special-purpose computer for performing the data transmission method illustrated herein.

Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.

The above embodiments are only used for illustrating the embodiments of the present application, and not for limiting the embodiments of the present application, and those skilled in the relevant art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application, so that all equivalent technical solutions also belong to the scope of the embodiments of the present application, and the scope of patent protection of the embodiments of the present application should be defined by the claims.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种电子工程网络适配器安装架

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类