Disclosure of Invention
In order to solve the defects in the prior art, the invention provides an algorithm for quickly correcting errors of a network transmission protocol.
In order to solve the technical problems, the invention provides the following technical scheme:
the invention relates to an algorithm for fast error correction of a network transmission protocol, which comprises the following steps:
s1: predicting the packet loss rate in the video transmission process based on a hidden Markov model;
s2: correcting errors of the video transmission through an algorithm based on the packet loss rate predicted in the step S1;
s3: and carrying out simulation experiments and result analysis.
As a preferred embodiment of the present invention, the hidden markov model is formed by a double stochastic process, wherein one stochastic process is a markov chain for describing state transitions, and the other stochastic process is an observation sequence composed of symbols output at each state transition, the state transitions cannot be directly observed but can be estimated only by the observation sequence of the other stochastic process, and the hidden markov model can be described by five parameters, i.e., λ ═ (X, O, a, B, and pi), where: x is a hidden state in the hidden Markov model, X ═Xi1,2,3, ·, N }; o is observed state, O ═ Oj,j=1,2,3,...M};
A represents a state transition probability matrix which is an N-order square matrix,i.e. A ═ ai,j0 < i, j < N }, wherein ai,jProbability of a transition from state i to state j; b is an NxM confusion matrix representing a state xjTime observation value OkI.e. B ═ Bj(k) J is more than 0 and less than N, k is more than 0 and less than M; pi is the initial probability distribution, pi ═ pii,i=1,2,...,N}。
As a preferred technical solution of the present invention, according to the predicted packet loss rate, different error correction methods are adopted for video data packets:
when the network packet loss rate is lower than 0.4%, the network load is low, and in this case, even if no error correction algorithm is adopted, the distortion of the video image is within an acceptable range;
if the packet loss rate is within the range of 0.4-5%, indicating that the network load is in a moderate state, the influence of the redundant data packet introduced by the FEC algorithm on the network bandwidth utilization rate is not significant, so the FEC algorithm is adopted for error correction, the algorithm is to firstly set a reverse transmission channel to support error-free transmission, that is, an Acknowledgement (ACK) or a Negative Acknowledgement (NACK) can be correctly received by a sender, and the transmission delay λ of the data packet can be expressed as λ ═ M +1 λ
r+Mλ
bWherein λ is
rAnd λ
bRespectively representing the forward and reverse transmission delays of the transmission channel, and thus
For real-time video transmission, when the transmission delay of a data packet is large, the delay of a playing end may cause obvious interference to video monitoring, remote operation and the like;
if the packet loss rate is more than 5%, error correction is carried out through a video transmission error correction algorithm (PPLECA), and the error correction steps are as follows:
a. initializing parameters U, F and matrices A and B;
b. quantifying the packet loss rate data acquired in the time period U by operating a fuzzy C-means clustering algorithm to obtain an observation sequence O and a value of an initial probability pi;
c. training a hidden Markov model by operation, calculating matrixes A and B, and calculating a packet loss rate Q in the next time period F;
d. judging whether Q is more than 0.05, if so, adopting an ARQ algorithm, and then calculating the maximum retransmission time M, if M is more than 2, then M is 2; if the result is false and Q is more than 0.004, the sender starts the FEC algorithm;
e. if the data transmission is finished, ending and returning; otherwise, counting the packet loss rate data with the subsequent time length of U, and turning to the step b.
As a preferred technical scheme of the invention, the simulation experiment is to establish a model of a video transmission system through network simulation software for verifying an algorithm PPLECA.
The invention has the beneficial effects that: the algorithm predicts the packet loss rate of data transmission by using a hidden Markov model, and then adaptively selects an FEC or ARQ algorithm according to the size of the predicted value of the packet loss rate in the next time period; the optimal RS redundancy value is analyzed, and the average packet loss rate is reduced on the premise of obtaining higher video reconstruction quality; the maximum retransmission times of the ARQ algorithm are calculated and adjusted, so that the network load is prevented from being further increased, and the average time delay of data transmission is reduced.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example (b): as shown in fig. 1, fig. 2, fig. 3 and fig. 4, the algorithm for fast error correction of network transmission protocol of the present invention includes the following steps:
s1: predicting the packet loss rate in the video transmission process based on a hidden Markov model;
s2: correcting errors of the video transmission through an algorithm based on the packet loss rate predicted in the step S1;
s3: and carrying out simulation experiments and result analysis.
The hidden markov model is described by five parameters, namely λ ═ X (X, O, a, B, and pi), wherein: x is a hidden state in the hidden Markov model, X ═Xi1,2,3, ·, N }; o is observed state, O ═ Oj,j=1,2,3,...M};
A represents a state transition probability matrix which is an N-order square matrix, namely A ═ ai,j0 < i, j < N }, wherein ai,jProbability of a transition from state i to state j; b is an NxM confusion matrix representing a state xjTime observation value okI.e. B ═ Bj(k) J is more than 0 and less than N, k is more than 0 and less than M; pi is the initial probability distribution, pi ═ pii,i=1,2,...,N}。
According to the predicted packet loss rate, different error correction methods are adopted for the video data packet:
when the network packet loss rate is lower than 0.4%, the network load is low, and in this case, even if no error correction algorithm is adopted, the distortion of the video image is within an acceptable range;
if the packet loss rate is within the range of 0.4-5%, it indicates thatThe network load is in a moderate state, and the influence of redundant data packets introduced by the FEC algorithm on the network bandwidth utilization rate is not obvious, so the FEC algorithm is adopted for error correction, the algorithm is to firstly set a reverse transmission channel to support error-free transmission, namely, a positive Acknowledgement (ACK) or a Negative Acknowledgement (NACK) can be correctly received by a sender, and the transmission delay lambda of the data packets can be expressed as lambda-1 lambda
r+Mλ
bWherein λ is
rAnd λ
bRespectively representing the forward and reverse transmission delays of the transmission channel, and thus
For real-time video transmission, when the transmission delay of a data packet is large, the delay of a playing end may cause obvious interference to video monitoring, remote operation and the like;
if the packet loss rate is more than 5%, error correction is carried out through a video transmission error correction algorithm (PPLECA), and the error correction steps are as follows:
a. initializing parameters U, F and matrices A and B;
b. quantifying the packet loss rate data acquired in the time period U by operating a fuzzy C-means clustering algorithm to obtain an observation sequence O and a value of an initial probability pi;
c. training a hidden Markov model by operation, calculating matrixes A and B, and calculating a packet loss rate Q in the next time period F;
d. judging whether Q is more than 0.05, if so, adopting an ARQ algorithm, and then calculating the maximum retransmission time M, if M is more than 2, then M is 2; if the result is false and Q is more than 0.004, the sender starts the FEC algorithm;
e. if the data transmission is finished, ending and returning; otherwise, counting the packet loss rate data with the subsequent time length of U, and turning to the step b.
The simulation experiment is to establish a model of a video transmission system through network simulation software for verifying an algorithm, PPLECA, fig. 1 is a block diagram of the video transmission system, wherein a node S1 is used as a sending end of video data, a node D1 is used as a receiving end, a node R1 and a node R2 are used as routers, and a node S1 respectively adopts the PPLECA and the HARQ error correction algorithm to send the video data to a node D1. The nodes S2, S3, S4 generate and send data to D2, D3, D4, respectively, to simulate the background data flow of the network. The link bandwidth between R1 and R2 is 10Mbps, and the link bandwidth between each node and R1 and R2 is 4Mbps respectively. In order to improve the simulation speed, the HMM, FEC/HARQ and fuzzy C-means clustering algorithm are realized by using C language in OPNET. The test video is an "akiyo" sequence of the h.264 standard, in the format qcif 4: 2: the length of the OYUV file is 300 frames, and the GOP structure is IBBPBBPBBP. The coding and decoding rate is set to 25frame/s, the parameters U and F are 10s and 25s respectively, JM18.4 is used as the coder/decoder of the video sequence, and the coded video sequence is imported to OPNET as an external data stream; setting simulation time as 1800s, operating the PPLECA and the HARQ algorithm under the same parameter setting environment, and comparing the performances of the PPLECA and the HARQ algorithm;
for the PPLECA algorithm, setting the initial probability distribution of the HMM:
pi ═ 0.4, 0.32, 0.16, 0.07, 0.05; collecting packet loss rate data in a time period U as an initial training sample set of the HMM, obtaining data as shown in fig. 2, and S1 adaptively selecting an FEC or ARQ algorithm according to the predicted packet loss rate Q; setting the maximum retransmission times of ARQ as 2, and adjusting the redundancy of RS; FIG. 2 is a comparison result of packet loss ratios of two error correction algorithms; fig. 2 shows that the packet loss rate of the PPLECA algorithm is low, which fully indicates that the bandwidth utilization rate can be effectively improved by the optimized selection of the redundancy in RS coding under the condition of limited bandwidth, fewer lost video data frames are available, a receiving end can obtain more decodable frames, and the video playing effect is smoother;
fig. 3 is a comparison of peak signal-to-noise ratios (PSNR) of the video sequences at the receiving end calculated when the PPLECA and HARQ algorithms are used, respectively, where: MSE represents mean square error, and it can be seen that, compared with the HARQ algorithm, the PSNR change of the video sequence transmitted by using the PPLECA algorithm is relatively stable, and the video playing quality is relatively high, which indicates that the PPLECA algorithm can better adapt to the dynamic change of the network packet loss rate, and has relatively strong error code resistance. Fig. 4 shows an average value of 720 sampling times, in which parameters such as PSNR, packet loss rate, and delay are sampled at intervals of duration U at the receiving end when two algorithms are respectively run. As can be seen from fig. 4, compared with the HARQ algorithm, the PPLECA algorithm increases the PSNR value of the transmitted video image by 1.6dB, reduces the average delay by about 0.24s, and reduces the average packet loss rate by 0.011, which indicates that the PPLECA algorithm effectively improves the real-time performance of video transmission and the distortion of the reconstructed video image is smaller.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.