Method for file transmission based on link quality prediction and network coding
By combining link quality prediction and network coding, the optimal path is selected and the coding coefficients are updated adaptively, which solves the problem of file transmission efficiency in high-latency or high-packet-loss network environments and achieves more efficient data communication and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2026-03-31
AI Technical Summary
Existing file transfer protocols cannot achieve efficient file transfer in network environments with high latency or high packet loss rates, and the performance of network coding needs to be improved.
By collecting a dataset of link quality parameters, a link quality prediction model is trained. The optimal path is selected by combining network coding coefficients and a greedy strategy. Gaussian elimination is used to decode the data, and lost data is retransmitted through a negative feedback mechanism. The network coding coefficients are then adaptively updated to adapt to the current network link status.
It improves the reliability and throughput of data communication between nodes, increases the efficiency of file transfer, reduces the number of data interactions, and enhances the parallelism and coding efficiency of the system.
Smart Images

Figure CN116455894B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to file transfer methods, and more particularly to a file transfer method based on link quality prediction and network coding. Background Technology
[0002] With the continuous development of communication technology, human life has undergone tremendous changes. Take mobile phones, a common communication device, for example. From the early bulky brick phones that only supported voice calls to today's smartphones capable of streaming videos and playing games, everything is inseparable from the rapid improvement in communication speed and quality. With the arrival of the 5G era, the concept of the Internet of Things has deeply penetrated people's daily lives. However, in certain scenarios, such as wireless sensor networks and long-distance satellite communication networks, the problem of unstable link quality still exists, and existing file transfer protocols cannot achieve efficient file transfer in such high-latency or high-packet-loss network environments. Network coding technology, link quality prediction, and optimal routing selection, among other key technologies, provide us with excellent design ideas for solving this problem.
[0003] Network coding is a relatively mature technology in the field of wireless communication. In recent decades of research, network coding techniques have been widely applied to unicast and multicast networks. Studies have shown that redundancy coding in network coding can significantly improve the reliability of data transmission in narrowband environments, thereby enabling efficient end-to-end file transfer. However, the performance of network coding still needs improvement. Summary of the Invention
[0004] Purpose of the invention: This invention addresses the problems existing in the prior art by providing a higher-performance file transfer method based on link quality prediction and network coding.
[0005] Technical solution: The file transfer method based on link quality prediction and network coding described in this invention includes the following steps:
[0006] (1) Collect link quality parameter datasets under different environments, train the link quality prediction model, and deploy the trained link quality prediction model to each node in the network.
[0007] (2) When the target node receives a file transfer request, it uses a greedy strategy based on link state analysis to select the optimal path from the complex network and initializes the network coding coefficients.
[0008] (3) The source node splits the large file into multiple sub-files;
[0009] (4) The source node performs network encoding on the sub-file using network encoding coefficients and transmits it to the next hop node in the optimal path;
[0010] (5) When the intermediate node receives the data, it performs network coding on the received data again using network coding coefficients and transmits it to the next hop node in the optimal path;
[0011] (6) When the target node receives a preset amount of data within a preset time period, it uses Gaussian elimination to decode the data; after receiving a sub-file, it uses the trained link quality prediction model to predict the link quality in real time under the current environment, and uses the network coding coefficient calculation algorithm to calculate the network coding coefficient of the previous hop node based on the predicted link quality parameters, and returns the network coding coefficient to the previous hop node.
[0012] (7) After receiving the network coding coefficients, the intermediate node uses the trained link quality prediction model to make real-time predictions of the link quality in the current environment, and calculates the network coding coefficients of the previous hop node based on the predicted link quality parameters using the network coding coefficient calculation algorithm, and returns the network coding coefficients to the previous hop node.
[0013] (8) Return to iteration steps (4) to (7) until the entire file transfer is complete.
[0014] Furthermore, when the target node does not receive a preset amount of data within a preset time period and the sub-file has not been fully received, the lost data is determined based on the received data, and the source node is requested to retransmit the lost data through a negative feedback mechanism.
[0015] Furthermore, the link quality parameter dataset in step (1) includes transmission delay and packet loss rate values of links under different environments. The link quality prediction model is specifically an encoder-decoder model based on a Bi-LSTM+attention mechanism network structure, which is used to predict the future packet loss rate by using past transmission delay and packet loss rate as samples.
[0016] Furthermore, if the source node or intermediate node is sending data for the first time, network coding is performed according to the initial network coding coefficients. Specifically, the initial network coding coefficients are calculated using a network coding coefficient calculation algorithm based on the link environment generated by the routing algorithm.
[0017] Furthermore, after collecting link quality parameter datasets under different environments, the datasets are preprocessed, including:
[0018] Calculate the average of transmission delay and packet loss rate;
[0019] The thresholds for transmission delay and packet loss rate are calculated based on the average values of transmission delay and packet loss rate using the following formulas:
[0020]
[0021]
[0022] In the formula, σ τ σ d These represent the threshold values for transmission delay and packet loss rate, respectively. These represent the average values of transmission delay and packet loss rate, respectively. Let represent the values of the i-th transmission delay and packet loss rate, respectively, and N represent the number of datasets;
[0023] Based on the thresholds for transmission delay and packet loss rate, the following formula is used to perform coarse filtering on packet loss rate and transmission delay:
[0024]
[0025]
[0026] In the formula, x′ i y′ i These represent the filtered values of the i-th transmission delay and packet loss rate, respectively.
[0027] The data after filtering out gross errors is normalized using the following formula:
[0028]
[0029]
[0030] In the formula, x i y i These represent the values of the i-th transmission delay and packet loss rate after preprocessing, respectively.
[0031] Furthermore, the greedy strategy based on link state analysis described in step (2) specifically includes:
[0032] The source node broadcasts Z link request packets with different numbers containing file initial information to the network, where Z is a positive integer greater than 1;
[0033] The target node and intermediate nodes receive link request packets. For link request packets with the same number, only the first arriving link request packet is received. Virtual path information is recorded as a virtual path, which includes the IP address of the previous hop node, the number of arriving link request packets, the virtual path length, and the virtual path transmission delay. The virtual path length and virtual path transmission delay are the average path length and average transmission delay of all actual paths included in the virtual path.
[0034] After the broadcast ends, the target node will reorder the number of link request packets arriving at all virtual paths according to the corresponding average transmission delay in ascending order, and calculate the packet loss rate of each virtual path based on the sorted arrival sequence A′:
[0035]
[0036] In the formula, A′ i R represents the i-th element in the sequence of arrivals. i Represents A′ i The packet loss rate of the corresponding virtual path;
[0037] The target node calculates the path index value based on the packet loss rate, virtual path length, and transmission delay of each virtual path according to the following formula, and selects the virtual path with the smallest path index value as the locally optimal virtual path:
[0038]
[0039] In the formula, sc i R represents i The path metric value corresponding to the virtual path, T avg,i For transmission delay, B i ω is the virtual path length, and ω is the weight.
[0040] The previous hop node of the current node in the local optimal virtual path is calculated using the same steps, and this process is repeated along the local optimal virtual path from the back to the front until the source node is calculated. All local optimal virtual paths are combined to obtain a true optimal path.
[0041] Furthermore, step (3) specifically includes:
[0042] The source node divides the sub-file into several groups;
[0043] For each group, an N0-row, K-column local random coding matrix M0 is generated based on the network coding coefficients sent by the next-hop node, where N0 is the network coding coefficients sent by the next-hop node and K is a positive integer;
[0044] For each group, divide the group into K fragments f. j This forms a file matrix F = [f1 f2 … f K ] T The corresponding local random coding matrix M0 is multiplied by the file matrix F to obtain the coded data C0 = M0 × F;
[0045] The random coding matrix M0 is sent together with the coded data C0 as the transmission coding matrix M′0 to the next hop node.
[0046] Furthermore, step (4) specifically includes:
[0047] When the intermediate node receives the encoded data C sent by the previous hop node k-1 Then, an N is generated based on the network coding coefficients sent by the next-hop node. k Local random coding matrix M with rows K columns k N k The network coding coefficients sent by the next hop node, where k represents the sequence number of the intermediate node in the path;
[0048] The local random coding matrix M k With the received encoded data C k-1 Multiply to obtain the encoded data C k =M k ×C k-1 ;
[0049] The local random coding matrix M k The transmission random coding matrix M′ sent by the previous hop node k-1 Multiplying them together yields the transmission random coding matrix M′ of the current node. k =M k ×M′ k-1 ;
[0050] Encode data C k and the transmission random coding matrix M′ k Send them together to the next hop node.
[0051] Furthermore, the data decoding using Gaussian elimination in step (5) specifically includes:
[0052] Decode according to the following formula:
[0053] F = M' L-1 - 1 ×C L-1
[0054] In the formula, F represents the grouped data of the subfile, L represents the selected optimal path length, and C L-1 M′ represents the encoded data received by the target node. L-1 This represents the transmission random coding matrix received by the target node.
[0055] Furthermore, the network coding coefficient calculation algorithm described in step (5) specifically includes:
[0056] Construct the following objective function and solve for the network coding coefficients N. k :
[0057]
[0058] In the formula, Rk Let K be the predicted packet loss rate for the current node, where K is a positive integer and θ is the success rate threshold.
[0059] Beneficial effects: Compared with the prior art, the significant advantages of this invention are: before file transfer, this invention selects a better-performing file transfer path from a complex and unknown network through a routing algorithm based on link state analysis, achieving more efficient file transfer. Furthermore, it uses a link quality prediction model to predict future link quality and adaptively updates network coding coefficients based on link quality, thereby making network coding more suitable for the current network link state, improving the reliability and throughput of data communication between nodes, and increasing transmission efficiency. Attached Figure Description
[0060] Figure 1 This is a flowchart illustrating the file transfer method based on link quality prediction and network coding provided by the present invention.
[0061] Figure 2 This is a diagram of the encoder-decoder framework structure;
[0062] Figure 3 This is a diagram of the attention mechanism structure;
[0063] Figure 4 This is a schematic diagram of the data packet structure;
[0064] Figure 5 This is an example diagram of a network model structure;
[0065] Figure 6 This is a flowchart of the source node;
[0066] Figure 7 A flowchart illustrating the process at intermediate nodes;
[0067] Figure 8 This is a flowchart illustrating the target node. Detailed Implementation
[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0069] This embodiment provides a file transfer method based on link quality prediction and network coding, such as Figure 1 As shown, the specific steps include the following:
[0070] Step 1: Collect link quality parameter datasets under different environments, train the link quality prediction model, and deploy the trained link quality prediction model to each node in the network.
[0071] Specifically, the link quality parameter dataset under different environments comprises transmission delay and packet loss rate values for links under several different environments. After collecting the transmission delay and packet loss rate values, preprocessing is performed, including:
[0072] (1.1.1) Calculate the average values of transmission delay and packet loss rate;
[0073] (1.1.2) Based on the average values of transmission delay and packet loss rate, the thresholds for transmission delay and packet loss rate are calculated using the following formulas:
[0074]
[0075]
[0076] In the formula, σ τ σ d These represent the threshold values for transmission delay and packet loss rate, respectively. These represent the average values of transmission delay and packet loss rate, respectively. Let represent the values of the i-th transmission delay and packet loss rate, respectively, and N represent the number of datasets;
[0077] (1.1.3) Based on the thresholds for transmission delay and packet loss rate, the following formula is used to perform coarse filtering on packet loss rate and transmission delay:
[0078]
[0079]
[0080] In the formula, x′ i y′ i These represent the filtered values of the i-th transmission delay and packet loss rate, respectively.
[0081] (1.1.4) Normalize the data after filtering out gross errors using the following formula:
[0082]
[0083]
[0084] In the formula, x i y i These represent the values of the i-th transmission delay and packet loss rate after preprocessing, respectively.
[0085] Specifically, the link quality prediction model is an encoder-decoder model based on a Bi-LSTM + attention mechanism network structure. It uses past transmission delays and packet loss rates as samples to predict future packet loss rates. The encoder and decoder use a Bi-LSTM structure, which adds the learning of inverted historical trajectories to the original LSTM learning mechanism, thereby mitigating the long-term dependency problem caused by the loss of historical data in LSTM. The encoder-decoder network structure diagram is shown below. Figure 2 As shown. An encoder is an encoder that processes the input sequence X(x1 x2 x3 … x…). t The encoding process is performed to obtain an intermediate semantic vector c. The calculation process of c is represented by the encoder's running function f(x), as follows:
[0086] c = f(x1,x2,x3,…,x) t )
[0087] During the decoding process, the decoder can take the output y from the previous time step. t′-1 The context variable c is used as input, combined with the hidden state S from the previous time step. t′-1 Get the hidden state S at the current time step t′ As shown in the following formula:
[0088] S t′ =g(y t′-1 ,c,S t′-1 )
[0089] At this point, the hidden state S at the current time step can be utilized. t′ The output y of the previous time step t′-1 The decoder output probability p at the current time step is obtained by combining the context vector c, as shown in the following equation:
[0090] p(y t′ |c,y1,y1,…,y t′-1 )=p(y t′-1 ,S t′ c)
[0091] Given the output sequence Y(y1 y2 y3 … y) in the training samples t′ After that, the conditional probability expression of the output sequence is calculated using the semantic vector c as follows:
[0092]
[0093] The purpose of the encoder-decoder model is to find the output value with the maximum probability given a known input sequence. Each output value is a local optimum of the entire output sequence, and the final output sequence reaches the maximum joint probability, thus finding a globally optimal sequence.
[0094] The attention mechanism module is designed to address the problems of lossy compression and information loss. It assigns different weights to each element of the encoder's input sequence, calculates an intermediate semantic vector containing the input sequence, and inputs this vector into the decoder, thereby improving the decoder's prediction accuracy. The attention mechanism module structure diagram is shown below. Figure 3 As shown, in the attention mechanism module, the intermediate semantic vector c of the decoder at each time step t′ It is the weighted average of the hidden states of the encoder at various time points, as shown in the following formula:
[0095]
[0096] Where t is the length of the input sequence, h j It is the hidden state of the encoder at step j, a t′j It is the weight of each hidden state. t′j The calculation can be expressed as the following formula:
[0097]
[0098] Among them, e t′j This mainly reflects the hidden state S in the previous moment. t′ -1 and h j The correlation between them. This method uses a multilayer perceptron function, e. t′j A higher value indicates a higher similarity, and thus a greater impact on the prediction results. Specifically, e... t′j The calculation formula is as follows:
[0099] e t′j =score(S t′ -1,h j ) = v T tanh(WS t′ -1+Uh j )
[0100] Here, v, W, and U are model parameters in the network, which can be trained together with the entire model. After the link quality prediction model is trained, it is deployed to each node in the network for use during file transfer.
[0101] Furthermore, this method transmits data packets based on a protocol. The data packets used in this method will be described in detail below. This embodiment divides the data packet format into five parts based on protocol design, such as... Figure 4 As shown, details are as follows:
[0102] UDP packet header: This part of the data is automatically encapsulated by the UDP socket. It belongs to the low-level encapsulation of the protocol and does not need to be implemented in this embodiment.
[0103] Custom headers: These custom headers are set up by this method to achieve effective file transfer. They mainly include the file sequence number (file_seq), file acknowledgment number (file_ack), packet sequence number (seq), packet acknowledgment number (ack), sending timestamp (s_time), packet type (TYPE), and group sequence number (group_seq). TYPE can define packets as SYN request packets, SYN_ACK request packets, DATA packets, ACK packets, NACK packets, and FIN packets. The file_seq header can determine the sequence number of the currently being sent small file (subfile). The seq header allows for quick statistics on network packet loss rate. The s_time header allows for quick statistics on transmission latency. The group_seq header determines the group to which the packet belongs, facilitating the distinction between different packet groups and their encoding / decoding by intermediate and target nodes.
[0104] Network coding coefficients: This part stores the network coding coefficients that the next-hop node adaptively calculates based on link quality. Since each small file will be split into 8 groups in this method, this part will record the coding coefficients N and K values of the 8 groups respectively.
[0105] Encoding Matrix: Since the values in the random encoding matrix in random linear network coding are randomly assigned, in order to obtain the information of the encoding matrix at the target node, the information of the encoding matrix needs to be carried in the data packet.
[0106] Data section: This section is the encoded data. At the target node, the original data file can be obtained by performing Gaussian elimination on the data section.
[0107] (2) When the target node receives a file transfer request, it adopts a greedy strategy based on link state analysis to select the optimal path from the complex network and initializes the network coding coefficients.
[0108] like Figure 5 The diagram illustrates a simple network topology, with source node S, intermediate nodes A, B, C, and D, and target node G. Based on this network diagram, a detailed analysis of the greedy algorithm is provided. The specific steps of the greedy algorithm are as follows:
[0109] (2.1) The source node broadcasts Z link request packets with different numbers that have file initial information to the network, where Z is a positive integer greater than 1.
[0110] (2.2) The target node and intermediate nodes receive link request packets. For link request packets with the same number, only the first link request packet that arrives is received. The virtual path information is recorded as a virtual path, which includes the IP address of the previous hop node, the number of arriving link request packets, the virtual path length, and the virtual path transmission delay. The virtual path length and virtual path transmission delay are the average path length and average transmission delay of all actual paths included in the virtual path.
[0111] Figure 5 It is clear from this that broadcasting request packets inevitably leads to the participation of some edge nodes. However, due to the first-to-arrive principle (for link request packets with the same number, only the first link request packet to arrive is accepted), the packets do not generate a severe broadcast storm in the network.
[0112] For virtual paths, for example Figure 5 Assuming the current node is the target node G, the paths from the source node S to the current node include path {S, A, G} (the link request data packet numbered 1 from this path to node G), path {S, D, G} (the link request data packet numbered 4 from this path to node G), path {S, B, C, G} (the link request data packet numbered 2 from this path to node G), and path {S, D, C, G} (the link request data packet numbered 3 from this path to node G). Paths {S, B, C, G} and {S, D, C, G} are considered as a virtual path {S, C, G}, and paths {S, A, G} and {S, D, G} are considered as virtual paths {S, A, G} and {S, D, G}, respectively, for a total of three virtual paths. Record the information for each virtual path separately. For example, for virtual path {S, C, G}, its virtual path information includes: the IP address of the previous hop node C, the number of link request packets that arrived (2), the virtual path length (the average path length of paths {S, B, C, G} and {S, D, C, G}) and the virtual path transmission delay (the average transmission delay of paths {S, B, C, G} and {S, D, C, G}).
[0113] (2.3) After the broadcast ends, the target node will reorder the number of link request packets arriving at all virtual paths according to the corresponding average transmission delay from smallest to largest, and calculate the packet loss rate of each virtual path based on the sorted arrival sequence A′:
[0114]
[0115] In the formula, A′ i R represents the i-th element in the sequence of arrivals. iRepresents A′ i The packet loss rate of the corresponding virtual path.
[0116] (2.4) The target node calculates the path index value according to the packet loss rate, virtual path length and transmission delay of each virtual path according to the following formula, and selects the virtual path with the smallest path index value as the local optimal virtual path:
[0117]
[0118] In the formula, sc i R represents i The path metric value corresponding to the virtual path, T avg,i For transmission delay, B i ω represents the virtual path length, and ω represents the weight.
[0119] (2.5) Calculate the previous hop node of the current node in the local optimal virtual path according to the same steps, and repeat the process along the local virtual path from back to front until the source node is calculated. Combine all the local optimal virtual paths to obtain a real optimal path.
[0120] like Figure 5 As shown, assuming that the locally optimal virtual path selected from the three virtual paths in (2.4) is the virtual path {S, C, G}, then the path between {C, G} is determined to be the optimal path. Then, taking C as the processing node and {S, C} as the virtual path, the optimal path among the paths {S, B, C} and {S, D, C} included in it is selected. Assuming that the virtual path {S, D, C} is optimal, since the virtual path {S, D, C} is unique, it is not calculated again. The actual optimal path is {S, D, C} + {C, G} = {S, D, C, G}.
[0121] The initialization of network coding coefficients is specifically achieved by calculating the network coding coefficients using a network coding coefficient calculation algorithm based on the link environment generated by the routing algorithm.
[0122] (3) The source node splits the large file into multiple sub-files.
[0123] To ensure reliable file transmission, the source node splits the large file into smaller parts. During file transmission, network encoding is used to ensure the reliable transmission of each sub-file, thereby guaranteeing the final reliable file transmission. The size of each sub-file is defined as 256 (kb).
[0124] (4) The source node performs network encoding on the sub-file using network encoding coefficients and transmits it to the next hop node in the optimal path.
[0125] like Figure 6 The diagram illustrates the entire process of encoding and sending a file at the source node.
[0126] (4.1) The source node divides the sub-file into several groups, specifically 8 groups of size 32 (kb).
[0127] (4.2) For each group, generate an N0-row, K-column local random coding matrix M0 based on the network coding coefficients sent by the next-hop node, where N0 is the network coding coefficient sent by the next-hop node.
[0128] Where K is a positive integer, and the value is uniform throughout the text, so it can be stored locally or sent by the next-hop node. In this embodiment, K = 32. If the source node or intermediate node is sending data for the first time, network coding is performed according to the initial network coding coefficients.
[0129] (4.3) For each group, divide the group into K fragments f. j Each fragment is 1 kb in length, forming a file matrix F = [f1 f2 … f K ] T Then, the corresponding local random encoding matrix M0 is multiplied by the file matrix F to obtain the encoded data C0 = M0 × F.
[0130]
[0131] (4.4) The random coding matrix M0 is sent together with the coded data C0 as the transmission coding matrix M′0 to the next hop node.
[0132] After the source node completes the encoding and transmission of all packets in the current small file, it waits for the target node's confirmation. If the target node returns a NACK packet, it indicates that some packets were lost during file transmission. In this case, the source node needs to retransmit all lost packets based on the information in the NACK packet. If the source node receives an ACK packet, it continues sending the next sub-file based on the latest network coding coefficients until the source node receives a FIN packet, indicating that the file transmission is complete.
[0133] (5) When the intermediate node receives the data, it performs network coding on the received data again using network coding coefficients and transmits it to the next hop node in the optimal path.
[0134] This step specifically includes the following steps:
[0135] (5.1) When the intermediate node receives the encoded data C sent by the previous hop node k-1 Then, an N is generated based on the network coding coefficients sent by the next-hop node. k Local random coding matrix M with rows K columns k N kThe network coding coefficients sent by the next hop node, where k represents the sequence number of the intermediate node in the path.
[0136] (5.2) The local random coding matrix M k With the received encoded data C k-1 Multiply to obtain the encoded data C k =M k ×C k-1 .
[0137] (5.3) The local random coding matrix M k The transmission random coding matrix M′ sent by the previous hop node k-1 Multiplying them together yields the transmission random coding matrix M′ of the current node. k =M k ×M′ k-1 .
[0138] (5.4) Encode the data C k and the transmission random coding matrix M′ k Send them together to the next hop node.
[0139] like Figure 7 As shown, the intermediate node needs to process the following data packets:
[0140] SYN packet: During file transfer, intermediate nodes will select routes based on the reception status of SYN packets. Therefore, when an intermediate node receives a SYN packet, it will record the virtual path information mentioned above and broadcast the SYN packet.
[0141] SYN_ACK packet: When an intermediate node receives a SYN_ACK packet, it proves that the target node has successfully received the SYN packet. At this time, the intermediate node needs to perform route selection according to the routing algorithm mentioned above and initialize the network coding coefficients of the previous hop node.
[0142] DATA data packet: When an intermediate node receives a DATA data packet, it will buffer the data packet until it receives K linearly independent data packets in the same group. Then, based on the network coding coefficients returned by the next-hop node, it will re-encode the grouped data and send the encoded data to the next-hop node.
[0143] ACK packet: When the intermediate node receives the ACK packet, it means that the target node has successfully received the current small file. At this time, the intermediate node predicts the link quality of the next 8 data based on the link quality of the first 16 data transmissions, and performs adaptive calculation of the network coding coefficient of the previous hop node in the next file transmission process based on the predicted value. The calculation method is shown in step (6).
[0144] NACK packet: Indicates that some packets were lost during file transfer and the NACK packet needs to be forwarded to the source node for retransmission;
[0145] FIN packet: Indicates that the file transfer is complete and needs to be forwarded to the source node.
[0146] (6) When the target node receives a preset amount of data within a preset time period, it uses Gaussian elimination to decode the data. After receiving a sub-file, it uses the trained link quality prediction model to predict the link quality in real time under the current environment, and uses the network coding coefficient calculation algorithm to calculate the network coding coefficient of the previous hop node based on the predicted link quality parameters, and returns the network coding coefficient to the previous hop node.
[0147] like Figure 8 As shown, the target node needs to process the following data packets:
[0148] DATA packets: After the target node receives K linearly independent DATA packets in the same group, it can extract the random coding matrix M′ from the packets. L-1 and the encoded data matrix C L-1 The original file is decoded using Gaussian elimination, with the specific formula being F = M′. L-1 -1 ×C L-1 In the formula, F represents the grouped data of the subfile, L represents the selected optimal path length, and C... L-1 M′ represents the encoded data received by the target node. L-1 This represents the transmission random coding matrix received by the target node;
[0149] SYN packet: When the target node receives a SYN packet, it proves that there is a usable transmission path from the source node to the target node. The target node selects a suitable transmission path based on the SYN reception status and initializes the network coding coefficients of the previous hop node. The specific calculation algorithm includes:
[0150] Construct the following objective function and solve for the network coding coefficients N. k :
[0151]
[0152] In the formula, R k The packet loss rate is predicted for the current node, where K is a positive integer and θ is the success rate threshold, defined as 99.9%.
[0153] (7) After receiving the network coding coefficients, the intermediate node uses the trained link quality prediction model to make real-time predictions of the link quality in the current environment, and calculates the network coding coefficients of the previous hop node based on the predicted link quality parameters using the network coding coefficient calculation algorithm, and returns the network coding coefficients to the previous hop node.
[0154] (8) Return to iteration steps (4) to (7) until the entire file transfer is complete.
[0155] The transmission process includes a timeout feature. If the target node times out during file reception before the current small file has been fully transmitted, it will count the lost packets based on the received packets within the small file and recover them through a negative feedback mechanism. Once the target node has finished receiving the current small file, it predicts the link quality of the next 8 data packets based on the link quality of the first 16 data packets. Based on the prediction, it adaptively calculates the network coding coefficients of the previous hop node for the next file transmission and returns an ACK packet. When the target node has finished receiving all files, it returns a FIN packet.
[0156] The advantages of this invention are as follows:
[0157] The advantages of this invention are as follows: Based on highly reliable redundant encoding at intermediate nodes, the encoding burden of the source node is evenly distributed across each intermediate node, reducing the encoding latency at the source node, increasing system parallelism, and improving system encoding efficiency. Furthermore, the file transfer scheme based on a negative feedback mechanism further improves the reliability of file transfer on top of network encoding. The application of network encoding significantly reduces the number of data interactions during file transfer, greatly improving file transfer efficiency.
[0158] The advantages of this invention are as follows: In the encoder-decoder-based prediction model, the 2sigma criterion is first used to filter out gross error datasets, improving the training speed and accuracy of the prediction model. Furthermore, the Bi-LSTM-based encoder-decoder prediction model can better identify the temporal relationships between link quality parameters, facilitating more accurate multi-time-step link quality prediction. With accurate link quality prediction, network resources in narrowband environments can be further utilized more efficiently, enabling more efficient file transfer.
[0159] The routing advantages of this invention are evident in the fact that in complex networks, good link quality often determines file transfer performance. While network coding-based file transfer schemes can mitigate performance degradation caused by link loss rates to some extent, the routing scheme proposed in this method fully evaluates the impact of link packet loss rate and transmission latency on file transfer performance. This allows for the selection of a relatively high-quality file transfer path in complex networks, further improving file transfer performance.
Claims
1. A method for file transfer based on link quality prediction and network coding, characterized in that, The method comprises the following steps: (1) collecting link quality parameter data sets under different environments, training a link quality prediction model, and deploying the trained link quality prediction model in each node of the network; (2) when the target node receives a file transmission request, an optimal path is selected from the complex network by using a greedy strategy based on link state analysis, and a network coding coefficient is initialized; (3) the source node splits a large file into multiple sub-files; (4) the source node performs network coding on the sub-files through the network coding coefficient and transmits to the next hop node in the optimal path; (5) when the intermediate node receives the data, the received data is again network coded through the network coding coefficient and transmitted to the next hop node in the optimal path; (6) when the target node receives a preset amount of data within a preset time period, the data is decoded by using the Gaussian elimination method; After receiving a sub-file, the trained link quality prediction model is used to predict the link quality in the current environment in real time, and the network coding coefficient of the previous hop node is calculated according to the predicted link quality parameters by using the network coding coefficient calculation algorithm, and the network coding coefficient is returned to the previous hop node; (7) after receiving the network coding coefficient, the trained link quality prediction model is used to predict the link quality in the current environment in real time, and the network coding coefficient of the previous hop node is calculated according to the predicted link quality parameters by using the network coding coefficient calculation algorithm, and the network coding coefficient is returned to the previous hop node; (8) return to steps (4) to (7) until the transmission of the entire file is completed.
2. The method of claim 1, wherein: When the target node does not receive a preset amount of data within a preset time period and the sub-file is not completed, the lost data is determined according to the received data, and the source node is requested to retransmit the lost data through a negative feedback mechanism.
3. The method of claim 1, wherein: The link quality parameter data set under different environments in step (1) includes the transmission delay and packet loss rate values of links under different environments, and the link quality prediction model is specifically an encoder-decoder model based on a Bi-LSTM+attention mechanism network structure, which is used to predict future packet loss rates by using past transmission delay and packet loss rate as samples.
4. The method of claim 1, wherein: If the source node or the intermediate node is the first data sending, network coding is performed according to the initial network coding coefficient, and the initial network coding coefficient is specifically a network coding coefficient calculated by using a network coding coefficient calculation algorithm based on a link environment generated by a routing selection algorithm.
5. The method of claim 3, wherein, After collecting the link quality parameter data set under different environments, the data set is preprocessed, and the preprocessing includes: calculating the average values of the transmission delay and the packet loss rate; calculating the threshold values of the transmission delay and the packet loss rate based on the average values of the transmission delay and the packet loss rate according to the following formula: In the formula, σ τ , σ d respectively represent threshold values of transmission delay and packet loss rate, respectively represent average values of transmission delay and packet loss rate, respectively represent values of the i th transmission delay and packet loss rate, and N represents the number of data sets. performing gross error filtering on the packet loss rate and the transmission delay according to the threshold values of the transmission delay and the packet loss rate according to the following formula: In the formula, x' and y' respectively represent the i-th transmission delay and the filtered value of the packet loss rate. i i In the formula, x' and y' respectively represent the i-th transmission delay and the filtered value of the packet loss rate. normalizing the data after gross error filtering according to the following formula: In the formula, x i , y i respectively represent the value of the ith transmission delay and the packet loss rate after preprocessing.
6. The method of link quality prediction and network coding based file transfer according to claim 1, wherein: The greedy strategy based on link state analysis in step (2) specifically includes: The source node broadcasts Z different numbered link request data packets with file initial information in the network, Z is a positive integer greater than 1; The target node and the intermediate node receive the link request data packets, for the same numbered link request data packets, only the first arrived link request data packet is received; and a virtual path information is recorded for all paths from the source node to the current node through the same previous hop node, including the IP address of the previous hop node, the number of arrived link request data packets, the length of the virtual path and the transmission delay of the virtual path; the length of the virtual path and the transmission delay of the virtual path are the average path length and the average transmission delay of all actual paths included in the virtual path; After the broadcasting is completed, the target node reorders the number of arrived link request data packets of all virtual paths according to the corresponding average transmission delay from small to large, and calculates the packet loss rate of each virtual path according to the reordered number sequence A'; In the formula, A′ i represents the i-th element in the sequence of the number of arrivals, R i represents A′ i corresponding to the virtual path packet loss rate; The target node calculates the path index value of each virtual path according to the packet loss rate, the length of the virtual path and the transmission delay of the virtual path according to the following formula, and selects the virtual path with the smallest path index value as the local optimal virtual path: In the formula, sc i R i T avg,i B i ω The previous hop node of the current node in the local optimal virtual path is calculated according to the same steps, and each node along the local virtual path from back to front is executed until the source node is calculated, all local optimal virtual paths are combined to obtain a real optimal path.
7. The method of link quality prediction and network coding based file transfer according to claim 1, wherein: Step (3) specifically comprises: The source node divides the sub-file into several groups; For each group, a local random coding matrix M0 of N0 rows and K columns is generated according to the network coding coefficient sent by the next hop node, N0 is the network coding coefficient sent by the next hop node, and K is a positive integer; For each group, the group is divided into K pieces of fragmented data f j , to form a file matrix F = [f1 f2 … f K ] T , and the corresponding local random encoding matrix M0 is multiplied with the file matrix F to obtain the encoded data C0 = M0 x F; The random coding matrix M0 is sent to the next hop node as a transmission coding matrix M'0 together with the coding data C0.
8. The method of link quality prediction and network coding based file transfer according to claim 1, wherein: Step (4) specifically comprises: When the intermediate node receives the encoded data C sent by the previous hop node k-1 Then, according to the network coding coefficient sent by the next hop node, generate an N k Row K column local random encoding matrix M k , N k is the network coding coefficient sent by the next hop node, and k represents the sequence number of the intermediate node in the path. The local random encoding matrix M k is multiplied with the received encoded data C k-1 to obtain the encoded data C k = M k × C k-1 ; The local random coding matrix M k is multiplied by the transmission random coding matrix M′ sent by the previous hop node k-1 to obtain the transmission random coding matrix M′ of the current node k = M k × M′ k-1 ; Encode data C k and the transmission random coding matrix M′ k Send them together to the next hop node.
9. The method of link quality prediction and network coding based file transfer according to claim 1, wherein: The Gaussian elimination method is used for data decoding in step (5), specifically comprising: Decoding is performed according to the following formula: F = M' L-1 -1 x C L-1 In the formula, F is the packet data of a sub-file, L represents the length of the selected optimal path, C L-1 represents the encoded data received by the target node, M' L-1 represents the transmission random encoding matrix received by the target node.
10. The method of link quality prediction and network coding based file transfer according to claim 1, wherein: The network coding coefficient calculation algorithm in step (5) specifically comprises: The following objective function is constructed, and the network coding coefficient N is solved k : where R k is the packet loss rate predicted for the current node, K is a positive integer, and Θ is a success rate threshold.