UDP data transmission quality detection method
By detecting and optimizing the quality of UDP data transmission, including initial packet grading, priority score calculation, anti-interference enhancement mechanism and real-time feedback, the UDP protocol's data loss and low bandwidth utilization in network unstable environments is solved, and more efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202510094728.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-01-21
AI Technical Summary
The existing UDP protocol is prone to data loss, low bandwidth utilization and lack of adaptive anti-interference mechanism in network instable or high-interference environments. Especially in remote device management scenarios, it is difficult to effectively support the transmission of different data priorities.
A UDP data transmission quality detection method is proposed, by receiving the original UDP data stream, performing initial packet grading and priority score calculation, dynamically adjusting the resource allocation ratio, designing an anti-interference enhancement mechanism, and real-time feedback and transmission parameter adjustment based on the network status.
It improves the reliability and adaptability of the UDP protocol in complex network environments, ensures the transmission reliability of high-priority data, optimizes bandwidth utilization, and significantly improves the transmission success rate of key data without increasing network load.
Smart Images

Figure CN119922149A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of UDP data transmission, and in particular relates to a UDP data transmission quality detection method. Background Art
[0002] With the rapid development of the Internet of Things (IoT) and industrial automation technology, the demand for remote device management and control has increased significantly. Real-time monitoring, command transmission and data collection of equipment through the network have become basic functions of modern intelligent systems. Among many communication protocols, the User Datagram Protocol (UDP) is widely used in scenarios with high real-time requirements, such as video streaming, real-time games and industrial control, due to its low latency and high efficiency. However, compared with the more reliable Transmission Control Protocol (TCP), UDP is not designed to provide functions such as packet order guarantee, packet loss retransmission or error checking, which makes it prone to the following problems in unstable network or high interference environments:
[0003] Risk of loss of critical data: Since the UDP protocol lacks confirmation and retransmission mechanisms, data packets are easily lost when the network is congested or jittery, especially in wireless networks with more interference. Once high-priority control instructions (such as device start or stop commands) in remote device management scenarios are lost, the security and stability of the system will be seriously affected.
[0004] Low bandwidth utilization: The UDP protocol usually transmits data at a fixed frequency and packet size, but in actual networks, bandwidth and transmission quality change dynamically. Traditional static transmission strategies lead to uneven resource allocation: insufficient bandwidth utilization when network conditions are good, and large-scale packet loss or even communication interruption may occur when the network is congested.
[0005] Lack of adaptable anti-interference mechanism: Existing UDP-based technologies mostly rely on hardware retries or simple data redundancy methods to improve the transmission success rate, but these methods are inefficient and cannot effectively cope with complex interference environments. In addition, some data redundancy schemes apply redundancy mechanisms to all data packets, resulting in excessive network load and further deteriorating transmission performance.
[0006] Insufficient support for different data priorities: In remote device management scenarios, the transmitted data usually includes control instructions, status updates, log information, and other contents with different priorities. However, in existing UDP-based implementations, all types of data are processed with the same priority, which may cause ordinary log data to occupy bandwidth, thereby delaying or losing high-priority instructions and reducing system reliability.
[0007] Therefore, although the existing technology can achieve efficient real-time data transmission through the UDP protocol, its reliability and transmission efficiency problems have not been effectively solved when the network stability is poor, resources are limited or tasks are diversified, and an improved transmission method is urgently needed. Summary of the invention
[0008] The purpose of the present invention is to propose a UDP data transmission quality detection method, which overcomes the shortcomings of the UDP protocol in the prior art in terms of reliability, adaptability and bandwidth utilization, and provides a low-cost, high-efficiency solution for remote device management and control scenarios. The combination of these technical points not only gives full play to the advantages of low latency and high efficiency of the UDP protocol, but also enhances its reliability and adaptability in complex network environments.
[0009] In order to achieve the above object, the present invention provides a UDP data transmission quality detection method, the method comprising:
[0010] S1, receiving an original UDP data stream, wherein the original UDP data stream includes the content and meta information of each data packet, wherein the meta information includes the timestamp, task category and data packet size of the data packet, and then initially classifying the data packets according to the task category of the meta information and calculating the arrival delay time of each data packet, dynamically calculating the priority score of each data packet by using machine learning according to the classification and arrival delay time of each data packet, attaching the priority score to each data packet, and generating a classified and marked data stream;
[0011] S2, initialize the global resource parameters according to the data flow after classification and marking, and then adjust the initial classification according to the priority score of the data flow after classification and marking, and calculate the sum of the priority scores for each type of data to dynamically adjust the resource allocation ratio of each type of data, and then adjust the global resource parameters to generate the application control strategy for each type of data, and finally output the priority data flow after dynamic control; wherein, the priority of the initial classification adjustment includes the high priority Data H , Medium priority Data M and low priority Data L ;
[0012] S3. Design an anti-interference enhancement mechanism for data streams at all levels to enhance and optimize data streams at all levels;
[0013] S4: Based on the enhanced and optimized data stream, the consistency check and reconstruction of high-priority data are performed, while the network status is monitored, and the data packets that pass the consistency check are aggregated into the final data stream;
[0014] S5, based on the final data flow statistics network indicators, adjusts the transmission parameters and feeds back to S1 to form a closed-loop optimization.
[0015] Further, the initial classification of the data packets according to the task category of the meta information and the calculation of the arrival delay time of each data packet specifically include:
[0016] The initial classification includes:
[0017] Data h Indicates high priority data, Data m Indicates medium priority data and Data l Indicates low priority data;
[0018] Calculate the arrival delay Δt for each data packet i , which is expressed as follows:
[0019] Δt i =t now -M i .time,
[0020] Among them, t now is the current time; M i .time is the timestamp of the data packet; Δt i Indicates the time interval from sending to receiving, which is used to dynamically adjust the priority. The data with the longest delay has the lowest value for real-time requirements.
[0021] Furthermore, the priority score of each data packet is dynamically calculated using machine learning according to the classification and arrival delay time of each data packet, specifically including:
[0022] Accept data stream Data raw , for Data raw ={(x i ,M i ,S i ′)|i=1,2,…,n}, where x i Indicates the content of the i-th data packet; M i is the meta information, S i ′ is the priority score calculated in the previous step, and n represents the total number of packets;
[0023] Extract key features from the data stream and construct a feature vector; wherein the key features include time features, category features, historical priority features, size features, and delay features;
[0024] The random forest and gradient boosting machine are used together to form an integrated model, and the feature vector is used as input to calculate the priority score S of each data packet. i , expressed as:
[0025] S i =w RF ·SRF,i +w GBM ·S GBM,i
[0026] Among them, S RF,i is the priority score obtained by random forest; S GBM,i is the priority score obtained by the gradient boosting machine; w RF and w GBM is the weight of the corresponding model;
[0027] Update the priority calculation method of data packets through online learning of the integrated model;
[0028] The final data stream output is the optimized data Data classified Packet priority information:
[0029] Data classified ={(x i ,M i ,S i )|i=1,2,…,n}
[0030] Among them, S i To calculate the priority score, the output of machine learning is combined.
[0031] Furthermore, the global resource parameters include the total available bandwidth B total , sliding window size W total and the initial resource allocation ratio α of high, medium, and low priority data h ,α m ,α l .
[0032] Furthermore, the global resource parameters are initialized according to the classified marked data streams, and the initial classification is adjusted according to the priority scores of the classified marked data streams. At the same time, the sum of the priority scores is calculated for each type of data to dynamically adjust the resource allocation ratio of each type of data, specifically including:
[0033] High priority data H , Medium priority Data M and low priority Data L The sum of the priority scores of the data packets is calculated respectively, which is used to dynamically adjust the resource allocation ratio of each type of data, as shown below:
[0034]
[0035] in, It is the total priority score of category P, reflecting the importance of the data in this category. H is high priority, M is medium priority, and L is low priority. Pis the set of packets belonging to priority P, P∈{H,M,L};
[0036] Combined with the initial allocation ratio α P , dynamically calculate the bandwidth allocation ratio β for each type of data P and sliding window allocation ratio γ P , which is expressed as follows:
[0037]
[0038] Among them, β P and γ P Indicates the bandwidth and sliding window ratio of category P, dynamically adjusts resource allocation between categories, and ensures that high-priority data gets more resources.
[0039] Further, the global resource parameters are adjusted to generate a control strategy for each type of data application, and finally a dynamically controlled priority data stream is output, specifically including:
[0040] Using Beta P and γ P Allocate resource limits for each type of data, including:
[0041] Bandwidth Limit B P =β P ·B total , represents the maximum transmission rate that can be used by category P;
[0042] Sliding window limit W P =γ P ·W total , represents the maximum number of packets sent simultaneously for category P;
[0043] Apply governance policies to each type of data, including:
[0044] Limit the sending rate so that the total sending rate of each type of data does not exceed B P ;
[0045] Priority Send Score S i The largest data packet to ensure resources are used for more important data;
[0046] The number of packets sent simultaneously by the sliding window is limited to W P ;
[0047] Output dynamically regulated priority data stream Data scheduled , whose format is:
[0048] Data scheduled ={(x i ,M i ,S i ,BP ,W P )|i=1,2,…,n}
[0049] Among them, M i Meta information, including timestamp, category and size; S i is the priority score; B P and W P They are the bandwidth and sliding window limits for each type of data.
[0050] Furthermore, the anti-interference enhancement mechanism specifically includes:
[0051] Initialize the parameters of the anti-interference enhancement mechanism according to the priority data stream, including: the number of redundant transmissions N for each type of data P , where high priority N H =3, medium priority N M =2, low priority N L =1; Perturbation intensity factor δ, which adds slight random perturbations to the data packets to improve robustness;
[0052] For high priority Data H , multiple redundant versions are generated for each data packet, and disturbance items are added to the data content to improve the anti-interference ability, which is expressed as follows:
[0053]
[0054] in, is the data packet x i The j-th enhanced version of ; is based on the data content x i The perturbation matrix, the intensity of the perturbation is controlled by δ; at the same time, in the perturbation matrix A special regularization term is introduced to weight the perturbation in the importance dimension, which is expressed as follows:
[0055]
[0056] Among them, rand(x i ) is the same as x i The structure of the random noise matrix, S i is the dynamic priority score of the data packet, which is used as a weight to control the strength of the disturbance; reg is the regularization coefficient, ensuring that packets with higher priority are subject to stricter perturbation limits;
[0057] Priority data for centering M , generating N M redundant versions, but no complex perturbations are added, only slight randomization is introduced to reduce the computational burden; for low-priority data L, directly send the original data packet without generating redundant versions, saving resources to the greatest extent;
[0058] Output the data stream after anti-interference enhancement processing enhanced , whose format is:
[0059]
[0060] Among them, B P and W P is the resource allocation constraint of category P, N P is the number of redundant transmissions of category P.
[0061] Furthermore, the S4 specifically includes:
[0062] S401, based on each data packet x i , extract all successfully received redundant versions from the receiving end cache and reconstructed through weighted aggregation as It is expressed as follows:
[0063]
[0064] Among them, N i is the number of successfully received redundant versions, j is the index of the successfully received redundant version; w j It is a redundant version The weight of the weight is designed to ensure that more reliable versions contribute more to the reconstruction;
[0065] S402: Reconstructing data Calculate its checksum and the CRC check value M of the meta information i Compare with the standard checksum value in .crc:
[0066] If its check value and the CRC check value M of the meta information i .crc is consistent, then the data is determined to be reconstructed Valid, join the final data stream;
[0067] If the check fails, the packet number is recorded and the packet is sorted according to its priority S. i Decide to retransmit or mark as lost;
[0068] S403: Aggregate the data packets that pass the consistency check into the final data stream Data reconstructed , whose format is:
[0069]
[0070] in, is the reconstructed data packet content; M i It is meta information;
[0071] The redundant version The weight w j The calculation is as follows:
[0072]
[0073] in, Is the version and other versions of median deviation, median median; λ diff is the adjustment coefficient, which is used to control the impact of median deviation on weight;
[0074] Among them, for the data packet that fails the verification, if the dynamic priority score S i >Threshold τ, start the following reconstruction strategy:
[0075] Select and reconstruct the package contents from the version set The two versions with the smallest deviation are reconstructed twice, and the calculation is as follows:
[0076]
[0077] Among them, j and k are the two version numbers with the smallest deviation. and In the data reconstruction process, the two most similar versions are selected according to the principle of minimum deviation from the reconstructed data packet;
[0078] If the secondary reconstruction still fails, the uplink request mechanism is triggered and the sender resends the message.
[0079] Furthermore, the S5 specifically includes:
[0080] S501, initializing the key feedback indicators of the feedback mechanism according to the final data flow; the key feedback indicators include packet loss rate, average delay and weighted bandwidth utilization
[0081] S502, calculating key feedback indicators for each type of data in combination with the final data stream receiving end cache, specifically including:
[0082] The packet loss rate Based on the number of successfully received packets and the total number of sent packets, the calculation is as follows:
[0083]
[0084] Among them, Received P is the number of packets successfully received by category P, Total P is the number of packets sent;
[0085] The average delay Latency P The calculation is based on the difference between the receiving time and the sending timestamp, as follows:
[0086]
[0087] in, It is a data packet The time of receipt;
[0088] The weighted bandwidth utilization BW util Weighted by priority, combined with dynamic priority score S i Dynamically assign weights, calculated as follows:
[0089]
[0090] Among them, β P is the bandwidth allocation ratio of category P, B total is the total available bandwidth;
[0091] S503, adjusting the transmission strategy based on the feedback indicators and designing improvement plans for different problems;
[0092] S504: Update the adjusted transmission parameters with a strategy package Strategy updated The output is in the form of, and the calculation is as follows:
[0093]
[0094] in, is the new bandwidth allocation ratio for each type of data; is the update sliding window limit for each type of data.
[0095] Furthermore, the S503 specifically includes:
[0096] like It is necessary to prioritize the increase of its resource allocation ratio β H , the update formula is:
[0097]
[0098] where κ loss is the adjustment coefficient used to control the smoothness of the distribution change;
[0099] If the average latency is high H >Delay threshold λ H , give priority to increasing the high priority sliding window limit W H , alleviating the delay problem and reducing the low priority window W L , calculated as follows:
[0100]
[0101] in, is the updated high priority sliding window limit, is the original high priority sliding window limit, γ is the weight coefficient used to adjust the window increase amplitude;
[0102] If high utilization If it is significantly lower than the expected target, the low-priority bandwidth will be reduced and reallocated to the high-priority and medium-priority categories.
[0103] The beneficial technical effects of the present invention are at least as follows:
[0104] (1) Aiming at the problem that the UDP protocol lacks support for different data priorities, the present invention designs a priority classification and dynamic control mechanism. According to the importance and real-time nature of the data, the data is divided into categories such as high-priority instructions, medium-priority status updates, and low-priority logs. By adding a priority flag field to the frame header and combining it with a dynamic window adjustment strategy, the transmission reliability of high-priority data is prioritized, while preventing low-priority data from occupying too much bandwidth resources.
[0105] (2) Aiming at the problem of data loss and damage of UDP in interference environment, the present invention designs a lightweight streaming anti-interference enhancement mechanism. For high-priority data, the sender improves the transmission robustness by generating multiple disturbance versions (such as different timestamps or redundant fields), and the receiver uses differential checksum and voting algorithm to reconstruct the lost data. This mechanism significantly improves the transmission success rate of key data without significantly increasing the network load.
[0106] (3) The present invention addresses the problem of the lack of adaptability of the UDP protocol. The present invention adds a real-time feedback mechanism at the receiving end to dynamically monitor the packet loss rate, delay and bandwidth utilization of the network, and transmits the feedback information to the sending end through the UDP channel. The sending end dynamically adjusts the data transmission frequency, redundancy strategy and priority allocation ratio based on the feedback information, thereby achieving optimal resource allocation and continuous optimization of transmission performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0107] The present invention is further described using the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other drawings based on the following drawings without creative work.
[0108] Figure 1 This is a flow chart of the UDP data transmission quality detection method of the present invention. DETAILED DESCRIPTION
[0109] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0110] like Figure 1 As shown, the UDP data transmission quality detection method provided by the embodiment of the present invention includes the following steps S1-S5:
[0111] S1. Receive the original UDP data stream, which includes the content and meta-information of each data packet, and the meta-information includes the timestamp, task category and size of the data packet. Then, the data packets are initially classified according to the task category of the meta-information and the arrival delay time of each data packet is calculated. The priority score of each data packet is dynamically calculated using machine learning according to the classification and arrival delay time of each data packet, and the priority score is attached to each data packet to generate a classified and marked data stream.
[0112] Specifically, receive the original UDP data stream Data raw , whose format is:
[0113] Data raw ={(x i ,M i )|i=1,2,…,n}
[0114] Among them, x i Indicates the content of the i-th data packet; M i Meta information, including:
[0115] M i .time: the timestamp of the data packet, in seconds;
[0116] M i .type: task category (such as control instructions, status feedback, etc.);
[0117] M i .size: Packet size in bytes.
[0118] Furthermore, an initial feature vector F is constructed for each data packet. i :
[0119] F i =[M i .time,M i .type,M i .size]
[0120] where Fi As the input for subsequent priority calculation, the three dimensions of the feature vector, time, category, and size, are used to accurately characterize the characteristics of the data packet.
[0121] Further, it is divided into the following three categories:
[0122] Data h : High-priority data (such as control instructions), which is sensitive to delays and has high reliability requirements;
[0123] Data m : Medium priority data (such as equipment status feedback), which has general requirements for real-time performance;
[0124] Data l : Low-priority data (such as log records) has low timeliness requirements.
[0125] Calculate the arrival delay Δt for each data packet i , the formula is:
[0126] Δt i =t now -M i .time
[0127] Among them, t now is the current time; M i .time is the timestamp of the packet. Δt i Indicates the time interval from sending to receiving, which is used to dynamically adjust the priority. The greater the delay, the lower the value of the data for real-time requirements.
[0128] Furthermore, the present invention will dynamically calculate the priority score of the data packet through a machine learning algorithm. The present invention will introduce a combination of classification algorithm and regression algorithm, and use ensemble learning to improve the accuracy and robustness of priority calculation. At the same time, in the process of feature design and model training, innovative calculation items are introduced to adapt to changes in network traffic.
[0129] As you can understand, the output of the previous step will be used to receive a formatted data stream:
[0130] Data raw ={(x i ,M i ,S i )|i=1,2,…,n}
[0131] Among them, x i Indicates the content of the i-th data packet; M i Meta information, including:
[0132] Mi .time: the timestamp of the data packet, in seconds;
[0133] M i .type: task category (such as control instructions, status feedback, etc.);
[0134] M i .size: packet size in bytes;
[0135] S i The priority score calculated in the previous step.
[0136] Furthermore, a set of features is extracted from the raw data as input to the machine learning model. In order to improve the accuracy and adaptability of the model, the following innovative features are designed:
[0137] Time characteristics: Based on M i .time, the present invention can calculate the time difference (delay) between the arrival time of each data packet and the previous data packet, that is:
[0138] Δt i =M i .time-M i-1 .time, (7)
[0139] Category characteristics: According to M i .type, one-hot encodes the data packet to indicate its task category (such as control, status, log, etc.).
[0140] Historical priority feature: The average priority score of k historical data packets is calculated through a sliding window as the historical priority feature of the data packet to capture the time-varying nature of traffic.
[0141] Size feature: the size of the data packet M i .size is used to regularize the model to prevent large data packets from taking too much priority.
[0142] Delay characteristics: Calculate the real-time delay Δt for each packet i , and the delay features are combined with the priority scores for training the model.
[0143] These features form a feature vector F i , used to train machine learning models:
[0144] F i =[Δt i ,one-hot(M i .type),M i .size,avg_priority_history]
[0145] Furthermore, the present invention uses ensemble learning to combine multiple machine learning algorithms to perform priority calculation. In this solution, random forest (RandomForest) and gradient boosting machine (GradientBoostingMachine, GBM) are selected to jointly form an integrated model. These two models can automatically learn the nonlinear relationship of data when facing complex input features.
[0146] As you can understand, the random forest algorithm improves the stability and generalization ability of the model by integrating multiple decision trees. Each tree is trained based on a different subset of data and ultimately performs classification or regression predictions by voting.
[0147] The gradient boosting machine is a tree model based on gradient descent optimization. It can iteratively train multiple weak classifiers or regressors to gradually correct the deviation of the previous round of models and achieve high accuracy.
[0148] Furthermore, the results of random forest and GBM are weighted and fused through the integration method to calculate the priority score of each data packet:
[0149] S i =w RF ·S RF,i +w GBM ·S GBM,i
[0150] Among them, S RF,i is the priority score obtained by random forest; S GBM,i is the priority score obtained by GBM; w RF and w GBM is the weight of the corresponding model.
[0151] Furthermore, in order to further improve the accuracy of priority calculation, a dynamic feature update mechanism is designed to continuously update the priority calculation method of data packets through online learning of the model. Specifically:
[0152] Data packet historical priority update: As new data packets arrive, the historical priority scores need to be updated and fed back into the model.
[0153] Latency and network status monitoring: Calculate latency changes and network status in real time, and fine-tune the model to adapt to fluctuations in network traffic.
[0154] Furthermore, the model training process is as follows:
[0155] Data preparation: Collect historical data from the system, format the data, and perform feature engineering.
[0156] Model training: Divide the data into training set and validation set, use the training set to train random forest and GBM, and use the validation set to evaluate model performance.
[0157] Ensemble model optimization: Adjust model weights w through cross-validation RF and w GBM , optimize the final priority calculation effect.
[0158] Real-time update and online learning: Use real-time collected network traffic data to adjust features online and use incremental learning to update the model.
[0159] Finally, the final data stream output is the optimized packet priority information:
[0160] Data classified ={(x i ,M i ,S i )|i=1,2,…,n}
[0161] Among them, S i The calculated priority score combines the outputs of machine learning models (random forest and GBM); data content x i ; Meta information M i (timestamp, category, size, etc.).
[0162] S2, initialize the global resource parameters according to the data flow after classification and marking, and then adjust the initial classification according to the priority score of the data flow after classification and marking, and calculate the sum of the priority scores for each type of data to dynamically adjust the resource allocation ratio of each type of data, and then adjust the global resource parameters to generate the application control strategy for each type of data, and finally output the priority data flow after dynamic control; wherein, the priority of the initial classification adjustment includes the high priority Data H , Medium priority Data M and low priority Data L .
[0163] Specifically, receive the output data Data from step 1 classified , whose format is:
[0164] Data classified ={(x i ,M i ,S i )|i=1,2,…,n}
[0165] Furthermore, initialize the global resource parameters:
[0166] B total: Total available bandwidth (bytes / second), indicating the total data transmission rate allowed by the system;
[0167] W total : Sliding window size, which indicates the number of data packets that the system can send simultaneously;
[0168] α H ,α M ,α L : The initial resource allocation ratios for high, medium, and low priority data are 0.5, 0.3, and 0.2, respectively.
[0169] Furthermore, according to Data classified S i and M i .type, reclassifies the data packets into three groups:
[0170] Data H : High priority (such as control instructions);
[0171] Data M : Medium priority (such as device status feedback);
[0172] Data L : Low priority (such as log information).
[0173] Furthermore, the sum of the priority scores is calculated for each type of data to dynamically adjust the resource allocation ratio of each type of data:
[0174]
[0175] in It is the total priority score of category P, reflecting the importance of the data in this category.
[0176] Combined with the initial allocation ratio α P , dynamically calculate the bandwidth allocation ratio β for each type of data P and sliding window allocation ratio γ P :
[0177]
[0178] In the formula, β P and γ P Indicates the bandwidth and sliding window ratio of category P, dynamically adjusts resource allocation between categories, and ensures that high-priority data gets more resources.
[0179] Furthermore, using β P and γ P Allocate resource quotas for each type of data:
[0180] Bandwidth Limit B P =βP ·B total , represents the maximum transmission rate that can be used by category P;
[0181] Sliding window limit W P =γ P ·W total , represents the maximum number of data packets of category P that can be sent simultaneously.
[0182] Apply governance policies to each type of data:
[0183] Limit the sending rate so that the total sending rate of each type of data does not exceed B P ;
[0184] Priority Send Score S i The largest data packet to ensure resources are used for more important data;
[0185] The number of packets sent simultaneously by the sliding window is limited to W P .
[0186] This strategy dynamically adapts to changes in data priority by combining bandwidth and sliding window allocation, while preventing low-priority data from occupying too many system resources.
[0187] Furthermore, the dynamically regulated priority data stream Data is output. scheduled , whose format is:
[0188] Data scheduled ={(x i ,M i ,S i ,B P ,W P )|i=1,2,…,n}
[0189] Among them, x i Indicates the content of the data packet; M i Represents meta information, including timestamp, category, and size; S i Indicates the priority score; B P and W P Indicates the bandwidth and sliding window limit for each type of data.
[0190] S3. Design anti-interference enhancement mechanisms for data streams at all levels to enhance and optimize data streams at all levels.
[0191] Specifically, receive the output data stream Data from step 2 scheduled , whose format is:
[0192] Data scheduled ={(x i ,M i ,S i,B P ,W P )|i=1,2,…,n}
[0193] Furthermore, the parameters of the anti-interference enhancement mechanism are initialized:
[0194] N P : The number of redundant transmissions of each type of data, high priority N H =3, medium priority N M =2, low priority N L =1;
[0195] δ: Perturbation intensity factor, used to add slight random perturbations to the data packet to improve robustness. The anti-interference mechanism provides a stronger enhancement strategy for high-priority data while ensuring that resources are controlled, serving the control result of step 2.
[0196] Furthermore, for high priority data H , generate multiple redundant versions for each data packet, and add disturbance items to the data content to improve anti-interference ability. The enhanced data version is defined as:
[0197]
[0198] in, is the data packet x i The j-th enhanced version of ; is based on the data content x i The perturbation matrix is , and the intensity of the perturbation is controlled by δ; δ is the perturbation intensity factor, which ensures that the difference between data versions is within an acceptable range, enhancing anti-interference without destroying the core content of the data. A special regularization term is introduced so that the perturbation is weighted in the importance dimension:
[0199]
[0200] Among them, rand(x i ) is the same as x i A random noise matrix with consistent structure; S i is the priority score of the data packet, which is used as a weight to control the strength of the disturbance; reg is the regularization coefficient, ensuring that higher priority packets are subject to stricter perturbation limits.
[0201] Furthermore, for the priority data M , generating N M Redundant versions are generated without adding complex perturbations, and only slight randomization is introduced to reduce the computational burden. L, directly send the original data packet without generating redundant versions, saving resources to the greatest extent.
[0202] Among them, all categories of data packets strictly follow the B assigned in step 2 when sending P and W P Limits ensure that bandwidth and sliding window usage comply with the regulation policy.
[0203] Furthermore, the data stream Data after anti-interference enhancement processing is output enhanced , whose format is:
[0204]
[0205] in, It is an enhanced version of the data package; M i is meta information; S i is the priority score; B P and W P is the resource allocation constraint of category P; N P is the number of redundant transmissions of category P.
[0206] S4. Based on the enhanced and optimized data stream, high-priority data is checked for consistency and reconstructed, while the network status is monitored, and the data packets that pass the consistency check are aggregated into the final data stream.
[0207] Specifically, receive the output data stream Data from step 3 enhanced , whose format is:
[0208]
[0209] in, is the jth redundant version of the ith data packet, after anti-interference enhancement processing; M i is the meta information, including the timestamp M i .time, category M i .type, size M i .size and CRC check value M i .crc;S i is the priority score of the data packet; B P and W P are the bandwidth and sliding window limits of category P; N P is the number of redundant transmissions of category P.
[0210] Furthermore, the receiving end cache is initialized to store the received redundant version And record the numbers of lost or duplicated data packets to assist in subsequent reconstruction and optimization.
[0211] Furthermore, for each data packet xi , extract all successfully received redundant versions from the receiving end cache and reconstructed through weighted aggregation as
[0212]
[0213] Among them, N i is the number of successfully received redundant versions; w j It is a redundant version The weight of the version is designed to ensure that more reliable versions contribute more to the reconstruction. j Dynamic adjustment combined with the following features:
[0214]
[0215] in, Is the version and the median deviation of other versions; λ diff is the adjustment coefficient, which is used to control the impact of median deviation on weight.
[0216] An anti-anomaly mechanism is introduced through median deviation to reduce the destructive impact of strongly interfered versions on the aggregation results.
[0217] Furthermore, the reconstructed data Calculate its checksum and the meta information M i Compare with the standard checksum value in .crc:
[0218] like With M i .crc is consistent, then it is determined Valid, join the final data stream;
[0219] If the check fails, the packet number is recorded and the packet is sorted according to its priority S. i Decide to retransmit or mark the packet as lost.
[0220] For packets that fail verification, if the priority S i >τ(threshold), start the following reconstruction strategy:
[0221] Select from the version collection The two versions with the smallest deviation are reconstructed twice:
[0222]
[0223] Where j and k are the two version numbers with the smallest deviation;
[0224] If the secondary reconstruction still fails, the uplink request mechanism is triggered and the sender resends the message.
[0225] Furthermore, the data packets that pass the consistency check are aggregated into the final data stream Data reconstructed , whose format is:
[0226]
[0227] in, is the reconstructed data packet content; M i It is meta information, including timestamp, category, size and CRC checksum value; S i is the priority score.
[0228] S5, based on the final data flow statistics network indicators, adjusts the transmission parameters and feeds back to S1 to form a closed-loop optimization.
[0229] Specifically, first, initialize the monitoring indicators of the feedback mechanism:
[0230] Packet loss rate Loss rate , record the loss ratio of each type of data;
[0231] Average Latency P , count the transmission delay of each type of data;
[0232] Bandwidth utilization BW util , analyze the resource utilization efficiency of each type of data.
[0233] These indicators provide basic data for dynamic optimization and support subsequent transmission strategy adjustments.
[0234] Furthermore, combining the receiving end cache and Data reconstructed , calculate key feedback indicators for each type of data:
[0235] Packet loss rate Loss rate : The packet loss rate is based on the number of successfully received packets and the total number of sent packets, and is defined as:
[0236]
[0237] Received P is the number of packets successfully received by category P, Total P is the number of packets sent.
[0238] Average Latency P : The transmission delay is calculated by the difference between the receiving time and the sending timestamp, and is defined as:
[0239]
[0240] in It is a data packet The receiving time.
[0241] Weighted bandwidth utilization BW util : Resource utilization efficiency is weighted by priority, combined with S i Dynamically assign weights:
[0242]
[0243] where β P is the bandwidth allocation ratio of category P, B total is the total available bandwidth. This formula reflects the actual efficiency of bandwidth allocation through priority weights.
[0244] Furthermore, the transmission strategy is adjusted based on the feedback indicators, and improvement solutions are designed for different problems:
[0245] Packet loss rate optimization: If the packet loss rate of high priority data (high priority packet loss rate threshold), its resource allocation ratio β needs to be increased first H , the update formula is:
[0246]
[0247] where κ loss is an adjustment coefficient used to control the smoothness of distribution changes.
[0248] Delay optimization: If Latency H >λ H (delay threshold), give priority to increasing the high priority sliding window limit W H , alleviating the delay problem and reducing the low priority window W L , through the formula:
[0249]
[0250] Utilization optimization: If Significantly below the expected target, reduce low priority bandwidth and reallocate it to high and medium priority categories.
[0251] Introducing regular constraints in the adjustment Smoothly adjust the range to ensure gradual optimization of resource allocation.
[0252] Furthermore, the adjusted transmission parameters are updated in the strategy package Strategy updated Output in the form of:
[0253]
[0254] in, is the new bandwidth allocation ratio for each type of data; is the update sliding window limit for each type of data.
[0255] The policy update package is fed back to the sender to complete the closed-loop optimization. This feedback mechanism adapts to network fluctuations through real-time monitoring and optimization, realizing the dynamic adaptation capability of the patented solution.
[0256] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0257] In addition, for technical details that are not described in detail in this embodiment, reference can be made to the parameter operation method provided in any embodiment of the present invention, and will not be repeated here.
[0258] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0259] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0260] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0261] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. UDP data transmission quality detection method, characterized in that: The method comprises: S1, receiving an original UDP data stream, wherein the original UDP data stream includes the content and meta information of each data packet, wherein the meta information includes the timestamp, task category and data packet size of the data packet, and then initially classifying the data packets according to the task category of the meta information and calculating the arrival delay time of each data packet, dynamically calculating the priority score of each data packet by using machine learning according to the classification and arrival delay time of each data packet, attaching the priority score to each data packet, and generating a classified and marked data stream; S2, initialize the global resource parameters according to the data flow after classification and marking, and then adjust the initial classification according to the priority score of the data flow after classification and marking, and calculate the sum of the priority scores for each type of data to dynamically adjust the resource allocation ratio of each type of data, and then adjust the global resource parameters to generate the application control strategy for each type of data, and finally output the priority data flow after dynamic control; wherein, the priority of the initial classification adjustment includes the high priority Data H , Medium priority Data M and low priority Data L ; S3. Design an anti-interference enhancement mechanism for data streams at all levels to enhance and optimize data streams at all levels; S4: Based on the enhanced and optimized data stream, the consistency check and reconstruction of high-priority data are performed, while the network status is monitored, and the data packets that pass the consistency check are aggregated into the final data stream; S5, based on the final data flow statistics network indicators, adjusts the transmission parameters and feeds back to S1 to form a closed-loop optimization.
2. The UDP data transmission quality detection method according to claim 1, characterized in that: The initial classification of the data packets according to the task category of the meta information and the calculation of the arrival delay time of each data packet specifically include: The initial classification includes: Data h Indicates high priority data, Data m Indicates medium priority data and Data l Indicates low priority data; Calculate the arrival delay Δt for each data packet i , which is expressed as follows: Δt i =t now -M i .time, Among them, t now is the current time; M i .time is the timestamp of the data packet; Δt i Indicates the time interval from sending to receiving, which is used to dynamically adjust the priority. The data with the longest delay has the lowest value for real-time requirements.
3. The UDP data transmission quality detection method according to claim 2, characterized in that: The priority score of each data packet is dynamically calculated by using machine learning according to the classification and arrival delay time of each data packet, specifically including: Accept data stream Data raw , for Data raw ={(x i ,M i ,S i ′)|i=1,2,…,n}, where x i Indicates the content of the i-th data packet; M i is the meta information, S i ′ is the priority score calculated in the previous step, and n represents the total number of packets; Extract key features from the data stream and construct a feature vector; wherein the key features include time features, category features, historical priority features, size features, and delay features; The random forest and gradient boosting machine are used together to form an integrated model, and the feature vector is used as input to calculate the priority score S of each data packet. i , expressed as: S i =w RF ·S RF,i +w GBM ·S GBM,i Among them, S RF,i is the priority score obtained by random forest; S GBM,i is the priority score obtained by the gradient boosting machine; w RF and w GBM is the weight of the corresponding model; Update the priority calculation method of data packets through online learning of the integrated model; The final data stream output is the optimized data Data classified Packet priority information: Data classified ={(x i ,M i ,S i )|i=1,2,…,n} Among them, S i To calculate the priority score, the output of machine learning is combined.
4. The UDP data transmission quality detection method according to claim 1, characterized in that: The global resource parameters include the total available bandwidth B total , sliding window size W total and the initial resource allocation ratio α of high, medium, and low priority data h ,α m ,α l .
5. The UDP data transmission quality detection method according to any one of claims 2 or 4, characterized in that: The method of initializing global resource parameters according to the classified marked data stream, adjusting the initial classification according to the priority score of the classified marked data stream, and calculating the sum of the priority scores for each type of data to dynamically adjust the resource allocation ratio of each type of data specifically includes: High priority data H , Medium priority Data M and low priority Data L The sum of the priority scores of the data packets is calculated respectively, which is used to dynamically adjust the resource allocation ratio of each type of data, as shown below: in, It is the total priority score of category P, reflecting the importance of the data in this category. H is high priority, M is medium priority, and L is low priority. P is the set of packets belonging to priority P, P∈{H,M,L}; Combined with the initial allocation ratio α P , dynamically calculate the bandwidth allocation ratio β for each type of data P and sliding window allocation ratio γ P , which is expressed as follows: Among them, β P and γ P Indicates the bandwidth and sliding window ratio of category P, dynamically adjusts resource allocation between categories, and ensures that high-priority data gets more resources.
6. The UDP data transmission quality detection method according to claim 5, characterized in that: The process of adjusting the global resource parameters to generate a control strategy for each type of data application and finally outputting a dynamically controlled priority data stream specifically includes: Using Beta P and γ P Allocate resource limits for each type of data, including: Bandwidth Limit B P =β P ·B total , represents the maximum transmission rate that can be used by category P; Sliding window limit W P =γ P ·W total , represents the maximum number of packets sent simultaneously for category P; Apply governance policies to each type of data, including: Limit the sending rate so that the total sending rate of each type of data does not exceed B P ; Priority Send Score S i The largest data packet to ensure resources are used for more important data; The number of packets sent simultaneously by the sliding window is limited to W P ; Output dynamically regulated priority data stream Data scheduled , whose format is: Data scheduled ={(x i ,M i ,S i ,B P ,W P )|i=1,2,…,n} Among them, M i Meta information, including timestamp, category and size; S i is the priority score; B P and W P They are the bandwidth and sliding window limits for each type of data.
7. The UDP data transmission quality detection method according to claim 1, characterized in that: The anti-interference enhancement mechanism specifically includes: Initialize the parameters of the anti-interference enhancement mechanism according to the priority data stream, including: the number of redundant transmissions N for each type of data P , where high priority N H =3, medium priority N M =2, low priority N L =1; Perturbation intensity factor δ, which adds slight random perturbations to the data packets to improve robustness; For high priority Data H , multiple redundant versions are generated for each data packet, and disturbance items are added to the data content to improve the anti-interference ability, which is expressed as follows: in, is the data packet x i The j-th enhanced version of ; is based on the data content x i The perturbation matrix, the intensity of the perturbation is controlled by δ; at the same time, in the perturbation matrix A special regularization term is introduced to weight the perturbation in the importance dimension, which is expressed as follows: Among them, rand(x i ) is the same as x i The structure of the random noise matrix, S i is the dynamic priority score of the data packet, which is used as a weight to control the strength of the disturbance; reg is the regularization coefficient, ensuring that packets with higher priority are subject to stricter perturbation limits; Priority data for centering M , generating N M redundant versions, but no complex perturbations are added, only slight randomization is introduced to reduce the computational burden; for low-priority data L , directly send the original data packet without generating redundant versions, saving resources to the greatest extent; Output the data stream after anti-interference enhancement processing enhanced , whose format is: Among them, B P and W P is the resource allocation constraint of category P, N P is the number of redundant transmissions of category P.
8. The UDP data transmission quality detection method according to claim 7, characterized in that: The S4 specifically includes: S401, based on each data packet x i , extract all successfully received redundant versions from the receiving end cache and reconstructed through weighted aggregation as It is expressed as follows: Among them, N i is the number of successfully received redundant versions, j is the index of the successfully received redundant version; w j It is a redundant version The weight of the weight is designed to ensure that more reliable versions contribute more to the reconstruction; S402: Reconstructing data Calculate its checksum and the CRC check value M of the meta information i Compare with the standard checksum value in .crc: If its check value The CRC check value M of the meta information i .crc is consistent, then the data is reconstructed Valid, join the final data stream; If the check fails, the packet number is recorded and the packet is sorted according to its priority S. i Decide to retransmit or mark the packet as lost; S403: Aggregate the data packets that pass the consistency check into the final data stream Data reconstructed , whose format is: in, is the reconstructed data packet content; M i It is meta information; The redundant version The weight w j The calculation is as follows: in, Is the version and other versions of median deviation, median median; λ diff is the adjustment coefficient, which is used to control the impact of median deviation on weight; Among them, for the data packet that fails the verification, if the dynamic priority score S i >Threshold τ, start the following reconstruction strategy: Select and reconstruct the package contents from the version set The two versions with the smallest deviation are reconstructed twice, and the calculation is as follows: Among them, j and k are the two version numbers with the smallest deviation. and In the data reconstruction process, the two most similar versions are selected according to the principle of minimum deviation from the reconstructed data packet; If the secondary reconstruction still fails, the uplink request mechanism is triggered and the sender resends the message.
9. The UDP data transmission quality detection method according to claim 1, characterized in that: The S5 specifically includes: S501, initializing the key feedback indicators of the feedback mechanism according to the final data flow; the key feedback indicators include packet loss rate, average delay and weighted bandwidth utilization S502, calculating key feedback indicators for each type of data in combination with the final data stream receiving end cache, specifically including: The packet loss rate Based on the number of successfully received packets and the total number of sent packets, the calculation is as follows: Among them, Received P is the number of packets successfully received by category P, Total P is the number of packets sent; The average delay Latency P The calculation is based on the difference between the receiving time and the sending timestamp, as follows: in, It is a data packet The time of receipt; The weighted bandwidth utilization BWutil is weighted by priority, and the weight is dynamically allocated in combination with the dynamic priority score Si, and is calculated as follows: Among them, β P is the bandwidth allocation ratio of category P, and Btotal is the total available bandwidth; S503, adjusting the transmission strategy based on the feedback indicators and designing improvement plans for different problems; S504: Output the adjusted transmission parameters in the form of a strategy update package Strategyupdated, which is calculated as follows: in, is the new bandwidth allocation ratio for each type of data; is the update sliding window limit for each type of data.
10. The UDP data transmission quality detection method according to claim 9, characterized in that: The S503 specifically includes: If the packet loss rate of high priority data It is necessary to prioritize the increase of its resource allocation ratio β H , the update formula is: where κ loss is the adjustment coefficient used to control the smoothness of the distribution change; If the average latency is high H >Delay threshold λ H , give priority to increasing the high priority sliding window limit W H , alleviating the delay problem and reducing the low priority window W L , calculated as follows: in, is the updated high priority sliding window limit, is the original high priority sliding window limit, γ is the weight coefficient used to adjust the window increase amplitude; If high utilization If it is significantly lower than the expected target, the low-priority bandwidth will be reduced and reallocated to the high-priority and medium-priority categories.
Citation Information
Patent Citations
Data packet level transmission priority adaptive adjustment method oriented to programmable network time delay guarantee
CN118158173A
Telemetry data collection and distribution method and system
CN118540227A
A method of priority-based packet scheduling for in heterogeneous wireless sensor networks
IN201721016038A
Network traffic tuning
US20160352528A1