CN109640107B - Live video data transmission method and device - Google Patents

Live video data transmission method and device Download PDF

Info

Publication number
CN109640107B
CN109640107B CN201811528378.3A CN201811528378A CN109640107B CN 109640107 B CN109640107 B CN 109640107B CN 201811528378 A CN201811528378 A CN 201811528378A CN 109640107 B CN109640107 B CN 109640107B
Authority
CN
China
Prior art keywords
preset
peer node
time
data frame
frame
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.)
Active
Application number
CN201811528378.3A
Other languages
Chinese (zh)
Other versions
CN109640107A (en
Inventor
徐文义
陈健生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201811528378.3A priority Critical patent/CN109640107B/en
Publication of CN109640107A publication Critical patent/CN109640107A/en
Application granted granted Critical
Publication of CN109640107B publication Critical patent/CN109640107B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • 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/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • 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
    • H04N21/26208Content 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 the scheduling operation being performed under constraints
    • 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/632Control 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 using a connection between clients on a wide area network, e.g. setting up a peer-to-peer communication via Internet for retrieving video segments from the hard-disk of other client devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer And Data Communications (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides a method and a device for transmitting live video data, wherein the method comprises the steps that a preset peer node determines waiting time; the preset peer node acquires the current historical delay time; when the waiting time length is greater than the sum of the historical delay time length and a preset frame transmission time length, the preset peer node generates a request for acquiring a second data frame; and the preset peer node sends the request to the server and receives a second data frame sent by the server. The device comprises a waiting time length determining module, a historical delay time length obtaining module, a request generating module and a second data frame receiving module. And determining that a preset peer node generates a request for acquiring a second data frame through the waiting time, and requesting a server to receive the second data frame, so that the preset peer node is prevented from being influenced by network fluctuation of other peer nodes, smooth transmission of data is ensured, and repeated data frame sending is reduced.

Description

Live video data transmission method and device
Technical Field
The invention relates to the field of data transmission, in particular to a live video data transmission method and device.
Background
Peer-to-peer (P2P for short), also called peer-to-peer technology, is a new communication technology different from the system modes of Client/Server, Browser/Server, and Slave/Master. The method is mainly characterized in that the method avoids the restraint of an application server, and users can directly communicate, share resources or cooperatively work. P2P technology has been applied to many areas of file sharing, distributed computing, collaborative work, search engines, gaming software, enterprise networks (intranets), and so forth.
Particularly, under the environment that a large amount of data needs to be transmitted in real time, such as live video, online games and the like, the P2P technology is adopted, users are allowed to transmit data mutually, the bandwidth cost of the server can be effectively saved, and large-flow data transmission can be realized at lower cost.
However, generally, the stability of the network environment of the user is not as good as that of the server, so that the data transmission speed between the users may not be as good as that between the users and the server, and even there may be a case of data loss, which affects the user experience. For example, in a live video environment, data delay or loss may cause a user to watch a video card or even to be unable to play the video.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a live video data transmission method and apparatus that overcome or at least partially solve the above problems.
A video live broadcast data transmission method is applied to a video live broadcast network supporting P2P transmission, wherein the video live broadcast network comprises a server and a plurality of peer nodes, the plurality of peer nodes comprise preset peer nodes and other peer nodes, and the method comprises the following steps:
the preset peer node determines a waiting time; the waiting time is the time from the time when the preset peer node receives the first data frame sent by the server to the current time;
the preset peer node acquires the current historical delay time; the historical delay duration is determined by the time when the preset peer node last receives the first data frame sent by the server and the time when the preset peer node last receives the second data frame sent by the other peer node;
when the waiting time length is greater than the sum of the historical delay time length and a preset frame transmission time length, the preset peer node generates a request for acquiring a second data frame;
and the preset peer node sends the request to the server and receives a second data frame sent by the server.
Preferably, when the waiting duration is greater than the sum of the historical delay duration and a preset frame transmission duration, the step of generating a request for acquiring a second data frame includes:
when the waiting time length is greater than the sum of a preset historical delay time length and a preset frame transmission time length, the preset peer node determines the frame sequence number of a target second data frame based on the second data frame received last time;
and the preset peer node generates a request for acquiring the target second data frame by adopting the frame sequence number of the target second data frame.
Preferably, the preset frame transmission duration is determined by the frame sequence number of the first data frame sent by the server and the frame sequence number of the second data frame sent by the other peer node.
Preferably, the method further comprises:
the preset peer node determines a receiving time difference according to the time of the last time the preset peer node receives the first data frame sent by the server and the time of the last time the preset peer node receives the second data frame sent by the other peer node;
and the preset peer node determines the current historical delay time length based on the preset frame transmission time length and the receiving time difference.
Preferably, the step of determining, by the preset peer node, a current historical delay duration based on the preset frame transmission duration and the reception time difference includes:
the preset peer node determines the current historical delay time according to the time difference; the time length difference value is a difference value between the receiving time difference and the preset frame transmission time length;
or the like, or, alternatively,
and the preset peer node determines the current historical delay time according to the weighted average value between the time difference and the prior historical delay time.
A video live broadcast data transmission device is applied to a video live broadcast network supporting P2P transmission, wherein the video live broadcast network comprises a server and a plurality of peer nodes, and the peer nodes comprise preset peer nodes and other peer nodes;
the method comprises the following steps:
a waiting duration determining module, configured to determine a waiting duration by the preset peer node; the waiting time is the time from the last time that the preset peer node receives the second data frame sent by the other peer node to the current time;
a history delay time length obtaining module, configured to obtain, by the preset peer node, a current history delay time length; the historical delay duration is determined by the time when the preset peer node receives the first data frame sent by the server last time and the time when the preset peer node receives the second data frame sent by the other peer node last time;
a request generating module, configured to, when the waiting duration is greater than a sum of the historical delay duration and a preset frame transmission duration, generate, by the preset peer node, a request for acquiring a second data frame;
and the second data frame receiving module is used for sending the request to the server by the preset peer node and receiving a second data frame sent by the server.
Preferably, the request generating module includes:
a frame sequence number determining submodule, configured to determine, by the preset peer node, a frame sequence number of a target second data frame based on the second data frame received last time when the waiting duration is greater than a sum of a preset historical delay duration and a preset frame transmission duration;
and the request generation submodule is used for generating a request for acquiring the target second data frame by the preset peer node by adopting the frame sequence number of the target second data frame.
Preferably, the preset frame transmission duration is determined by the frame sequence number of the first data frame sent by the server and the frame sequence number of the second data frame sent by the other peer node.
Preferably, the data request apparatus further includes:
a receiving time difference determining module, configured to determine, by the preset peer node, a receiving time difference according to a time when the preset peer node last receives a first data frame sent by the server and a time when the preset peer node last receives a second data frame sent by the other peer node;
a current historical delay duration determining module, configured to determine, by the preset peer node, a current historical delay duration based on the preset frame transmission duration and the reception time difference.
Preferably, the current historical delay time period determining module includes:
a first current historical delay time determining submodule, configured to determine, by the preset peer node, a current historical delay time according to the time difference; the time length difference value is a difference value between the receiving time difference and the preset frame transmission time length;
or the like, or, alternatively,
and the second current historical delay time length determining submodule is used for determining the current historical delay time length by the preset peer node according to the weighted average value between the time length difference value and the prior historical delay time length.
One or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more methods as described in embodiments of the invention.
Compared with the prior art, the invention has the following advantages: when the waiting time is longer than the sum of the historical delay time and the preset frame transmission time, the preset peer node generates a request for acquiring a second data frame, and requests a server to receive the second data frame, so that the preset peer node is prevented from being influenced by network fluctuation of other peer nodes, and smooth transmission of data is ensured. Meanwhile, the request for acquiring the second data frame is generated when the waiting time length is greater than the sum of the historical delay time length and the preset frame transmission time length, so that the situation that the time for generating the request for acquiring the second data frame is too early and the frequency of repeated sending of the same data frame is too high can be avoided.
Drawings
Fig. 1 is a flowchart illustrating steps of an embodiment of a live video data transmission method according to an embodiment of the present invention;
fig. 2 is a block diagram of a live video data transmission apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a live video data transmission method according to an embodiment of the present invention is shown, where the method is applied to a live video network supporting P2P transmission, where the live video network includes a server and a plurality of peer nodes, and the plurality of peer nodes includes a preset peer node and other peer nodes.
In the embodiment of the present invention, the server stores service data therein, and sends the service data to the plurality of peer nodes. The peer nodes are nodes (peer) of a video live broadcast network transmitted by the P2P, and each peer node receives the service data sent by the server and other peer nodes except the peer node, and simultaneously sends the service data received by the peer node to other peer nodes in the P2P network.
The live video data transmission method can comprise the following steps:
step 101, the preset peer node determines a waiting time; the waiting time is the time from the time when the preset peer node receives the first data frame sent by the server to the current time;
in this embodiment of the present invention, the preset peer node may set a timer to record the time of receiving the data frame sent by the server or the other peer node. The waiting duration, that is, the duration from the last time when the preset peer node receives the first data frame sent by the server to the current time, may also be recorded by a timer, and is used to determine the real-time use time when the preset peer node receives the second data frame.
102, the preset peer node acquires the current historical delay time; the historical delay duration is determined by the time when the preset peer node receives the first data frame sent by the server last time and the time when the preset peer node receives the second data frame sent by the other peer node last time;
in the embodiment of the present invention, since the network stability of the server is generally better, the speed of sending the first data frame is generally uniform, the network delay is lower, and the network environment stability of other peer nodes is not as good as that of the server, it can be considered that the preset peer node needs to consume more time to receive the data frame sent by the other peer nodes than to receive the data frame sent by the server. Therefore, the preset peer node can respectively determine the current historical delay time of each other peer node according to the time of the last received first data frame sent by the server and the time of the last received second data frame sent by each other peer node. The historical delay time length can be used for representing the network delay situation of one other peer node compared with the server at present.
103, when the waiting time length is greater than the sum of the historical delay time length and a preset frame transmission time length, the preset peer node generates a request for acquiring a second data frame;
in this embodiment of the present invention, the preset frame transmission duration may be a preset time interval between the other peer nodes sending the data frame and the server sending the data frame.
In the embodiment of the present invention, in order to ensure that the preset peer node can watch the video or play the network game smoothly, a transmission duration of each frame may be preset, where the transmission duration of each frame is related to a transmission Frame Per Second (FPS) of a video frame, and the transmission duration of each frame is a maximum time interval between the preset peer node receiving each frame of data Frames. For example, the number of frames transmitted per second of a video being watched by the user is 25, that is, the transmission time of each frame required for smoothly watching the video is 1/25 seconds, and when the frame transmission time between consecutive frames is not more than 1/25 seconds, the user can smoothly watch the video; when the frame transmission time between successive frames is longer than 1/25 seconds, a user may be stuck watching a video.
In the embodiment of the present invention, since the first data frame sent by the server and the second data frame sent by the other peer node both originate from the same live video service data, the frame sequence numbers of the data frames sent by the server and the peer node may be the same as the original live video service data. Therefore, the preset frame transmission duration may be determined according to each frame transmission duration and a frame sequence number difference between the frame sequence number of the first data frame sent by the server and the frame sequence numbers of the second data frames sent by the other peer nodes. For example, when the transmission time length of each frame is 1/25s, and the frame numbers of the data frames sent by the server are "1, 5, and 9 … …", the frame numbers of the data frames sent by the other peer nodes 1 are "2, 6, and 10 … …", the frame numbers of the data frames sent by the other peer nodes 2 are "3, 7, and 11 … …", the difference between the frame numbers of the other peer nodes 1 and the server is 1, the preset frame transmission time length is 1 × 1/25s, the difference between the frame numbers of the other peer nodes 2 and the server is 2, and the preset frame transmission time length is 2 × 1/25 s.
In this embodiment of the present invention, when the waiting duration is greater than the sum of the historical delay duration and the preset frame transmission duration, it indicates that the network of the other peer nodes may fluctuate, so that the second data frame may not be sent to the preset peer node at the original speed, or the second data frame is lost, and in order to avoid the problem that the preset peer node encounters video, game jam, or the like, a request for obtaining the second data frame needs to be generated at this time, and the second data frame is ready to be applied for retransmission.
In the embodiment of the present invention, the request for acquiring the second data frame is generated when the waiting duration is greater than the sum of the historical delay duration and the preset frame transmission duration, so that it can be avoided that the time for generating the request for acquiring the second data frame is too early, which results in too high frequency of repeated transmission of the same data frame.
And 104, the preset peer node sends the request to the server and receives a second data frame sent by the server.
In the embodiment of the present invention, when the preset peer node cannot receive the second data frame sent by the other peer node on time, a request for obtaining the second data frame is sent to the server, and the server is requested to send the second data frame that cannot be received on time, so as to avoid the influence of network fluctuation of the other peer node on the preset peer node.
According to the live video data transmission method provided by the embodiment of the invention, when the waiting time is longer than the sum of the historical delay time and the transmission time of the preset frame, the preset peer node generates a request for acquiring a second data frame and requests a server to receive the second data frame, so that the preset peer node is prevented from being influenced by network fluctuation of other peer nodes, and smooth transmission of data is ensured. Meanwhile, the request for acquiring the second data frame is generated when the waiting time length is greater than the sum of the historical delay time length and the preset frame transmission time length, so that the situation that the time for generating the request for acquiring the second data frame is too early and the frequency of repeated sending of the same data frame is too high can be avoided.
In another embodiment of the present invention, when the waiting duration is greater than the sum of the historical delay duration and a preset frame transmission duration, the step of generating the request for acquiring the second data frame includes:
s11, when the waiting time is longer than the sum of the preset historical delay time and the preset frame transmission time, the preset peer node determines the frame sequence number of the target second data frame based on the second data frame received last time;
in this embodiment of the present invention, the other peer nodes may sequentially send the second data frame according to the frame sequence number of the second data frame. Therefore, when the preset peer node cannot receive the second data frame sent by the other peer node, the frame sequence number of the target second data frame may be determined based on the frame sequence number of the second data frame received last time.
S12, the preset peer node generates a request for acquiring the target second data frame by using the frame number of the target second data frame.
In the embodiment of the present invention, the request for acquiring the target data frame includes a frame number of the target second data frame, which is convenient for the server to find the target second data frame according to the frame number of the target second data frame.
According to the live video data transmission method provided by the embodiment of the invention, the frame number of the target second data frame is determined based on the second data frame received last time, so that the target second data frame is applied to the server for retransmission under the condition that the target second data frame cannot be received, and smooth data transmission is ensured.
In another embodiment of the present invention, the preset frame transmission duration is determined by a frame sequence number of a first data frame sent by the server and a frame sequence number of a second data frame sent by the other peer node.
In the embodiment of the invention, the server stores the service data of live video, and the service data is divided into at least one data sub-stream according to a preset frame sequence number interval; the first data frame is a data frame in a data sub-stream sent to the preset peer node by the server; the second data frame is a data frame in the data sub-stream received by the other peer node from the server.
In this embodiment of the present invention, the frame sequence numbers of the second data frame and the first data frame may be the same as the frame sequence number of the data substream. For example, the frame numbers of the data frames in the service data are 1 to n. When the preset frame number interval is k, the frame number of the data frame in the data substream may be "1 + k, 1+2k, … …, 1+ n × k", "2 + k, 2+2k, … …, 2+ n × k", "3 + k, 3+2k, … …, 3+ n × k", and the like. The frame number of the first data frame may be "1 + k, 1+2k, … …, 1+ n × k", and the frame number of the second data frame may be "2 + k, 2+2k, … …, 2+ n × k".
In this embodiment of the present invention, the preset frame sequence number interval and the number of data sub-streams may be set according to the number of peer nodes in the P2P network, or may be set according to the overall situation of the P2P network, which is not limited in this invention.
As an example of the present invention, when there are 4 peer nodes in the P2P network, and the peer nodes include 3 other peer nodes and 1 preset peer node, the frame sequence number may be set to 4 according to the number of peer nodes in the P2P network, at this time, the frame sequence number in the data sub-flow sent by the server to the preset peer node may be "1, 5, 9, 13 … …", the frame sequence number in the data sub-flow sent by the server to the other peer node 1 may be "2, 6, 10, 14 … …", the frame sequence number of the data sub-flow sent by the server to the other peer node 2 may be "3, 7, 11, 15 … …", and the frame sequence number of the data sub-flow sent by the server to the other peer node 3 may be "4, 8, 12, 16 … …".
In the embodiment of the present invention, the preset frame transmission duration may be determined according to a preset transmission duration of each frame and a frame number difference between a frame number of the first data frame and a frame number of the second data frame.
In the embodiment of the present invention, the service data may be divided into at least one data substream according to a preset frame number interval, so that a frame number difference between every two data substreams is fixed. So that a difference between the frame number of the first data frame and the frame number of the second data frame can be determined. For example, when the preset frame number interval is k, the frame numbers of the first data frames sent by the server are "1 + k, 1+2k, … …, and 1+ n × k", the frame numbers of the second data frames sent by other peer nodes are "2 + k, 2+2k, … …, and 2+ n × k", and the frame number difference is 1. For another example, when the preset frame number interval is k, the frame numbers of the first data frames sent by the server are "1 + k, 1+2k, … …, and 1+ n × k", the frame numbers of the second data frames sent by the other peer nodes are "3 + k, 3+2k, … …, and 3+ n × k", and then the frame number difference is 2.
In the embodiment of the invention, in order to ensure that the live video can be normally played, the transmission interval between every two continuous data frames should not be greater than the transmission duration of each frame. Because the network stability of the server is good, and the speed of sending data frames is generally uniform, the preset peer node can predict the latest arrival time of second data frames sent by other peer nodes without delay based on the first data frame sent by the server, so that the preset frame transmission time can be determined according to the preset transmission time of each frame and the frame number difference between the frame number of the first data frame and the frame number of the second data frame.
In the embodiment of the present invention, the transmission duration of each frame may be 1/25s, 1/50s, 1/60s, and the like, which is not limited in the present invention.
In the embodiment of the present invention, the preset frame transmission time length is equal to each frame transmission time length × a frame number difference. For example, when the frame number difference is 1 and the transmission time per frame is 1/25s, the preset frame transmission time is 1/25s, and when the frame number difference is 2 and the transmission time per frame is 1/25s, the preset frame transmission time is 2/25 s.
According to the live video data transmission method provided by the embodiment of the invention, the preset frame transmission time length is determined based on the transmission time length of each frame and the frame number difference value, so that the time for sending the request for acquiring the second data frame can be better determined, and the phenomenon that the time for generating the request for acquiring the second data frame is too early, which causes the repeated sending frequency of the same data frame to be too high can be avoided.
In another embodiment of the present invention, the method for transmitting live video data further includes:
s21, the preset peer node determines a receiving time difference according to the time when the preset peer node last received the first data frame sent by the server and the time when the preset peer node last received the second data frame sent by the other peer node;
in this embodiment of the present invention, since the network conditions of the other peer nodes and the server are different, although the server and the other peer nodes sequentially send data frames to the preset peer node based on the sequence of frame numbers, the sequence in which the preset peer node actually receives the data frames may be different from the sequence in which the other peer nodes and the server send the data frames. Generally, the second data frame is more prone to delay due to poorer network stability of the pre-set peer node. To determine the current historical delay period, the receive time difference needs to be determined.
In this embodiment of the present invention, when the time of the last time that the preset peer node receives the first data frame sent by the server is later than the time of the last time that the preset peer node receives the second data frame sent by the other peer node, that is, the speed of sending the second data frame by the other peer node is faster than the speed of sending the first data frame by the server, the receiving time difference at this time is 0.
In this embodiment of the present invention, when the time of the last reception of the second data frame sent by the other peer node by the preset peer node is later than the last reception of the first data frame sent by the server, the other peer node may have a delay, and the reception time difference is determined as a difference between the last reception of the second data frame sent by the other peer node and the last reception of the first data frame sent by the server.
S22, the preset peer node determines a current historical delay duration based on the preset frame transmission duration and the receiving time difference.
In the embodiment of the present invention, comparing the receiving time difference with the preset frame transmission time length can obtain a delay condition of the preset peer node receiving the second data frame sent by the other peer node compared with the preset peer node receiving the first data frame sent by the server.
In this embodiment of the present invention, after receiving the second data frame sent by the other peer node, the preset peer node may update the current historical delay time according to sub-steps S21 to S22. If a certain second data frame sent by the other peer node is lost, because the preset peer node does not receive the second data frame, the preset peer node does not update the current historical delay time, until the current historical delay time is updated after the second data frame sent by the other peer node is received again.
For example, the other peer node 1 sends a second data frame to the preset peer node, and the frame sequence numbers of the second data frame are "2, 6, 10, 14 … …" in sequence; the server sends a first data frame to the preset peer node, and the frame sequence number of the first data frame is as follows in sequence: "1, 5, 9, 13 … …". The preset peer node receives the first data frame with the frame sequence number 1 sent by the server, receives the second data frame with the frame sequence number 2 sent by the other peer node 1, and updates the current historical delay time according to substeps S21-S22 after receiving the second data frame with the frame sequence number 2. Then, the preset peer node receives the first data frame with the frame sequence number of 5 sent by the server, and then receives the first data frame with the frame sequence number of 9 sent by the server, at this time, because the preset peer node does not receive the second data frames sent by other peer nodes, the second data frame with the frame sequence number of 6 may have been lost, and the current historical delay time length will not be updated. However, when the waiting time is longer than the sum of the historical delay time and the preset frame transmission time, the preset peer node sends a request for acquiring a second data frame with a frame number of 6 to the server. And then the preset peer node receives the second data frame with the frame sequence number of 10, and after that, the preset peer node updates the current historical delay time again according to the substeps S21-S22.
By the live video data transmission method, the current historical delay time can be determined by comparing the transmission time of the preset frame with the receiving time difference. The request for acquiring the second data frame is convenient to be actually sent properly, and the condition that the time for generating the request for acquiring the second data frame is too early and the repeated sending frequency of the same data frame is too high can be avoided.
In another embodiment of the present invention, the step of the preset peer node determining the current historical delay time based on the preset frame transmission time and the receiving time difference includes:
the preset peer node determines the current historical delay time according to a time difference value, wherein the time difference value is the difference value between the receiving time difference and the preset frame transmission time;
in this embodiment of the present invention, the current historical delay duration may be determined as a difference between the receiving time difference and the preset frame transmission duration by the preset peer node, where the current historical delay duration at this time is a real data frame delay duration. And when the waiting time length is longer than the time used for receiving the second data frame last time, sending a request for acquiring the second data frame to the server.
Or the like, or, alternatively,
and the preset peer node determines the current historical delay time according to the weighted average value between the time difference and the prior historical delay time.
In this embodiment of the present invention, the current historical delay time may be determined as a weighted average of the difference between the receiving time difference and the transmission time of the preset frame, and the previous historical delay time, so as to avoid that the current historical delay time is affected by too fast or too slow receiving of an individual data frame, and thus the timing for sending the request for obtaining the second data frame to the server is not appropriate.
In the embodiment of the present invention, the time length difference and the weight of the previous historical delay time length in the weighted average may be the same, that is, the arithmetic average of the time length difference and the previous historical delay time length is obtained. The time length difference and the previous historical delay time length may also be different in weight in the weighted average, for example, the time length difference is 0.3 in weight, and the previous historical delay time length is 0.7 in weight. The invention is not limited thereto
According to the live video data transmission method provided by the embodiment of the invention, the preset peer node determines the current historical delay time based on the transmission time difference and the receiving time difference of the preset frame, so that the current historical delay time can be better determined, and based on the historical delay time, the request for acquiring the second data frame is properly and actually sent, so that the condition that the time for generating the request for acquiring the second data frame is too early and the frequency for repeatedly sending the same data frame is too high can be avoided.
Referring to fig. 2, a block diagram of an embodiment of a live video data transmission apparatus according to an embodiment of the present invention is shown, where the apparatus is applied in a P2P network, and the P2P network includes a server, other peer nodes, and a preset peer node;
the live video data transmission device comprises:
a waiting duration determining module 201, configured to determine a waiting duration by the preset peer node; the waiting time is the time from the last time that the preset peer node receives the second data frame sent by the other peer node to the current time;
a history delay duration obtaining module 202, configured to obtain, by the preset peer node, a current history delay duration; the historical delay duration is determined by the time when the preset peer node receives the first data frame sent by the server last time and the time when the preset peer node receives the second data frame sent by the other peer node last time;
a request generating module 203, configured to, when the waiting duration is greater than a sum of the historical delay duration and a preset frame transmission duration, generate, by the preset peer node, a request for acquiring a second data frame;
a second data frame receiving module 204, configured to send the request to the server by the preset peer node, and receive a second data frame sent by the server.
In another embodiment of the present invention, the request generation module includes:
a frame sequence number determining submodule, configured to determine, by the preset peer node, a frame sequence number of a target second data frame based on the second data frame received last time when the waiting duration is greater than a sum of a preset historical delay duration and a preset frame transmission duration;
and the request generation submodule is used for generating a request for acquiring the target data frame by the preset peer node by adopting the frame sequence number of the target second data frame.
In another embodiment of the present invention, the preset frame transmission duration is determined by a frame sequence number of a first data frame sent by the server and a frame sequence number of a second data frame sent by the other peer node.
In another embodiment of the present invention, the data request apparatus further includes:
a receiving time difference determining module, configured to determine, by the preset peer node, a receiving time difference according to a time when the preset peer node last receives a first data frame sent by the server and a time when the preset peer node last receives a second data frame sent by the other peer node;
a current historical delay time determining module, configured to determine, by the preset peer node, a current historical delay time based on the preset frame transmission time and the reception time difference.
In another embodiment of the present invention, the current historical delay time determination module includes:
a first current historical delay time determining submodule, configured to determine, by the preset peer node, a current historical delay time according to the time difference; the time length difference value is a difference value between the receiving time difference and the preset frame transmission time length;
or the like, or, alternatively,
and the second current historical delay time length determining submodule is used for determining the current historical delay time length by the preset peer node according to the weighted average value between the time length difference value and the prior historical delay time length.
Embodiments of the invention also provide one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more methods as described in embodiments of the invention.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The method and the device for transmitting live video data provided by the invention are described in detail, and a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (11)

1. A live video data transmission method is applied to a live video network supporting P2P transmission, the live video network comprises a server and a plurality of peer nodes, the plurality of peer nodes comprise preset peer nodes and other peer nodes, and the method comprises the following steps:
the preset peer node determines a waiting time; the waiting time is the time from the time when the preset peer node receives the first data frame sent by the server to the current time;
the preset peer node acquires the current historical delay time; the historical delay duration is determined by the time when the preset peer node receives the first data frame sent by the server last time and the time when the preset peer node receives the second data frame sent by the other peer node last time;
when the waiting time length is greater than the sum of the historical delay time length and a preset frame transmission time length, the preset peer node generates a request for acquiring a second data frame; the preset frame transmission duration is a preset time interval between the other peer nodes sending the data frame and the server sending the data frame;
and the preset peer node sends the request to the server and receives a second data frame sent by the server.
2. The method of claim 1, wherein generating the request to acquire the second data frame when the wait duration is greater than the sum of the historical delay duration and a preset frame transmission duration comprises:
when the waiting time length is greater than the sum of a preset historical delay time length and a preset frame transmission time length, the preset peer node determines the frame sequence number of a target second data frame based on the second data frame received last time;
and the preset peer node generates a request for acquiring the target second data frame by adopting the frame sequence number of the target second data frame.
3. The method of claim 1, wherein the predetermined frame transmission duration is determined by a frame sequence number of a first data frame sent by the server and a frame sequence number of a second data frame sent by the other peer node.
4. The method of claim 1 or 3, further comprising:
the preset peer node determines a receiving time difference according to the time of the last time the preset peer node receives the first data frame sent by the server and the time of the last time the preset peer node receives the second data frame sent by the other peer node;
and the preset peer node determines the current historical delay time length based on the preset frame transmission time length and the receiving time difference.
5. The method of claim 4, wherein the step of the preset peer node determining a current historical delay duration based on the preset frame transmission duration and the reception time difference comprises:
the preset peer node determines the current historical delay time according to the time difference; the time length difference value is a difference value between the receiving time difference and the preset frame transmission time length;
or the like, or, alternatively,
and the preset peer node determines the current historical delay time according to the weighted average value between the time difference and the previous historical delay time.
6. A video live broadcast data transmission device is applied to a video live broadcast network supporting P2P transmission, and the video live broadcast network comprises a server and a plurality of peer nodes, wherein the peer nodes comprise preset peer nodes and other peer nodes;
the live video data transmission device comprises:
a waiting duration determining module, configured to determine a waiting duration by the preset peer node; the waiting time is the time from the last time that the preset peer node receives the second data frame sent by the other peer node to the current time;
a history delay time length obtaining module, configured to obtain, by the preset peer node, a current history delay time length; the historical delay duration is determined by the time when the preset peer node receives the first data frame sent by the server last time and the time when the preset peer node receives the second data frame sent by the other peer node last time;
a request generating module, configured to, when the waiting duration is greater than a sum of the historical delay duration and a preset frame transmission duration, generate, by the preset peer node, a request for acquiring a second data frame; the preset frame transmission duration is a preset time interval between the other peer nodes sending the data frame and the server sending the data frame;
and the second data frame receiving module is used for sending the request to the server by the preset peer node and receiving a second data frame sent by the server.
7. The apparatus of claim 6, wherein the request generation module comprises:
a frame sequence number determining submodule, configured to determine, by the preset peer node, a frame sequence number of a target second data frame based on the second data frame received last time when the waiting duration is greater than a sum of a preset historical delay duration and a preset frame transmission duration;
and the request generation submodule is used for generating a request for acquiring the target second data frame by the preset peer node by adopting the frame sequence number of the target second data frame.
8. The apparatus of claim 6 wherein the predetermined frame transmission duration is determined by the frame sequence number of the first data frame sent by the server and the frame sequence number of the second data frame sent by the other peer node.
9. The apparatus of claim 6 or 8, wherein the data requesting means further comprises:
a receiving time difference determining module, configured to determine, by the preset peer node, a receiving time difference according to a time when the preset peer node last receives a first data frame sent by the server and a time when the preset peer node last receives a second data frame sent by the other peer node;
a current historical delay duration determining module, configured to determine, by the preset peer node, a current historical delay duration based on the preset frame transmission duration and the reception time difference.
10. The apparatus of claim 9, wherein the current historical delay period determination module comprises:
a first current historical delay time determining submodule, configured to determine, by the preset peer node, a current historical delay time according to the time difference; the time length difference value is a difference value between the receiving time difference and the preset frame transmission time length;
or the like, or, alternatively,
and the second current historical delay time length determining submodule is used for determining the current historical delay time length by the preset peer node according to the weighted average value between the time length difference value and the prior historical delay time length.
11. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-5.
CN201811528378.3A 2018-12-13 2018-12-13 Live video data transmission method and device Active CN109640107B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811528378.3A CN109640107B (en) 2018-12-13 2018-12-13 Live video data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811528378.3A CN109640107B (en) 2018-12-13 2018-12-13 Live video data transmission method and device

Publications (2)

Publication Number Publication Date
CN109640107A CN109640107A (en) 2019-04-16
CN109640107B true CN109640107B (en) 2021-07-27

Family

ID=66073859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811528378.3A Active CN109640107B (en) 2018-12-13 2018-12-13 Live video data transmission method and device

Country Status (1)

Country Link
CN (1) CN109640107B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132390A (en) * 2006-08-21 2008-02-27 宁波成功多媒体通信有限公司 Stream media system based on P2P technology
CN102387164B (en) * 2010-08-30 2014-05-14 上海悠络客电子科技有限公司 Method for transmitting peer-to-peer (p2p) network data
US20130007186A1 (en) * 2011-06-30 2013-01-03 Interdigital Patent Holdings, Inc. Controlling content caching and retrieval
CN103384259B (en) * 2012-05-04 2017-10-10 上海聚力传媒技术有限公司 A kind of method, device, equipment and the system of the transmission speed for adjusting peer node
CN102904830A (en) * 2012-11-06 2013-01-30 北京交通大学 Method for realizing flow optimization on peer-to-peer (P2P) network software
CN103024076B (en) * 2012-12-31 2016-03-23 乐视网信息技术(北京)股份有限公司 A kind of live dispatching patcher and method being applied to peer-to-peer network
CN103957269B (en) * 2014-05-08 2017-09-29 中国联合网络通信集团有限公司 The system of selection of P2P network nodes and point-to-point redirection P2P Redirector servers
CN104967685B (en) * 2015-06-25 2018-12-14 广东德诚科教有限公司 Streaming Media multi-level buffer network accelerating method based on Flash P2P

Also Published As

Publication number Publication date
CN109640107A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
KR102262982B1 (en) Method, apparatus and system for slicing live streaming
US8578042B2 (en) Method, system and device for playing streaming media
CN109889543B (en) Video transmission method, root node, child node, P2P server and system
TWI586158B (en) Manager for dash media streaming
US8069251B2 (en) System and/or method for client-driven server load distribution
US9313015B2 (en) HTTP-based synchronization method and apparatus
Cherif et al. DASH fast start using HTTP/2
EP2493191B1 (en) Method, device and system for realizing hierarchically requesting content in http streaming system
US7934011B2 (en) System and method for flow control in web-based video editing system
CN112738548B (en) Streaming media scheduling method, device, equipment and storage medium
EP3734927A1 (en) Content service implementation method and device, and content delivery network node
CN111625743A (en) Resource loading method and device and electronic equipment
CN107920108A (en) A kind of method for pushing of media resource, client and server
CN111131843A (en) Network live broadcast system and method
CN104581340A (en) Client-side, streaming media data receiving method and streaming media data transmission system
CN109640107B (en) Live video data transmission method and device
JP2019092133A (en) Transmission apparatus, reception apparatus, communication system, and program
CN110213330B (en) Pre-push system, method, device, electronic equipment and computer readable medium
CN116308671A (en) Online bidding method based on MQTT protocol, electronic equipment and storage medium
EP3681122B1 (en) System, method and devices for low latency transmission
CN110251943B (en) Game player matching method, device, equipment and storage medium
JP6378631B2 (en) Video distribution system and video distribution method
JP2008085826A (en) Information transmitting apparatus, communication terminal device, information transmission program and information communication program
JP6195757B2 (en) Content distribution server and content distribution program
JP2014522594A (en) Method and apparatus for streaming multimedia content

Legal Events

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