CN-122027570-A - Data transmission method and system
Abstract
The invention discloses a data transmission method and a data transmission system, relates to the technical field of data transmission, and can ensure the reliability of data transmission and simultaneously give consideration to the real-time performance of data transmission. The scheme includes that a transmitting end adds a protocol head to each data packet to be transmitted and then adds the protocol head to an initial transmitting queue, the protocol head comprises fields for indicating the priority, survival time and dependency relationship of the data packets, the stacking state level of the initial transmitting queue is monitored, when the stacking state level exceeds a preset level, a target discarding strategy is selected from a plurality of preset discarding strategies according to the current network state and the stacking state level, the data packets to be discarded are determined to be discarded according to at least one of the priority threshold, the survival time threshold and the dependency relationship corresponding to the target discarding strategy in sequence, the target transmitting queue is obtained, and the data packets in the target transmitting queue are transmitted to a receiving end based on the UDP protocol.
Inventors
- ZHU YINGLONG
- NIE YAN
Assignees
- 西安正量能源科技有限责任公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260209
Claims (10)
- 1. A data transmission method, applied to a transmitting end, the method comprising: adding a protocol header to each data packet to be transmitted, and then adding the protocol header to an initial transmission queue, wherein the protocol header comprises fields for indicating the priority, the survival time and the dependency relationship of the data packet; monitoring the stacking state grade of the initial sending queue, and selecting a target discarding strategy from a plurality of preset discarding strategies according to the current network state and the stacking state grade when the stacking state grade exceeds a preset grade; sequentially determining the data packets to be discarded according to at least one of a priority threshold, a survival time threshold and a dependency relationship corresponding to the target discarding strategy, and obtaining a target sending queue; and transmitting the data packet in the target sending queue to a receiving end based on the UDP protocol.
- 2. The method of claim 1, wherein the monitoring the heap status level of the initial transmit queue comprises: periodically collecting state indexes related to the initial transmission queue from a plurality of dimensions, wherein the plurality of dimensions comprise queue capacity, data delay and memory occupation; Comparing the collected state indexes of each dimension with corresponding preset thresholds, and determining the accumulation severity level reached by each dimension; And judging the highest stacking severity level reached in each dimension as the stacking state level of the current transmission queue.
- 3. The method according to claim 1, wherein the method further comprises: constructing a decision list taking a network state level as a row and taking a stacking severity level as a column, wherein each cell of the decision list corresponds to a discarding strategy; the selecting a target discarding policy from a plurality of preset discarding policies according to the current network state and the stacking state level comprises: and inquiring from the decision list to obtain the target discarding strategy according to the network state grade to which the current network state belongs and the stacking state grade.
- 4. The method of claim 3, wherein the network status level is partitioned based on network health calculated from weighted scores of throughput, packet loss rate, and delay; the plurality of discarding strategies sequentially comprise a conservation strategy, a balance strategy, an active strategy, an aggressive strategy, a survival strategy and an emergency strategy, wherein the range of the priority of the data packet which is allowed to be discarded is sequentially enlarged from the conservation strategy to the emergency strategy, and the queue load proportion which is planned to be reduced is sequentially increased.
- 5. The method of claim 1, wherein the determining, sequentially according to at least one of a priority threshold, a time-to-live threshold, and a dependency corresponding to the target discard policy, to discard the data packet to be discarded, to obtain the target transmit queue includes: Determining a priority threshold of the corresponding data to be discarded according to the target discarding strategy; Traversing the data packets in the initial transmission queue, and sequentially determining the data packets to be discarded according to at least one of the priority, the generation time and the dependency relationship of each data packet to obtain the target transmission queue.
- 6. The method according to claim 5, wherein determining that the data packet to be discarded is discarded according to at least one of the priority, the generation time and the dependency relationship of each data packet in turn comprises: traversing the initial transmission queue, discarding all data packets with priority lower than the priority threshold value, and obtaining a first queue; Judging whether the proportion of discarded data packets of the first queue compared with the initial transmission queue reaches the discarding proportion corresponding to the target discarding strategy, if so, determining the first queue as a target transmission queue, and if not, further discarding the data packets exceeding the generating time from the first queue according to the generating time of each data packet to obtain a second intermediate queue; Judging whether the proportion of discarded data packets of the second queue compared with the initial transmission queue reaches the discarding proportion, if so, determining the second queue as a target transmission queue, and if not, further discarding the data packets which are not depended by other non-discarded data packets from the second queue according to the dependency relationship among the data packets, thereby obtaining the target transmission queue.
- 7. The method of claim 1, wherein the protocol header further comprises a sequence number field, an acknowledgement bitmap field, a timestamp field, a flag field, and a data length field, wherein the sequence number field of each data packet in the destination transmission queue is reordered in order.
- 8. A data transmission method, applied to a receiving end, the method comprising: receiving a data packet in a target sending queue transmitted by a sending end; and sending an acknowledgement to the sending end according to the sequence number field and the acknowledgement bitmap field in each data packet, wherein the acknowledgement comprises an acknowledgement number field and an acknowledgement bitmap field.
- 9. The method of claim 8, wherein the method further comprises: And sending a retransmission request to the sending end, wherein the retransmission request comprises the sequence number of the data packet missing from the target.
- 10. A data transmission system, wherein the system comprises a transmitting end and a receiving end; the sending end is used for adding a protocol header to each data packet to be sent and then adding the protocol header to an initial sending queue, wherein the protocol header comprises fields for indicating the priority, the survival time and the dependency relationship of the data packet; The sending end is further configured to monitor a stacking status level of the initial sending queue, and select a target discarding policy from a plurality of preset discarding policies according to a current network status and the stacking status level when the stacking status level exceeds a preset level; the sending end is further configured to determine, in sequence, that the data packet to be discarded is discarded according to at least one of a priority threshold, a time-to-live threshold, and a dependency relationship corresponding to the target discarding policy, so as to obtain a target sending queue; The sending end is further configured to transmit the data packet in the target sending queue to the receiving end based on a UDP protocol.
Description
Data transmission method and system Technical Field The present application relates to the field of data transmission technologies, and in particular, to a data transmission method and system. Background In network communications, the transmission process of data from a transmitting end to a receiving end is often affected by multiple factors such as machine performance, network bandwidth fluctuation, congestion, delay, and the like, resulting in a decrease in data transmission efficiency. The decrease in transmission efficiency can result in a significant accumulation of packets in the sender buffer. If these stacked packets are not handled in time, the end-to-end transmission delay is significantly increased, which affects the user experience and even results in service unavailability. In the existing network data transmission, the UDP protocol is commonly used for real-time application due to the low delay characteristic, but lacks of reliability guarantee, and cannot be recovered after data loss. Some reliable transmission schemes based on UDP attempt to introduce acknowledgement and retransmission mechanisms, but still cannot distinguish data importance, and may still delay due to retransmission when the network is congested, or employ a simple discard strategy to affect critical data transmission. Therefore, a transmission method capable of intelligently balancing reliability and real-time performance is needed to adapt to diversified real-time service requirements in a complex network environment. Disclosure of Invention The application provides a data transmission method and a data transmission device, which can ensure the reliability of data transmission and simultaneously give consideration to the real-time performance of data transmission. In order to achieve the above purpose, the application adopts the following technical scheme: in a first aspect of the embodiment of the present application, a data transmission method is provided and applied to a transmitting end, where the method includes: adding a protocol header to each data packet to be transmitted, and then adding the protocol header to an initial transmission queue, wherein the protocol header comprises fields for indicating the priority, the survival time and the dependency relationship of the data packet; monitoring the stacking state grade of the initial sending queue, and selecting a target discarding strategy from a plurality of preset discarding strategies according to the current network state and the stacking state grade when the stacking state grade exceeds a preset grade; sequentially determining the data packets to be discarded according to at least one of a priority threshold, a survival time threshold and a dependency relationship corresponding to the target discarding strategy, and obtaining a target sending queue; and transmitting the data packet in the target sending queue to a receiving end based on the UDP protocol. In one embodiment, the monitoring the heap status level of the initial transmit queue includes: periodically collecting state indexes related to the initial transmission queue from a plurality of dimensions, wherein the plurality of dimensions comprise queue capacity, data delay and memory occupation; Comparing the collected state indexes of each dimension with corresponding preset thresholds, and determining the accumulation severity level reached by each dimension; And judging the highest stacking severity level reached in each dimension as the stacking state level of the current transmission queue. In one embodiment, the method further comprises: constructing a decision list taking a network state level as a row and taking a stacking severity level as a column, wherein each cell of the decision list corresponds to a discarding strategy; the selecting a target discarding policy from a plurality of preset discarding policies according to the current network state and the stacking state level comprises: and inquiring from the decision list to obtain the target discarding strategy according to the network state grade to which the current network state belongs and the stacking state grade. In one embodiment, the network state level is partitioned based on network health calculated from weighted scores of throughput, packet loss rate, and delay; the plurality of discarding strategies sequentially comprise a conservation strategy, a balance strategy, an active strategy, an aggressive strategy, a survival strategy and an emergency strategy, wherein the range of the priority of the data packet which is allowed to be discarded is sequentially enlarged from the conservation strategy to the emergency strategy, and the queue load proportion which is planned to be reduced is sequentially increased. In one embodiment, the determining, sequentially according to at least one of a priority threshold, a time-to-live threshold and a dependency corresponding to the target discard policy, to discard the data packet to be disca