A data download method and apparatus
By encapsulating data packet indexes into TS format and sending data using TS technology, the problems of packet loss and error in multicast transmission are solved, achieving reliable and cost-effective data transmission.
Patent Information
- Application Number
- CN202010268443.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-08
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2040-04-08
AI Technical Summary
During multicast data transmission, packet loss and packet errors occur, which are difficult to solve effectively with existing technologies.
The traditional multicast private protocol is replaced by TS technology. The data packet index is encapsulated into TS format and sent as a TS data stream. The reliability of data transmission is ensured by using the carousel and checksum mechanism of the TS data stream.
It solves the problem of unreliable multicast data transmission, simplifies the complexity of data transmission design, and reduces bandwidth pressure and server costs.
Smart Images

Figure CN113497796B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication technology, and more particularly, to a data downloading method and device. BACKGROUND
[0002] With the continuous development of the Internet, network data has become increasingly rich and diverse, and people's work and study data or information can be basically obtained from the network. Network-based data interaction has become indispensable.
[0003] When people need some network data, they can usually download the data to the current operating terminal through the download application on the terminal.
[0004] In the network data downloading process, in order to ensure reliable downloading of data, HTTP (HyperText Transfer Protocol) is usually used to broadcast data, combined with TCP / IP (Transmission Control Protocol / Internet Protocol). However, when using HTTP to broadcast data, if the downloaded network data reaches a certain level, the bandwidth pressure will increase, and the number of servers also needs to be increased, which increases the cost of purchasing servers. To solve this problem, another data downloading method is to directly use the multicast mode of the private protocol, and use the UDP (User Datagram Protocol) mode to broadcast data. Although UDP can realize connectionless and fast data transmission, UDP has the disadvantage of unreliable data transmission, which may cause packet loss and packet error.
[0005] In summary, how to provide a data downloading method and device to solve the problems of packet loss and packet error in the process of multicast data transmission has become a technical problem that needs to be solved by technical personnel in the field. SUMMARY
[0006] Therefore, the present application discloses a data downloading method and device, which uses TS technology to replace the multicast private protocol of the traditional scheme, encapsulates the target data packet with added packet index into a TS packet in TS format, and sends it to the client in the form of TS data stream. Since TS data stream has the characteristics of data broadcasting and data transmission unit, and TS specification itself has a check mechanism, the problem of unreliable multicast data transmission is solved.
[0007] A data downloading method applied to a server end, the method comprising:
[0008] According to a download request of a client for a data file to be downloaded, the data file to be downloaded is searched, wherein the download request contains an identifier of the data file to be downloaded;
[0009] The data file to be downloaded is split according to a preset length, and N data packets are obtained, wherein N is a positive integer.
[0010] A data packet index is added to each data packet to obtain a target data packet, wherein the data packet index includes an index number of a previous data packet of the data packet and an index number of a next data packet of the data packet.
[0011] Based on Section, each target data packet is encapsulated into a TS format to obtain M TS packets, wherein M is a positive integer.
[0012] Each time, a preset number of TS packets are packaged into a UDP packet.
[0013] TS data streams formed by the TS packets in the UDP packet are broadcasted to the client in an index order, each payload data is parsed from the TS data streams by the client, and the payload data that passes the verification is stored in a file preset position until all payload data passes the verification and is stored in the file preset position.
[0014] Optionally, in a head packet obtained by splitting the data file to be downloaded, an index number of a previous data packet of the head packet is 0, and an index number of a next data packet of the head packet is 2.
[0015] Optionally, in a tail packet obtained by splitting the data file to be downloaded, an index number of a next data packet of a data packet index of the tail packet is 0.
[0016] Optionally, based on Section, each target data packet is encapsulated into a TS format to obtain a TS data stream, and specifically includes:
[0017] The length and index data of the target data packet are encapsulated into a TS format in a private table carrying Section to obtain M TS packets, and the M TS packets form a TS data stream.
[0018] Optionally, the preset number is seven.
[0019] A data downloading device is applied to a server end, and the device includes:
[0020] A searching unit is configured to search a data file to be downloaded according to a download request of a client for the data file to be downloaded, wherein the download request contains an identifier of the data file to be downloaded.
[0021] a splitting unit, configured to split the to-be-downloaded data file according to a preset length to obtain N data packets, N being a positive integer;
[0022] an adding unit, configured to add a data packet index to each of the data packets to obtain a target data packet, wherein the data packet index comprises an index number of a previous data packet of the data packet and an index number of a next data packet of the data packet;
[0023] an encapsulating unit, configured to encapsulate each of the target data packets into a TS format based on Section to obtain M TS packets, M being a positive integer;
[0024] a packing unit, configured to pack a preset number of the TS packets into one UDP packet each time;
[0025] a broadcasting unit, configured to broadcast a TS data stream formed by the TS packets in the UDP packet to the client in an index order in a loop, parse each of the payloads from the TS data stream by the client, and perform a check, and store the payload data that passes the check to a file preset position until all the payload data passes the check and is stored to the file preset position.
[0026] Optionally, in a head packet obtained by splitting the to-be-downloaded data file, an index number of a previous data packet of the head packet is 0, and an index number of a next data packet of the head packet is 2.
[0027] Optionally, in a tail packet obtained by splitting the to-be-downloaded data file, an index number of a next data packet of a data packet index of the tail packet is 0.
[0028] Optionally, the encapsulating unit is specifically configured to:
[0029] carry the length and the index data of the target data packet in a private table in a manner of carrying Section to encapsulate the target data packet into the TS format to obtain M TS packets, and the M TS packets form a TS data stream.
[0030] Optionally, the preset number is seven.
[0031] From the above technical solution can be known, the application discloses a kind of data download method and device, server end finds the data file to be downloaded according to the download request sent by client, the data file to be downloaded is split, obtain N data packet, for each data packet, data packet index is added to obtain target data packet, based on Section, each target data packet is encapsulated into TS format and obtains M TS packet, the TS packet of pre-set quantity is packed into a UDP packet, and the TS data stream in UDP packet is broadcasted to client in index order, each payload data is parsed from TS data stream by client, and is checked, the payload data that passes through checking is stored to file pre-set position, until all payload data is checked and stored to file pre-set position.Obvious from this, the application uses TS technology to replace the multicast private protocol of traditional scheme, the target data packet of adding data packet index is encapsulated into TS packet of TS format, and is sent to client in the form of TS data stream.Due to the characteristics of TS data stream, such as data delivery can be broadcasted and data transmission unit, and TS specification itself has checking mechanism, thereby solve the problem that multicast transmission data is unreliable. BRIEF DESCRIPTION OF DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only a part of the embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor based on the disclosed drawings.
[0033] Figure 1 A data download method flow chart disclosed by the embodiments of the present application;
[0034] Figure 2 A schematic diagram of server end sending data disclosed by the embodiments of the present application;
[0035] Figure 3 A principle diagram of client parsing UDP packet disclosed by the embodiments of the present application;
[0036] Figure 4 A structural schematic diagram of data download device disclosed by the embodiments of the present application. DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0038] The embodiment of the present application discloses a data downloading method and device, a server end finds a to-be-downloaded data file according to a downloading request sent by a client end, splits the to-be-downloaded data file, obtains N data packets, adds a data packet index to each data packet to obtain a target data packet, encapsulates each target data packet into a TS format to obtain M TS packets, packs a preset number of TS packets into a UDP packet, and circulates the TS data stream in the UDP packet to the client end according to the index order, parses each payload data from the TS data stream by the client end, performs verification, stores the payload data that passes the verification to a file preset position, and until all the payload data passes the verification and is stored to the file preset position. As can be seen, the present application replaces the multicast private protocol of the traditional scheme with the TS technology, encapsulates the target data packet with the added data packet index into a TS packet in the TS format, and sends the TS data stream to the client end. Since the TS data stream has the characteristics of data broadcasting and data transmission unit, and the TS specification itself has a verification mechanism, the problem of unreliable multicast transmission data is solved.
[0039] In addition, since the multicast TS technology is used in the data downloading, the development and debugging workload caused by the multicast private protocol and the multicast private fault-tolerant mechanism of the traditional scheme is avoided, so that the complexity of the data transmission design is simplified, and the workload is reduced. Meanwhile, compared with the data broadcasting using the http, the bandwidth pressure is also reduced, so that the cost of purchasing the server is reduced.
[0040] Referring to Figure 1 The embodiment of the present application discloses a data downloading method flow chart, the method is applied to a server end, and includes the following steps:
[0041] Step S101, according to the downloading request of the to-be-downloaded data file submitted by the client end, finding the to-be-downloaded data file;
[0042] The downloading request contains the identifier of the to-be-downloaded data file;
[0043] Step S102, splitting the to-be-downloaded data file according to a preset length to obtain N data packets, and N is a positive integer;
[0044] Specifically, referring to Figure 2 The embodiment of the present application discloses a server end sending data schematic diagram, assuming that the to-be-downloaded data file is data, the data is split according to a preset length len to obtain N data packets.
[0045] Step S103, adding a data packet index to each data packet to obtain a target data packet;
[0046] The data packet index includes an index number of a previous data packet of the data packet and an index number of a next data packet of the data packet.
[0047] It should be particularly noted that the data packet index of the first data packet (i.e. a head packet) obtained by splitting the data file to be downloaded is 0 and 2, that is, the index number of the previous data packet of the head packet is 0, the index number of the next data packet of the head packet is 2, and the index number of the head packet is 1.
[0048] In the data packet index of the last data packet (i.e. a tail packet) obtained by splitting the data file to be downloaded, the index number of the next data packet of the tail packet included in the data packet index is also defined as 0.
[0049] In this way, the offsets of the head packet, the tail packet and the intermediate data packets of the data file to be downloaded in the data file to be downloaded can be calculated.
[0050] Specifically, in actual application, a TS data stream tool can be used to add a data packet index to each data packet to obtain a target data packet.
[0051] Referring to Figure 2 , it is assumed that the data packet index is index, and the target data packet obtained includes:
[0052] len index1, len index2, len index3, len index4, len index5, len index6, ….
[0053] Step S104, encapsulating each target data packet into a TS format based on Section to obtain M TS packets;
[0054] M is a positive integer.
[0055] Section is a special name in TS specification.
[0056] Section data is the payload data organized after removing the headers of the TS packets.
[0057] TS stands for MPEG2-TS. TS is the abbreviation of "Transport Stream", which is packetized and transmitted, and each packet is 188 bytes long. The structure of the packet is that the header is 4 bytes long and the payload is 184 bytes long. Many types of data can be filled in the TS data stream, such as video, audio, custom information, etc.
[0058] MPEG2-TS is mainly applied to real-time transmission of programs, such as real-time broadcast of television programs. The feature of the MPEG2-TS format is that any segment of a video stream can be independently decoded.
[0059] Generally, the length of a payload data is 1024 bytes, and the length of a TS packet is 188 bytes, so generally a payload data is composed of multiple TS packets, and of course it is also possible that a payload data is composed of a TS payload data.
[0060] Specifically, the length and index data of the target data packet are encapsulated into TS format in the form of a private table carrying a section, to obtain M TS packets, and the M TS packets form a TS data stream.
[0061] Step S105, each time a preset number of TS packets are packaged into a UDP packet;
[0062] Among them, the Internet protocol set supports a connectionless transmission protocol, which is called User Datagram Protocol (UDP).
[0063] UDP provides a method for application programs to send encapsulated IP datagrams without establishing a connection.
[0064] Preferably, the preset number is seven.
[0065] It should be noted that the length of the network layer IP datagram is limited to 1500 bytes, and the length of a TS packet is 188 bytes, and since the length of seven TS packets, i.e. 188*7, is closest to 1500, therefore, 7 TS packets is the maximum number for transmission, although the number of TS packets packaged into a UDP packet can be smaller, but the data transmission efficiency is not the highest. If there are more than seven TS packets, for example, 8 TS packets, then 188*8 = 1504 > 1500, so the UDP packet obtained thereby needs to be split during transmission, thereby increasing the complexity of subsequent processing logic.
[0066] Therefore, in this embodiment, a UDP packet is preferably packaged from seven TS data streams.
[0067] Specifically, referring to Figure 2 , len index1, len index2, len index3, len index4, len index5, len index6 and len index7 are packaged to obtain a TS data stream, which is the TS format data.ts converted from the data to be downloaded data file data.
[0068] Step S106, the TS data stream formed by each of the TS packets in the UDP packet is circularly broadcast to the client according to the index order, each payload data is parsed from the TS data stream by the client, and is checked, the payload data passing the check is stored to a file preset position until all the payload data is checked and stored to the file preset position.
[0069] Specifically, the TS data stream formed by the preset number of TS packets in the UDP packet is circularly broadcast to the multicast environment according to the index order, the client obtains the UDP packet from the multicast environment, and obtains the 7*188 TS stream from the UDP packet, the client parses each payload data from the TS data stream according to the TS specification, and performs CRC check on the payload data, if the check fails, the payload data is determined as error data and discarded, and other payload data is continuously received until all the payload data is correctly received, at this time, the payload data passing the check is stored to the file preset position according to the index number of the payload data passing the check.
[0070] Specifically, the multicast broadcast device reads the TS data stream containing the preset number of TS packets as a UDP packet each time, and sends the UDP packet to the multicast environment in the form of a unit packet.
[0071] It should be noted that one TS data stream includes a plurality of TS packets, when the TS data stream is sent to the multicast environment, it is necessary to ensure that each TS packet in the TS data stream is sent once. After each TS packet in the TS data stream is sent once, the first TS packet in the TS data stream is continuously broadcasted.
[0072] An example of the processing process of the client to the received UDP is as follows:
[0073] Referring to Figure 3 The principle diagram of the client parsing the UDP packet disclosed by the embodiment of the application is disclosed, the client receives the TS data stream sent by the server in the first round, parses each payload data from the TS data stream according to the TS filtering rule, performs CRC check on the payload data, and stores the payload data passing the check to a file preset position according to the index number of the payload data passing the check. The client receives the second round TS data stream sent by the server, supplements the payload data not received due to packet loss and packet error in the first round TS data stream, and discards the repeated packets and error packets. When the client receives the complete and checked payload data, the index number and the length of the payload data are restored to obtain the data file to be downloaded.
[0074] In summary, the embodiment of the present application discloses a data downloading method, a server end searches for a data file to be downloaded according to a downloading request sent by a client end, splits the data file to be downloaded, obtains N data packets, adds a data packet index to each data packet to obtain a target data packet, encapsulates each target data packet into a TS format to obtain M TS packets, packs a preset number of TS packets into a UDP packet, and cyclically broadcasts the TS data stream in the UDP packet to the client end according to the index order, parses each payload data from the TS data stream by the client end, performs verification, stores the payload data that passes the verification to a preset position of a file, and until all the payload data passes the verification and is stored to the preset position of the file. As can be seen, the present application replaces the multicast private protocol of the traditional scheme with the TS technology, encapsulates the target data packet with the added data packet index into a TS packet in the TS format, and sends the TS data stream to the client end. Since the TS data stream has the characteristics of data broadcasting and data transmission unit, and the TS specification itself has a verification mechanism, the problem of unreliable multicast transmission data is solved.
[0075] In addition, since the multicast TS technology is used in the data downloading, the development and debugging workload caused by the multicast private protocol and the multicast private fault-tolerant mechanism of the traditional scheme is avoided, the complexity of the data transmission design is simplified, and the workload is reduced. Meanwhile, compared with the data broadcasting using the http, the bandwidth pressure is also reduced, and the cost of purchasing the server is reduced.
[0076] Corresponding to the method embodiment, the present application also discloses a data downloading device.
[0077] Referring to Figure 4 An embodiment of the present application discloses a structure schematic diagram of a data downloading device, the device is applied to a server end, and the device comprises:
[0078] A searching unit 201 is configured to search for a data file to be downloaded according to a downloading request of the data file to be downloaded submitted by a client end, wherein the downloading request comprises an identifier of the data file to be downloaded;
[0079] A splitting unit 202 is configured to split the data file to be downloaded according to a preset length to obtain N data packets, wherein N is a positive integer.
[0080] Specifically, referring to Figure 2 An embodiment of the present application discloses a schematic diagram of a server end sending data, assuming that a data file to be downloaded is data, the data is split according to a preset length len to obtain N data packets.
[0081] An adding unit 203 is configured to add a data packet index to each data packet to obtain a target data packet, wherein the data packet index comprises an index number of a previous data packet of the data packet and an index number of a next data packet of the data packet.
[0082] It should be particularly noted that the data packet index of the first data packet (i.e., a head packet) obtained by splitting the data file to be downloaded is 0 and 2, that is, the index number of the previous data packet of the head packet is 0, the index number of the next data packet of the head packet is 2, and the index number of the head packet is 1.
[0083] In the data packet index of the last data packet (i.e., a tail packet) obtained by splitting the data file to be downloaded, it is defined that the index number of the next data packet of the tail packet included in the data packet index is also 0.
[0084] In this way, the offsets of the head packet, the tail packet and the intermediate data packets in the data file to be downloaded in the transmission process can be calculated.
[0085] Specifically, in actual application, a TS data stream tool can be used to add a data packet index to each data packet to obtain a target data packet.
[0086] An encapsulating unit 204 is configured to encapsulate each target data packet into a TS format based on a Section to obtain M TS packets, where M is a positive integer.
[0087] The Section is a special name in TS specification.
[0088] The Section data is payload data organized after removing the headers of the TS packets.
[0089] Generally, the length of one payload data is 1024 bytes, and the length of one TS packet is 188 bytes, so generally one payload data is composed of multiple TS packets, and of course one payload data can also be composed of one TS payload data.
[0090] The encapsulating unit 204 can specifically encapsulate the length and index data of the target data packet into a TS format in a private table carrying Section to obtain M TS packets, and the M TS packets form a TS data stream.
[0091] A packing unit 205 is configured to pack a preset number of TS packets into one UDP packet each time.
[0092] The Internet protocol set supports a connectionless transmission protocol, which is referred to as User Datagram Protocol (UDP).
[0093] UDP provides a method for application to send encapsulated IP datagram without establishing connection.
[0094] Preferably, the preset number is seven.
[0095] It should be noted that the length of network layer IP datagram is limited to 1500 bytes, and the length of one TS packet is 188 bytes, and since the length of seven TS packets, i.e. 188*7, is closest to 1500, the maximum number of TS packets for transmission is seven, although the number of TS packets packaged into one UDP packet can be smaller, the data transmission efficiency is not the highest. If the number of TS packets is more than seven, for example, eight, then 188*8=1504>1500, and the UDP packet thus obtained needs to be packaged during transmission, thereby increasing the complexity of subsequent processing logic.
[0096] Therefore, in the embodiment, one UDP packet is preferably packaged by seven TS data streams.
[0097] The broadcasting unit 206 is configured to broadcast the TS data streams formed by the TS packets in the UDP packet to the client in index order in a loop, parse each payload data from the TS data streams by the client, and perform verification, store the payload data that passes the verification to a file preset position until all the payload data is verified and stored to the file preset position.
[0098] Specifically, the TS data stream formed by the TS packets in the UDP packet is broadcast to the multicast environment in index order in a loop, the client obtains the UDP packet from the multicast environment, and obtains 7*188 TS streams from the UDP packet, the client parses each payload data from the TS data stream according to the TS specification, performs CRC verification on the payload data, if the verification fails, the payload data is determined as error data and discarded, and other payload data is continuously received until all the payload data is correctly received, at this time, the payload data that passes the verification is stored to the file preset position according to the index number of the payload data that passes the verification.
[0099] Specifically, the multicast broadcasting device reads the TS data stream containing the preset number of TS packets as one UDP packet each time, and sends the UDP packet to the multicast environment in the form of a unit packet.
[0100] It should be noted that one TS data stream includes multiple TS packets, when the TS data stream is sent to the multicast environment, it is required to ensure that each TS packet in the TS data stream is sent once. After each TS packet in the TS data stream is sent once, the first TS packet in the TS data stream is continued to be broadcasted in a loop.
[0101] As can be seen from the above, the embodiment of the present application discloses a data downloading device, the server end searches for a data file to be downloaded according to a downloading request sent by the client end, splits the data file to be downloaded to obtain N data packets, adds a data packet index to each data packet to obtain a target data packet, encapsulates each target data packet into a TS format based on Section to obtain M TS packets, packs a preset number of TS packets into one UDP packet, and broadcasts the TS data stream in the UDP packet to the client end in an index order, the client end parses each payload data from the TS data stream and performs verification, and the payload data that passes the verification is stored to a preset position of a file until all the payload data passes the verification and is stored to the preset position of the file. As can be seen from the above, the present application uses TS technology to replace the multicast private protocol of the traditional scheme, encapsulates the target data packet with the added data packet index into a TS packet in a TS format, and sends the TS packet to the client end in the form of a TS data stream. Since the TS data stream has the characteristics of data broadcasting in a loop and data transmission unit, and the TS specification itself has a verification mechanism, the problem of unreliable multicast transmission data is solved.
[0102] In addition, since the multicast TS technology is used in data downloading, the development and debugging workload caused by the multicast private protocol and the multicast private fault-tolerant mechanism of the traditional scheme is avoided, thereby simplifying the complexity of data transmission design and reducing the workload. Meanwhile, compared with using http to broadcast data, the present application also reduces the bandwidth pressure, thereby reducing the cost of purchasing servers.
[0103] Finally, it should be noted that in this document, the terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.
[0104] The various embodiments described in this specification are intended to be illustrative only and in no way limit the scope of the application. Changes and modifications can be made by those skilled in the art, which employ the principles of the application, without departing from the scope thereof. Accordingly, the application is not limited to the embodiments described herein, but instead has scope to encompass any changes and modifications that serve the same, equivalent, or similar purpose(s) described herein.
[0105] The foregoing description of the disclosed embodiments enables a person skilled in the art to carry out or use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Therefore, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data download method, characterized by, Applied to the server side, the method comprises: According to the download request of the client submitted data file to be downloaded, find the data file to be downloaded, wherein the download request contains the identification of the data file to be downloaded; The data file to be downloaded is split according to the preset length, and N data packets are obtained, N is a positive integer; Each data packet is added with a data packet index to obtain a target data packet, wherein the data packet index includes the index number of the previous data packet of the data packet and the index number of the next data packet of the data packet; The length and index data of the target data packet are encapsulated into TS format in the form of private table carrying Section, and M TS packets are obtained, M is a positive integer; Each time, a preset number of TS packets are packaged into a UDP packet; The TS data stream formed by each TS packet in the UDP packet is broadcasted to the client in index order, the client parses each payload data from the TS data stream and performs verification, stores the payload data that passes the verification to a file preset position, and receives and completes the payload data that has not been received in the TS data stream in subsequent loop broadcast, and discards the repeated packets and error packets until all payload data are verified and stored in the file preset position.
2. The data download method of claim 1, wherein, In the head packet obtained by splitting the data file to be downloaded, the index number of the previous data packet of the head packet is 0, and the index number of the next data packet of the head packet is 2.
3. The data download method of claim 1, wherein, In the tail packet obtained by splitting the data file to be downloaded, the index number of the next data packet of the data packet index of the tail packet is 0.
4. The data download method of claim 1, wherein, The preset number is seven.
5. A data downloading apparatus characterized by comprising: Applied to the server side, the device comprises: A finding unit is configured to find the data file to be downloaded according to the download request of the client submitted data file to be downloaded, wherein the download request contains the identification of the data file to be downloaded; A splitting unit is configured to split the data file to be downloaded according to the preset length, and obtain N data packets, N is a positive integer; An adding unit is configured to add a data packet index to each data packet to obtain a target data packet, wherein the data packet index includes the index number of the previous data packet of the data packet and the index number of the next data packet of the data packet; An encapsulating unit is configured to encapsulate the length and index data of the target data packet into TS format in the form of private table carrying Section, and obtain M TS packets, M is a positive integer; A packaging unit is configured to package a preset number of TS packets into a UDP packet each time; The broadcasting unit is used to circularly broadcast the TS data stream formed by each TS packet in the UDP packet to the client in index order, parse each payload data from the TS data stream by the client, perform checking, store the payload data passing the checking to a preset file position, receive and complete the payload data not received in the TS data stream in the subsequent circular broadcasting by the client, and discard the repeated packets and error packets until all the payload data are checked and stored to the preset file position.
6. The data downloading apparatus according to claim 5, wherein In the head packet obtained by splitting the data file to be downloaded, the index number of the previous data packet of the head packet is 0, and the index number of the next data packet of the head packet is 2.
7. The data downloading apparatus according to claim 5, wherein In the tail packet obtained by splitting the data file to be downloaded, the index number of the next data packet of the data packet index of the tail packet is 0.
8. The data downloading apparatus according to claim 5, wherein The preset number is seven.
Citation Information
Patent Citations
HLS streaming media transmission method and apparatus
CN106686410A