CN111988674A - Multimedia data transmission method, device, equipment and storage medium - Google Patents

Multimedia data transmission method, device, equipment and storage medium Download PDF

Info

Publication number
CN111988674A
CN111988674A CN202010833893.3A CN202010833893A CN111988674A CN 111988674 A CN111988674 A CN 111988674A CN 202010833893 A CN202010833893 A CN 202010833893A CN 111988674 A CN111988674 A CN 111988674A
Authority
CN
China
Prior art keywords
data
packet
sub
main
multimedia
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010833893.3A
Other languages
Chinese (zh)
Inventor
许健健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Xaircraft Technology Co Ltd
Original Assignee
Guangzhou Xaircraft Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Xaircraft Technology Co Ltd filed Critical Guangzhou Xaircraft Technology Co Ltd
Priority to CN202010833893.3A priority Critical patent/CN111988674A/en
Publication of CN111988674A publication Critical patent/CN111988674A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23106Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols

Abstract

The invention discloses a multimedia data transmission method, a device, equipment and a storage medium, wherein the method comprises the following steps: dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data, wherein each data segment is provided with a segment sequence identifier; packaging each data fragment into a data packet with a specified number, wherein the packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of the data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment; and sending the data packet to a multimedia data playing end, wherein the multimedia data playing end is used for decoding the data packet according to a main packet number and a sub-packet number contained in a packet header of the data packet after receiving the data packet, so as to obtain multimedia data. The problems that the multimedia data are disordered and the multimedia data playing end cannot decode the complete multimedia data are avoided, and the transmission quality of the multimedia data is improved.

Description

Multimedia data transmission method, device, equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for multimedia data transmission.
Background
In the process of multimedia data transmission, in order to reduce the data volume of transmission, an original multimedia data sequence is compressed according to a certain coding algorithm to obtain code streams with different data volumes of each frame. In order to adapt to network transmission, the compressed code stream is encapsulated and fragmented once according to a certain encapsulation protocol, and the process of encapsulating and fragmenting on an IP network is called packetization.
After encoding and packing, a frame of original multimedia data is divided into data packets of a plurality of Real-time Transport protocols (RTP) for transmission, in order to improve transmission efficiency, the transmission data packets generally use User Datagram Protocol (UDP), and the transmission Protocol does not need handshaking and responding, so that transmission efficiency is high. However, based on the principle of UDP transmission, UDP is unreliable transmission, which may cause that data transmitted first arrives later or data transmitted later arrives first in the transmission process, resulting in confusion of multimedia data, and finally causing that the receiving end cannot decode complete multimedia data.
Disclosure of Invention
The invention provides a multimedia data transmission method, a device, equipment and a storage medium, which are used for avoiding the problems that multimedia data are disordered and a multimedia data playing end cannot decode complete multimedia data and improving the transmission quality of the multimedia data.
In a first aspect, an embodiment of the present invention provides a multimedia data transmission method, applied to a multimedia data acquisition end, including:
dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data, wherein each data segment is provided with a segment sequence identifier;
packaging each data fragment into a data packet with a specified number, wherein the packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of the data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
and sending the data packet to a multimedia data playing end, wherein the multimedia data playing end is used for decoding the data packet according to a main packet number and the sub packet number contained in a packet header of the data packet after receiving the data packet, so as to obtain the multimedia data.
Optionally, the dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data includes:
dividing the multimedia data into a plurality of data segments according to a preset playing time length and the playing time sequence of the multimedia data;
and setting a segment sequence identifier for the data segment according to the sequence of the ending playing time of the data segment.
Optionally, the packing each data fragment into a specified number of data packets includes:
dividing the data segments into a specified number of sub-data segments;
determining the sequence of the sub-data segments in the data segments as a packet sequence identifier;
and coding the sub data fragments by taking the fragment sequence identification and the packet sequence identification of the data fragments as packet heads to obtain data packets, wherein the fragment sequence identification in the packet heads is a main packet number, and the packet sequence identification is a sub packet number.
In a second aspect, an embodiment of the present invention further provides a multimedia data transmission method, applied to a multimedia data playing end, including:
receiving a data packet sent by a multimedia data acquisition end, wherein the packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
storing the packet body data in the data packet according to the main packet number and the sub-packet number;
and when the specified number of the inclusion data with the same main packet number is stored, sending the inclusion data with the same main packet number to the playing area according to the sequence of the sub-packet numbers so as to play the inclusion data with the same main packet number according to the sequence of the sub-packet numbers of the data packets.
Optionally, the storing the body data in the data packet according to the main packet number and the sub-packet number includes:
analyzing each received data packet to obtain a main packet number and a sub-packet number in a packet header;
judging whether packet body data with the same main packet number as that of the received data packet is stored in the plurality of cache areas;
if so, storing the packet body data of the received data packet into a cache region where the stored packet body data with the same main packet number are located;
and if not, storing the packet body data of the received data packet into an idle cache area.
Optionally, the cache region includes a specified number of sub-regions, and the storing the body data of the received data packet into the cache region where the stored body data with the same primary packet number is located includes:
storing the packet body data of the data packet into a sub-area corresponding to the sub-packet number in the cache area;
and accumulating the quantity of the stored packet data of the cache region by 1.
Optionally, the storing the packet body data of the received data packet in an idle buffer area includes:
acquiring state information of a plurality of cache areas;
judging whether a cache region with state information in an idle state exists in the plurality of cache regions;
if so, storing the packet body data of the data packet into an idle cache region;
if not, emptying the cache region for storing the packet body data with the minimum main packet number, and updating the state information of the emptied cache region into an idle state;
storing the packet body data of the data packet into the emptied cache region, updating the main packet number of the packet body data stored in the cache region and updating the state information of the cache region into an occupied state.
Optionally, the cache region is provided with the number of the stored bag body data and the main bag number of the stored bag body data, and when the specified number of bag body data of the same main bag number is stored, the bag body data of the same main bag number is sent to the playing region according to the sequence of the sub-bag numbers, including:
judging whether the quantity of stored packet body data in a cache region with the minimum main packet number is equal to a specified numerical value or not;
if so, sending the packet body data in the cache region with the minimum main packet number to a playing region according to the sequence of the sub regions in the cache region with the minimum main packet number;
if not, counting the total time length of the packet body data stored in the cache region with the minimum main packet number;
and when the total duration is greater than a preset threshold value, clearing the cache region with the minimum main packet number.
Optionally, when the specified number of packet data of the same main packet number is stored, the packet data of the same main packet number is sent to the playing area according to the sequence of the sub-packet numbers, and the method further includes:
initializing the buffer area after the bag body data is sent, the state information of the buffer area after the buffer area is emptied, the quantity of the stored bag body data and the main bag number of the stored bag body data.
In a third aspect, an embodiment of the present invention further provides a multimedia data transmission device, applied to a multimedia data acquisition end, including:
the data segment dividing module is used for dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data, and each data segment is provided with a segment sequence identifier;
the data packaging module is used for packaging each data fragment into a specified number of data packets, wherein the packet header of each data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of the data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
and the data packet sending module is used for sending the data packet to a multimedia data playing end, and the multimedia data playing end is used for decoding the data packet according to a main packet number and the sub packet number contained in a packet header of the data packet after receiving the data packet to obtain the multimedia data.
Optionally, the data fragment dividing module includes:
the data segment dividing submodule is used for dividing the multimedia data into a plurality of data segments according to a preset playing time length and the playing time sequence of the multimedia data;
and the segment sequence identifier setting submodule is used for setting segment sequence identifiers for the data segments according to the sequence of the ending playing time of the data segments.
Optionally, the data packing module includes:
a sub-data segment dividing sub-module, configured to divide the data segment into a specified number of sub-data segments;
a packet sequence identifier determining submodule, configured to determine a sequence of the sub-data segments in the data segment as a packet sequence identifier;
and the coding submodule is used for coding the subdata fragments by taking the fragment sequence identification and the packet sequence identification of the data fragments as packet heads to obtain data packets, wherein the fragment sequence identification in the packet heads is a main packet number, and the packet sequence identification is a sub-packet number.
In a fourth aspect, an embodiment of the present invention further provides a multimedia data transmission apparatus, applied to a multimedia data playing end, including:
the data packet receiving module is used for receiving a data packet sent by a multimedia data acquisition end, wherein the packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
the bag body data storage module is used for storing bag body data in the data bag according to the main bag number and the sub-bag number;
and the inclusion data sending module is used for sending the inclusion data with the same main packet number to the playing area according to the sequence of the sub-packet numbers when the specified number of the inclusion data with the same main packet number is stored, so as to play the inclusion data with the same main packet number according to the sequence of the sub-packet numbers of the data packets.
Optionally, the bag body data storage module includes:
the analysis submodule is used for analyzing each received data packet to obtain a main packet number and a sub-packet number in the packet header;
the first judgment submodule is used for judging whether the plurality of cache areas store packet data of which the main packet numbers are the same as those of the received data packets;
the first storage submodule is used for storing the received packet body data into a cache region where the stored packet body data with the same main packet number is located when the fact that the packet body data with the same main packet number as the received data packet is stored in the plurality of cache regions is determined;
and the second storage submodule is used for storing the packet body data of the received data packet into an idle cache region when determining that no packet body data with the same main packet number as that of the received data packet is stored in the plurality of cache regions.
Optionally, the first storage submodule includes:
the first storage unit is used for storing the packet body data of the data packet into a sub-area corresponding to the sub-packet number in the cache area;
and the accumulation unit is used for accumulating the quantity of the stored packet body data of the cache region by 1.
Optionally, the second storage submodule includes:
the state information acquisition unit is used for acquiring the state information of the plurality of cache areas;
the judging unit is used for judging whether a cache region with state information in an idle state exists in the plurality of cache regions;
the second storage unit is used for storing the packet body data of the data packet into an idle cache region when determining that the cache region with the state information in the idle state exists in the plurality of cache regions;
the emptying unit is used for emptying the cache region for storing the packet body data with the minimum main packet number and updating the state information of the emptied cache region into an idle state when the cache region with the state information of the idle state does not exist in the plurality of cache regions;
and the third storage unit is used for storing the packet body data of the data packet into the emptied cache region, updating the main packet number of the packet body data stored in the cache region and updating the state information of the cache region into an occupied state.
Optionally, the cache region is provided with the number of the stored bag body data and the number of the main bag of the stored bag body data, and the bag body data sending module includes:
the second judgment submodule is used for judging whether the quantity of the stored bag body data in the cache region with the minimum main bag number is equal to a specified numerical value or not;
the sending submodule is used for sending the packet body data in the cache region with the minimum main packet number to the playing region according to the sequence of the sub-regions in the cache region with the minimum main packet number when the number of the stored packet body data in the cache region with the minimum main packet number is determined to be equal to a specified numerical value;
the time length counting submodule is used for counting the total time length of the stored bag body data of the cache region with the minimum main bag number when the stored bag body data quantity of the cache region with the minimum main bag number is determined not to be equal to a specified value;
and the emptying submodule is used for emptying the cache region with the main packet number as the minimum value when the total duration is greater than a preset threshold value.
Optionally, the packet data sending module further includes:
and the initialization submodule is used for initializing the cache region after the data packet is sent, the state information of the emptied cache region, the quantity of the stored packet body data and the main packet number of the stored packet body data.
In a fifth aspect, an embodiment of the present invention further provides a computer device, including:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a multimedia data transmission method as provided in the first aspect of the invention, or to implement a multimedia data transmission method as provided in the second aspect of the invention.
In a sixth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the multimedia data transmission method provided in the first aspect of the present invention, or implements the multimedia data transmission method provided in the second aspect of the present invention.
The multimedia data transmission method provided by the embodiment of the invention is applied to a multimedia data acquisition end, and the data packet is sent to the multimedia data playing end by dividing the acquired multimedia data into a plurality of data segments according to the playing time sequence, packaging each data segment into a specified number of data packets, wherein the packet head of each data packet comprises a main packet number and a sub packet number, the main packet number is the segment sequence identification of the data segment to which the data packet belongs, and the sub packet number is the packet sequence identification of the data packet in the data segment. The multimedia data playing end analyzes the data packet, obtains a packet head and a packet body in the data packet, and then stores packet body data in the data packet according to the main packet number and the sub packet number. And when the specified number of the inclusion data with the same main packet number is stored, the inclusion data with the same main packet number is sent to the playing area according to the sequence of the sub-packet numbers, so that the inclusion data with the same main packet number is played according to the sequence of the sub-packet numbers of the data packets. Therefore, even if the situation that the data packet is transmitted first and then arrives or the data packet is transmitted later and arrives first exists in the transmission process of the data packet, the specified number of packet data with the same main packet number needs to be waited for to be completely stored, and then the packet data with the same main packet number is transmitted to the playing area according to the sequence of the sub-packet numbers, so that the problems that the multimedia data is disordered and the multimedia data playing end cannot decode complete multimedia data are avoided, and the transmission quality of the multimedia data is improved.
Drawings
Fig. 1 is a flowchart of a multimedia data transmission method according to an embodiment of the present invention;
fig. 2 is a flowchart of a multimedia data transmission method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a multimedia data transmission method according to a third embodiment of the present invention;
fig. 4 is a flowchart of a multimedia data transmission method according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a multimedia data transmission apparatus according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a multimedia data transmission apparatus according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a multimedia data transmission method according to an embodiment of the present invention, where the present embodiment is applicable to a case of multimedia data transmission based on a UDP transport protocol, and the method may be executed by a multimedia data transmission device according to an embodiment of the present invention, where the device may be implemented in a software and/or hardware manner and is integrated in a multimedia data acquisition end according to an embodiment of the present invention, as shown in fig. 1, the method specifically includes the following steps:
s101, dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data.
Specifically, the multimedia data acquisition end may be an audio acquisition device, such as a microphone, for acquiring audio data; which may be a video collector, such as a camera, for collecting video data. In the specific embodiment of the present invention, a multimedia data acquisition end is taken as an example of an audio acquisition device, and the embodiment of the present invention is described.
The multimedia data acquisition terminal acquires multimedia data continuously and in real time and divides the multimedia data into a plurality of data segments according to the playing time sequence (or the acquisition time sequence) of the acquired multimedia data. Specifically, in a specific embodiment of the present invention, the multimedia data acquisition end divides the data acquisition process according to a predetermined time period (for example, 1s), defines the multimedia data of the predetermined time period as a data segment when acquiring the multimedia data of the predetermined time period, and so on until the last data segment is divided. In another embodiment of the present invention, after a segment of complete multimedia data is acquired, the multimedia data acquisition end divides the segment of complete multimedia data, and divides the segment of complete multimedia data into a plurality of data segments by a predetermined time interval (e.g., 1s) from an initial time of acquisition.
In the above embodiment, the playing time sequence (or the collection time sequence) of the multimedia data may be determined by adding a time stamp to the data during or after the collection.
In the above embodiment, in the process of dividing the multimedia data, when the duration of the last played (or last collected) data segment is less than the predetermined time period or less than the predetermined time interval, zero padding is performed on the data segment.
Specifically, in the above embodiment, when the multimedia data is divided according to the playing time sequence, each data segment is provided with a segment sequence identifier, and the segment sequence identifier is used for identifying the sequence of the data segment.
And S102, packaging each data fragment into a specified number of data packets.
Specifically, data packing is to map multimedia data into a payload of a certain encapsulation protocol, and then fill a packet header of a corresponding protocol to form a data packet of the encapsulation protocol, where the data packet includes two parts, a packet header and a packet body. In the embodiment of the invention, each data fragment is packaged into a specified number of data packets. In the embodiment of the present invention, the packet header of the data packet includes a main packet number and a sub-packet number, where the main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, the sub-packet number is a packet sequence identifier of the data packet in the data fragment, and the packet sequence identifier is used to identify a sequence of the data packet in the data fragment. The packet body is packet body data including the data packet, namely valid data included in the data packet.
S103, sending the data packet to a multimedia data playing end.
Specifically, after each data fragment is packaged into a specified number of data packets, the data packets are sent to the multimedia data playing end through a wireless transmission medium. Illustratively, in a specific embodiment, the multimedia data acquisition end sequentially sends the data packets according to the packet sequence identifiers of the data packets.
The multimedia data playing end can be an audio player or a video player, and is used for decoding the data packet according to the main packet number and the sub packet number contained in the packet header of the data packet after receiving the data packet to obtain multimedia data. Specifically, the multimedia data playing end analyzes the data packet, obtains a packet header and a packet body in the data packet, and then stores packet body data in the data packet according to the main packet number and the sub packet number. And when the specified number of the inclusion data with the same main packet number is stored, the inclusion data with the same main packet number is sent to the playing area according to the sequence of the sub-packet numbers, so that the inclusion data with the same main packet number is played according to the sequence of the sub-packet numbers of the data packets. Therefore, even if the situation that the data packet is transmitted first and then arrives or the data packet is transmitted later and arrives first exists in the transmission process of the data packet, the specified number of packet data with the same main packet number needs to be waited for to be completely stored, and then the packet data with the same main packet number is transmitted to the playing area according to the sequence of the sub-packet numbers, so that the problems that the multimedia data is disordered and the multimedia data playing end cannot decode complete multimedia data are avoided, and the transmission quality of the multimedia data is improved.
The multimedia data transmission method provided by the embodiment of the invention is applied to a multimedia data acquisition end, and the data packet is sent to the multimedia data playing end by dividing the acquired multimedia data into a plurality of data segments according to the playing time sequence, packaging each data segment into a specified number of data packets, wherein the packet head of each data packet comprises a main packet number and a sub packet number, the main packet number is the segment sequence identification of the data segment to which the data packet belongs, and the sub packet number is the packet sequence identification of the data packet in the data segment. The multimedia data playing end analyzes the data packet, obtains a packet head and a packet body in the data packet, and then stores packet body data in the data packet according to the main packet number and the sub packet number. And when the specified number of the inclusion data with the same main packet number is stored, the inclusion data with the same main packet number is sent to the playing area according to the sequence of the sub-packet numbers, so that the inclusion data with the same main packet number is played according to the sequence of the sub-packet numbers of the data packets. Therefore, even if the situation that the data packet is transmitted first and then arrives or the data packet is transmitted later and arrives first exists in the transmission process of the data packet, the specified number of packet data with the same main packet number needs to be waited for to be completely stored, and then the packet data with the same main packet number is transmitted to the playing area according to the sequence of the sub-packet numbers, so that the problems that the multimedia data is disordered and the multimedia data playing end cannot decode complete multimedia data are avoided, and the transmission quality of the multimedia data is improved.
Example two
Fig. 2 is a flowchart of a multimedia data transmission method according to a second embodiment of the present invention, which is optimized based on the first embodiment of the present invention, and describes in detail a specific process of dividing a data packet and a data structure of the data packet according to the second embodiment of the present invention, specifically, as shown in fig. 2, the method according to the second embodiment of the present invention may include the following steps:
s201, dividing the multimedia data into a plurality of data segments according to a preset playing time and a playing time sequence of the multimedia data.
Specifically, after a multimedia data acquisition end acquires a segment of multimedia data with a preset playing time, the segment of multimedia data is equally divided into a plurality of data segments according to the playing time sequence of the multimedia data. Illustratively, in an embodiment of the present invention, the multimedia data is audio data, and the multimedia data acquisition end is a microphone. After the microphone collects a section of audio data with 3s playing time, the audio data is sequentially divided into 3 audio segments with 1s playing time according to the playing time sequence.
S202, setting fragment sequence identification for the data fragments according to the sequence of the ending playing time of the data fragments.
Specifically, if the ending playing time of the data segment is at the end of the nth second, the segment sequence identifier of the data segment is set to be the nth. Illustratively, in a specific embodiment of the present invention, the segment id of the audio segment ending the playing time at the end of 1 second is set to 1 st, the segment id of the audio segment ending the playing time at the end of 2 second is set to 2 nd, and the segment id of the audio segment ending the playing time at the end of 3 rd second is set to 3 rd.
S203, dividing the data segment into a designated number of sub-data segments.
Specifically, in the process of packing the data segments, the data segments are firstly divided into a specified number of sub-data segments according to the time sequence. Illustratively, in a specific embodiment of the present invention, each audio segment with a duration of 1s is divided into 16 sub-audio segments according to the chronological order.
S204, determining the sequence of the sub-data segments in the data segments as a packet sequence identifier.
Specifically, according to the time sequence of dividing the subdata fragments, the sequence of the subdata fragments in the data fragments is determined as a packet sequence identifier. Illustratively, in a specific embodiment of the present invention, while or after dividing each audio segment with a duration of 1s into 16 sub-audio segments according to the time sequence, packet sequence identifiers are set for each sub-audio segment according to the time sequence, which are respectively the 1 st to the 16 th in sequence.
S205, coding the sub-data fragments by using the fragment sequence identification and the packet sequence identification of the data fragments as packet headers to obtain data packets.
Specifically, for each sub-data fragment, the fragment sequence identifier of the data fragment to which the sub-data fragment belongs and the packet sequence identifier of the sub-data fragment are used as packet headers, and the data of the sub-data fragment is used as packet headers to be encoded, so as to form a data packet. The sequence of fragments in the header of a data packet is identified as the primary packet number and the sequence of packets is identified as the sub-packet number. Illustratively, table 1 shows a data structure of a data packet provided in an embodiment of the present invention, where the data packet includes a packet header and a packet body, the packet header includes a main packet number and a sub-packet number, and the packet body is valid data of the data packet, that is, data of a sub-audio segment.
TABLE 1
Figure BDA0002638980400000091
In this embodiment, the packet header further includes a frame header, and a frame of data is a data packet. The frame header is a data type identifier for identifying the type of data, such as for indicating that the data is audio data or video data.
Illustratively, in an embodiment of the present invention, the data structure of a 3 s-duration audio clip is shown in table 2.
TABLE 2
Description of data Audio identifier Main packet number Steamed stuffed bun number Audio data
1 st data packet of 1 st second audio segment Frame header 1 1 XXXXXX
2 nd data packet of 1 st second audio segment Frame header 1 2 XXXXXX
16 th data packet of 1 second audio clip Frame header 1 16 XXXXXX
1 st data packet of 2 second audio segment Frame header 2 1 XXXXXX
2 nd data packet of 2 nd second audio segment Frame header 2 2 XXXXXX
16 th data packet of 2 second audio clip Frame header 2 16 XXXXXX
1 st data packet of 3 second audio clip Frame header 3 1 XXXXXX
2 nd data packet of 3 rd second audio segment Frame header 3 2 XXXXXX
16 th data packet of 3 second audio clip Frame header 3 16 XXXXXX
As shown in table 2, each audio segment with a duration of 1s is divided into 16 sub-audio segments according to the time sequence, each sub-audio segment forms a data packet, and the data packet includes a packet header and a packet body. The packet body is effective audio data of the sub-audio segment, the packet header comprises a main packet number and a sub-packet number, the main packet number is a segment sequence identifier of the audio segment to which the sub-audio segment belongs, and the sub-packet number is a packet sequence identifier of the data packet, namely a sequence identifier of the sub-audio segment in the audio segment to which the sub-audio segment belongs.
It should be noted that, in table 2, for convenience of understanding, the main packet number and the sub-packet number are expressed in decimal, and in an actual data packet, the main packet number and the sub-packet number are expressed in a computer language, such as a binary or hexadecimal character string.
And S206, sending the data packet to a multimedia data playing end.
Specifically, after each data fragment is packaged into a specified number of data packets, the data packets are sent to the multimedia data playing end through a wireless transmission medium. Illustratively, in a specific embodiment, the multimedia data acquisition end sequentially sends the data packets according to the packet sequence identifiers of the data packets.
The multimedia data transmission method provided by the embodiment of the invention is applied to a multimedia data acquisition end, and the data packet is sent to the multimedia data playing end by dividing the acquired multimedia data into a plurality of data segments according to the playing time sequence, packaging each data segment into a specified number of data packets, wherein the packet head of each data packet comprises a main packet number and a sub packet number, the main packet number is the segment sequence identification of the data segment to which the data packet belongs, and the sub packet number is the packet sequence identification of the data packet in the data segment. The multimedia data playing end analyzes the data packet, obtains a packet head and a packet body in the data packet, and then stores packet body data in the data packet according to the main packet number and the sub packet number. And when the specified number of the inclusion data with the same main packet number is stored, the inclusion data with the same main packet number is sent to the playing area according to the sequence of the sub-packet numbers, so that the inclusion data with the same main packet number is played according to the sequence of the sub-packet numbers of the data packets. Therefore, even if the situation that the data packet is transmitted first and then arrives or the data packet is transmitted later and arrives first exists in the transmission process of the data packet, the specified number of packet data with the same main packet number needs to be waited for to be completely stored, and then the packet data with the same main packet number is transmitted to the playing area according to the sequence of the sub-packet numbers, so that the problems that the multimedia data is disordered and the multimedia data playing end cannot decode complete multimedia data are avoided, and the transmission quality of the multimedia data is improved.
EXAMPLE III
Fig. 3 is a flowchart of a multimedia data transmission method according to a third embodiment of the present invention, where the present embodiment is applicable to a case of multimedia data transmission based on a UDP transport protocol, and the method may be executed by a multimedia data transmission apparatus according to the third embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner, and is integrated in a multimedia data playing end according to the third embodiment of the present invention, as shown in fig. 3, the method specifically includes the following steps:
s301, receiving a data packet sent by a multimedia data acquisition end.
Specifically, the multimedia data playing end receives a data packet sent by the multimedia data acquisition end through a wireless transmission medium. The packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is the fragment sequence identification of the data fragment to which the data packet belongs, and the sub-packet number is the packet sequence identification of the data packet in the data fragment.
Specifically, the multimedia data acquisition end divides the multimedia data into a plurality of data segments according to the playing time sequence of the acquired multimedia data, each data segment is provided with a segment sequence identifier, each data segment is packaged into a specified number of data packets, the packet head of each data packet comprises a main packet number and a sub packet number, the main packet number is the segment sequence identifier of the data segment to which the data packet belongs, and the sub packet number is the packet sequence identifier of the data packet in the data segment, and then the data packet is sent to the multimedia data playing end. Specifically, the process of dividing the multimedia data into a plurality of data segments and the process of packaging each data segment into a specified number of data packets have been described in detail in the foregoing embodiments, and the embodiments of the present invention are not described herein again.
S302, storing the body data in the data packet according to the main packet number and the sub-packet number.
Specifically, the multimedia data playing end analyzes the data packet, obtains a packet header and a packet body in the data packet, and then stores packet body data in the data packet according to the main packet number and the sub packet number. For example, in a specific embodiment of the present invention, the packet body data in the data packets with the same primary packet number are stored in the same cache region.
S303, when the specified number of the bag body data with the same main bag number is stored, sending the bag body data with the same main bag number to a playing area according to the sequence of the sub-bag numbers, and playing the bag body data with the same main bag number according to the sequence of the sub-bag numbers of the data bags.
Specifically, after the specified number of packet data in a certain data packet with the same main packet number is completely stored, the packet data in the data packet with the same main packet number is sent to the playing area according to the sequence of the sub-packet numbers, so that the multimedia data playing end plays the packet data with the same main packet number according to the sequence of the sub-packet numbers of the data packets, namely, the packet data is sequentially played according to the time sequence of the packet data received by the playing area. Therefore, even if the situation that the data packet is transmitted first and then arrives or the data packet is transmitted later and arrives first exists in the transmission process of the data packet, the specified number of packet data with the same main packet number needs to be waited for to be completely stored, and then the packet data with the same main packet number is transmitted to the playing area according to the sequence of the sub-packet numbers, so that the problems that the multimedia data is disordered and the multimedia data playing end cannot decode complete multimedia data are avoided, and the transmission quality of the multimedia data is improved.
The multimedia data transmission method provided by the embodiment of the invention is applied to a multimedia data playing end, and is characterized in that the data packets sent by a multimedia data acquisition end are received, the inclusion data in the data packets are stored according to the main packet numbers and the sub-packet numbers in the data packets, and when the specified number of inclusion data with the same main packet number is stored, the inclusion data with the same main packet number is sent to a playing area according to the sequence of the sub-packet numbers, so that the inclusion data with the same main packet number is played according to the sequence of the sub-packet numbers of each data packet. The main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment. Therefore, even if the situation that the data packet is transmitted first and then arrives or the data packet is transmitted later and arrives first exists in the transmission process of the data packet, the specified number of packet data with the same main packet number needs to be waited for to be completely stored, and then the packet data with the same main packet number is transmitted to the playing area according to the sequence of the sub-packet numbers, so that the problems that the multimedia data is disordered and the multimedia data playing end cannot decode complete multimedia data are avoided, and the transmission quality of the multimedia data is improved.
Example four
Fig. 4 is a flowchart of a multimedia data transmission method according to a fourth embodiment of the present invention, which is optimized based on the third embodiment of the present invention to describe in detail a process of storing inclusion data according to the third embodiment of the present invention, and specifically, as shown in fig. 4, the method according to the fourth embodiment of the present invention may include the following steps:
s401, receiving a data packet sent by a multimedia data acquisition end.
Specifically, the multimedia data playing end receives a data packet sent by the multimedia data acquisition end through a wireless transmission medium. The packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is the fragment sequence identification of the data fragment to which the data packet belongs, and the sub-packet number is the packet sequence identification of the data packet in the data fragment.
Illustratively, in an embodiment of the present invention, the multimedia data is audio data, and the multimedia data acquisition end is a microphone. After the microphone collects a section of audio data with 3s playing time, the audio data is sequentially divided into 3 audio segments with 1s playing time according to the playing time sequence. And dividing each audio clip with the duration of 1s into 16 sub-audio clips according to the time sequence, and setting packet sequence identifiers for each sub-audio clip according to the time sequence, wherein the packet sequence identifiers are respectively 1 st to 16 th in sequence.
The data packet comprises a packet header and a packet body, wherein the packet header comprises a main packet number and a sub-packet number, and the packet body is effective data of the data packet, namely data of the sub-audio fragment. Specifically, the data structure has been described in detail in the foregoing embodiments, and the embodiments of the present invention are not described herein again.
S402, analyzing the data packet to obtain a main packet number and a sub-packet number in the packet header aiming at each received data packet.
Specifically, the multimedia data playing end analyzes the data packet to obtain a packet header and a packet body in the data packet, wherein the packet header comprises a main packet number and a sub-packet number, the main packet number is a segment sequence identifier of a data segment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data segment. For example, taking the 1 st packet of the 1 st audio segment as an example, after parsing, the main packet number is 1, the sub-packet number is 1, and the body data (i.e., the valid audio data in the packet) are obtained.
S403, judging whether the plurality of cache regions store packet data with the same main packet number as that of the received data packet.
Specifically, the multimedia playing end is provided with a memory for storing the received multimedia data. The memory is provided with a plurality of cache areas, and one cache area can store the packet body data in all the data packets corresponding to one main packet number. After a data packet is received and the data packet is analyzed to obtain a packet header and packet body data, whether the packet body data with the main packet number same as that of the received data packet is stored in a memory is judged. Illustratively, the cache region is provided with a primary packet number of stored packet body data, and when the cache region stores the first packet body data, the primary packet number of the stored packet body data is automatically updated to be the primary packet number to which the packet body data belongs. Therefore, whether the packet data with the same main packet number as that of the received data packet is stored in the memory can be judged by comparing each main packet number of the cache area with the main packet number of the received data packet.
In step S403, if the plurality of buffer areas store packet data having the same primary packet number as the primary packet number of the received packet, step S404 is executed to store the packet data of the received packet in the buffer area where the stored packet data having the same primary packet number is located.
Specifically, when it is determined that the memory already stores the packet body data with the same main packet number as that of the received data packet, the packet body data of the received data packet is stored in the cache area where the stored packet body data with the same main packet number is located. Illustratively, if the currently received data packet is the 8 th data packet of the 1 s-th audio segment, the number of the main packet is 1. At this time, if any data packet with the primary packet number of 1 exists in the memory, that is, if a cache region with the primary packet number of 1 exists in the memory, the packet body data in the received data packet is stored in the cache region with the primary packet number of 1.
Specifically, step S404 may include:
storing the packet body data of the data packet into a sub-region corresponding to the sub-packet number in the cache region;
and accumulating the quantity of the stored packet data of the buffer area by 1.
Specifically, each cache region includes a designated number of sub-regions, and in a specific embodiment of the present invention, each cache region includes 16 sub-regions, and the sub-regions are numbered sequentially and are respectively No. 1 to No. 16, and the sub-regions No. 1 to No. 16 are respectively used to store packet body data in the sub-packets No. 1 to No. 16.
The buffer area is provided with the number of the stored bag body data, and after the bag body data are stored in the sub-area corresponding to the sub-bag number in the buffer area, the number of the stored bag body data in the buffer area is accumulated by 1.
In step S403, if no packet data having the same primary packet number as the primary packet number of the received packet is stored in the plurality of cache areas, step S405 is executed to acquire status information of the plurality of cache areas.
Specifically, the cache region is provided with status information, and the status information may include an occupied status and an idle status, which are respectively used to indicate that the cache region already stores the packet body data and that the cache region does not yet store the packet body data. By acquiring the state information of each cache region, the cache region can be known to be in an occupied state or an idle state.
S406, judging whether a cache region with the state information in an idle state exists in the plurality of cache regions.
Specifically, whether a cache region with state information in an idle state exists in the plurality of cache regions is judged according to the state information of the cache regions.
If yes, step S407 is executed to store the packet body data of the data packet into the free buffer area.
Specifically, if a cache region with state information in an idle state exists, the packet body data of the received data packet is stored in the idle cache region, the state information of the cache region is updated to be in an occupied state, the primary packet number of the cache region is updated to be the primary packet number of the data packet, and the number of the stored packet body data in the cache region is accumulated to 1. In the embodiment of the present invention, three attributes, that is, the state information of the cache region, the primary packet number of the cache region, and the number of the stored packet data of the cache region, are referred to as region attributes.
If not, step S408 is executed to empty the cache region storing the packet body data with the smallest primary packet number, and update the state information of the empty cache region to be in an idle state.
Specifically, if there is no cache region whose state information is in an idle state, that is, all cache regions in the memory are occupied, the cache region with the smallest current primary packet number is determined according to the primary packet number of each cache region, and the cache region is emptied, and then the state information of the emptied cache region is updated. In the embodiment of the present invention, when the state information of the cache region is modified, the number of the primary packet in the cache region and the amount of the stored packet data in the cache region are initialized.
Illustratively, taking the case that the memory includes 3 buffer areas as an example, the 3 buffer areas respectively store the inclusion data with the main packet number 1 (i.e., the audio data of the 1 st s), the inclusion data with the main packet number 2 (i.e., the audio data of the 2 nd s), and the inclusion data with the main packet number 3 (i.e., the audio data of the 3 rd s). That is, all of the 3 cache regions are currently in an occupied state, and if the primary packet number of the received data packet is different from the primary packet numbers of the current cache regions, emptying the cache region for storing packet body data with the primary packet number of 1, and updating the state information of the emptied cache region to be in an idle state.
S409, storing the packet body data of the data packet into the emptied cache region, and updating the main packet number of the packet body data stored in the cache region and updating the state information of the cache region into an occupied state.
Specifically, after step S408, the body data of the data packet is stored in the emptied buffer area, and the primary packet number of the body data stored in the buffer area and the state information of the updated buffer area are updated to be in the occupied state. Specifically, the packet body data of the data packet is stored in a sub-area corresponding to the sub-packet number in the cache area, then the area attribute of the cache area is updated, that is, the state information of the cache area is modified into an occupied state, the main packet number of the cache area is updated into the main packet number of the data packet, and the number of the stored packet body data in the cache area is accumulated by 1.
In the embodiment of the invention, when the state information of a plurality of cache areas is determined to be in an occupied state, and the number of the received main packet of the data packet is different from the number of the main packet of each current cache area, the cache area for storing the packet data with the minimum number of the main packet is emptied, the state information of the emptied cache area is updated to be in an idle state, then the packet data of the data packet is stored in the emptied cache area, and the number of the main packet of the packet data stored in the cache area and the state information of the updated cache area are updated to be in the occupied state. When the number of the received main packet of the data packet is different from the number of the main packet of each current cache region, and the cache region of the packet data with the smallest number of the main packet is not sent out, it is indicated that the packet data with the smallest number of the main packet is lost or delayed too long, at this time, the cache region storing the packet data with the smallest number of the main packet is emptied (namely, the data of the cache region actively discarding the packet data with the smallest number of the main packet), and the state information of the emptied cache region is updated to be in an idle state, so that a storage space is vacated for the received data packet, and subsequent data are prevented from being disordered.
S410, judging whether the quantity of the stored packet data in the cache region with the minimum main packet number is equal to a specified numerical value or not.
Specifically, after the above steps S404, S407, and S409, it is determined whether the number of stored packet data in the buffer area with the minimum primary packet number is equal to a specified value. The buffer area with the minimum primary packet number is the buffer area of the earliest data segment stored in the current-time memory. The 3 buffer areas respectively store the inclusion data with the main packet number of 1 (namely, the audio data of the 1 st s), the inclusion data with the main packet number of 2 (namely, the audio data of the 2 nd s) and the inclusion data with the main packet number of 3 (namely, the audio data of the 3 rd s). And after step S404, step S407, and step S409, it is determined whether the number of stored packet data of the buffer area whose primary packet number is 1 is equal to 16.
If so, executing step S411, and sending the packet body data in the buffer area with the minimum primary packet number to the playing area according to the sequence of the sub-areas in the buffer area with the minimum primary packet number.
Specifically, if the number of the stored packet data in the cache region with the minimum primary packet number is equal to a specified numerical value, the packet data in the storage region is sent to the playing region in the sequence of the sub-regions in the region. Illustratively, in the embodiment of the present invention, as described above, each sub-area in the cache area has a number from 1 to 16, and is respectively used for storing body data of a data packet with a sub-packet number from 1 to 16. And transmitting the body data according to the sequence of the subareas, namely transmitting the body data according to the sub-packet numbers. The playing area receives and plays the packet body data in sequence according to the sub-packet numbers.
If not, step S412 is executed to count the total duration of the packet body data stored in the cache region with the minimum primary packet number.
Specifically, if the number of the stored packet data in the cache region with the minimum primary packet number is not equal to the specified value (i.e., is less than the specified number), the total duration of the packet data stored in the cache region with the minimum primary packet number is counted.
And S413, when the total duration is greater than a preset threshold, clearing the buffer area with the minimum main packet number.
Specifically, the preset threshold may be determined according to the number of the cache regions in the embodiment of the present invention, and the preset threshold (second) is equal to the number of the cache regions minus 1. For example, in an embodiment of the present invention, if the number of the cache regions is 3, the preset threshold is 2 s. That is, in the embodiment of the present invention, if the delay of the cache region with the minimum primary packet number is not sent for 2s, which indicates that the packet data with the minimum primary packet number is lost or the delay is too long, at this time, the cache region storing the packet data with the minimum primary packet number is emptied (i.e., the data of the cache region actively discarding the packet data with the minimum primary packet number), and the state information of the empty cache region is updated to be in an idle state, so as to vacate a storage space for the received data packet, and avoid confusion of subsequent data.
And S414, initializing the buffer area after the transmission of the bag body data, the state information of the buffer area after emptying, the quantity of the stored bag body data and the main bag number of the stored bag body data.
Specifically, after step S411 and step S413, the buffer area to which the body data is sent, the state information of the buffer area after being cleared, the number of the stored body data, and the primary packet number of the stored body data are initialized. Namely, the state information of the cache area is modified into an idle state, the quantity of the stored packet body data is initialized to be zero, the main packet number of the stored packet body data is initialized to be zero, and then storage space is vacated for the subsequently received data packets. In the embodiment of the present invention, when the state information of the cache region is modified, the number of the primary packet in the cache region and the amount of the stored packet data in the cache region are initialized.
The multimedia data transmission method provided by the embodiment of the invention is applied to a multimedia data playing end, and is characterized in that the data packets sent by a multimedia data acquisition end are received, the inclusion data in the data packets are stored according to the main packet numbers and the sub-packet numbers in the data packets, and when the specified number of inclusion data with the same main packet number is stored, the inclusion data with the same main packet number is sent to a playing area according to the sequence of the sub-packet numbers, so that the inclusion data with the same main packet number is played according to the sequence of the sub-packet numbers of each data packet. The main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment. Therefore, even if the situation that the data packet is transmitted first and then arrives or the data packet is transmitted later and arrives first exists in the transmission process of the data packet, the specified number of packet data with the same main packet number needs to be waited for to be completely stored, and then the packet data with the same main packet number is transmitted to the playing area according to the sequence of the sub-packet numbers, so that the problems that the multimedia data is disordered and the multimedia data playing end cannot decode complete multimedia data are avoided, and the transmission quality of the multimedia data is improved. In addition, when the number of the received main packet of the data packet is different from the number of the main packet of each current cache region, and the cache region of the packet data with the smallest number of the main packet is not sent out, it is indicated that the packet data with the smallest number of the main packet is lost or delayed too long, at this time, the cache region storing the packet data with the smallest number of the main packet is emptied, the state information of the emptied cache region is updated to be in an idle state, a storage space is vacated for the received data packet, and disorder of subsequent data is avoided.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a multimedia data transmission device according to a fifth embodiment of the present invention, which is applied to a multimedia data acquisition end, and as shown in fig. 5, the device includes:
a data segment dividing module 501, configured to divide the multimedia data into multiple data segments according to a playing time sequence of the collected multimedia data, where each data segment is provided with a segment sequence identifier;
a data packing module 502, configured to pack each data fragment into a specified number of data packets, where a packet header of each data packet includes a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of the data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
a data packet sending module 503, configured to send the data packet to a multimedia data playing end, where the multimedia data playing end is configured to decode the data packet according to a main packet number and the sub packet number included in a packet header of the data packet after receiving the data packet, so as to obtain the multimedia data.
In some embodiments of the present invention, the data fragment dividing module 501 comprises:
the data segment dividing submodule is used for dividing the multimedia data into a plurality of data segments according to a preset playing time length and the playing time sequence of the multimedia data;
and the segment sequence identifier setting submodule is used for setting segment sequence identifiers for the data segments according to the sequence of the ending playing time of the data segments.
In some embodiments of the present invention, the data packing module 502 comprises:
a sub-data segment dividing sub-module, configured to divide the data segment into a specified number of sub-data segments;
a packet sequence identifier determining submodule, configured to determine a sequence of the sub-data segments in the data segment as a packet sequence identifier;
and the coding submodule is used for coding the subdata fragments by taking the fragment sequence identification and the packet sequence identification of the data fragments as packet heads to obtain data packets, wherein the fragment sequence identification in the packet heads is a main packet number, and the packet sequence identification is a sub-packet number.
The device can execute the method provided by the first embodiment or the second embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a multimedia data transmission apparatus according to a sixth embodiment of the present invention, applied to a multimedia data playing end, as shown in fig. 6, the apparatus includes:
a data packet receiving module 601, configured to receive a data packet sent by a multimedia data acquisition end, where a packet header of the data packet includes a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
a packet data storage module 602, configured to store packet data in the data packet according to the main packet number and the sub-packet number;
the inclusion data sending module 603 is configured to, when the specified number of inclusion data with the same main packet number is stored, send the inclusion data with the same main packet number to the playing area according to the sequence of the sub-packet numbers, so as to play the inclusion data with the same main packet number according to the sequence of the sub-packet numbers of the data packets.
In some embodiments of the invention, the enclosure data storage module 602 comprises:
the analysis submodule is used for analyzing each received data packet to obtain a main packet number and a sub-packet number in the packet header;
the first judgment submodule is used for judging whether the plurality of cache areas store packet data of which the main packet numbers are the same as those of the received data packets;
the first storage submodule is used for storing the received packet body data into a cache region where the stored packet body data with the same main packet number is located when the fact that the packet body data with the same main packet number as the received data packet is stored in the plurality of cache regions is determined;
and the second storage submodule is used for storing the packet body data of the received data packet into an idle cache region when determining that no packet body data with the same main packet number as that of the received data packet is stored in the plurality of cache regions.
In some embodiments of the invention, the first storage submodule comprises:
the first storage unit is used for storing the packet body data of the data packet into a sub-area corresponding to the sub-packet number in the cache area;
and the accumulation unit is used for accumulating the quantity of the stored packet body data of the cache region by 1.
In some embodiments of the invention, the second storage submodule comprises:
the state information acquisition unit is used for acquiring the state information of the plurality of cache areas;
the judging unit is used for judging whether a cache region with state information in an idle state exists in the plurality of cache regions;
the second storage unit is used for storing the packet body data of the data packet into an idle cache region when determining that the cache region with the state information in the idle state exists in the plurality of cache regions;
the emptying unit is used for emptying the cache region for storing the packet body data with the minimum main packet number and updating the state information of the emptied cache region into an idle state when the cache region with the state information of the idle state does not exist in the plurality of cache regions;
and the third storage unit is used for storing the packet body data of the data packet into the emptied cache region, updating the main packet number of the packet body data stored in the cache region and updating the state information of the cache region into an occupied state.
In some embodiments of the present invention, the buffer area is provided with the number of the stored packet data and a main packet number of the stored packet data, and the packet data sending module 603 includes:
the second judgment submodule is used for judging whether the quantity of the stored bag body data in the cache region with the minimum main bag number is equal to a specified numerical value or not;
the sending submodule is used for sending the packet body data in the cache region with the minimum main packet number to the playing region according to the sequence of the sub-regions in the cache region with the minimum main packet number when the number of the stored packet body data in the cache region with the minimum main packet number is determined to be equal to a specified numerical value;
the time length counting submodule is used for counting the total time length of the stored bag body data of the cache region with the minimum main bag number when the stored bag body data quantity of the cache region with the minimum main bag number is determined not to be equal to a specified value;
and the emptying submodule is used for emptying the cache region with the main packet number as the minimum value when the total duration is greater than a preset threshold value.
In some embodiments of the present invention, the body data sending module 603 further includes:
and the initialization submodule is used for initializing the cache region after the data packet is sent, the state information of the emptied cache region, the quantity of the stored packet body data and the main packet number of the stored packet body data.
The device can execute the method provided by the third embodiment or the fourth embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE seven
A seventh embodiment of the present invention provides a computer device, and fig. 7 is a schematic structural diagram of a computer device provided in the seventh embodiment of the present invention, as shown in fig. 7, the computer device includes:
a processor 701, a memory 702, a communication module 703, an input device 704, and an output device 705; the number of the processors 701 in the computer device may be one or more, and one processor 701 is taken as an example in fig. 7; the processor 701, the memory 702, the communication module 703, the input device 704, and the output device 705 in the computer apparatus may be connected by a bus or other means, and fig. 7 illustrates an example of connection by a bus. The processor 701, the memory 702, the communication module 703, the input device 704, and the output device 705 described above may be integrated on a computer apparatus.
The memory 702 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as the modules corresponding to the multimedia data transmission method in the above embodiments. The processor 701 executes various functional applications and data processing of the computer device by executing software programs, instructions and modules stored in the memory 702, that is, implements the multimedia data transmission method described above.
The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the microcomputer, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 702 may further include memory located remotely from the processor 701, which may be connected to an electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The communication module 703 is configured to establish a connection with an external device (e.g., an intelligent terminal), and implement data interaction with the external device. The input device 704 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the computer apparatus.
The computer device provided by the embodiment of the invention can execute the multimedia data transmission method provided by the first, second, third and fourth embodiments of the invention, and has corresponding functions and beneficial effects.
Example eight
An eighth embodiment of the present invention provides a storage medium containing computer-executable instructions, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the storage medium implements the multimedia data transmission method according to any of the above embodiments of the present invention.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the multimedia data transmission method provided by the embodiment of the present invention.
It should be noted that, as for the apparatus, the device and the storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and in relevant places, reference may be made to the partial description of the method embodiments.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the multimedia data transmission method according to any embodiment of the present invention.
It should be noted that, in the above apparatus, each included module and unit are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, the specific names of the functional modules are only for convenience of distinguishing from each other and are not used for limiting the protection scope of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by suitable instruction execution devices. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (13)

1. A multimedia data transmission method is applied to a multimedia data acquisition end and comprises the following steps:
dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data, wherein each data segment is provided with a segment sequence identifier;
packaging each data fragment into a data packet with a specified number, wherein the packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of the data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
and sending the data packet to a multimedia data playing end, wherein the multimedia data playing end is used for decoding the data packet according to a main packet number and the sub packet number contained in a packet header of the data packet after receiving the data packet, so as to obtain the multimedia data.
2. The method for transmitting multimedia data according to claim 1, wherein the dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data comprises:
dividing the multimedia data into a plurality of data segments according to a preset playing time length and the playing time sequence of the multimedia data;
and setting a segment sequence identifier for the data segment according to the sequence of the ending playing time of the data segment.
3. The method for transmitting multimedia data according to claim 1, wherein the packing each data fragment into a specified number of data packets comprises:
dividing the data segments into a specified number of sub-data segments;
determining the sequence of the sub-data segments in the data segments as a packet sequence identifier;
and coding the sub data fragments by taking the fragment sequence identification and the packet sequence identification of the data fragments as packet heads to obtain data packets, wherein the fragment sequence identification in the packet heads is a main packet number, and the packet sequence identification is a sub packet number.
4. A multimedia data transmission method is applied to a multimedia data playing end and comprises the following steps:
receiving a data packet sent by a multimedia data acquisition end, wherein the packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
storing the packet body data in the data packet according to the main packet number and the sub-packet number;
and when the specified number of the inclusion data with the same main packet number is stored, sending the inclusion data with the same main packet number to the playing area according to the sequence of the sub-packet numbers so as to play the inclusion data with the same main packet number according to the sequence of the sub-packet numbers of the data packets.
5. The method of claim 4, wherein the storing the body data according to the main packet number and the sub-packet number comprises:
analyzing each received data packet to obtain a main packet number and a sub-packet number in a packet header;
judging whether packet body data with the same main packet number as that of the received data packet is stored in the plurality of cache areas;
if so, storing the packet body data of the received data packet into a cache region where the stored packet body data with the same main packet number are located;
and if not, storing the packet body data of the received data packet into an idle cache area.
6. The method according to claim 5, wherein the buffer area includes a specified number of sub-areas, and the storing the body data of the received data packet into the buffer area where the stored body data with the same primary packet number is located comprises:
storing the packet body data of the data packet into a sub-area corresponding to the sub-packet number in the cache area;
and accumulating the quantity of the stored packet data of the cache region by 1.
7. The method for transmitting multimedia data according to claim 5, wherein the storing the body data of the received data packet into a free buffer area comprises:
acquiring state information of a plurality of cache areas;
judging whether a cache region with state information in an idle state exists in the plurality of cache regions;
if so, storing the packet body data of the data packet into an idle cache region;
if not, emptying the cache region for storing the packet body data with the minimum main packet number, and updating the state information of the emptied cache region into an idle state;
storing the packet body data of the data packet into the emptied cache region, updating the main packet number of the packet body data stored in the cache region and updating the state information of the cache region into an occupied state.
8. The method according to any one of claims 5 to 7, wherein the buffer area is provided with the number of the stored packet body data and a main packet number of the stored packet body data, and when the specified number of packet body data of the same main packet number is stored, the method for transmitting the packet body data of the same main packet number to the playing area according to the sequence of the sub-packet numbers comprises:
judging whether the quantity of stored packet body data in a cache region with the minimum main packet number is equal to a specified numerical value or not;
if so, sending the packet body data in the cache region with the minimum main packet number to a playing region according to the sequence of the sub regions in the cache region with the minimum main packet number;
if not, counting the total time length of the packet body data stored in the cache region with the minimum main packet number;
and when the total duration is greater than a preset threshold value, clearing the cache region with the minimum main packet number.
9. The method of claim 8, wherein the transmitting the body data of the same main bundle number to the playing area in the order of the sub-bundle numbers when the specified number of body data of the same main bundle number is stored, further comprises:
initializing the buffer area after the bag body data is sent, the state information of the buffer area after the buffer area is emptied, the quantity of the stored bag body data and the main bag number of the stored bag body data.
10. A multimedia data transmission device is characterized in that the device is applied to a multimedia data acquisition end and comprises:
the data segment dividing module is used for dividing the multimedia data into a plurality of data segments according to the playing time sequence of the collected multimedia data, and each data segment is provided with a segment sequence identifier;
the data packaging module is used for packaging each data fragment into a specified number of data packets, wherein the packet header of each data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of the data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
and the data packet sending module is used for sending the data packet to a multimedia data playing end, and the multimedia data playing end is used for decoding the data packet according to a main packet number and the sub packet number contained in a packet header of the data packet after receiving the data packet to obtain the multimedia data.
11. A multimedia data transmission device, which is applied to a multimedia data playing end, comprises:
the data packet receiving module is used for receiving a data packet sent by a multimedia data acquisition end, wherein the packet head of the data packet comprises a main packet number and a sub-packet number, the main packet number is a fragment sequence identifier of a data fragment to which the data packet belongs, and the sub-packet number is a packet sequence identifier of the data packet in the data fragment;
the bag body data storage module is used for storing bag body data in the data bag according to the main bag number and the sub-bag number;
and the inclusion data sending module is used for sending the inclusion data with the same main packet number to the playing area according to the sequence of the sub-packet numbers when the specified number of the inclusion data with the same main packet number is stored, so as to play the inclusion data with the same main packet number according to the sequence of the sub-packet numbers of the data packets.
12. A computer device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the multimedia data transmission method of any of claims 1-3, or the multimedia data transmission method of any of claims 4-9.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a multimedia data transmission method according to any one of claims 1 to 3, or carries out a multimedia data transmission method according to any one of claims 4 to 9.
CN202010833893.3A 2020-08-18 2020-08-18 Multimedia data transmission method, device, equipment and storage medium Pending CN111988674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010833893.3A CN111988674A (en) 2020-08-18 2020-08-18 Multimedia data transmission method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010833893.3A CN111988674A (en) 2020-08-18 2020-08-18 Multimedia data transmission method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111988674A true CN111988674A (en) 2020-11-24

Family

ID=73435603

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010833893.3A Pending CN111988674A (en) 2020-08-18 2020-08-18 Multimedia data transmission method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111988674A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138196A (en) * 2021-11-26 2022-03-04 南方电网大数据服务有限公司 Power system data storage method and device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5926205A (en) * 1994-10-19 1999-07-20 Imedia Corporation Method and apparatus for encoding and formatting data representing a video program to provide multiple overlapping presentations of the video program
CN103546662A (en) * 2013-09-23 2014-01-29 浙江工业大学 Audio and video synchronizing method in network monitoring system
JP2016140089A (en) * 2013-04-19 2016-08-04 サムスン エレクトロニクス カンパニー リミテッド Method for receiving media data in multimedia transmission system
CN109889543A (en) * 2019-03-26 2019-06-14 广州华多网络科技有限公司 Method, root node, child node, P2P server and the system of transmission of video
US20190200029A1 (en) * 2016-09-08 2019-06-27 Koninklijke Kpn N.V. Partial Video Decoding Method, Device and System
US20190206443A1 (en) * 2005-08-10 2019-07-04 Mitsubishi Electric Corporation Recording medium, reproducing apparatus, and reproducing method
CN111263221A (en) * 2018-11-30 2020-06-09 南京超聚通信科技有限公司 Video information carousel method and device and video information receiving method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5926205A (en) * 1994-10-19 1999-07-20 Imedia Corporation Method and apparatus for encoding and formatting data representing a video program to provide multiple overlapping presentations of the video program
US20190206443A1 (en) * 2005-08-10 2019-07-04 Mitsubishi Electric Corporation Recording medium, reproducing apparatus, and reproducing method
JP2016140089A (en) * 2013-04-19 2016-08-04 サムスン エレクトロニクス カンパニー リミテッド Method for receiving media data in multimedia transmission system
CN103546662A (en) * 2013-09-23 2014-01-29 浙江工业大学 Audio and video synchronizing method in network monitoring system
US20190200029A1 (en) * 2016-09-08 2019-06-27 Koninklijke Kpn N.V. Partial Video Decoding Method, Device and System
CN111263221A (en) * 2018-11-30 2020-06-09 南京超聚通信科技有限公司 Video information carousel method and device and video information receiving method and device
CN109889543A (en) * 2019-03-26 2019-06-14 广州华多网络科技有限公司 Method, root node, child node, P2P server and the system of transmission of video

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138196A (en) * 2021-11-26 2022-03-04 南方电网大数据服务有限公司 Power system data storage method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN101188477B (en) A data packet sequence receiving method and device
US20170300595A1 (en) Data packet extraction method and apparatus
CN102427446A (en) Packet coalescing
CN101485152A (en) Method, system, and computer program product for resequencing of data segments received over a bonding channel set
CN111385221B (en) Data processing method and communication equipment
CN110087140B (en) Method, device, medium and equipment for transmitting stream media data
CN1662896B (en) Method and device for filtering data
WO2022022229A1 (en) Method and device for processing message
KR20220006606A (en) Message processing method and related device
CN110958331A (en) Data transmission method and terminal
CN112787902B (en) Message encapsulation method and device and message decapsulation method and device
CN114584560B (en) Method and device for reorganizing fragmented frames
CN111988674A (en) Multimedia data transmission method, device, equipment and storage medium
CN111193966A (en) Audio data transmission method and device, computer equipment and storage medium
CN113316028A (en) Screen projection method, screen projection equipment and storage medium
CN108460044B (en) Data processing method and device
US11057312B2 (en) Apparatus and method for configuring MMT payload header
CN112436998A (en) Data transmission method and electronic equipment
CN111404872A (en) Message processing method, device and system
US7372864B1 (en) Reassembly of data fragments in fixed size buffers
EP3480696A1 (en) Adaptive event aggregation
CN103856445B (en) The data transmission method of voice data traffic based on UDP, device and system
CN114531332A (en) Data transmission method, data processing method, device and storage medium
KR20160123562A (en) Receiver for processing data packet and data packet processing method of receiver
WO2021109744A1 (en) Data compression method and apparatus, network device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510000 Block C, 115 Gaopu Road, Tianhe District, Guangzhou City, Guangdong Province

Applicant after: Guangzhou Jifei Technology Co.,Ltd.

Address before: 510000 Block C, 115 Gaopu Road, Tianhe District, Guangzhou City, Guangdong Province

Applicant before: Guangzhou Xaircraft Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201124